From gerrit-no-reply at lists.osmocom.org Fri Sep 1 05:16:36 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 1 Sep 2017 05:16:36 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 2: @Max: It has been three days this is broken. Can you please have a look and fix it? -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:02:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:02:27 +0000 Subject: osmo-pcu[master]: Support receiving SI13 from BTS In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3753/2/src/pcu_l1_if.cpp File src/pcu_l1_if.cpp: Line 166: #ifdef ENABLE_DIRECT_PHY unrelated cosmetic change? Line 252: if (len != GSM_MACBLOCK_LEN) { might be a good idea to use len==0 to set si13_is_set to false. -- To view, visit https://gerrit.osmocom.org/3753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:04:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:04:13 +0000 Subject: osmo-pcu[master]: Move gsmtap and accounting into separate function In-Reply-To: References: Message-ID: Patch Set 2: not sure if this is a big gain. In general, those two operations don't relate or depend on each other. -- To view, visit https://gerrit.osmocom.org/3755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:04:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:04:22 +0000 Subject: osmo-pcu[master]: Move gsmtap and accounting into separate function In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:36:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:36:13 +0000 Subject: libosmo-sccp[master]: osmo-stp: Fix process termination on SIGINT+SIGTERM In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3757 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff79c8ac0b347660333912c9258073a013ea799b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:36:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:36:19 +0000 Subject: [MERGED] libosmo-sccp[master]: osmo-stp: Fix process termination on SIGINT+SIGTERM In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-stp: Fix process termination on SIGINT+SIGTERM ...................................................................... osmo-stp: Fix process termination on SIGINT+SIGTERM In commit eed8c1bfae1d151e135b574d83ed295d36ad8b44 we introduced some singal handling code for (among others) SIGINT and SIGTERM. This code causes the process to hang rather than terminate, as it only dispatches a signal that nobody handles yet in libosmo-sccp. Until a proper implementation is made, let's terminate the process as expected. Change-Id: Iff79c8ac0b347660333912c9258073a013ea799b --- M stp/stp_main.c 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/stp/stp_main.c b/stp/stp_main.c index 8e3282c..a33045a 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -134,8 +134,11 @@ switch (signal) { case SIGINT: case SIGTERM: + /* FIXME: handle the signal somewhere else and gracefully shut down + * SIGTRAN links osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); - sleep(1); + sleep(1); */ + exit(0); break; case SIGABRT: osmo_generate_backtrace(); -- To view, visit https://gerrit.osmocom.org/3757 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff79c8ac0b347660333912c9258073a013ea799b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:38:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:38:06 +0000 Subject: osmo-gsm-manuals[master]: Allow easily disabling GFDL references In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3736/2/common/chapters/preface.adoc File common/chapters/preface.adoc: Line 86: ifdef::gfdl-enabled[] would be best to remove the entire Endorsements chapter in non-GFDL context Line 225: ifdef::gfdl-enabled[Please see <> for further information.] same here for the documentation license chapter. no use to have an empty chapter. I'll update myself. -- To view, visit https://gerrit.osmocom.org/3736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:43:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:43:29 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Allow easily disabling GFDL references In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3736 to look at the new patch set (#3). Allow easily disabling GFDL references All parts referencing GFDL can be easily disabled by removing the 'gfdl-enabled' attribute from the document. Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 --- M OsmoBSC/osmobsc-usermanual.adoc M OsmoBTS/osmobts-abis.adoc M OsmoBTS/osmobts-usermanual.adoc M OsmoNITB/osmonitb-usermanual.adoc M OsmoPCU/osmopcu-gb.adoc M OsmoPCU/osmopcu-usermanual.adoc M OsmoSGSN/osmosgsn-usermanual.adoc M common/chapters/glossary.adoc M common/chapters/preface.adoc 9 files changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/36/3736/3 diff --git a/OsmoBSC/osmobsc-usermanual.adoc b/OsmoBSC/osmobsc-usermanual.adoc index 9323373..b455897 100644 --- a/OsmoBSC/osmobsc-usermanual.adoc +++ b/OsmoBSC/osmobsc-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBSC User Manual =================== Harald Welte diff --git a/OsmoBTS/osmobts-abis.adoc b/OsmoBTS/osmobts-abis.adoc index 930cbfb..1e02414 100644 --- a/OsmoBTS/osmobts-abis.adoc +++ b/OsmoBTS/osmobts-abis.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS Abis Protocol Specification =================================== Neels Hofmeyr diff --git a/OsmoBTS/osmobts-usermanual.adoc b/OsmoBTS/osmobts-usermanual.adoc index 4d47b1c..d746d85 100644 --- a/OsmoBTS/osmobts-usermanual.adoc +++ b/OsmoBTS/osmobts-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS User Manual =================== Harald Welte diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 73166fa..0d6fa7e 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoNITB User Manual ==================== Harald Welte diff --git a/OsmoPCU/osmopcu-gb.adoc b/OsmoPCU/osmopcu-gb.adoc index fc2ca8f..64316a2 100644 --- a/OsmoPCU/osmopcu-gb.adoc +++ b/OsmoPCU/osmopcu-gb.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU Gb Protocol Specification ================================= Harald Welte diff --git a/OsmoPCU/osmopcu-usermanual.adoc b/OsmoPCU/osmopcu-usermanual.adoc index 5d2b09c..f47a0a9 100644 --- a/OsmoPCU/osmopcu-usermanual.adoc +++ b/OsmoPCU/osmopcu-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU User Manual =================== Harald Welte diff --git a/OsmoSGSN/osmosgsn-usermanual.adoc b/OsmoSGSN/osmosgsn-usermanual.adoc index 12a7b87..79c94f6 100644 --- a/OsmoSGSN/osmosgsn-usermanual.adoc +++ b/OsmoSGSN/osmosgsn-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoSGSN User Manual ==================== Harald Welte diff --git a/common/chapters/glossary.adoc b/common/chapters/glossary.adoc index c39d439..2a0d3c4 100644 --- a/common/chapters/glossary.adoc +++ b/common/chapters/glossary.adoc @@ -96,8 +96,10 @@ Interface between PCU and SGSN in GPRS/EDGE network; uses NS, BSSGP, LLC GERAN:: GPRS/EDGE Radio Access Network +ifdef::gfdl-enabled[] GFDL:: GNU Free Documentation License; a copyleft-style Documentation License +endif::[] GGSN:: GPRS Gateway Support Node; gateway between GPRS and external (IP) network GMSK:: diff --git a/common/chapters/preface.adoc b/common/chapters/preface.adoc index 13afec1..975dcca 100644 --- a/common/chapters/preface.adoc +++ b/common/chapters/preface.adoc @@ -78,6 +78,7 @@ -- Harald Welte, Osmocom.org and OpenBSC founder, January 2016. +ifdef::gfdl-enabled[] === Endorsements This version of the manual is endorsed by Harald Welte as the official @@ -86,7 +87,7 @@ While the GFDL license (see <>) permits anyone to create and distribute modified versions of this manual, such modified versions must remove the above endorsement. - +endif::[] == Preface @@ -219,9 +220,11 @@ text included with the software for more details. +ifdef::gfdl-enabled[] ==== Documentation License Please see <> for further information. +endif::[] == Introduction -- To view, visit https://gerrit.osmocom.org/3736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:44:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:44:11 +0000 Subject: osmo-gsm-tester[master]: contrib: Add scripts to build osmo-pcu In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:47:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:47:58 +0000 Subject: osmo-bts[master]: Support sending SI13 to PCU In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:53:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:53:50 +0000 Subject: openbsc[master]: abis: fix unaligned memory access In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) How often are those unaligned accesses? Are they in frequently-used code paths? Do we really consider fixing those up an efficient use of our time/resources? https://gerrit.osmocom.org/#/c/3750/3/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 2797: /* FIXME: we try to overwrite the RAC (1 byte) with the Cell ID (2 bytes) so we also override part of LAC?! */ as you can see from the user/caller of the function, 'buf' is one byte larger in the ipacess case. we hence write one byte more than in the RAC-case: 3 bytes MCC+MNC, 2 bytes LAC, 2 bytes CID. -- To view, visit https://gerrit.osmocom.org/3750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:54:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:54:39 +0000 Subject: libosmocore[master]: Makefile.am: fix missing LTLDFLAGS for libosmocoding In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf677825ff642d50bea43c7f970810783e864fdd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:55:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:55:01 +0000 Subject: [MERGED] libosmocore[master]: Makefile.am: fix missing LTLDFLAGS for libosmocoding In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Makefile.am: fix missing LTLDFLAGS for libosmocoding ...................................................................... Makefile.am: fix missing LTLDFLAGS for libosmocoding Despite the libosmocoding.map is preset since the library release, one was not used in a proper way. The LTLDFLAGS were missing, so let's add them. Change-Id: Idf677825ff642d50bea43c7f970810783e864fdd --- M configure.ac M src/coding/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 5821ad3..33c151e 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,7 @@ esac AC_SUBST(LTLDFLAGS_OSMOGB) AC_SUBST(LTLDFLAGS_OSMOGSM) +AC_SUBST(LTLDFLAGS_OSMOCODING) dnl checks for header files AC_HEADER_STDC diff --git a/src/coding/Makefile.am b/src/coding/Makefile.am index 06e55e5..dcbbd8f 100644 --- a/src/coding/Makefile.am +++ b/src/coding/Makefile.am @@ -22,6 +22,7 @@ gsm0503_parity.c \ gsm0503_coding.c libosmocoding_la_LDFLAGS = \ + $(LTLDFLAGS_OSMOCODING) \ -version-info \ $(LIBVERSION) \ -no-undefined \ -- To view, visit https://gerrit.osmocom.org/3752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf677825ff642d50bea43c7f970810783e864fdd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:56:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:56:23 +0000 Subject: [PATCH] pysim[master]: Support writing SMSP for sysmoUSIM-SJS1 In-Reply-To: References: Message-ID: Support writing SMSP for sysmoUSIM-SJS1 Closes: OS#1989 Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a --- M pySim/cards.py 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/3751/2 diff --git a/pySim/cards.py b/pySim/cards.py index 925c5e6..9f678ab 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -459,6 +459,9 @@ # write EF.IMSI data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi'])) + # EF.SMSP + r = self._scc.select_file(['3f00', '7f10']) + data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True) def erase(self): -- To view, visit https://gerrit.osmocom.org/3751 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:57:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:57:00 +0000 Subject: pysim[master]: Support writing SMSP for sysmoUSIM-SJS1 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3751 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:57:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:57:01 +0000 Subject: [MERGED] pysim[master]: Support writing SMSP for sysmoUSIM-SJS1 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Support writing SMSP for sysmoUSIM-SJS1 ...................................................................... Support writing SMSP for sysmoUSIM-SJS1 Closes: OS#1989 Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a --- M pySim/cards.py 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/pySim/cards.py b/pySim/cards.py index 925c5e6..9f678ab 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -459,6 +459,9 @@ # write EF.IMSI data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi'])) + # EF.SMSP + r = self._scc.select_file(['3f00', '7f10']) + data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True) def erase(self): -- To view, visit https://gerrit.osmocom.org/3751 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:57:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:57:38 +0000 Subject: libosmocore[master]: libosmogsm: add Routing Area Identifier test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3749 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27117fe728407dd10886459e89ba4ff9d5e53e6b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:57:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:57:41 +0000 Subject: [MERGED] libosmocore[master]: libosmogsm: add Routing Area Identifier test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmogsm: add Routing Area Identifier test ...................................................................... libosmogsm: add Routing Area Identifier test Ensure that gsm48_parse_ra() and gsm48_construct_ra() behave properly. Change-Id: I27117fe728407dd10886459e89ba4ff9d5e53e6b --- M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 2 files changed, 57 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index f922a4f..3f3a5c7 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -130,6 +130,54 @@ return 0; } +static inline void dump_ra(const struct gprs_ra_id *raid) +{ + printf("RA: MNC=%u, MCC=%u, LAC=%u, RAC=%u\n", raid->mnc, raid->mcc, raid->lac, raid->rac); +} + +static inline void check_ra(const struct gprs_ra_id *raid) +{ + uint8_t buf[6]; + int res; + struct gprs_ra_id raid0 = { + .mnc = 0, + .mcc = 0, + .lac = 0, + .rac = 0, + }; + + res = gsm48_construct_ra(buf, raid); + printf("Constructed RA: %d - %s\n", res, res != sizeof(buf) ? "FAIL" : "OK"); + + gsm48_parse_ra(&raid0, buf); + dump_ra(raid); + dump_ra(&raid0); + printf("RA test..."); + if (raid->mnc != raid0.mnc || raid->mcc != raid0.mcc || raid->lac != raid0.lac || raid->rac != raid0.rac) + printf("FAIL\n"); + else + printf("passed\n"); +} + +static void test_ra_cap(void) +{ + struct gprs_ra_id raid1 = { + .mnc = 121, + .mcc = 77, + .lac = 666, + .rac = 5, + }; + struct gprs_ra_id raid2 = { + .mnc = 98, + .mcc = 84, + .lac = 11, + .rac = 89, + }; + + check_ra(&raid1); + check_ra(&raid2); +} + static void test_mid_from_tmsi(void) { static const uint8_t res[] = { 0x17, 0x05, 0xf4, 0xaa, 0xbb, 0xcc, 0xdd }; @@ -152,6 +200,7 @@ msgb_talloc_ctx_init(NULL, 0); test_bearer_cap(); test_mid_from_tmsi(); + test_ra_cap(); return EXIT_SUCCESS; } diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 4a6d78b..f0abfd5 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,3 +1,11 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed +Constructed RA: 6 - OK +RA: MNC=121, MCC=77, LAC=666, RAC=5 +RA: MNC=121, MCC=77, LAC=666, RAC=5 +RA test...passed +Constructed RA: 6 - OK +RA: MNC=98, MCC=84, LAC=11, RAC=89 +RA: MNC=98, MCC=84, LAC=11, RAC=89 +RA test...passed -- To view, visit https://gerrit.osmocom.org/3749 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27117fe728407dd10886459e89ba4ff9d5e53e6b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:58:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:58:14 +0000 Subject: osmo-mgw[master]: log: output message content also on retransmissions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3746 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic41c2defb521e2f81762d932f8e29f7c8fed06a9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:58:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:58:21 +0000 Subject: osmo-mgw[master]: rework debian packages support In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96a6a56c401833d053d48908872fb0474f5aec53 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:58:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:58:23 +0000 Subject: osmo-mgw[master]: split off osmo-mgw: remove files, apply build, rename In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:58:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:58:55 +0000 Subject: osmo-gsm-manuals[master]: Allow easily disabling GFDL references In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:58:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:58:56 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Allow easily disabling GFDL references In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Allow easily disabling GFDL references ...................................................................... Allow easily disabling GFDL references All parts referencing GFDL can be easily disabled by removing the 'gfdl-enabled' attribute from the document. Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 --- M OsmoBSC/osmobsc-usermanual.adoc M OsmoBTS/osmobts-abis.adoc M OsmoBTS/osmobts-usermanual.adoc M OsmoNITB/osmonitb-usermanual.adoc M OsmoPCU/osmopcu-gb.adoc M OsmoPCU/osmopcu-usermanual.adoc M OsmoSGSN/osmosgsn-usermanual.adoc M common/chapters/glossary.adoc M common/chapters/preface.adoc 9 files changed, 20 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/osmobsc-usermanual.adoc b/OsmoBSC/osmobsc-usermanual.adoc index 9323373..b455897 100644 --- a/OsmoBSC/osmobsc-usermanual.adoc +++ b/OsmoBSC/osmobsc-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBSC User Manual =================== Harald Welte diff --git a/OsmoBTS/osmobts-abis.adoc b/OsmoBTS/osmobts-abis.adoc index 930cbfb..1e02414 100644 --- a/OsmoBTS/osmobts-abis.adoc +++ b/OsmoBTS/osmobts-abis.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS Abis Protocol Specification =================================== Neels Hofmeyr diff --git a/OsmoBTS/osmobts-usermanual.adoc b/OsmoBTS/osmobts-usermanual.adoc index 4d47b1c..d746d85 100644 --- a/OsmoBTS/osmobts-usermanual.adoc +++ b/OsmoBTS/osmobts-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS User Manual =================== Harald Welte diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 73166fa..0d6fa7e 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoNITB User Manual ==================== Harald Welte diff --git a/OsmoPCU/osmopcu-gb.adoc b/OsmoPCU/osmopcu-gb.adoc index fc2ca8f..64316a2 100644 --- a/OsmoPCU/osmopcu-gb.adoc +++ b/OsmoPCU/osmopcu-gb.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU Gb Protocol Specification ================================= Harald Welte diff --git a/OsmoPCU/osmopcu-usermanual.adoc b/OsmoPCU/osmopcu-usermanual.adoc index 5d2b09c..f47a0a9 100644 --- a/OsmoPCU/osmopcu-usermanual.adoc +++ b/OsmoPCU/osmopcu-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU User Manual =================== Harald Welte diff --git a/OsmoSGSN/osmosgsn-usermanual.adoc b/OsmoSGSN/osmosgsn-usermanual.adoc index 12a7b87..79c94f6 100644 --- a/OsmoSGSN/osmosgsn-usermanual.adoc +++ b/OsmoSGSN/osmosgsn-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoSGSN User Manual ==================== Harald Welte diff --git a/common/chapters/glossary.adoc b/common/chapters/glossary.adoc index c39d439..2a0d3c4 100644 --- a/common/chapters/glossary.adoc +++ b/common/chapters/glossary.adoc @@ -96,8 +96,10 @@ Interface between PCU and SGSN in GPRS/EDGE network; uses NS, BSSGP, LLC GERAN:: GPRS/EDGE Radio Access Network +ifdef::gfdl-enabled[] GFDL:: GNU Free Documentation License; a copyleft-style Documentation License +endif::[] GGSN:: GPRS Gateway Support Node; gateway between GPRS and external (IP) network GMSK:: diff --git a/common/chapters/preface.adoc b/common/chapters/preface.adoc index 13afec1..975dcca 100644 --- a/common/chapters/preface.adoc +++ b/common/chapters/preface.adoc @@ -78,6 +78,7 @@ -- Harald Welte, Osmocom.org and OpenBSC founder, January 2016. +ifdef::gfdl-enabled[] === Endorsements This version of the manual is endorsed by Harald Welte as the official @@ -86,7 +87,7 @@ While the GFDL license (see <>) permits anyone to create and distribute modified versions of this manual, such modified versions must remove the above endorsement. - +endif::[] == Preface @@ -219,9 +220,11 @@ text included with the software for more details. +ifdef::gfdl-enabled[] ==== Documentation License Please see <> for further information. +endif::[] == Introduction -- To view, visit https://gerrit.osmocom.org/3736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:59:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:59:16 +0000 Subject: osmo-sgsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/3716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 07:59:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 07:59:34 +0000 Subject: osmo-sgsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: -Verified -- To view, visit https://gerrit.osmocom.org/3716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:00:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:00:42 +0000 Subject: osmo-sgsn[master]: rework /debian support to match new osmo-sgsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0135a1118a115e8f053154e280f60674390f43a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:00:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:00:59 +0000 Subject: osmo-sgsn[master]: split off osmo-sgsn: remove files, apply build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3739 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:01:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:01:05 +0000 Subject: osmo-bsc[master]: split off osmo-bsc: remove files, apply build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3737 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:01:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:01:35 +0000 Subject: osmo-bsc[master]: rework /debian package support to match new osmo-bsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3738 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9fe1003f7d2af5c6a07c41aec59ea91594b825bd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:02:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:02:21 +0000 Subject: osmo-sgsn[master]: sccp init: pass no local m3ua addr to use defaults In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3740 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibafda0a9097183c26b21f3380d24dbe293e132e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:03:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:03:07 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:03:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:03:50 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 description fixes requested by holger missing -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:04:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:04:38 +0000 Subject: osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 @Holger: Would you mind having a look at this? looks fine to me, but you requested that feature/ticket in the past, AFAIR. -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:05:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:05:31 +0000 Subject: osmo-ci[master]: jenkins: Follow the convention and create a jenkins.sh as well In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:05:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 08:05:54 +0000 Subject: libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Patch Set 1: ping? -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:08:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 08:08:32 +0000 Subject: [MERGED] osmo-bts[master]: Support sending SI13 to PCU In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Support sending SI13 to PCU ...................................................................... Support sending SI13 to PCU * explicitly set SAPI when sending data_ind to PCU * drop unused receiving code for BCCH SAPI * send SI13 when PCU is connected * send SI13 when new SI is received Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf Related: OS#2400 --- M include/osmo-bts/pcu_if.h M src/common/l1sap.c M src/common/pcu_sock.c M src/common/rsl.c 4 files changed, 32 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index a020c05..ba3873e 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -6,6 +6,7 @@ extern int pcu_direct; int pcu_tx_info_ind(void); +int pcu_tx_si13(const struct gsm_bts *bts); int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, uint16_t arfcn, uint8_t block_nr); int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 21d9dc6..1b3a3ad 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -52,6 +52,7 @@ #include #include #include +#include struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) @@ -1013,7 +1014,7 @@ if (len == 0) return -EINVAL; if (L1SAP_IS_PTCCH(fn)) { - pcu_tx_data_ind(&trx->ts[tn], 1, fn, + pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PTCCH, fn, 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), data, len, rssi, data_ind->ber10k, data_ind->ta_offs_qbits, @@ -1023,7 +1024,7 @@ if (pr_info != PRES_INFO_BOTH) return 0; /* PDTCH / PACCH frame handling */ - pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PDTCH, fn, 0 /* ARFCN */, L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); } diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index a4ddc05..0a9ba2d 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -322,7 +322,7 @@ return pcu_sock_send(&bts_gsmnet, msg); } -int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn, uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) { @@ -332,9 +332,8 @@ struct gsm_bts *bts = ts->trx->bts; struct gsm_bts_role_bts *btsb = bts_role_bts(bts); - LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d " - "block=%d data=%s\n", is_ptcch, arfcn, block_nr, - osmo_hexdump(data, len)); + LOGP(DPCU, LOGL_DEBUG, "Sending data indication: sapi=%s arfcn=%d block=%d data=%s\n", + sapi_string[sapi], arfcn, block_nr, osmo_hexdump(data, len)); if (lqual / 10 < btsb->min_qual_norm) { LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n", @@ -348,7 +347,7 @@ pcu_prim = (struct gsm_pcu_if *) msg->data; data_ind = &pcu_prim->u.data_ind; - data_ind->sapi = (is_ptcch) ? PCU_IF_SAPI_PTCCH : PCU_IF_SAPI_PDTCH; + data_ind->sapi = sapi; data_ind->rssi = rssi; data_ind->fn = fn; data_ind->arfcn = arfcn; @@ -488,16 +487,6 @@ osmo_hexdump(data_req->data, data_req->len)); switch (data_req->sapi) { - case PCU_IF_SAPI_BCCH: - if (data_req->len == 23) { - bts->si_valid |= (1 << SYSINFO_TYPE_13); - memcpy(bts->si_buf[SYSINFO_TYPE_13], data_req->data, - data_req->len); - } else { - bts->si_valid &= ~(1 << SYSINFO_TYPE_13); - } - osmo_signal_dispatch(SS_GLOBAL, S_NEW_SYSINFO, bts); - break; case PCU_IF_SAPI_PCH: if (msg_type == PCU_IF_MSG_PAG_REQ) { /* FIXME: Add function to schedule paging request. @@ -546,6 +535,21 @@ return rc; } +int pcu_tx_si13(const struct gsm_bts *bts) +{ + /* the SI is per-BTS so it doesn't matter which TRX we use */ + struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 0); + + /* The low-level data like FN, ARFCN etc will be ignored but we have to set lqual high enough to bypass + the check at lower levels */ + int rc = pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, GSM_BTS_SI(bts, SYSINFO_TYPE_13), + GSM_MACBLOCK_LEN, 0, 0, 0, INT16_MAX); + if (rc < 0) + LOGP(DPCU, LOGL_NOTICE, "Failed to send SI13 to PCU: %d\n", rc); + + return rc; +} + static int pcu_rx_txt_ind(struct gsm_bts *bts, struct gsm_pcu_if_txt_ind *txt) { @@ -555,6 +559,11 @@ txt->text); osmo_signal_dispatch(SS_FAIL, OSMO_EVT_PCU_VERS, txt->text); osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH); + + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13)) + return pcu_tx_si13(bts); + else + LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n"); break; case PCU_OML_ALERT: osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, txt->text); diff --git a/src/common/rsl.c b/src/common/rsl.c index dc176ea..69ecf2e 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -50,6 +50,7 @@ #include #include #include +#include //#define FAKE_CIPH_MODE_COMPL @@ -306,6 +307,9 @@ LCHAN_REL_ACT_REACT; } + if (SYSINFO_TYPE_13 == osmo_si) + pcu_tx_si13(trx->bts); + if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; -- To view, visit https://gerrit.osmocom.org/3754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:20:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 08:20:12 +0000 Subject: [PATCH] osmo-sip-connector[master]: Fix build after recent libosmocore update Message-ID: Review at https://gerrit.osmocom.org/3758 Fix build after recent libosmocore update Change-Id: Idd1eba7ed0c5454de29d86a8bb72beb24d03ef2a --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/58/3758/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 1e028f1..2999120 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -12,7 +12,7 @@ osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd1eba7ed0c5454de29d86a8bb72beb24d03ef2a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:29:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 08:29:31 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 2: Sorry for delay, the fix is available in 3758. Once it's merged, rebasing this patch on top of it should fix the build. -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 08:32:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 1 Sep 2017 08:32:32 +0000 Subject: [PATCH] libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3537 to look at the new patch set (#2). osmux: Re-write osmux_snprintf After last buffer overflow fix to osmux_snprintf in 7cca0da1cc58bd589989684147ae3a0cd5819902, it was spotted that some cases may still be able to make osmux_snprintf acces unexpected memory. This patch attemps to try harder at fixing those issues. See OS#2443 for more information. Change-Id: I695771d099833842db37a415b636035d17f1bba7 --- M src/osmux.c 1 file changed, 40 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/37/3537/2 diff --git a/src/osmux.c b/src/osmux.c index b3c43e2..2b1bef8 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -846,19 +846,17 @@ h->rtp_ssrc = rtp_ssrc; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size -= ret; \ - if (ret > len) \ - ret = len; \ - offset += ret; \ - len -= ret; +#define SNPRINTF_BUFFER_SIZE(ret, buffer_offset, size) \ + if (ret < 0) \ + return ret; \ + if (ret >= size - buf_offset - 1) \ + return size - 1; /* full, early return */ \ + buf_offset += ret; \ + static int osmux_snprintf_header(char *buf, size_t size, struct osmux_hdr *osmuxh) { - int ret; - int len = size, offset = 0; - - ret = snprintf(buf, len, "OSMUX seq=%03u ccid=%03u " + return snprintf(buf, size, "OSMUX seq=%03u ccid=%03u " "ft=%01u ctr=%01u " "amr_f=%01u amr_q=%01u " "amr_ft=%02u amr_cmr=%02u ", @@ -866,82 +864,74 @@ osmuxh->ft, osmuxh->ctr, osmuxh->amr_f, osmuxh->amr_q, osmuxh->amr_ft, osmuxh->amr_cmr); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - - return offset; } static int osmux_snprintf_payload(char *buf, size_t size, const uint8_t *payload, int payload_len) { + unsigned int buf_offset = 0; int ret, i; - int len = size, offset = 0; - ret = snprintf(buf+offset, len, "[ "); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + buf_offset, size - buf_offset, "[ "); + SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); - for (i=0; ilen, len = size; + unsigned int msg_offset = 0; + unsigned int buf_offset = 0; struct osmux_hdr *osmuxh; - int this_len, msg_off = 0; - while (msg_len > 0) { - if (msg_len < sizeof(struct osmux_hdr)) { + while (msg->len > msg_offset) { + if (msg->len - msg_offset < sizeof(struct osmux_hdr)) { LOGP(DLMIB, LOGL_ERROR, - "No room for OSMUX header: only %d bytes\n", - msg_len); + "No room for OSMUX header: only %u bytes\n", + msg->len - msg_offset); return -1; } - osmuxh = (struct osmux_hdr *)((uint8_t *)msg->data + msg_off); + osmuxh = (struct osmux_hdr *)((uint8_t *)msg->data + msg_offset); - if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { - LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", + if (osmuxh->ft == OSMUX_FT_VOICE_AMR && !osmo_amr_ft_valid(osmuxh->amr_ft)) { + LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT 0x%x, skipping\n", osmuxh->amr_ft); return -1; } - ret = osmux_snprintf_header(buf+offset, size, osmuxh); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = osmux_snprintf_header(buf + buf_offset, size - buf_offset, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); - this_len = sizeof(struct osmux_hdr) + - osmux_get_payload_len(osmuxh); - msg_off += this_len; + msg_offset += sizeof(struct osmux_hdr) + osmux_get_payload_len(osmuxh); - if (msg_len < this_len) { + if (msg_offset > msg->len) { LOGP(DLMIB, LOGL_ERROR, "No room for OSMUX payload: only %d bytes\n", - msg_len); + msg->len - msg_offset); return -1; } - ret = osmux_snprintf_payload(buf+offset, size, + ret = osmux_snprintf_payload(buf + buf_offset, size - buf_offset, osmux_get_payload(osmuxh), osmux_get_payload_len(osmuxh)); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - - msg_len -= this_len; + SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); } - - return offset; + return buf_offset; } /*! @} */ -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:04:18 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Fri, 1 Sep 2017 09:04:18 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in ftmp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#3). sdp.c Send octet-align in ftmp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/3 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..0245651 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_msg_type == GSM_TCH_FRAME_AMR) + fmtp_str = talloc_asprintf(leg,"a=fmtp:%d octet-align=1 mode-set=4\r\n",other->payload_type); + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:06:56 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Fri, 1 Sep 2017 09:06:56 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in ftmp In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3735/3/src/sdp.c File src/sdp.c: Line 174: fmtp_str = talloc_asprintf(leg,"a=fmtp:%d octet-align=1 mode-set=4\r\n",other->payload_type); I have no idea if this the right way to invoke talloc_asprintf() hints appreciated :) -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 09:07:18 +0000 Subject: osmo-sip-connector[master]: Fix build after recent libosmocore update In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd1eba7ed0c5454de29d86a8bb72beb24d03ef2a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:07:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 09:07:20 +0000 Subject: [MERGED] osmo-sip-connector[master]: Fix build after recent libosmocore update In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix build after recent libosmocore update ...................................................................... Fix build after recent libosmocore update Change-Id: Idd1eba7ed0c5454de29d86a8bb72beb24d03ef2a --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 1e028f1..2999120 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -12,7 +12,7 @@ osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd1eba7ed0c5454de29d86a8bb72beb24d03ef2a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:08:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 09:08:28 +0000 Subject: [PATCH] osmo-pcu[master]: Support receiving SI13 from BTS In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3753 to look at the new patch set (#3). Support receiving SI13 from BTS * store SI13 in BTS struct * check and handle BCCH SAPI Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Related: OS#2400 --- M src/bts.h M src/osmo-bts-litecell15/lc15_l1_if.c M src/osmo-bts-sysmo/sysmo_l1_if.c M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty.h 6 files changed, 33 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/3753/3 diff --git a/src/bts.h b/src/bts.h index b1fb8cc..d65cd2f 100644 --- a/src/bts.h +++ b/src/bts.h @@ -29,6 +29,7 @@ #include #include #include +#include } #include "poll_controller.h" @@ -212,7 +213,8 @@ uint8_t alpha, gamma; uint8_t egprs_enabled; uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */ - + uint8_t si13[GSM_MACBLOCK_LEN]; + bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c index c82ddba..37b7f78 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index 9170972..1c5ecc9 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -10,6 +10,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 97eee9b..7112b04 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -245,6 +245,27 @@ return pdch->rcv_block(data, len, fn, meas); } +static int pcu_rx_data_ind_bcch(uint8_t *data, uint8_t len) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (len == 0) { + bts->si13_is_set = false; + LOGP(DL1IF, LOGL_INFO, "Received PCU data indication with empty SI13: cache cleaned\n"); + return 0; + } + + if (len != GSM_MACBLOCK_LEN) { + LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with SI13 with unexpected length %u\n", len); + return -EINVAL; + } + + memcpy(bts->si13, data, GSM_MACBLOCK_LEN); + bts->si13_is_set = true; + + return 0; +} + static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) { struct gprs_rlcmac_bts *bts = bts_main_data(); @@ -271,6 +292,9 @@ data_ind->data, data_ind->len, data_ind->fn, &meas); break; + case PCU_IF_SAPI_BCCH: + rc = pcu_rx_data_ind_bcch(data_ind->data, data_ind->len); + break; default: LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " "unsupported sapi %d\n", data_ind->sapi); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index e909b75..b7574f9 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -183,6 +183,7 @@ bts->n3103 = 4; bts->n3105 = 8; bts->alpha = 0; /* a = 0.0 */ + bts->si13_is_set = false; bts->ms_idle_sec = 60; /* slightly above T3314 (default 44s, 24.008, 11.2.2) */ bts->cs_adj_enabled = 1; bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */ diff --git a/src/pcu_vty.h b/src/pcu_vty.h index c00b882..a075350 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -1,6 +1,7 @@ #ifndef _PCU_VTY_H #define _PCU_VTY_H +#include #include #include -- To view, visit https://gerrit.osmocom.org/3753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:08:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 09:08:28 +0000 Subject: [PATCH] osmo-pcu[master]: cosmetic: tighten direct-phy related code Message-ID: Review at https://gerrit.osmocom.org/3759 cosmetic: tighten direct-phy related code * move the code to related SAPI case * get rid of 'unused variable' warning if direct-phy is not used Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b --- M src/pcu_l1_if.cpp 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/3759/1 diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 50e181e..97eee9b 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -163,9 +163,9 @@ void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn, uint32_t fn, uint8_t block_nr) { +#ifdef ENABLE_DIRECT_PHY struct gprs_rlcmac_bts *bts = bts_main_data(); -#ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, msg->data, msg->len); @@ -250,16 +250,7 @@ struct gprs_rlcmac_bts *bts = bts_main_data(); int rc; pcu_l1_meas meas; - meas.set_rssi(data_ind->rssi); -#ifndef ENABLE_DIRECT_PHY - /* convert BER to % value */ - meas.set_ber(data_ind->ber10k / 100); - meas.set_bto(data_ind->ta_offs_qbits); - meas.set_link_qual(data_ind->lqual_cb / 10); - LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements " - "received: BER10k = %d, BTO = %d, Q = %d\n", data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); -#endif + LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d " "block=%d data=%s\n", data_ind->sapi, data_ind->arfcn, data_ind->block_nr, @@ -267,6 +258,15 @@ switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: + meas.set_rssi(data_ind->rssi); +#ifndef ENABLE_DIRECT_PHY + /* convert BER to % value */ + meas.set_ber(data_ind->ber10k / 100); + meas.set_bto(data_ind->ta_offs_qbits); + meas.set_link_qual(data_ind->lqual_cb / 10); + LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements received: BER10k = %d, BTO = %d, Q = %d\n", + data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); +#endif rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, data_ind->data, data_ind->len, data_ind->fn, &meas); -- To view, visit https://gerrit.osmocom.org/3759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:28:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 09:28:21 +0000 Subject: osmo-pcu[master]: Move gsmtap and accounting into separate function In-Reply-To: References: Message-ID: Patch Set 3: > In general, those two operations don't relate or depend on each other. Yes, but in this particular case (hence static function) they come bundled which makes it somewhat harder to follow the code. This will be even more so than we'll add SI13 scheduling in here. -- To view, visit https://gerrit.osmocom.org/3755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 09:32:59 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Fri, 1 Sep 2017 09:32:59 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#5). sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode and can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/5 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..0245651 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_msg_type == GSM_TCH_FRAME_AMR) + fmtp_str = talloc_asprintf(leg,"a=fmtp:%d octet-align=1 mode-set=4\r\n",other->payload_type); + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 5 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 12:29:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 12:29:05 +0000 Subject: [PATCH] osmo-pcu[master]: Split TS allocation into digestable pieces Message-ID: Review at https://gerrit.osmocom.org/3760 Split TS allocation into digestable pieces Algorithm B implementation is way too big and complex to maintain or even to follow the code. Split it into set of smaller functions with documented interfaces to make it easier to read and modify. Also, clarify types in function signatures, document them and drop those which are unused. This opens up the road for reusing those functions in implementation of additional allocation algorithms. The test results are intentionally left unchanged to avoid potential regressions. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2400 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 332 insertions(+), 240 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/1 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..51d1c31 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -652,12 +652,11 @@ #warning "Copy and paste with other routines.." if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index b1fb8cc..1493f6e 100644 --- a/src/bts.h +++ b/src/bts.h @@ -203,11 +203,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..ad6f66f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -300,26 +300,20 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(BTS *bts, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; @@ -377,11 +371,30 @@ return NULL; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in,out] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -390,20 +403,24 @@ if (tfi < 0) return -EBUSY; - if (trx_no_) - *trx_no_ = trx_no; + *trx_no_ = trx_no; return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -488,9 +505,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in,out] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -796,15 +819,218 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign fiven UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign fiven DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + +/*! Update timeslot counters + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return single TS from a given UL/DL set according to TBF's direction + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns UL or DL timeslot number + */ +static uint8_t get_slots_single(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return pcu_lsb(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of UL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] usf USF array + * \param[in,out] ul_slots set of UL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_ul_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t dl_slots, + uint8_t reserved_ul_slots, int8_t first_common_ts, + int *usf, uint8_t *ul_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + int free_usf = -1; + + if (single) + (*ul_slots) = get_slots_single(trx, tbf, dl_slots, *ul_slots, &ts); + + if ((*ul_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No uplink slots available\n"); + return -EINVAL; + } + + if (first_common_ts >= 0) + (*ul_slots) = 1 << first_common_ts; + else + (*ul_slots) = (*ul_slots) & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, *ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + OSMO_ASSERT(ts >= 0 && ts <= 8); + + (*ul_slots) = 1 << ts; + usf[ts] = free_usf; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_ul_slots, 'u', '.'), *ul_slots, 'U'), + single ? ", single" : ""); + + update_slot_counters(*ul_slots, reserved_ul_slots, slotcount, avail_count); + + return ts; +} + +/*! Find set of DL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] dl_slots set of DL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_dl_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t ul_slots, + uint8_t reserved_dl_slots, int8_t first_common_ts, + uint8_t *dl_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + + if (single) + (*dl_slots) = get_slots_single(trx, tbf, *dl_slots, ul_slots, &ts); + + if ((*dl_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots available\n"); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, 'd', '.'), (*dl_slots), 'D'), + single ? ", single" : ""); + + update_slot_counters(*dl_slots, reserved_dl_slots, slotcount, avail_count); + + return ffs(*dl_slots) - 1; +} + +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -812,14 +1038,11 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; - char slot_info[9] = {0}; - int ts; + uint8_t avail_count = 0, trx_no; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -836,18 +1059,8 @@ first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } - /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -858,7 +1071,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -867,95 +1080,25 @@ } /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + first_ts = get_dl_slot_set(trx, tbf, single, ul_slots, reserved_dl_slots, first_common_ts, + &dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - OSMO_ASSERT(ts >= 0 && ts <= 8); - - ul_slots = 1 << ts; - usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; + first_ts = get_ul_slot_set(trx, tbf, single, dl_slots, reserved_ul_slots, first_common_ts, usf, + &ul_slots, &slotcount, &avail_count); /* We will stick to that single UL slot, unreserve the others */ + slotcount = 1; reserved_ul_slots = ul_slots; - - avail_count = pcu_bitcount(reserved_ul_slots); } + + if (first_ts < 0) + return -EINVAL; first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); - return -EINVAL; - } - if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); return -EINVAL; } @@ -974,58 +1117,23 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,10 +1141,15 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; @@ -1048,7 +1161,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,7 +1170,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); return rc; } diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..0e617ab 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ #warning "Copy and paste with tbf_new_dl_assignment" /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, 0, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b350720..7fd1131 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index e26c432..271f966 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -813,7 +811,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -823,7 +821,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 12:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 12:39:14 +0000 Subject: [PATCH] osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo Message-ID: Review at https://gerrit.osmocom.org/3761 cosmetic: convert explicit warnings to fixme/todo We do not use this style (#warning as an issue tracker replacement) in any other Osmocom project. Also those warnings clutter compiler output making it harder to spot warnings for the actual code. Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f --- M src/bts.cpp M src/gprs_bssgp_pcu.cpp M src/gprs_rlcmac_meas.cpp M src/gprs_rlcmac_sched.cpp M src/osmobts_sock.cpp M src/tbf.cpp M src/tbf_dl.cpp 7 files changed, 13 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/61/3761/1 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..b768569 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -649,7 +649,7 @@ } } else { // Create new TBF - #warning "Copy and paste with other routines.." + /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index 9c78ecf..284dd56 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -963,10 +963,11 @@ /* FIXME: move this to libgb: btsctx_free() */ llist_del(&the_pcu.bctx->list); -#warning "This causes ASAN to complain. It is not critical for normal operation but should be fixed nevertheless" -#if 0 + +/*FIXME: This causes ASAN to complain. It is not critical for normal operation but should be fixed nevertheless + talloc_free(the_pcu.bctx); -#endif +*/ the_pcu.bctx = NULL; } diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp index d6bbc19..41a7531 100644 --- a/src/gprs_rlcmac_meas.cpp +++ b/src/gprs_rlcmac_meas.cpp @@ -28,7 +28,7 @@ /* * downlink measurement */ -#warning "TODO: trigger the measurement report from the pollcontroller and use it for flow control" +/* TODO: trigger the measurement report from the pollcontroller and use it for flow control */ /* received Measurement Report */ int gprs_rlcmac_meas_rep(Packet_Measurement_Report_t *pmr) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 42f0308..4309909 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -60,7 +60,8 @@ || ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = ul_tbf; -#warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" +/* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all +states? */ } llist_for_each(pos, &bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index e9b85ab..31715d5 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -108,7 +108,8 @@ #endif for (ts = 0; ts < 8; ts++) bts->trx[trx].pdch[ts].disable(); -#warning "NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c for the reset." +/* FIXME: NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c +for the reset. */ gprs_rlcmac_tbf::free_all(&bts->trx[trx]); } diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..8e54157 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -382,7 +382,7 @@ { struct gprs_rlcmac_ul_tbf *tbf; -#warning "Copy and paste with tbf_new_dl_assignment" +/* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); @@ -465,7 +465,7 @@ get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, tbf->dl_ass_state)); tbf->stop_timer(); - #warning "TODO: Could/Should generate bssgp_tx_llc_discarded" + /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); llist_del(&tbf->list()); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b350720..1dd7dd8 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -145,7 +145,7 @@ } // Create new TBF (any TRX) -#warning "Copy and paste with alloc_ul_tbf" +/* FIXME: Copy and paste with alloc_ul_tbf */ /* set number of downlink slots according to multislot class */ dl_tbf = tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, ss); -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 12:43:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 12:43:42 +0000 Subject: [PATCH] osmo-pcu[master]: Split TS allocation into digestible pieces In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#2). Split TS allocation into digestible pieces Algorithm B implementation is way too big and complex to maintain or even to follow the code. Split it into set of smaller functions with documented interfaces to make it easier to read and modify. Also, clarify types in function signatures, document them and drop those which are unused. This opens up the road for reusing those functions in implementation of additional allocation algorithms. The test results are intentionally left unchanged to avoid potential regressions. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2400 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 332 insertions(+), 240 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/2 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..51d1c31 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -652,12 +652,11 @@ #warning "Copy and paste with other routines.." if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index b1fb8cc..1493f6e 100644 --- a/src/bts.h +++ b/src/bts.h @@ -203,11 +203,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..ad6f66f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -300,26 +300,20 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(BTS *bts, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; @@ -377,11 +371,30 @@ return NULL; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in,out] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -390,20 +403,24 @@ if (tfi < 0) return -EBUSY; - if (trx_no_) - *trx_no_ = trx_no; + *trx_no_ = trx_no; return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -488,9 +505,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in,out] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -796,15 +819,218 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign fiven UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign fiven DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + +/*! Update timeslot counters + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return single TS from a given UL/DL set according to TBF's direction + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns UL or DL timeslot number + */ +static uint8_t get_slots_single(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return pcu_lsb(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of UL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] usf USF array + * \param[in,out] ul_slots set of UL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_ul_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t dl_slots, + uint8_t reserved_ul_slots, int8_t first_common_ts, + int *usf, uint8_t *ul_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + int free_usf = -1; + + if (single) + (*ul_slots) = get_slots_single(trx, tbf, dl_slots, *ul_slots, &ts); + + if ((*ul_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No uplink slots available\n"); + return -EINVAL; + } + + if (first_common_ts >= 0) + (*ul_slots) = 1 << first_common_ts; + else + (*ul_slots) = (*ul_slots) & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, *ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + OSMO_ASSERT(ts >= 0 && ts <= 8); + + (*ul_slots) = 1 << ts; + usf[ts] = free_usf; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_ul_slots, 'u', '.'), *ul_slots, 'U'), + single ? ", single" : ""); + + update_slot_counters(*ul_slots, reserved_ul_slots, slotcount, avail_count); + + return ts; +} + +/*! Find set of DL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] dl_slots set of DL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_dl_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t ul_slots, + uint8_t reserved_dl_slots, int8_t first_common_ts, + uint8_t *dl_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + + if (single) + (*dl_slots) = get_slots_single(trx, tbf, *dl_slots, ul_slots, &ts); + + if ((*dl_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots available\n"); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, 'd', '.'), (*dl_slots), 'D'), + single ? ", single" : ""); + + update_slot_counters(*dl_slots, reserved_dl_slots, slotcount, avail_count); + + return ffs(*dl_slots) - 1; +} + +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -812,14 +1038,11 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; - char slot_info[9] = {0}; - int ts; + uint8_t avail_count = 0, trx_no; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -836,18 +1059,8 @@ first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } - /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -858,7 +1071,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -867,95 +1080,25 @@ } /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + first_ts = get_dl_slot_set(trx, tbf, single, ul_slots, reserved_dl_slots, first_common_ts, + &dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - OSMO_ASSERT(ts >= 0 && ts <= 8); - - ul_slots = 1 << ts; - usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; + first_ts = get_ul_slot_set(trx, tbf, single, dl_slots, reserved_ul_slots, first_common_ts, usf, + &ul_slots, &slotcount, &avail_count); /* We will stick to that single UL slot, unreserve the others */ + slotcount = 1; reserved_ul_slots = ul_slots; - - avail_count = pcu_bitcount(reserved_ul_slots); } + + if (first_ts < 0) + return -EINVAL; first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); - return -EINVAL; - } - if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); return -EINVAL; } @@ -974,58 +1117,23 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,10 +1141,15 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; @@ -1048,7 +1161,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,7 +1170,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); return rc; } diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..0e617ab 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ #warning "Copy and paste with tbf_new_dl_assignment" /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, 0, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b350720..7fd1131 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index e26c432..271f966 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -813,7 +811,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -823,7 +821,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 13:03:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 1 Sep 2017 13:03:52 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: In general we should avoid using #warning for this, and use #pragma message, to be able to enable -Werror at some point. #pragma message ("whatever I want to say here") -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 13:09:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 1 Sep 2017 13:09:10 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3761/1/src/gprs_bssgp_pcu.cpp File src/gprs_bssgp_pcu.cpp: Line 967: /*FIXME: This causes ASAN to complain. It is not critical for normal operation but should be fixed nevertheless We may want to have this one as pragma message instead of moving it to a comment, as it may be covering a memory leak? Then if a memory leak is spotted at some point, it's easy to see it can be here as we usually see it during build. -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 1 13:28:28 2017 From: gerrit-no-reply at lists.osmocom.org (Ivan Kluchnikov) Date: Fri, 1 Sep 2017 13:28:28 +0000 Subject: libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Patch Set 1: Hello Harald, Sorry for slow response, I don't think this fix overlaps with gerrit 266 and 3257. Regrading the unittest - unfortunately my understanding of the code is not enough to implement a meaningful unittest. If unittest is a requirement, I need to find some time to learn the code more deeply which I'm afraid won't happen soon. Or may be I don't understand what test do you mean? I assume you are talking about a test case for statefull handling for DL SAP messages from L3 which is implemented in lapd_recv_dlsap() function. -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 13:35:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 1 Sep 2017 13:35:07 +0000 Subject: libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Patch Set 1: I think at this point I would be happy if you could follow up with Holgers' request to include a backtrace int o the commit message. Thanks! -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 13:50:15 2017 From: gerrit-no-reply at lists.osmocom.org (Ivan Kluchnikov) Date: Fri, 1 Sep 2017 13:50:15 +0000 Subject: [PATCH] libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3467 to look at the new patch set (#2). lapd_core: Fix crash in lapd_est_req() function lapd_est_req() function could be called on uninitialized lapd link (before lapd_dl_init() and after lapd_dl_exit() functions) due to invalid usage on higher levels. In order to prevent using uninitialized lapd link, we should set LAPD_STATE_NULL state for lapd_datalink in lapd_dl_exit() function. So all messages for lapd_datalink in null state will be unhandled by lapd_recv_dlsap() function and lapd_est_req() function will not be called before lapd_dl_init() function where lapd link state is changed to idle. #0 0x00007f46ecd99aa5 in lapd_est_req (dp=, lctx=0x7f46ed80b8b8) at lapd_core.c:1769 #1 0x00007f46ecd9dda8 in rslms_rx_rll_est_req (msg=msg at entry=0x7f46eeab4940, dl=dl at entry=0x7f46ed80b888) at lapdm.c:845 #2 0x00007f46ecd9fc03 in rslms_rx_rll (lc=0x7f46ed80b398, msg=0x7f46eeab4940) at lapdm.c:1157 #3 lapdm_rslms_recvmsg (msg=0x7f46eeab4940, lc=0x7f46ed80b398) at lapdm.c:1223 #4 0x00007f46ed63773d in rsl_rx_rll (msg=, trx=) at rsl.c:2178 #5 down_rsl (trx=, msg=) at rsl.c:2541 #6 0x00007f46ed641529 in sign_link_cb (msg=) at abis.c:169 #7 0x00007f46ec54b111 in ipaccess_bts_read_cb (link=0x7f46eeab4940, msg=0x0) at input/ipaccess.c:807 #8 0x00007f46ec548a8e in ipa_client_read (link=0x7f46ee26ae30) at input/ipa.c:74 #9 ipa_client_fd_cb (ofd=, what=1) at input/ipa.c:137 #10 0x00007f46ecfc726f in osmo_fd_disp_fds (_eset=0x7ffe7a9fcd20, _wset=0x7ffe7a9fcca0, _rset=0x7ffe7a9fcc20) at select.c:167 #11 osmo_select_main (polling=polling at entry=0) at select.c:207 #12 0x00007f46ed63fc25 in bts_main (argc=5, argv=) at main.c:359 #13 0x00007f46ebd76f45 in __libc_start_main (main=0x7f46ed61b120
, argc=5, argv=0x7ffe7a9fcf18, init=, fini=, rtld_fini=, #14 0x00007f46ed61b14e in _start () Related: OS#1982 Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c --- M src/gsm/lapd_core.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/3467/2 diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 166bf9a..6b58006 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -326,6 +326,10 @@ { /* free all ressources except history buffer */ lapd_dl_reset(dl); + + /* enter null state */ + lapd_dl_newstate(dl, LAPD_STATE_NULL); + /* free history buffer list */ talloc_free(dl->tx_hist); dl->tx_hist = NULL; -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 13:57:17 2017 From: gerrit-no-reply at lists.osmocom.org (Ivan Kluchnikov) Date: Fri, 1 Sep 2017 13:57:17 +0000 Subject: libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Patch Set 2: > I think at this point I would be happy if you could follow up with > Holgers' request to include a backtrace int o the commit message. > Thanks! Yes, sure, included. -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 14:07:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 14:07:14 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: This function is always called right before exit so it can't cause memleak. And any refactoring which changes that will have to touch this code anyway so I think comment is enough for now. -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 14:11:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 1 Sep 2017 14:11:21 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 It would be good to git blame on the lines with #warning and see who introduced them, and ask for reivew. It may be a good moment to see if the issues they are still there or they can be removed completely. -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 14:25:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 14:25:25 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: In theory I agree with both points but in practice some of those warnings were introduced years ago by people no longer working on the code. Also testing for all of them would require significant time, while converting them to comments will make working with the code easier immediately. -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 14:45:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 14:45:57 +0000 Subject: [PATCH] osmo-bts[master]: Support removing SI13 from PCU Message-ID: Review at https://gerrit.osmocom.org/3762 Support removing SI13 from PCU If SI13 becomes unavailable in runtime than send 0-length message with BCCH SAPI to PCU to indicate that SI13 have to be removed. Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b Related: OS#2400 --- M include/osmo-bts/pcu_if.h M src/common/pcu_sock.c M src/common/rsl.c 3 files changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/3762/1 diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index ba3873e..4377833 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -6,7 +6,7 @@ extern int pcu_direct; int pcu_tx_info_ind(void); -int pcu_tx_si13(const struct gsm_bts *bts); +int pcu_tx_si13(const struct gsm_bts *bts, bool enable); int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, uint16_t arfcn, uint8_t block_nr); int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 0a9ba2d..e5bcf57 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -535,7 +535,7 @@ return rc; } -int pcu_tx_si13(const struct gsm_bts *bts) +int pcu_tx_si13(const struct gsm_bts *bts, bool enable) { /* the SI is per-BTS so it doesn't matter which TRX we use */ struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 0); @@ -543,7 +543,7 @@ /* The low-level data like FN, ARFCN etc will be ignored but we have to set lqual high enough to bypass the check at lower levels */ int rc = pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, GSM_BTS_SI(bts, SYSINFO_TYPE_13), - GSM_MACBLOCK_LEN, 0, 0, 0, INT16_MAX); + enable ? GSM_MACBLOCK_LEN : 0, 0, 0, 0, INT16_MAX); if (rc < 0) LOGP(DPCU, LOGL_NOTICE, "Failed to send SI13 to PCU: %d\n", rc); @@ -561,9 +561,9 @@ osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH); if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13)) - return pcu_tx_si13(bts); - else - LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n"); + return pcu_tx_si13(bts, true); + + LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n"); break; case PCU_OML_ALERT: osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, txt->text); diff --git a/src/common/rsl.c b/src/common/rsl.c index 69ecf2e..28dc2d0 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -308,7 +308,7 @@ } if (SYSINFO_TYPE_13 == osmo_si) - pcu_tx_si13(trx->bts); + pcu_tx_si13(trx->bts, true); if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); @@ -353,6 +353,8 @@ bts->si_valid &= ~(1 << osmo_si); LOGP(DRSL, LOGL_INFO, " RX RSL Disabling BCCH INFO (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); + if (SYSINFO_TYPE_13 == osmo_si) + pcu_tx_si13(trx->bts, false); } osmo_signal_dispatch(SS_GLOBAL, S_NEW_SYSINFO, bts); -- To view, visit https://gerrit.osmocom.org/3762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 14:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 1 Sep 2017 14:48:53 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: I'm not saying it's a hard requirement for them to say anything to merge this, but I think it's still good to give them the chance to say something about it :-) -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 1 14:50:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 14:50:24 +0000 Subject: [ABANDON] osmo-bts[master]: Use git-version-gen from gnulib In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Use git-version-gen from gnulib ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I290acecbbb91f5ee713a035d07e23e7d5c0cf03c Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 1 15:50:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 1 Sep 2017 15:50:34 +0000 Subject: [MERGED] osmo-gsm-tester[master]: contrib: Add scripts to build osmo-pcu In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: contrib: Add scripts to build osmo-pcu ...................................................................... contrib: Add scripts to build osmo-pcu Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab --- A contrib/jenkins-build-osmo-pcu-sysmo.sh A contrib/jenkins-build-osmo-pcu.sh 2 files changed, 29 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-pcu-sysmo.sh b/contrib/jenkins-build-osmo-pcu-sysmo.sh new file mode 100755 index 0000000..b912252 --- /dev/null +++ b/contrib/jenkins-build-osmo-pcu-sysmo.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -e -x + +poky="/opt/poky/1.5.4" +. "$poky/environment-setup-armv5te-poky-linux-gnueabi" + +# Cross-compilation: all installations need to be put in the sysmo SDK sysroot +export DESTDIR="$poky/sysroots/armv5te-poky-linux-gnueabi" + +base="$PWD" +name="osmo-pcu-sysmo" +prefix="/usr/local/jenkins-build/inst-$name" +prefix_real="$DESTDIR$prefix" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-pcsc --disable-doxygen +build_repo osmo-pcu --enable-sysmocom-dsp + +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-pcu.sh b/contrib/jenkins-build-osmo-pcu.sh new file mode 100755 index 0000000..7953875 --- /dev/null +++ b/contrib/jenkins-build-osmo-pcu.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-pcu" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-pcsc --disable-doxygen +build_repo osmo-pcu + +create_bin_tgz -- To view, visit https://gerrit.osmocom.org/3756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 1 16:04:31 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 1 Sep 2017 16:04:31 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add features attribute to modems Message-ID: Review at https://gerrit.osmocom.org/3763 Add features attribute to modems The idea behind this attribute is similar to the Features one in ofono: To provide an easy-to-use list of features that a modem supports. In osmo-gsm-tester this feature list can be used to create scenarios to act as a filter for modems. For instance, if an sms related feature must be tested, then a modem supporting sms features is required. This way only modems supporting that feature are going to be selected for that test when that scenario is used. We provide our own list instead of dynamically using it for two reasons: - Accessing the list from ofono means powering on + online the modem, which requires using the modem before resource resolution is done. - ofono may state that it has support for feature X, but it still doesn't have all features required by osmo-gsm-tester or there is a bug in some part of the feature which prevents it from being used for a specific test. Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 --- M example/resources.conf A example/scenarios/mfeature-gprs.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 4 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/63/3763/1 diff --git a/example/resources.conf b/example/resources.conf index e7e64ee..4798b0a 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -60,6 +60,7 @@ ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' ciphers: ['a5 0', 'a5 1'] + features: ['sms'] - label: sierra_2 path: '/sierra_2' @@ -67,6 +68,7 @@ ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' ciphers: ['a5 0', 'a5 1'] + features: ['sms'] - label: gobi_0 path: '/gobi_0' @@ -74,6 +76,7 @@ ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' ciphers: ['a5 0', 'a5 1'] + features: [] - label: gobi_3 path: '/gobi_3' @@ -81,3 +84,4 @@ ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' ciphers: ['a5 0', 'a5 1'] + features: ['gprs'] diff --git a/example/scenarios/mfeature-gprs.conf b/example/scenarios/mfeature-gprs.conf new file mode 100644 index 0000000..69a05d8 --- /dev/null +++ b/example/scenarios/mfeature-gprs.conf @@ -0,0 +1,4 @@ +resources: + modem: + - features: + - 'gprs' diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 4f43bfc..f960322 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -67,6 +67,7 @@ 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, 'modem[].ciphers[]': schema.CIPHER, + 'modem[].features[]': schema.MODEM_FEATURE, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 91ad883..f7be899 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -71,6 +71,11 @@ return raise ValueError('Unknown Cipher value: %r' % val) +def modem_feature(val): + if val in ('sms', 'gprs', 'voicecall', 'ussd'): + return + raise ValueError('Unknown Modem Feature: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -82,6 +87,8 @@ MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' CIPHER = 'cipher' +MODEM_FEATURE = 'modem_feature' + SCHEMA_TYPES = { INT: int, STR: str, @@ -94,6 +101,7 @@ MSISDN: msisdn, AUTH_ALGO: auth_algo, CIPHER: cipher, + MODEM_FEATURE: modem_feature, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 1 16:39:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 1 Sep 2017 16:39:25 +0000 Subject: [PATCH] meta-telephony[master]: Add git-review config Message-ID: Review at https://gerrit.osmocom.org/3764 Add git-review config Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/64/3764/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..30ca929 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=meta-telephony -- To view, visit https://gerrit.osmocom.org/3764 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:10 +0000 Subject: [MERGED] osmo-mgw[master]: split off osmo-mgw: remove files, apply build, rename In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: split off osmo-mgw: remove files, apply build, rename ...................................................................... split off osmo-mgw: remove files, apply build, rename Add vty and logging previously used from libcommon Rename libmgcp to libosmo-legacy-mgcp and install. Use DLMGCP, not DMGCP. Slim down the public mgcpgw_client API, move all elements not actually used by current callers to private headers / static c. Depends: libosmocore I09c587e2d59472cbde852d467d457254746d9e67 Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7 --- M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/a_iface.h D include/openbsc/a_iface_bssap.h D include/openbsc/a_reset.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_reset.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_bsc_sigtran.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/a_reset.c D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 483 files changed, 9,790 insertions(+), 159,951 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:13 +0000 Subject: [MERGED] osmo-mgw[master]: rework debian packages support In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rework debian packages support ...................................................................... rework debian packages support Remove old leftover from split of osmo-mgw out of openbsc. Change-Id: I96a6a56c401833d053d48908872fb0474f5aec53 --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs A debian/libosmo-legacy-mgcp-dev.install A debian/libosmo-legacy-mgcp0.install D debian/openbsc-dev.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install A debian/osmo-mgw.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules 31 files changed, 131 insertions(+), 1,175 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..21e4bbd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-mgw (0.1.0) unstable; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:12:53 +0000 diff --git a/debian/control b/debian/control index 87b6f07..a1e4704 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,49 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-mgw Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, - libssl-dev, - libc-ares-dev, - libsmpp34-dev + pkg-config, + autotools-dev, + libosmocore-dev, + libosmo-netif-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-iuh.git +Vcs-Browser: https://git.osmocom.org/osmo-iuh/ +Homepage: https://projects.osmocom.org/projects/osmohnbgw -Package: osmocom-bsc +Package: osmo-mgw Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: libosmo-legacy-mgcp0, ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-mgw-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible +Multi-Arch: same +Depends: osmo-mgw (= ${binary:Version}), ${misc:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-ipaccess-utils-dbg +Package: libosmo-legacy-mgcp0 +Section: libs Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-bs11-utils-dbg -Architecture: any +Package: libosmo-legacy-mgcp-dbg Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible +Architecture: any +Multi-Arch: same +Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-sgsn-dbg +Package: libosmo-legacy-mgcp-dev +Section: libdevel Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..f1dada2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,74 +1,14 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-mgw +Source: git://git.osmocom.org/osmo-mgw -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2009-2014 On-Waves + 2009-2015 Holger Hans Peter Freyther + 2013 Jacob Erlbeck + 2016 sysmocom s.m.f.c. GmbH +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -76,62 +16,67 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Affero General Public License for more details. . You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. +Files: src/libosmo-legacy-mgcp/g711common.h +Copyright: 2000 Abramo Bagnara +License: GPL-2.0+ + Wrapper for linphone Codec class by Simon Morlat . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". - - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. - . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + The FSF address in the above text is the old one. + . + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + +Files: src/libosmo-legacy-mgcp/mgcp_osmux.c +Copyright: 2012-2013 On Waves ehf + 2012-2013 Pablo Neira Ayuso +License: AGPL-3.0+ + All rights not specifically granted under this license are reserved. + . + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published by the + Free Software Foundation; either version 3 of the License, or (at your + option) any later version. + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install new file mode 100644 index 0000000..5bd9dd0 --- /dev/null +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/*.so +usr/lib/*/pkgconfig/*.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libosmo-legacy-mgcp0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-gtphub.default b/debian/osmo-gtphub.default deleted file mode 100644 index 6af82da..0000000 --- a/debian/osmo-gtphub.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-gtphub.cfg" - diff --git a/debian/osmo-gtphub.examples b/debian/osmo-gtphub.examples deleted file mode 100644 index 48c2dc0..0000000 --- a/debian/osmo-gtphub.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-gtphub diff --git a/debian/osmo-gtphub.init b/debian/osmo-gtphub.init deleted file mode 100755 index 160d55b..0000000 --- a/debian/osmo-gtphub.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gtphub -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GTP hub -# Description: Osmocom GTP hub -### END INIT INFO - -# Author: Neels Hofmeyr - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gtphub # Introduce the short server's name here -DESC="Osmocom GTP hub" # Introduce a short description here -DAEMON=/usr/bin/osmo-gtphub # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmo-gtphub - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmo-gtphub ] && . /etc/default/osmo-gtphub - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install deleted file mode 100644 index 908c1a5..0000000 --- a/debian/osmo-gtphub.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gtphub diff --git a/debian/osmo-mgw.install b/debian/osmo-mgw.install new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/debian/osmo-mgw.install @@ -0,0 +1 @@ +usr/bin diff --git a/debian/osmocom-bs11-utils.install b/debian/osmocom-bs11-utils.install deleted file mode 100644 index 757a854..0000000 --- a/debian/osmocom-bs11-utils.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/bs11_config -/usr/bin/isdnsync diff --git a/debian/osmocom-bsc-nat.init b/debian/osmocom-bsc-nat.init deleted file mode 100755 index 984a7ce..0000000 --- a/debian/osmocom-bsc-nat.init +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmocom-bsc-nat -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-bsc_nat # Introduce the short server's name here -DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here -DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-bsc-nat -CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-bsc-nat.install b/debian/osmocom-bsc-nat.install deleted file mode 100644 index b561a7e..0000000 --- a/debian/osmocom-bsc-nat.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-bsc_nat diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/osmocom-gbproxy.init b/debian/osmocom-gbproxy.init deleted file mode 100755 index 924f32d..0000000 --- a/debian/osmocom-gbproxy.init +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gbproxy -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GBproxy -# Description: A tool to proxy the GPRS Gb interface. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gbproxy # Introduce the short server's name here -DESC="Osmocom GBProxy" # Introduce a short description here -DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-gbproxy -CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-gbproxy.install b/debian/osmocom-gbproxy.install deleted file mode 100644 index ba3f6ee..0000000 --- a/debian/osmocom-gbproxy.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gbproxy diff --git a/debian/osmocom-ipaccess-utils.install b/debian/osmocom-ipaccess-utils.install deleted file mode 100644 index de13c18..0000000 --- a/debian/osmocom-ipaccess-utils.install +++ /dev/null @@ -1,3 +0,0 @@ -/usr/bin/ipaccess-config -/usr/bin/abisip-find -/usr/bin/ipaccess-proxy diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/osmocom-sgsn.default b/debian/osmocom-sgsn.default deleted file mode 100644 index 77c9679..0000000 --- a/debian/osmocom-sgsn.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg" - diff --git a/debian/osmocom-sgsn.examples b/debian/osmocom-sgsn.examples deleted file mode 100644 index 15de78d..0000000 --- a/debian/osmocom-sgsn.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-sgsn diff --git a/debian/osmocom-sgsn.init b/debian/osmocom-sgsn.init deleted file mode 100755 index 0794dc1..0000000 --- a/debian/osmocom-sgsn.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom Serving GPRS Support Node -# Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-sgsn # Introduce the short server's name here -DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here -DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-sgsn - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-sgsn.install b/debian/osmocom-sgsn.install deleted file mode 100644 index d89c456..0000000 --- a/debian/osmocom-sgsn.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-sgsn diff --git a/debian/rules b/debian/rules index 4e187a6..ee680cc 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,34 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) +DEBIAN := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2) DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) +# debmake generated override targets +# Set options for ./configure +#CONFIGURE_FLAGS = +#overrride_dh_configure: +# dh_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo + override_dh_autoreconf: - cd openbsc && autoreconf --install --force + echo $(VERSION) > .tarball-version + dh_autoreconf +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - -override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp - + dh_strip --dbg-package=osmo-mgw-dbg + dh_strip --dbg-package=libosmo-legacy-mgcp-dbg -- To view, visit https://gerrit.osmocom.org/3745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I96a6a56c401833d053d48908872fb0474f5aec53 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:13 +0000 Subject: [MERGED] osmo-mgw[master]: log: output message content also on retransmissions In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: log: output message content also on retransmissions ...................................................................... log: output message content also on retransmissions When a duplicate command is sent, the MGCP-GW will interpret this as a retramsmission and will send the response of the already executed command again. This response is not printed in the log. Make sure that also responses, which are retrsnamitted are displayed in the log Change-Id: Ic41c2defb521e2f81762d932f8e29f7c8fed06a9 --- M src/libosmo-legacy-mgcp/mgcp_protocol.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-legacy-mgcp/mgcp_protocol.c b/src/libosmo-legacy-mgcp/mgcp_protocol.c index 332aa91..bc1ec0d 100644 --- a/src/libosmo-legacy-mgcp/mgcp_protocol.c +++ b/src/libosmo-legacy-mgcp/mgcp_protocol.c @@ -172,6 +172,7 @@ msg->l2h = msgb_put(msg, strlen(endp->last_response)); memcpy(msg->l2h, endp->last_response, msgb_l2len(msg)); + display_mgcp_message(msg->l2h, msgb_l2len(msg), "Retransmitted response"); return msg; } -- To view, visit https://gerrit.osmocom.org/3746 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic41c2defb521e2f81762d932f8e29f7c8fed06a9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:29 +0000 Subject: [MERGED] osmo-sgsn[master]: sccp init: pass no local m3ua addr to use defaults In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sccp init: pass no local m3ua addr to use defaults ...................................................................... sccp init: pass no local m3ua addr to use defaults Remove the FIXMEs because these addresses are configurable via the cs7 / {as,asp} vty commands. Change-Id: Ibafda0a9097183c26b21f3380d24dbe293e132e2 --- M src/gprs/sgsn_main.c 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index e24a57b..8ffc6c8 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -479,10 +479,9 @@ #if BUILD_IU sccp = osmo_sccp_simple_client(tall_bsc_ctx, "OsmoSGSN", 2 /* FIXME: configurable */, - OSMO_SS7_ASP_PROT_M3UA, 0, - "127.0.0.4" /* FIXME: configurable */, - M3UA_PORT, - "127.0.0.1" /* FIXME: configurable */); + OSMO_SS7_ASP_PROT_M3UA, + 0, NULL, + 0, "127.0.0.1"); if (!sccp) { printf("Setting up SCCP client failed.\n"); return 8; -- To view, visit https://gerrit.osmocom.org/3740 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibafda0a9097183c26b21f3380d24dbe293e132e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:30 +0000 Subject: [MERGED] osmo-sgsn[master]: split off osmo-sgsn: remove files, apply build In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: split off osmo-sgsn: remove files, apply build ...................................................................... split off osmo-sgsn: remove files, apply build Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f --- M configure.ac M include/openbsc/Makefile.am D include/openbsc/a_iface.h D include/openbsc/a_iface_bssap.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/e1_config.h M include/openbsc/gprs_sgsn.h M include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_reset.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_bsc_sigtran.h D include/openbsc/osmo_msc.h D include/openbsc/osmux.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h M include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_vty.c A src/gprs/gsup_client.c M src/gprs/gtphub_main.c M src/gprs/gtphub_vty.c A src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/a_reset.c D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok M tests/oap/Makefile.am M tests/sgsn/Makefile.am M tests/slhc/Makefile.am D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok M tests/v42bis/Makefile.am M tests/vty_test_runner.py M tests/xid/Makefile.am 318 files changed, 795 insertions(+), 97,309 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3739 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:32 +0000 Subject: [MERGED] osmo-sgsn[master]: rework /debian support to match new osmo-sgsn In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rework /debian support to match new osmo-sgsn ...................................................................... rework /debian support to match new osmo-sgsn Remove old leftover from split of osmo-sgsn out of openbsc. Change-Id: Ic0135a1118a115e8f053154e280f60674390f43a --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install R debian/osmo-gbproxy.init A debian/osmo-gbproxy.install D debian/osmo-gtphub.examples M debian/osmo-gtphub.install A debian/osmo-sgsn.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules 28 files changed, 556 insertions(+), 855 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..6216695 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-sgsn (0.1.0) unstable; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:13:05 +0000 diff --git a/debian/control b/debian/control index 87b6f07..16fd244 100644 --- a/debian/control +++ b/debian/control @@ -1,82 +1,59 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-sgsn Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, + autotools-dev, + autoconf, + automake, + libtool, + pkg-config, libssl-dev, + libtalloc-dev, libc-ares-dev, - libsmpp34-dev + libgtp-dev, + libdbi-dev, + libdbd-sqlite3, + libosmocore-dev, + libosmo-abis-dev, + libosmo-ranap-dev, + libosmo-sccp-dev, + libosmo-netif-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-sgsn.git +Vcs-Browser: http://git.osmocom.org/gitweb?p=osmo-sgsn.git;a=summary +Homepage: https://projects.osmocom.org/projects/osmo-sgsn -Package: osmocom-bsc + +Package: osmo-sgsn Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoSGSN: Osmocom's Serving GPRS Support Node for 2G and 3G packet-switched mobile networks -Package: osmocom-nitb +Package: osmo-sgsn-dbg +Section: debug Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. +Multi-Arch: same +Depends: osmo-sgsn (= ${binary:Version}), ${misc:Depends} +Description: OsmoSGSN: Osmocom's Serving GPRS Support Node for 2G and 3G packet-switched mobile networks -Package: osmocom-ipaccess-utils +Package: osmo-gtphub Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom GTP Hub + Proxy for comms between multiple SGSNs and GGSNs. -Package: osmocom-bs11-utils +Package: osmo-gtphub-dbg Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. +Section: debug +Priority: extra +Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} +Description: Debug symbols for Osmocom GTP Hub + Make debugging possible -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy +Package: osmo-gbproxy Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -87,95 +64,11 @@ . This package is part of OpenBSC and closely related to osmocom-sgsn. -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg +Package: osmo-gbproxy-dbg Architecture: any Section: debug Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} +Depends: osmo-gbproxy (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for Osmocom GTP Hub Make debugging possible + diff --git a/debian/copyright b/debian/copyright index 1e4dee1..8d731ee 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,75 +1,277 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-sgsn +Source: git://git.osmocom.org/osmo-sgsn -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well +Files: .gitignore + .gitreview + .mailmap + AUTHORS + Makefile.am + README + README.vty-tests + configure.ac + contrib/Makefile.am + contrib/a-link/sccp-split-by-con.lua + contrib/bsc-test/README + contrib/bsc-test/all_dial + contrib/bsc-test/dial.sh + contrib/bsc-test/drop-oml.sh + contrib/bsc-test/drop.sh + contrib/bsc-test/hangup + contrib/bsc-test/msc.sh + contrib/bsc_control.py + contrib/bt.py + contrib/convert_to_enum.py + contrib/ctrl2sse.py + contrib/gprs/gb-proxy-unblock-bug.py + contrib/gprs/gprs-bssgp-histogram.lua + contrib/gprs/gprs-buffer-count.lua + contrib/gprs/gprs-split-trace-by-tlli.lua + contrib/gprs/gprs-verify-nu.lua + contrib/hlr-remove-old.sql + contrib/hlrsync/hlrsync.py + contrib/ipa.py + contrib/jenkins.sh + contrib/mgcp_server.py + contrib/nat/test_regexp.c + contrib/nat/ussd_example.py + contrib/rtp/gen_rtp_header.erl + contrib/rtp/rtp_replay.st + contrib/rtp/rtp_replay_shared.st + contrib/rtp/rtp_replay_sip.st + contrib/rtp/timestamp_rtp.lua + contrib/sms/fill-hlr.st + contrib/sms/hlr-query.st + contrib/sms/sqlite-probe.tap.d + contrib/soap.py + contrib/systemd/osmo-bsc-mgcp.service + contrib/systemd/osmo-bsc.service + contrib/systemd/osmo-gbproxy.service + contrib/systemd/osmo-msc.service + contrib/systemd/osmo-nitb.service + contrib/systemd/osmo-sgsn.service + contrib/testconv/Makefile + contrib/testconv/testconv_main.c + contrib/twisted_ipa.py + doc/BS11-OML.txt + doc/Makefile.am + doc/call-routing.txt + doc/channel_release.txt + doc/e1-data-model.txt + doc/examples/Makefile.am + doc/examples/osmo-bsc/osmo-bsc.cfg + doc/examples/osmo-bsc_mgcp/mgcp.cfg + doc/examples/osmo-bsc_nat/black-list.cfg + doc/examples/osmo-bsc_nat/bscs.cfg + doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg + doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg + doc/examples/osmo-gbproxy/osmo-gbproxy.cfg + doc/examples/osmo-gtphub/gtphub-example.txt + doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg + doc/examples/osmo-gtphub/osmo-gtphub.cfg + doc/examples/osmo-msc/osmo-msc.cfg + doc/examples/osmo-sgsn/osmo-sgsn.cfg + doc/gsm-hopping.txt + doc/handover.txt + doc/ipa-sccp.txt + doc/oml-interface.txt + doc/osmo-nitb-data_structures.dot + doc/paging.txt + include/Makefile.am + include/compat_af_isdn.h + include/openbsc/Makefile.am + include/openbsc/common.h + include/openbsc/crc24.h + include/openbsc/debug.h + include/openbsc/gb_proxy.h + include/openbsc/gprs_gb_parse.h + include/openbsc/gprs_gmm.h + include/openbsc/gprs_llc.h + include/openbsc/gprs_sgsn.h + include/openbsc/gprs_sndcp.h + include/openbsc/gprs_subscriber.h + include/openbsc/rest_octets.h + include/openbsc/sgsn.h + include/openbsc/vty.h + m4/README + openbsc.pc.in + src/Makefile.am + src/gprs/.gitignore + src/gprs/Makefile.am + src/gprs/osmo_sgsn.cfg + src/libcommon/Makefile.am + src/libcommon/gsup_test_client.c + tests/Makefile.am + tests/atlocal.in + tests/gbproxy/Makefile.am + tests/gbproxy/gbproxy_test.ok + tests/gprs/Makefile.am + tests/gprs/gprs_test.c + tests/gprs/gprs_test.ok + tests/gtphub/Makefile.am + tests/gtphub/gtphub_test.ok + tests/libiudummy/Makefile.am + tests/libiudummy/README + tests/libiudummy/iudummy.c + tests/oap/Makefile.am + tests/oap/oap_client_test.err + tests/oap/oap_client_test.ok + tests/sgsn/Makefile.am + tests/sgsn/sgsn_test.ok + tests/slhc/Makefile.am + tests/slhc/slhc_test.ok + tests/sndcp_xid/Makefile.am + tests/sndcp_xid/sndcp_xid_test.ok + tests/testsuite.at + tests/v42bis/Makefile.am + tests/v42bis/v42bis_test.ok + tests/xid/Makefile.am + tests/xid/xid_test.ok + tools/hlrstat.pl +Copyright: __NO_COPYRIGHT_NOR_LICENSE__ +License: __NO_COPYRIGHT_NOR_LICENSE__ -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: include/openbsc/a_reset.h + include/openbsc/gprs_llc_xid.h + include/openbsc/gprs_sndcp_comp.h + include/openbsc/gprs_sndcp_dcomp.h + include/openbsc/gprs_sndcp_pcomp.h + include/openbsc/gprs_sndcp_xid.h + include/openbsc/gprs_utils.h + include/openbsc/gsup_client.h + include/openbsc/gtphub.h + include/openbsc/oap_client.h + include/openbsc/signal.h + src/gprs/crc24.c + src/gprs/gb_proxy.c + src/gprs/gb_proxy_main.c + src/gprs/gb_proxy_patch.c + src/gprs/gb_proxy_peer.c + src/gprs/gb_proxy_tlli.c + src/gprs/gb_proxy_vty.c + src/gprs/gprs_gb_parse.c + src/gprs/gprs_gmm.c + src/gprs/gprs_llc.c + src/gprs/gprs_llc_parse.c + src/gprs/gprs_llc_vty.c + src/gprs/gprs_llc_xid.c + src/gprs/gprs_sgsn.c + src/gprs/gprs_sndcp.c + src/gprs/gprs_sndcp_comp.c + src/gprs/gprs_sndcp_dcomp.c + src/gprs/gprs_sndcp_pcomp.c + src/gprs/gprs_sndcp_vty.c + src/gprs/gprs_sndcp_xid.c + src/gprs/gprs_subscriber.c + src/gprs/gprs_utils.c + src/gprs/gsup_client.c + src/gprs/gtphub.c + src/gprs/gtphub_main.c + src/gprs/gtphub_vty.c + src/gprs/oap_client.c + src/gprs/sgsn_ares.c + src/gprs/sgsn_auth.c + src/gprs/sgsn_cdr.c + src/gprs/sgsn_ctrl.c + src/gprs/sgsn_libgtp.c + src/gprs/sgsn_main.c + src/gprs/sgsn_vty.c + src/libcommon/bsc_version.c + src/libcommon/common_vty.c + src/libcommon/debug.c + src/libcommon/gsm_data.c + src/libcommon/gsm_data_shared.c + src/libcommon/gsm_subscriber_base.c + src/libcommon/gsup_client.c + src/libcommon/oap_client.c + src/libcommon/socket.c + src/libcommon/talloc_ctx.c + tests/gtphub/gtphub_test.c + tests/oap/oap_client_test.c + tests/sgsn/sgsn_test.c + tests/slhc/slhc_test.c + tests/sndcp_xid/sndcp_xid_test.c + tests/v42bis/v42bis_test.c + tests/xid/xid_test.c +Copyright: 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009-2015 Holger Hans Peter Freyther + 2010-2014 On-Waves + 2011-2016 sysmocom s.f.m.c. GmbH + 2014-2016 Sysmocom s.f.m.c. GmbH + 2014-2017 sysmocom s.f.m.c. GmbH +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: src/gprs/gtphub_ares.c + src/gprs/gtphub_sock.c + tests/ctrl_test_runner.py + tests/gbproxy/gbproxy_test.c +Copyright: 2013 Jacob Erlbeck + 2013 sysmocom s.f.m.c. GmbH + 2014 Holger Hans Peter Freyther + 2015 sysmocom s.f.m.c. GmbH +License: __NO_LICENSE__ + +Files: include/openbsc/v42bis.h + include/openbsc/v42bis_private.h +Copyright: 2005-2011 Steve Underwood +License: LGPL-2.1 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 2.1, + as published by the Free Software Foundation. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + . + The FSF address in the above text is the old one. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: git-version-gen +Copyright: 2007-2010 Free Software Foundation, Inc. +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . @@ -78,60 +280,190 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . You should have received a copy of the GNU General Public License along with this program. If not, see . . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. + This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. + It may be run two ways: + - from a git repository in which the "git describe" command below + produces useful output (thus requiring at least one signed tag) + - from a non-git-repo directory containing a .tarball-version file, which + presumes this script is invoked like "./git-version-gen .tarball-version". . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + In order to use intra-version strings in your project, you will need two + separate generated version string files: . - You should have received a copy of the GNU General Public License - along with this program. If not, see . + .tarball-version - present only in a distribution tarball, and not in + a checked-out repository. Created with contents that were learned at + the last time autoconf was run, and used by git-version-gen. Must not + be present in either $(srcdir) or $(builddir) for git-version-gen to + give accurate answers during normal development with a checked out tree, + but must be present in a tarball when there is no version control system. + Therefore, it cannot be used in any dependencies. GNUmakefile has + hooks to force a reconfigure at distribution time to get the value + correct, without penalizing normal development with extra reconfigures. . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". + .version - present in a checked-out repository and in a distribution + tarball. Usable in dependencies, particularly for files that don't + want to depend on config.h but do want to track version changes. + Delete this file prior to any autoconf run where you want to rebuild + files to pick up a version string change; and leave it stale to + minimize rebuild time after unrelated changes to configure sources. + . + It is probably wise to add these two files to .gitignore, so that you + don't accidentally commit either generated file. + . + Use the following line in your configure.ac, so that $(VERSION) will + automatically be up-to-date each time configure is run (and note that + since configure.ac no longer includes a version string, Makefile rules + should not depend on configure.ac for version updates). + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/mISDNif.h +Copyright: 2008 Karsten Keil +License: LGPL-2.1 + This code is free software; you can redistribute it and/or modify + it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE + version 2.1 as published by the Free Software Foundation. + . + This code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU LESSER GENERAL PUBLIC LICENSE for more details. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: src/gprs/v42bis.c +Copyright: 2005-2011 Steve Underwood +License: LGPL-2.1 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 2.1, + as published by the Free Software Foundation. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + License along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. + Currently it performs the core compression and decompression functions OK. + However, a number of the bells and whistles in V.42bis are incomplete. + . + ! \file + . + The FSF address in the above text is the old one. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: include/openbsc/slhc.h +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation + +Files: src/gprs/slhc.c +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation (from 1.19) + PPP.05 02-15-90 [ks] + PPP.08 05-02-90 [ks] use PPP protocol field to signal compression + PPP.15 09-90 [ks] improve mbuf handling + PPP.16 11-02 [karn] substantially rewritten to use NOS facilities + +Files: m4/ax_check_compile_flag.m4 +Copyright: 2008 Guido U. Draheim + 2011 Maarten Bosmans +License: GPL-3.0+ with unknown exception *** check multiple exceptions *** + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + . + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program. If not, see . + . + As a special exception, the respective Autoconf Macro's copyright owner + gives unlimited permission to copy, distribute and modify the configure + scripts that are the output of Autoconf when processing the Macro. You + need not follow the terms of the GNU General Public License when using + or distributing such scripts, even though portions of the text of the + Macro appear in them. The GNU General Public License (GPL) does govern + all other use of the material that constitutes the Autoconf Macro. + . + This special exception to the GPL applies to versions of the Autoconf + Macro released by the Autoconf Archive. When you make and distribute a + modified version of the Autoconf Macro, you may extend this special + exception to the GPL to apply to your modified version as well. + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmocom-gbproxy.init b/debian/osmo-gbproxy.init similarity index 100% rename from debian/osmocom-gbproxy.init rename to debian/osmo-gbproxy.init diff --git a/debian/osmo-gbproxy.install b/debian/osmo-gbproxy.install new file mode 100644 index 0000000..62ebe2a --- /dev/null +++ b/debian/osmo-gbproxy.install @@ -0,0 +1,2 @@ +usr/bin/osmo-gbproxy +usr/share/doc/openbsc/examples/osmo-gbproxy diff --git a/debian/osmo-gtphub.examples b/debian/osmo-gtphub.examples deleted file mode 100644 index 48c2dc0..0000000 --- a/debian/osmo-gtphub.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-gtphub diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install index 908c1a5..8a5dafd 100644 --- a/debian/osmo-gtphub.install +++ b/debian/osmo-gtphub.install @@ -1 +1,2 @@ -/usr/bin/osmo-gtphub +usr/bin/osmo-gtphub +usr/share/doc/openbsc/examples/osmo-gtphub diff --git a/debian/osmo-sgsn.install b/debian/osmo-sgsn.install new file mode 100644 index 0000000..55086cc --- /dev/null +++ b/debian/osmo-sgsn.install @@ -0,0 +1,4 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-gtphub +usr/share/doc/openbsc/examples/osmo-gbproxy +usr/share/doc/openbsc/examples/osmo-sgsn diff --git a/debian/osmocom-bs11-utils.install b/debian/osmocom-bs11-utils.install deleted file mode 100644 index 757a854..0000000 --- a/debian/osmocom-bs11-utils.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/bs11_config -/usr/bin/isdnsync diff --git a/debian/osmocom-bsc-nat.init b/debian/osmocom-bsc-nat.init deleted file mode 100755 index 984a7ce..0000000 --- a/debian/osmocom-bsc-nat.init +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmocom-bsc-nat -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-bsc_nat # Introduce the short server's name here -DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here -DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-bsc-nat -CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-bsc-nat.install b/debian/osmocom-bsc-nat.install deleted file mode 100644 index b561a7e..0000000 --- a/debian/osmocom-bsc-nat.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-bsc_nat diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/osmocom-gbproxy.install b/debian/osmocom-gbproxy.install deleted file mode 100644 index ba3f6ee..0000000 --- a/debian/osmocom-gbproxy.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gbproxy diff --git a/debian/osmocom-ipaccess-utils.install b/debian/osmocom-ipaccess-utils.install deleted file mode 100644 index de13c18..0000000 --- a/debian/osmocom-ipaccess-utils.install +++ /dev/null @@ -1,3 +0,0 @@ -/usr/bin/ipaccess-config -/usr/bin/abisip-find -/usr/bin/ipaccess-proxy diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/osmocom-sgsn.default b/debian/osmocom-sgsn.default deleted file mode 100644 index 77c9679..0000000 --- a/debian/osmocom-sgsn.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg" - diff --git a/debian/osmocom-sgsn.examples b/debian/osmocom-sgsn.examples deleted file mode 100644 index 15de78d..0000000 --- a/debian/osmocom-sgsn.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-sgsn diff --git a/debian/osmocom-sgsn.init b/debian/osmocom-sgsn.init deleted file mode 100755 index 0794dc1..0000000 --- a/debian/osmocom-sgsn.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom Serving GPRS Support Node -# Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-sgsn # Introduce the short server's name here -DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here -DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-sgsn - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-sgsn.install b/debian/osmocom-sgsn.install deleted file mode 100644 index d89c456..0000000 --- a/debian/osmocom-sgsn.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-sgsn diff --git a/debian/rules b/debian/rules index 4e187a6..4fe1f46 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,61 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force +# debmake generated override targets +# Set options for ./configure +CONFIGURE_FLAGS += --enable-iu +override_dh_configure: + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - -override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp - + dh_strip --dbg-package=osmo-sgsn-dbg + dh_strip --dbg-package=osmo-gtphub-dbg + dh_strip --dbg-package=osmo-gbproxy-dbg -- To view, visit https://gerrit.osmocom.org/3741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic0135a1118a115e8f053154e280f60674390f43a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:44 +0000 Subject: [MERGED] osmo-bsc[master]: rework /debian package support to match new osmo-bsc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rework /debian package support to match new osmo-bsc ...................................................................... rework /debian package support to match new osmo-bsc Remove leftover from split out of openbsc Change-Id: I9fe1003f7d2af5c6a07c41aec59ea91594b825bd --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-bsc.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules 29 files changed, 215 insertions(+), 1,180 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..28b5ebf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-bsc (0.1.0) UNRELEASED; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:12:56 +0000 diff --git a/debian/control b/debian/control index 87b6f07..e6e5724 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,42 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-bsc Section: net -Priority: optional -Build-Depends: debhelper (>= 9), +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, autotools-dev, - autoconf-archive, + autoconf, + automake, + libtool, pkg-config, + python-minimal, + libdbi-dev, + libssl-dev, + libsctp-dev, + libtalloc-dev, + libasn1c-dev, + libc-ares-dev, libgtp-dev, libosmocore-dev, libosmo-sccp-dev, - libdbi0-dev, - dh-autoreconf, + libosmo-ranap-dev, libosmo-abis-dev, libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, - libssl-dev, - libc-ares-dev, - libsmpp34-dev + libosmo-legacy-mgcp-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-bsc.git +Vcs-Browser: https://git.osmocom.org/osmo-bsc/ +Homepage: https://projects.osmocom.org/projects/osmo-bsc -Package: osmocom-bsc +Package: osmo-bsc Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-bsc-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: osmo-bsc (= ${binary:Version}), ${misc:Depends} +Description: OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..c748589 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,74 +1,18 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-bsc +Source: git://git.osmocom.org/osmo-bsc -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009-2015 On-Waves + 2010-2011 Daniel Willmann + 2011-2017 sysmocom s.f.m.c. GmbH + 2014-2015 Alexander Chemeris + 2008 Jan Luebbe + 2013 Andreas Eversberg +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -76,62 +20,129 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Affero General Public License for more details. . You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. +Files: src/libbsc/bsc_ctrl_lookup.c + src/libbsc/pcu_sock.c +Copyright: 2008-2010 Harald Welte + 2009-2012 Andreas Eversberg + 2010-2011 Daniel Willmann + 2010-2011 On-Waves + 2012 Holger Hans Peter Freyther +License: GPL-2.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". - - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. - . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/mISDNif.h +Copyright: 2008 Karsten Keil +License: LGPL-2.1 + This code is free software; you can redistribute it and/or modify + it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE + version 2.1 as published by the Free Software Foundation. + . + This code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU LESSER GENERAL PUBLIC LICENSE for more details. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: include/openbsc/bsc_msc_data.h +Copyright: 2010-2015 Holger Hans Peter Freyther + 2010-2015 On-Waves +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + . + NOTE: This is about a *remote* MSC for OsmoBSC and is not part of libmsc. + +Files: src/libbsc/bts_nokia_site.c +Copyright: 2011 Dieter Spaar +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + . + TODO: Attention: There are some static variables used for states during + configuration. Those variables have to be moved to a BTS specific context, + otherwise there will most certainly be problems if more than one Nokia BTS + is used. + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install new file mode 100644 index 0000000..85e2103 --- /dev/null +++ b/debian/osmo-bsc.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-bsc diff --git a/debian/osmo-gtphub.default b/debian/osmo-gtphub.default deleted file mode 100644 index 6af82da..0000000 --- a/debian/osmo-gtphub.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-gtphub.cfg" - diff --git a/debian/osmo-gtphub.examples b/debian/osmo-gtphub.examples deleted file mode 100644 index 48c2dc0..0000000 --- a/debian/osmo-gtphub.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-gtphub diff --git a/debian/osmo-gtphub.init b/debian/osmo-gtphub.init deleted file mode 100755 index 160d55b..0000000 --- a/debian/osmo-gtphub.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gtphub -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GTP hub -# Description: Osmocom GTP hub -### END INIT INFO - -# Author: Neels Hofmeyr - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gtphub # Introduce the short server's name here -DESC="Osmocom GTP hub" # Introduce a short description here -DAEMON=/usr/bin/osmo-gtphub # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmo-gtphub - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmo-gtphub ] && . /etc/default/osmo-gtphub - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install deleted file mode 100644 index 908c1a5..0000000 --- a/debian/osmo-gtphub.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gtphub diff --git a/debian/osmocom-bs11-utils.install b/debian/osmocom-bs11-utils.install deleted file mode 100644 index 757a854..0000000 --- a/debian/osmocom-bs11-utils.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/bs11_config -/usr/bin/isdnsync diff --git a/debian/osmocom-bsc-nat.init b/debian/osmocom-bsc-nat.init deleted file mode 100755 index 984a7ce..0000000 --- a/debian/osmocom-bsc-nat.init +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmocom-bsc-nat -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-bsc_nat # Introduce the short server's name here -DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here -DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-bsc-nat -CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-bsc-nat.install b/debian/osmocom-bsc-nat.install deleted file mode 100644 index b561a7e..0000000 --- a/debian/osmocom-bsc-nat.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-bsc_nat diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/osmocom-gbproxy.init b/debian/osmocom-gbproxy.init deleted file mode 100755 index 924f32d..0000000 --- a/debian/osmocom-gbproxy.init +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gbproxy -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GBproxy -# Description: A tool to proxy the GPRS Gb interface. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gbproxy # Introduce the short server's name here -DESC="Osmocom GBProxy" # Introduce a short description here -DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-gbproxy -CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-gbproxy.install b/debian/osmocom-gbproxy.install deleted file mode 100644 index ba3f6ee..0000000 --- a/debian/osmocom-gbproxy.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gbproxy diff --git a/debian/osmocom-ipaccess-utils.install b/debian/osmocom-ipaccess-utils.install deleted file mode 100644 index de13c18..0000000 --- a/debian/osmocom-ipaccess-utils.install +++ /dev/null @@ -1,3 +0,0 @@ -/usr/bin/ipaccess-config -/usr/bin/abisip-find -/usr/bin/ipaccess-proxy diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/osmocom-sgsn.default b/debian/osmocom-sgsn.default deleted file mode 100644 index 77c9679..0000000 --- a/debian/osmocom-sgsn.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg" - diff --git a/debian/osmocom-sgsn.examples b/debian/osmocom-sgsn.examples deleted file mode 100644 index 15de78d..0000000 --- a/debian/osmocom-sgsn.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-sgsn diff --git a/debian/osmocom-sgsn.init b/debian/osmocom-sgsn.init deleted file mode 100755 index 0794dc1..0000000 --- a/debian/osmocom-sgsn.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom Serving GPRS Support Node -# Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-sgsn # Introduce the short server's name here -DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here -DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-sgsn - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-sgsn.install b/debian/osmocom-sgsn.install deleted file mode 100644 index d89c456..0000000 --- a/debian/osmocom-sgsn.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-sgsn diff --git a/debian/rules b/debian/rules index 4e187a6..72a7d18 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,57 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force - -override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - +CONFIGURE_FLAGS += --enable-osmo-bsc override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=osmo-bsc-dbg -- To view, visit https://gerrit.osmocom.org/3738 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9fe1003f7d2af5c6a07c41aec59ea91594b825bd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Sep 1 22:02:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 1 Sep 2017 22:02:46 +0000 Subject: [MERGED] osmo-bsc[master]: split off osmo-bsc: remove files, apply build In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: split off osmo-bsc: remove files, apply build ...................................................................... split off osmo-bsc: remove files, apply build Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca --- M configure.ac M include/openbsc/Makefile.am D include/openbsc/a_iface.h D include/openbsc/a_iface_bssap.h M include/openbsc/bsc_api.h M include/openbsc/common_cs.h D include/openbsc/db.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h A include/openbsc/gsm_04_08_utils.h D include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/oap_client.h M include/openbsc/rest_octets.h D include/openbsc/slhc.h M include/openbsc/transaction.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/handover_logic.c M src/libbsc/net_init.c M src/libbsc/paging.c M src/libbsc/system_information.c M src/libcommon-cs/common_cs.c M src/libcommon/Makefile.am M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c M src/libfilter/bsc_msg_filter.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc_nat/bsc_nat_rewrite.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok M tests/gsm0408/gsm0408_test.c D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok M tests/testsuite.at D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 226 files changed, 100 insertions(+), 87,177 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3737 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 2 01:25:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 01:25:48 +0000 Subject: osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3721/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 449: return False It is potentially dangerous to change this logic and I want to be sure I understand why these patches are necessary. Could you include a full example, best in the form of a unit test showing why this change is necessary and that it doesn't break previous behavior? -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 01:26:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 01:26:13 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3722/1/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 253: dest.append(src[i]) It is potentially dangerous to change this logic and I want to be sure I understand why these patches are necessary. Could you include a full example, best in the form of a unit test showing why this change is necessary and that it doesn't break previous behavior? -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 01:40:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 01:40:38 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3723/3/example/resources.conf File example/resources.conf: Line 16: ciphers: ['a5 0', 'a5 1', 'a5 3'] re-reading this, I get two thoughts: So far we only use the '- item' list format. I would like to use as little diverse a yaml feature set as strictly necessary, to keep the option of moving to a simpler parser one day (i.e. never, but still...). So far we only have config items that have no spaces. I know that it is handy to just write the 'a5 0' thru to a vty config, but I think design wise it's better to add explicit keywords that we validate during config parsing and translate to the actual vty string explicitly. We can then use underscores and drop the need for quoting: bts - label: yada ciphers: - a5_0 - a5_1 - a5_3 (or use a50 like you chose for the scenario naming) Do you agree or am I too pedantic here? -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 01:42:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 01:42:23 +0000 Subject: osmo-gsm-tester[master]: config: Fix variable reference before assigment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3730 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a1acd7b3e5ff96b09a9a8e2825fb864ead9e54b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 01:46:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 01:46:19 +0000 Subject: osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/3763/1/example/resources.conf File example/resources.conf: Line 63: features: ['sms'] again the '- item' list format consideration, if you agree Line 79: features: [] (let's just omit the property if it is empty) https://gerrit.osmocom.org/#/c/3763/1/example/scenarios/mfeature-gprs.conf File example/scenarios/mfeature-gprs.conf: Line 4: - 'gprs' (no need for quotes) -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 16:46:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 16:46:47 +0000 Subject: meta-telephony[master]: Add git-review config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3764 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 16:46:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 16:46:53 +0000 Subject: [MERGED] meta-telephony[master]: Add git-review config In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Add git-review config ...................................................................... Add git-review config Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..30ca929 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=meta-telephony -- To view, visit https://gerrit.osmocom.org/3764 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sat Sep 2 16:50:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 16:50:34 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I remember at some point I wanted to do something similar in openbsc code, but learned that some of us *intend* these things to clutter the build output, so that they are not forgotten and fixed sooner. Not sure if that strategy works out. I personally prefer having less warnings so my vim :make command shows me only those that I introduced with the current development, but want to give others a chance to chip in. -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 16:55:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 16:55:47 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Actually, I believe all of these are better as mere comments, because they seem to be non-critical. Except for that "missing free". I'd +2 without that one. https://gerrit.osmocom.org/#/c/3761/1/src/gprs_bssgp_pcu.cpp File src/gprs_bssgp_pcu.cpp: Line 969: talloc_free(the_pcu.bctx); what? do we have a missing free here? Why can we just omit it, because we never call gprs_bssgp_destroy() unless the program is exiting anyway? -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 17:35:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 17:35:03 +0000 Subject: osmo-pcu[master]: Split TS allocation into digestible pieces In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (9 comments) A general problem is that the split of Algorithm B is super complex to review, yet this patch places more cosmetic changes on top -- tldr syndrome. I accept that there is complex logic merely spread across functions to clarify, and now that I read these functions on their own I spot various little "API cracks"; i.e. that I am stricter on the code now that it is split into a smaller function, and would not have dared to touch the complexity otherwise. That's why I'm stopping the review halfway through: I fear that I'm annoying more than helping and using our time for no benefit. It would be easier to review this in smaller chunks :) https://gerrit.osmocom.org/#/c/3760/2/src/bts.h File src/bts.h: Line 210 it would be nice to have a brief explanation in the commit log why this cust thing can be dropped. https://gerrit.osmocom.org/#/c/3760/2/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 390: if (trx) { Does this function make sense with trx == NULL? If yes, it needs to be documented above. If not, drop the check. Line 848: /*! Assign fiven UL timeslots to UL TBF "five"? "given"? :) Line 872: /*! Assign fiven DL timeslots to DL TBF same Line 892: /*! Update timeslot counters "Count used bits in slots and reserved_slots bitmasks"? It doesn't really update anything, rather returns a count. Line 912: * \returns UL or DL timeslot number and document what is returned in *ts Line 914: static uint8_t get_slots_single(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, the naming of "get_slots" + "single" cracks my head. Get several slots or a single one? Line 923: return pcu_lsb(ret); should *ts be assigned a value when we return here? If not, this special case needs documenting. Line 925: return ret & (1 << (*ts)); It seems that we quite possibly return no TS number: if the dl_slots & ul_slots mask results in a bitmask that doesn't match 1 << *ts. Is that expected? Document it? -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 17:48:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 17:48:19 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#6). sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode and can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/6 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..0245651 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_msg_type == GSM_TCH_FRAME_AMR) + fmtp_str = talloc_asprintf(leg,"a=fmtp:%d octet-align=1 mode-set=4\r\n",other->payload_type); + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 6 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Sep 2 17:49:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 17:49:59 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3735/6/src/sdp.c File src/sdp.c: Line 174: fmtp_str = talloc_asprintf(leg,"a=fmtp:%d octet-align=1 mode-set=4\r\n",other->payload_type); (rather have a space after each comma) The invocation in itself is correct, the question is more about memory management. fmtp_str is a local string that can safely be freed after below talloc_asprintf() is done. You're allocating it in the 'leg' context, so it will be freed once the 'leg' ctx is freed. So, how often will this be called before 'leg' is going to be freed? If we call this a thousand times, we would create a thousand such unused allocations and an explicit free before returning would make a real positive impact. Otherwise it doesn't matter much, though an explicit free would be more sanitary. If you free it, of course you won't be able to start out with a "" string constant, because we must not attempt to talloc_free(""). instead e.g. use fmtp_str = NULL; [...] talloc_asprintf(..., fmtp_str ? fmtp_str : "" ) BTW, the same applies to the returned value: does the caller free it? Does it matter? This is of course present before this patch and hopefully the author had it figured out. -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 6 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 18:13:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 18:13:01 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (7 comments) There's a lot going on in this patch, and it practically screams for a small unit test explicitly checking osmux_snprintf() behavior for "all" the edge cases. That would verify beyond doubt that you're not just shooting in the dark but actually fixing behavior. https://gerrit.osmocom.org/#/c/3537/3//COMMIT_MSG Commit Message: Line 12: to try harder at fixing those issues. lol, "attempts to try harder" -- you don't sound awfully certain of this patch? :) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 849: #define SNPRINTF_BUFFER_SIZE(ret, buffer_offset, size) \ phew, can we document the arguments? my head is spinning... Line 851: return ret; \ wait, you are having a function return in this macro? I think that's bad style. Rather assign a value to buf_offset and let the caller decide on the return value? Line 866: osmuxh->amr_ft, osmuxh->amr_cmr); If I get this right, before this patch this function always returned 0 (offset = 0 was never changed) and now it returns the amount of bytes printed? Looks sane and a fix by itself. Line 903: if (msg->len - msg_offset < sizeof(struct osmux_hdr)) { This change alone is complex enough. With the rest also being changed I'm unable to wrap my head around it easily. Line 911: if (osmuxh->ft == OSMUX_FT_VOICE_AMR && !osmo_amr_ft_valid(osmuxh->amr_ft)) { oof, is this change really related? Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); (to illustrate above point, this macro call might return the function and below logging and the remaining loops will just not happen. It makes the code much harder to read at the very least and is certainly not what you want to do here anyway.) -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 18:18:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 18:18:56 +0000 Subject: osmo-sgsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 If I see this right, this is already part of osmo-sgsn.git. IIUC it was added to osmo-msc.git, and now that osmo-msc.git has been "copied" over to osmo-{sgsn,bsc,mgw} with the split replayed on top, the release helper should already be present in all new repositories. Please still take a look to verify that all is correct in current masters of osmo-{msc,bsc,sgsn,mgw}, thanks! -- To view, visit https://gerrit.osmocom.org/3716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 18:19:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 18:19:15 +0000 Subject: osmo-bsc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 If I see this right, this is already part of osmo-sgsn.git. IIUC it was added to osmo-msc.git, and now that osmo-msc.git has been "copied" over to osmo-{sgsn,bsc,mgw} with the split replayed on top, the release helper should already be present in all new repositories. Please still take a look to verify that all is correct in current masters of osmo-{msc,bsc,sgsn,mgw}, thanks! -- To view, visit https://gerrit.osmocom.org/3710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05bf42d638167c779328fa61b01c917da91a88de Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 18:19:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 18:19:26 +0000 Subject: osmo-mgw[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 If I see this right, this is already part of osmo-sgsn.git. IIUC it was added to osmo-msc.git, and now that osmo-msc.git has been "copied" over to osmo-{sgsn,bsc,mgw} with the split replayed on top, the release helper should already be present in all new repositories. Please still take a look to verify that all is correct in current masters of osmo-{msc,bsc,sgsn,mgw}, thanks! -- To view, visit https://gerrit.osmocom.org/3713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0905eeb177185da1e2818a01fdb7265694d9903d Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 18:29:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 18:29:06 +0000 Subject: osmo-ci[master]: jenkins: Follow the convention and create a jenkins.sh as well In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/3676/1/contrib/jenkins.sh File contrib/jenkins.sh: Line 3: cd ~/osmo-ci || (cd ~/ && git clone git://git.osmocom.org/osmo-ci) nice, but in the clone case it is missing a final 'cd osmo-ci' Line 7: git pull origin I've had massive pains with "git, please just use latest master", and it looks like this could fall in the trap and remain on a revision without us noticing, e.g. if 'master' was ever force-updated, or if for some reason there are conflicts with local files... The easiest is indeed to clone afresh each and every time, otherwise it seems to me we need to go for things like rm -rf ./* git reset --hard origin/master Not sure what's the optimal way there; for the osmo-gsm-tester where I want to use either branch name or git hash, I went for both re-cloning and checking out a build branch :P https://git.osmocom.org/osmo-gsm-tester/tree/contrib/jenkins-build-common.sh#n75 -- To view, visit https://gerrit.osmocom.org/3676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:20:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 19:20:25 +0000 Subject: openggsn[master]: ggsn: Fix DNS not sent in PDP context response In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3748/1/ggsn/ggsn.c File ggsn/ggsn.c: Line 225: cur += cur_len + 3; (a comment explaining the magic three would be nice, but obvious enough from above uint16_t and uint8_t) -- To view, visit https://gerrit.osmocom.org/3748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:32:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 19:32:33 +0000 Subject: osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3724/3/selftest/conf/resources.conf File selftest/conf/resources.conf: Line 67: auth_algo: 'xor' xor is somewhat untypical, comp128 would be more common. Hmm, which one was it, comp128v3? https://gerrit.osmocom.org/#/c/3724/3/selftest/resource_test.py File selftest/resource_test.py: Line 40: [0, 2] ]) (better not mix in unrelated whitespace fixes) -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:41:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:41:33 +0000 Subject: osmo-bts[master]: Support removing SI13 from PCU In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:41:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:41:49 +0000 Subject: osmo-pcu[master]: cosmetic: tighten direct-phy related code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:42:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:42:02 +0000 Subject: osmo-pcu[master]: Move gsmtap and accounting into separate function In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:42:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:42:22 +0000 Subject: osmo-pcu[master]: Support receiving SI13 from BTS In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:42:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:42:27 +0000 Subject: [MERGED] osmo-pcu[master]: Support receiving SI13 from BTS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Support receiving SI13 from BTS ...................................................................... Support receiving SI13 from BTS * store SI13 in BTS struct * check and handle BCCH SAPI Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Related: OS#2400 --- M src/bts.h M src/osmo-bts-litecell15/lc15_l1_if.c M src/osmo-bts-sysmo/sysmo_l1_if.c M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty.h 6 files changed, 33 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.h b/src/bts.h index b1fb8cc..d65cd2f 100644 --- a/src/bts.h +++ b/src/bts.h @@ -29,6 +29,7 @@ #include #include #include +#include } #include "poll_controller.h" @@ -212,7 +213,8 @@ uint8_t alpha, gamma; uint8_t egprs_enabled; uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */ - + uint8_t si13[GSM_MACBLOCK_LEN]; + bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c index c82ddba..37b7f78 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index 9170972..1c5ecc9 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -10,6 +10,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 97eee9b..7112b04 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -245,6 +245,27 @@ return pdch->rcv_block(data, len, fn, meas); } +static int pcu_rx_data_ind_bcch(uint8_t *data, uint8_t len) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (len == 0) { + bts->si13_is_set = false; + LOGP(DL1IF, LOGL_INFO, "Received PCU data indication with empty SI13: cache cleaned\n"); + return 0; + } + + if (len != GSM_MACBLOCK_LEN) { + LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with SI13 with unexpected length %u\n", len); + return -EINVAL; + } + + memcpy(bts->si13, data, GSM_MACBLOCK_LEN); + bts->si13_is_set = true; + + return 0; +} + static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) { struct gprs_rlcmac_bts *bts = bts_main_data(); @@ -271,6 +292,9 @@ data_ind->data, data_ind->len, data_ind->fn, &meas); break; + case PCU_IF_SAPI_BCCH: + rc = pcu_rx_data_ind_bcch(data_ind->data, data_ind->len); + break; default: LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " "unsupported sapi %d\n", data_ind->sapi); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index e909b75..b7574f9 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -183,6 +183,7 @@ bts->n3103 = 4; bts->n3105 = 8; bts->alpha = 0; /* a = 0.0 */ + bts->si13_is_set = false; bts->ms_idle_sec = 60; /* slightly above T3314 (default 44s, 24.008, 11.2.2) */ bts->cs_adj_enabled = 1; bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */ diff --git a/src/pcu_vty.h b/src/pcu_vty.h index c00b882..a075350 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -1,6 +1,7 @@ #ifndef _PCU_VTY_H #define _PCU_VTY_H +#include #include #include -- To view, visit https://gerrit.osmocom.org/3753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:42:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:42:28 +0000 Subject: [MERGED] osmo-pcu[master]: cosmetic: tighten direct-phy related code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: tighten direct-phy related code ...................................................................... cosmetic: tighten direct-phy related code * move the code to related SAPI case * get rid of 'unused variable' warning if direct-phy is not used Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b --- M src/pcu_l1_if.cpp 1 file changed, 11 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 50e181e..97eee9b 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -163,9 +163,9 @@ void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn, uint32_t fn, uint8_t block_nr) { +#ifdef ENABLE_DIRECT_PHY struct gprs_rlcmac_bts *bts = bts_main_data(); -#ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, msg->data, msg->len); @@ -250,16 +250,7 @@ struct gprs_rlcmac_bts *bts = bts_main_data(); int rc; pcu_l1_meas meas; - meas.set_rssi(data_ind->rssi); -#ifndef ENABLE_DIRECT_PHY - /* convert BER to % value */ - meas.set_ber(data_ind->ber10k / 100); - meas.set_bto(data_ind->ta_offs_qbits); - meas.set_link_qual(data_ind->lqual_cb / 10); - LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements " - "received: BER10k = %d, BTO = %d, Q = %d\n", data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); -#endif + LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d " "block=%d data=%s\n", data_ind->sapi, data_ind->arfcn, data_ind->block_nr, @@ -267,6 +258,15 @@ switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: + meas.set_rssi(data_ind->rssi); +#ifndef ENABLE_DIRECT_PHY + /* convert BER to % value */ + meas.set_ber(data_ind->ber10k / 100); + meas.set_bto(data_ind->ta_offs_qbits); + meas.set_link_qual(data_ind->lqual_cb / 10); + LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements received: BER10k = %d, BTO = %d, Q = %d\n", + data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); +#endif rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, data_ind->data, data_ind->len, data_ind->fn, &meas); -- To view, visit https://gerrit.osmocom.org/3759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8cae6f3579cfdecc25bbe1d08fa88a4f664a03b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:42:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:42:50 +0000 Subject: [MERGED] osmo-bts[master]: Support removing SI13 from PCU In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Support removing SI13 from PCU ...................................................................... Support removing SI13 from PCU If SI13 becomes unavailable in runtime than send 0-length message with BCCH SAPI to PCU to indicate that SI13 have to be removed. Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b Related: OS#2400 --- M include/osmo-bts/pcu_if.h M src/common/pcu_sock.c M src/common/rsl.c 3 files changed, 9 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index ba3873e..4377833 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -6,7 +6,7 @@ extern int pcu_direct; int pcu_tx_info_ind(void); -int pcu_tx_si13(const struct gsm_bts *bts); +int pcu_tx_si13(const struct gsm_bts *bts, bool enable); int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, uint16_t arfcn, uint8_t block_nr); int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 0a9ba2d..e5bcf57 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -535,7 +535,7 @@ return rc; } -int pcu_tx_si13(const struct gsm_bts *bts) +int pcu_tx_si13(const struct gsm_bts *bts, bool enable) { /* the SI is per-BTS so it doesn't matter which TRX we use */ struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 0); @@ -543,7 +543,7 @@ /* The low-level data like FN, ARFCN etc will be ignored but we have to set lqual high enough to bypass the check at lower levels */ int rc = pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, GSM_BTS_SI(bts, SYSINFO_TYPE_13), - GSM_MACBLOCK_LEN, 0, 0, 0, INT16_MAX); + enable ? GSM_MACBLOCK_LEN : 0, 0, 0, 0, INT16_MAX); if (rc < 0) LOGP(DPCU, LOGL_NOTICE, "Failed to send SI13 to PCU: %d\n", rc); @@ -561,9 +561,9 @@ osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH); if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13)) - return pcu_tx_si13(bts); - else - LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n"); + return pcu_tx_si13(bts, true); + + LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n"); break; case PCU_OML_ALERT: osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, txt->text); diff --git a/src/common/rsl.c b/src/common/rsl.c index 69ecf2e..28dc2d0 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -308,7 +308,7 @@ } if (SYSINFO_TYPE_13 == osmo_si) - pcu_tx_si13(trx->bts); + pcu_tx_si13(trx->bts, true); if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); @@ -353,6 +353,8 @@ bts->si_valid &= ~(1 << osmo_si); LOGP(DRSL, LOGL_INFO, " RX RSL Disabling BCCH INFO (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); + if (SYSINFO_TYPE_13 == osmo_si) + pcu_tx_si13(trx->bts, false); } osmo_signal_dispatch(SS_GLOBAL, S_NEW_SYSINFO, bts); -- To view, visit https://gerrit.osmocom.org/3762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:43:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:43:00 +0000 Subject: [MERGED] osmo-pcu[master]: Move gsmtap and accounting into separate function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move gsmtap and accounting into separate function ...................................................................... Move gsmtap and accounting into separate function Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 --- M src/gprs_rlcmac_sched.cpp 1 file changed, 31 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 42f0308..e059ae1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -307,6 +307,34 @@ return msg; } +static inline void tap_n_acc(const struct msgb *msg, const struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, + uint32_t fn, enum pcu_gsmtap_category cat) +{ + if (!msg) + return; + + switch(cat) { + case PCU_GSMTAP_C_DL_CTRL: + bts->bts->rlc_sent_control(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, + msg->len); + break; + case PCU_GSMTAP_C_DL_DATA_GPRS: + bts->bts->rlc_sent(); + /* FIXME: distinguish between GPRS and EGPRS */ + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, + msg->len); + break; + case PCU_GSMTAP_C_DL_DUMMY: + bts->bts->rlc_sent_dummy(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, + msg->len); + break; + default: + break; + } +} + int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr) @@ -356,29 +384,19 @@ /* Prio 1: select control message */ msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); - if (msg) { - bts->bts->rlc_sent_control(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); - } + tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_CTRL); /* Prio 2: select data message for downlink */ if (!msg) { msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); - if (msg) { - bts->bts->rlc_sent(); - /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); - } + tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_DATA_GPRS); } /* Prio 3: send dummy contol message */ if (!msg) { /* increase counter */ msg = sched_dummy(); - if (msg) { - bts->bts->rlc_sent_dummy(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); - } + tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_DUMMY); } if (!msg) -- To view, visit https://gerrit.osmocom.org/3755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:44:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:44:13 +0000 Subject: libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:44:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:44:22 +0000 Subject: [MERGED] libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lapd_core: Fix crash in lapd_est_req() function ...................................................................... lapd_core: Fix crash in lapd_est_req() function lapd_est_req() function could be called on uninitialized lapd link (before lapd_dl_init() and after lapd_dl_exit() functions) due to invalid usage on higher levels. In order to prevent using uninitialized lapd link, we should set LAPD_STATE_NULL state for lapd_datalink in lapd_dl_exit() function. So all messages for lapd_datalink in null state will be unhandled by lapd_recv_dlsap() function and lapd_est_req() function will not be called before lapd_dl_init() function where lapd link state is changed to idle. #0 0x00007f46ecd99aa5 in lapd_est_req (dp=, lctx=0x7f46ed80b8b8) at lapd_core.c:1769 #1 0x00007f46ecd9dda8 in rslms_rx_rll_est_req (msg=msg at entry=0x7f46eeab4940, dl=dl at entry=0x7f46ed80b888) at lapdm.c:845 #2 0x00007f46ecd9fc03 in rslms_rx_rll (lc=0x7f46ed80b398, msg=0x7f46eeab4940) at lapdm.c:1157 #3 lapdm_rslms_recvmsg (msg=0x7f46eeab4940, lc=0x7f46ed80b398) at lapdm.c:1223 #4 0x00007f46ed63773d in rsl_rx_rll (msg=, trx=) at rsl.c:2178 #5 down_rsl (trx=, msg=) at rsl.c:2541 #6 0x00007f46ed641529 in sign_link_cb (msg=) at abis.c:169 #7 0x00007f46ec54b111 in ipaccess_bts_read_cb (link=0x7f46eeab4940, msg=0x0) at input/ipaccess.c:807 #8 0x00007f46ec548a8e in ipa_client_read (link=0x7f46ee26ae30) at input/ipa.c:74 #9 ipa_client_fd_cb (ofd=, what=1) at input/ipa.c:137 #10 0x00007f46ecfc726f in osmo_fd_disp_fds (_eset=0x7ffe7a9fcd20, _wset=0x7ffe7a9fcca0, _rset=0x7ffe7a9fcc20) at select.c:167 #11 osmo_select_main (polling=polling at entry=0) at select.c:207 #12 0x00007f46ed63fc25 in bts_main (argc=5, argv=) at main.c:359 #13 0x00007f46ebd76f45 in __libc_start_main (main=0x7f46ed61b120
, argc=5, argv=0x7ffe7a9fcf18, init=, fini=, rtld_fini=, #14 0x00007f46ed61b14e in _start () Related: OS#1982 Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c --- M src/gsm/lapd_core.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 166bf9a..6b58006 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -326,6 +326,10 @@ { /* free all ressources except history buffer */ lapd_dl_reset(dl); + + /* enter null state */ + lapd_dl_newstate(dl, LAPD_STATE_NULL); + /* free history buffer list */ talloc_free(dl->tx_hist); dl->tx_hist = NULL; -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:44:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:44:52 +0000 Subject: osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:44:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 2 Sep 2017 19:44:55 +0000 Subject: [MERGED] osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT ...................................................................... trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT * do not deactivate lchan when called with LCHAN_REL_ACT_REACT * add fixme comment It's unclear yet if any special steps are required for osmo-bts-trx so let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1 for now. Background: CCCH is auto activated by some OsmoBTS - before we receive SI3, see 4a8582846281322e8d7dfc577b18767cf35c24d1. To accommodate for that we deactivate CCCH in common/rsl.c, which triggers BTS-model specific callback sapi_deactivate_cb() which updates parameters and activates it again. In case of osmo-bts-trx there is no auto-activation and (seems to be) no need in special interaction with hw to activate channel (no lchan_activate()) hence we can just skip entire deactivate/setup/activate again routine. [1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file. Related: OS#1575 Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 --- M include/osmo-bts/rsl.h M src/osmo-bts-trx/l1_if.c 2 files changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index d5d0f1a..ddd756e 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -9,7 +9,7 @@ LCHAN_REL_ACT_RSL, LCHAN_REL_ACT_PCU, LCHAN_REL_ACT_OML, - LCHAN_REL_ACT_REACT, + LCHAN_REL_ACT_REACT, /* remove once auto-activation hack is removed from opstart_compl() */ }; #define LCHAN_FN_DUMMY 0xFFFFFFFF diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index c629a61..3c11dfd 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -109,6 +109,12 @@ struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + /* FIXME: perform whatever is needed (if any) to set proper PCH/AGCH allocation according to + 3GPP TS 44.018 Table 10.5.2.11.1 using num_agch(lchan->ts->trx, "TRX L1"); function */ + return 0; + } /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou From admin at opensuse.org Sat Sep 2 19:54:56 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 02 Sep 2017 19:54:56 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59ab0caa45d66_28c612fef802435bb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 212s] | generated by GNU Autoconf 2.69. Invocation command line was [ 212s] | [ 212s] | CONFIG_FILES = [ 212s] | CONFIG_HEADERS = [ 212s] | CONFIG_LINKS = [ 212s] | CONFIG_COMMANDS = [ 212s] | $ ./config.status Doxyfile.core [ 212s] | [ 212s] | on build33 [ 212s] | [ 212s] | config.status:1169: creating Doxyfile.core [ 212s] [ 212s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 212s] make[1]: *** [override_dh_auto_test] Error 1 [ 212s] make[1]: Le[ 197.260160] serial8250: too much work for irq4 [ 212s] aving directory '/usr/src/packages/BUILD' [ 212s] debian/rules:15: recipe for target 'build' failed [ 212s] make: *** [build] Error 2 [ 212s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 212s] [ 212s] build33 failed "build libosmocore_0.9.6.20170902.dsc" at Sat Sep 2 19:54:38 UTC 2017. [ 212s] [ 212s] ### VM INTERACTION START ### [ 214s] Powering off. [ 214s] [ 198.517965] reboot: Power down [ 215s] ### VM INTERACTION END ### [ 215s] [ 215s] build33 failed "build libosmocore_0.9.6.20170902.dsc" at Sat Sep 2 19:54:41 UTC 2017. [ 215s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Sep 2 19:58:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 19:58:50 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 2: (5 comments) https://gerrit.osmocom.org/#/c/3731/2/src/osmo_gsm_tester/bts_osmotrx.py File src/osmo_gsm_tester/bts_osmotrx.py: Line 140: }) Ah, before I didn't notice that this is in conf_for_bsc(), not the conf for this object itself... https://gerrit.osmocom.org/#/c/3731/2/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 117: self.band_arfcn = band_arfcn self.band_arfcn should have a default value up in __init__() or above that. Line 120: return self.band_arfcn.get('band') can self.band_arfcn be unset? Then this would raise a NoneType exception. Line 123: return int(self.band_arfcn.get('arfcn')) same https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 484: bts_inst.set_arfcn_resource(arfcn) > I thought a lot about all pros and cons of doing it one or the other way, a I am fairly strongly against reserving more resources after the test started. The point is that I would like to keep the option of scheduling test suites in parallel. The paradigm there is that a test suite in advance says what it needs, and we can thus know which two suites can run in parallel without resource conflicts. If we reserve more after it started, we are closing the door on this possibility for good. I think this is a topic we should sit down and discuss in person, easier to wave hands while talking. I'll come and chat with you this week. -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 20:12:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 20:12:06 +0000 Subject: osmo-gsm-manuals[master]: OsmoGsmTester: Move coredump section and add reference to ke... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (3 comments) https://gerrit.osmocom.org/#/c/3711/1//COMMIT_MSG Commit Message: Line 7: OsmoGsmTester: Move coredump section and add reference to kernel.core_pattern sysctl Sneaky! Editing while moving. Makes it hard to spot the edits. https://gerrit.osmocom.org/#/c/3711/1/OsmoGSMTester/chapters/install.adoc File OsmoGSMTester/chapters/install.adoc: Line 449: osmo-gsm-tester source tree to the main unit: (oops, it says "copy file" yet I have replaced the copy with an echo of the rule) Line 464: value of that sysctl parameter: "Please excuse the length of my letter, I didn't have the time to make it shorter" What do you think about: Set the @kernel.core_pattern@ to @core@ (usually the default). For each binary run by osmo-gsm-tester, a core file will then appear in the same dir that contains stdout and stderr for that process (because this dir is set as CWD). ---- sysctl ... ---- -- To view, visit https://gerrit.osmocom.org/3711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 2 22:55:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 22:55:47 +0000 Subject: [PATCH] osmo-ci[master]: debian nightly: don't use pre_release branches, use master Message-ID: Review at https://gerrit.osmocom.org/3765 debian nightly: don't use pre_release branches, use master Related: OS#2297 Change-Id: I15e114389095af381978201c1bb3aad2a51fbaaa --- M scripts/osmocom-nightly-nitb-split.sh 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/3765/1 diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index ee39a5b..c1a0052 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -88,13 +88,13 @@ checkout libosmo-sccp checkout libsmpp34 checkout libasn1c - checkout osmo-iuh lynxis/pre_release + checkout osmo-iuh checkout osmo-hlr checkout openggsn - checkout osmo-mgw pre_release - checkout osmo-bsc lynxis/pre_release - checkout osmo-msc pre_release - checkout osmo-sgsn pre_release + checkout osmo-mgw + checkout osmo-bsc + checkout osmo-msc + checkout osmo-sgsn build libosmocore build libosmo-abis -- To view, visit https://gerrit.osmocom.org/3765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I15e114389095af381978201c1bb3aad2a51fbaaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 2 22:56:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 22:56:41 +0000 Subject: osmo-ci[master]: debian nightly: don't use pre_release branches, use master In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15e114389095af381978201c1bb3aad2a51fbaaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 2 22:56:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 2 Sep 2017 22:56:43 +0000 Subject: [MERGED] osmo-ci[master]: debian nightly: don't use pre_release branches, use master In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian nightly: don't use pre_release branches, use master ...................................................................... debian nightly: don't use pre_release branches, use master Related: OS#2297 Change-Id: I15e114389095af381978201c1bb3aad2a51fbaaa --- M scripts/osmocom-nightly-nitb-split.sh 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index ee39a5b..c1a0052 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -88,13 +88,13 @@ checkout libosmo-sccp checkout libsmpp34 checkout libasn1c - checkout osmo-iuh lynxis/pre_release + checkout osmo-iuh checkout osmo-hlr checkout openggsn - checkout osmo-mgw pre_release - checkout osmo-bsc lynxis/pre_release - checkout osmo-msc pre_release - checkout osmo-sgsn pre_release + checkout osmo-mgw + checkout osmo-bsc + checkout osmo-msc + checkout osmo-sgsn build libosmocore build libosmo-abis -- To view, visit https://gerrit.osmocom.org/3765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15e114389095af381978201c1bb3aad2a51fbaaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 08:00:33 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sun, 3 Sep 2017 08:00:33 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#7). sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode and can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/7 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..713cdc4 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_msg_type == GSM_TCH_FRAME_AMR) + fmtp_str = talloc_asprintf(leg, "a=fmtp:%d octet-align=1\r\n", other->payload_type); + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 7 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 08:05:18 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sun, 3 Sep 2017 08:05:18 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 7: > (1 comment) So to free fmtp_str after the talloc_asprintf() inside sdp_create_file(), one would have to store the returned value from the talloc_asprintf() then free then return.. but then you haven't freed the return value from the talloc_asprintf() ? -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 7 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 08:11:35 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sun, 3 Sep 2017 08:11:35 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#8). sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode and can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/8 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..66856bb 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_msg_type == GSM_TCH_FRAME_AMR) + fmtp_str = talloc_asprintf(leg, "a=fmtp:%d octet-align=1\r\n", other->payload_type); + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 8 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 08:18:23 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sun, 3 Sep 2017 08:18:23 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#9). sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode and can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/9 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..0a21129 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_msg_type == GSM_TCH_FRAME_AMR) + fmtp_str = talloc_asprintf(leg, "a=fmtp:%d octet-align=1\r\n", other->payload_type); + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 9 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 13:28:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 13:28:36 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 9: build failure: all you need to do is rebase this patch onto current master. I checked and all callers of sdp_create_file() free the returned string, no problem there. But indeed we should free fmtp_str before returning the other talloc'd string. -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 9 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 16:05:37 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sun, 3 Sep 2017 16:05:37 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 10: > > But indeed we should free fmtp_str before returning the other > talloc'd string. Bizarre that after decades of working in languages that.. are not C, I have no idea how I can free a string that is used to compose a string before I return that string. :-/ -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 10 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:27:35 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 3 Sep 2017 18:27:35 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 10: > Bizarre that after decades of working in languages that.. are not > C, I have no idea how I can free a string that is used to compose a > string before I return that string. :-/ don't worry. Let me edit as example. -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 10 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:31:28 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 3 Sep 2017 18:31:28 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#11). sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode and can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/11 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..213e979 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,18 +166,27 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = NULL, *sdp; leg->wanted_codec = app_media_name(other->payload_msg_type); - return talloc_asprintf(leg, + + if (strcmp(leg->wanted_codec, "AMR") == 0) + fmtp_str = talloc_asprintf(leg, "a=fmtp:%d octet-align=1\r\n", other->payload_type); + + sdp = talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" "s=GSM Call\r\n" "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str ? fmtp_str : "", other->payload_type, leg->wanted_codec); + talloc_free(fmtp_str); + return sdp; } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 11 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:35:32 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 3 Sep 2017 18:35:32 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 11: (2 comments) Could you test my version? https://gerrit.osmocom.org/#/c/3735/10/src/sdp.c File src/sdp.c: Line 169: char *fmtp_str = NULL, *sdp; We would need to allocate this with memory as well or have a NULL check. Line 173: if (strcmp(leg->wanted_codec, "AMR") == 0) I would prefer strcmp(leg->wanted_codec, "AMR") == 0 -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 11 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:09 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: No more libosmogb dependency Message-ID: Review at https://gerrit.osmocom.org/3766 configure.ac: No more libosmogb dependency Change-Id: I7c96d74687847964fd6d73c9e903e1d26ae47e1e --- M configure.ac 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/3766/1 diff --git a/configure.ac b/configure.ac index cc07f7a..1050f3d 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,6 @@ PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -- To view, visit https://gerrit.osmocom.org/3766 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c96d74687847964fd6d73c9e903e1d26ae47e1e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:09 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: remove --enable-osmo-bsc, --enable-nat Message-ID: Review at https://gerrit.osmocom.org/3767 configure.ac: remove --enable-osmo-bsc, --enable-nat This is the OsmoBSC project. Disabling the build of the BSC would be somewhat odd, so let's remove the option. Also, OsmoBSC depends on libosmo-sccp now, so we must unconditionally depend on it. As a result, we can remove the --enable-nat option, as this was only to avoid a mandatory libosmo-sccp requirement in historical times. Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 --- M configure.ac M src/Makefile.am M tests/Makefile.am 3 files changed, 3 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/3767/1 diff --git a/configure.ac b/configure.ac index 1050f3d..e7f0546 100644 --- a/configure.ac +++ b/configure.ac @@ -48,24 +48,7 @@ PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) - -# Enabke/disable the NAT? -AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], - [osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"]) -if test "$osmo_ac_build_nat" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -fi -AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") -AC_SUBST(osmo_ac_build_nat) - -# Enable/disable the BSC? -AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], - [osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"]) -if test "$osmo_ac_build_bsc" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) -fi -AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") -AC_SUBST(osmo_ac_build_bsc) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], diff --git a/src/Makefile.am b/src/Makefile.am index 9a26a7b..d04f025 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,17 +32,6 @@ SUBDIRS += \ utils \ ipaccess \ - $(NULL) - -# Conditional Programs -if BUILD_NAT -SUBDIRS += \ + osmo-bsc \ osmo-bsc_nat \ $(NULL) -endif - -if BUILD_BSC -SUBDIRS += \ - osmo-bsc \ - $(NULL) -endif diff --git a/tests/Makefile.am b/tests/Makefile.am index fc7fc57..aff05bb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,23 +1,14 @@ SUBDIRS = \ + bsc \ gsm0408 \ channel \ abis \ trau \ subscr \ nanobts_omlattr \ - $(NULL) - -if BUILD_NAT -SUBDIRS += \ bsc-nat \ bsc-nat-trie \ $(NULL) -endif -if BUILD_BSC -SUBDIRS += \ - bsc \ - $(NULL) -endif # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac -- To view, visit https://gerrit.osmocom.org/3767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:09 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: remove smpp_mirror, which has no relation to a... Message-ID: Review at https://gerrit.osmocom.org/3768 configure.ac: remove smpp_mirror, which has no relation to a BSC smpp_mirror is maintained in osmo-msc.git, so let's remove it (and the associated libsmpp34 build requirement). Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 --- M configure.ac M src/utils/Makefile.am D src/utils/smpp_mirror.c 3 files changed, 0 insertions(+), 387 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/68/3768/1 diff --git a/configure.ac b/configure.ac index e7f0546..795a307 100644 --- a/configure.ac +++ b/configure.ac @@ -50,16 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable smpp support in the msc? -AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], - [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) -if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) - AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) -fi -AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -AC_SUBST(osmo_ac_build_smpp) - # Enable/disable transcoding within osmo-bsc_mgcp? AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 26494e1..d3f6d62 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -11,7 +11,6 @@ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ - $(LIBSMPP34_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -43,12 +42,6 @@ $(NULL) endif -if BUILD_SMPP -noinst_PROGRAMS = \ - smpp_mirror \ - $(NULL) -endif - bs11_config_SOURCES = \ bs11_config.c \ $(NULL) @@ -65,17 +58,6 @@ isdnsync_SOURCES = \ isdnsync.c \ - $(NULL) - -smpp_mirror_SOURCES = \ - smpp_mirror.c \ - $(NULL) - -smpp_mirror_LDADD = \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBSMPP34_LIBS) \ $(NULL) meas_vis_SOURCES = \ diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c deleted file mode 100644 index c570505..0000000 --- a/src/utils/smpp_mirror.c +++ /dev/null @@ -1,359 +0,0 @@ -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* FIXME: merge with smpp_smsc.c */ -#define SMPP_SYS_ID_LEN 16 -enum esme_read_state { - READ_ST_IN_LEN = 0, - READ_ST_IN_MSG = 1, -}; -/* FIXME: merge with smpp_smsc.c */ - -struct esme { - struct osmo_fd ofd; - - uint32_t own_seq_nr; - - struct osmo_wqueue wqueue; - enum esme_read_state read_state; - uint32_t read_len; - uint32_t read_idx; - struct msgb *read_msg; - - uint8_t smpp_version; - char system_id[SMPP_SYS_ID_LEN+1]; - char password[SMPP_SYS_ID_LEN+1]; -}; - -/* FIXME: merge with smpp_smsc.c */ -#define SMPP34_UNPACK(rc, type, str, data, len) \ - memset(str, 0, sizeof(*str)); \ - rc = smpp34_unpack(type, str, data, len) -#define INIT_RESP(type, resp, req) { \ - memset((resp), 0, sizeof(*(resp))); \ - (resp)->command_length = 0; \ - (resp)->command_id = type; \ - (resp)->command_status = ESME_ROK; \ - (resp)->sequence_number = (req)->sequence_number; \ -} -#define PACK_AND_SEND(esme, ptr) pack_and_send(esme, (ptr)->command_id, ptr) -static inline uint32_t smpp_msgb_cmdid(struct msgb *msg) -{ - uint8_t *tmp = msgb_data(msg) + 4; - return ntohl(*(uint32_t *)tmp); -} -static uint32_t esme_inc_seq_nr(struct esme *esme) -{ - esme->own_seq_nr++; - if (esme->own_seq_nr > 0x7fffffff) - esme->own_seq_nr = 1; - - return esme->own_seq_nr; -} -static int pack_and_send(struct esme *esme, uint32_t type, void *ptr) -{ - struct msgb *msg = msgb_alloc(4096, "SMPP_Tx"); - int rc, rlen; - if (!msg) - return -ENOMEM; - - rc = smpp34_pack(type, msg->tail, msgb_tailroom(msg), &rlen, ptr); - if (rc != 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Error during smpp34_pack(): %s\n", - esme->system_id, smpp34_strerror); - msgb_free(msg); - return -EINVAL; - } - msgb_put(msg, rlen); - - if (osmo_wqueue_enqueue(&esme->wqueue, msg) != 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Write queue full. Dropping message\n", - esme->system_id); - msgb_free(msg); - return -EAGAIN; - } - return 0; -} -/* FIXME: merge with smpp_smsc.c */ - -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) -{ - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; - } - return NULL; -} - -static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) -{ - struct deliver_sm_t deliver; - struct deliver_sm_resp_t deliver_r; - struct submit_sm_t submit; - tlv_t *t; - int rc; - - memset(&deliver, 0, sizeof(deliver)); - SMPP34_UNPACK(rc, DELIVER_SM, &deliver, msgb_data(msg), msgb_length(msg)); - if (rc < 0) - return rc; - - INIT_RESP(DELIVER_SM_RESP, &deliver_r, &deliver); - - PACK_AND_SEND(esme, &deliver_r); - - memset(&submit, 0, sizeof(submit)); - submit.command_id = SUBMIT_SM; - submit.command_status = ESME_ROK; - submit.sequence_number = esme_inc_seq_nr(esme); - - submit.dest_addr_ton = deliver.source_addr_ton; - submit.dest_addr_npi = deliver.source_addr_npi; - memcpy(submit.destination_addr, deliver.source_addr, - OSMO_MIN(sizeof(submit.destination_addr), - sizeof(deliver.source_addr))); - - submit.source_addr_ton = deliver.dest_addr_ton; - submit.source_addr_npi = deliver.dest_addr_npi; - memcpy(submit.source_addr, deliver.destination_addr, - OSMO_MIN(sizeof(submit.source_addr), - sizeof(deliver.destination_addr))); - - /* Mirror delivery receipts as a delivery acknowledgements. */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); - submit.esm_class = 0x08; - } else { - submit.esm_class = deliver.esm_class; - } - - submit.registered_delivery = deliver.registered_delivery; - submit.protocol_id = deliver.protocol_id; - submit.priority_flag = deliver.priority_flag; - memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, - OSMO_MIN(sizeof(submit.schedule_delivery_time), - sizeof(deliver.schedule_delivery_time))); - memcpy(submit.validity_period, deliver.validity_period, - OSMO_MIN(sizeof(submit.validity_period), - sizeof(deliver.validity_period))); - submit.registered_delivery = deliver.registered_delivery; - submit.replace_if_present_flag = deliver.replace_if_present_flag; - submit.data_coding = deliver.data_coding; - submit.sm_default_msg_id = deliver.sm_default_msg_id; - submit.sm_length = deliver.sm_length; - memcpy(submit.short_message, deliver.short_message, - OSMO_MIN(sizeof(submit.short_message), - sizeof(deliver.short_message))); - - /* FIXME: More TLV? */ - t = find_tlv(deliver.tlv, TLVID_user_message_reference); - if (t) { - tlv_t tlv; - - memset(&tlv, 0, sizeof(tlv)); - tlv.tag = TLVID_user_message_reference; - tlv.length = 2; - tlv.value.val16 = t->value.val16; - build_tlv(&submit.tlv, &tlv); - } - - return PACK_AND_SEND(esme, &submit); -} - -static int bind_transceiver(struct esme *esme) -{ - struct bind_transceiver_t bind; - - memset(&bind, 0, sizeof(bind)); - bind.command_id = BIND_TRANSCEIVER; - bind.sequence_number = esme_inc_seq_nr(esme); - snprintf((char *)bind.system_id, sizeof(bind.system_id), "%s", esme->system_id); - snprintf((char *)bind.password, sizeof(bind.password), "%s", esme->password); - snprintf((char *)bind.system_type, sizeof(bind.system_type), "mirror"); - bind.interface_version = esme->smpp_version; - - return PACK_AND_SEND(esme, &bind); -} - -static int smpp_pdu_rx(struct esme *esme, struct msgb *msg) -{ - uint32_t cmd_id = smpp_msgb_cmdid(msg); - int rc; - - switch (cmd_id) { - case DELIVER_SM: - rc = smpp_handle_deliver(esme, msg); - break; - default: - LOGP(DSMPP, LOGL_NOTICE, "unhandled case %d\n", cmd_id); - rc = 0; - break; - } - - return rc; -} - -/* FIXME: merge with smpp_smsc.c */ -static int esme_read_cb(struct osmo_fd *ofd) -{ - struct esme *esme = ofd->data; - uint32_t len; - uint8_t *lenptr = (uint8_t *) &len; - uint8_t *cur; - struct msgb *msg; - int rdlen; - int rc; - - switch (esme->read_state) { - case READ_ST_IN_LEN: - rdlen = sizeof(uint32_t) - esme->read_idx; - rc = read(ofd->fd, lenptr + esme->read_idx, rdlen); - if (rc < 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); - } else if (rc == 0) { - goto dead_socket; - } else - esme->read_idx += rc; - if (esme->read_idx >= sizeof(uint32_t)) { - esme->read_len = ntohl(len); - msg = msgb_alloc(esme->read_len, "SMPP Rx"); - if (!msg) - return -ENOMEM; - esme->read_msg = msg; - cur = msgb_put(msg, sizeof(uint32_t)); - memcpy(cur, lenptr, sizeof(uint32_t)); - esme->read_state = READ_ST_IN_MSG; - esme->read_idx = sizeof(uint32_t); - } - break; - case READ_ST_IN_MSG: - msg = esme->read_msg; - rdlen = esme->read_len - esme->read_idx; - rc = read(ofd->fd, msg->tail, OSMO_MIN(rdlen, msgb_tailroom(msg))); - if (rc < 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); - } else if (rc == 0) { - goto dead_socket; - } else { - esme->read_idx += rc; - msgb_put(msg, rc); - } - - if (esme->read_idx >= esme->read_len) { - rc = smpp_pdu_rx(esme, esme->read_msg); - esme->read_msg = NULL; - esme->read_idx = 0; - esme->read_len = 0; - esme->read_state = READ_ST_IN_LEN; - } - break; - } - - return 0; -dead_socket: - msgb_free(esme->read_msg); - osmo_fd_unregister(&esme->wqueue.bfd); - close(esme->wqueue.bfd.fd); - esme->wqueue.bfd.fd = -1; - exit(2342); - - return 0; -} - -static int esme_write_cb(struct osmo_fd *ofd, struct msgb *msg) -{ - struct esme *esme = ofd->data; - int rc; - - rc = write(ofd->fd, msgb_data(msg), msgb_length(msg)); - if (rc == 0) { - osmo_fd_unregister(&esme->wqueue.bfd); - close(esme->wqueue.bfd.fd); - esme->wqueue.bfd.fd = -1; - exit(99); - } else if (rc < msgb_length(msg)) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Short write\n", esme->system_id); - return 0; - } - - return 0; -} - -static int smpp_esme_init(struct esme *esme, const char *host, uint16_t port) -{ - int rc; - - if (port == 0) - port = 2775; - - esme->own_seq_nr = rand(); - esme_inc_seq_nr(esme); - osmo_wqueue_init(&esme->wqueue, 10); - esme->wqueue.bfd.data = esme; - esme->wqueue.read_cb = esme_read_cb; - esme->wqueue.write_cb = esme_write_cb; - - rc = osmo_sock_init_ofd(&esme->wqueue.bfd, AF_UNSPEC, SOCK_STREAM, - IPPROTO_TCP, host, port, OSMO_SOCK_F_CONNECT); - if (rc < 0) - return rc; - - return bind_transceiver(esme); -} - - -int main(int argc, char **argv) -{ - struct esme esme; - char *host = "localhost"; - int port = 0; - int rc; - - msgb_talloc_ctx_init(NULL, 0); - - memset(&esme, 0, sizeof(esme)); - - osmo_init_logging(&log_info); - - snprintf((char *) esme.system_id, sizeof(esme.system_id), "mirror"); - snprintf((char *) esme.password, sizeof(esme.password), "mirror"); - esme.smpp_version = 0x34; - - if (argc >= 2) - host = argv[1]; - if (argc >= 3) - port = atoi(argv[2]); - - rc = smpp_esme_init(&esme, host, port); - if (rc < 0) - exit(1); - - while (1) { - osmo_select_main(0); - } - - exit(0); -} -- To view, visit https://gerrit.osmocom.org/3768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:09 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Remove --enable-mgcp-transcoding Message-ID: Review at https://gerrit.osmocom.org/3769 configure.ac: Remove --enable-mgcp-transcoding This was for osmo-bsc_mgcp, whichc is now in osmo-mgw.git Change-Id: I5bf619922001ce4a8a229fe028109361a3fad986 --- M configure.ac 1 file changed, 0 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/3769/1 diff --git a/configure.ac b/configure.ac index 795a307..588d5ef 100644 --- a/configure.ac +++ b/configure.ac @@ -50,22 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable transcoding within osmo-bsc_mgcp? -AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], - [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) -AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) - -if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi - AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support]) -fi -AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") -AC_SUBST(osmo_ac_mgcp_transcoding) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) -- To view, visit https://gerrit.osmocom.org/3769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bf619922001ce4a8a229fe028109361a3fad986 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:10 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Remove --enable-iu Message-ID: Review at https://gerrit.osmocom.org/3770 configure.ac: Remove --enable-iu There is no Iu in a BSC, this was from old times with OsmoNITB. This configure option now lives in osmo-msc.git Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea --- M configure.ac 1 file changed, 0 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/3770/1 diff --git a/configure.ac b/configure.ac index 588d5ef..03e7cc4 100644 --- a/configure.ac +++ b/configure.ac @@ -50,18 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable 3G aka IuPS + IuCS support? -AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], - [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) -if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? - AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) -fi -AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -AC_SUBST(osmo_ac_iu) - - found_libgtp=yes PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) -- To view, visit https://gerrit.osmocom.org/3770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:10 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Remove checks for libgtp + c-ares Message-ID: Review at https://gerrit.osmocom.org/3771 configure.ac: Remove checks for libgtp + c-ares Those are requirements of sgsn/gtphub and live in osmo-sgsn.git Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 --- M configure.ac 1 file changed, 0 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/3771/1 diff --git a/configure.ac b/configure.ac index 03e7cc4..a54bcf0 100644 --- a/configure.ac +++ b/configure.ac @@ -50,25 +50,8 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -found_libgtp=yes -PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) -AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) -AC_SUBST(found_libgtp) - -found_libcares=yes -PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no]) -AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes) -AC_SUBST(found_libcares) - -found_libgtp_and_libcares=no -if test "$found_libgtp" = "yes" -a "$found_libcares" = "yes"; then - found_libgtp_and_libcares=yes -fi -AC_SUBST(found_libgtp_and_libcares) - dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) found_pcap=yes AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) -- To view, visit https://gerrit.osmocom.org/3771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:10 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Remove check for GMTOFF Message-ID: Review at https://gerrit.osmocom.org/3772 configure.ac: Remove check for GMTOFF this was from NITB days and now in osmo-msc.git Change-Id: I337201ec2c2457100b229b5df2cbabbcb801236f --- M configure.ac 1 file changed, 0 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/72/3772/1 diff --git a/configure.ac b/configure.ac index a54bcf0..a091b39 100644 --- a/configure.ac +++ b/configure.ac @@ -101,31 +101,6 @@ AC_SUBST([COVERAGE_LDFLAGS]) fi -AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ - AC_CACHE_CHECK( - [whether struct tm has tm_gmtoff member], - osmo_cv_tm_includes_tm_gmtoff, - [AC_LINK_IFELSE([ - AC_LANG_PROGRAM([ - #include - ], [ - time_t t = time(NULL); - struct tm* lt = localtime(&t); - int off = lt->tm_gmtoff; - ]) - ], - osmo_cv_tm_includes_tm_gmtoff=yes, - osmo_cv_tm_includes_tm_gmtoff=no - )] - ) - if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then - AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1, - [Define if struct tm has tm_gmtoff member.]) - fi -]) - -CHECK_TM_INCLUDES_TM_GMTOFF - AC_ARG_ENABLE([vty_tests], AC_HELP_STRING([--enable-vty-tests], [Include the VTY/CTRL tests in make check (deprecated) -- To view, visit https://gerrit.osmocom.org/3772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I337201ec2c2457100b229b5df2cbabbcb801236f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:44:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:44:10 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Package is now called osmo-bsc, not openbsc Message-ID: Review at https://gerrit.osmocom.org/3773 configure.ac: Package is now called osmo-bsc, not openbsc Change-Id: I85511946316a34877080ac55553c5b88e34bd1be --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/73/3773/1 diff --git a/configure.ac b/configure.ac index a091b39..5d684ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT([openbsc], +AC_INIT([osmo-bsc], m4_esyscmd([./git-version-gen .tarball-version]), [openbsc at lists.osmocom.org]) -- To view, visit https://gerrit.osmocom.org/3773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I85511946316a34877080ac55553c5b88e34bd1be Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 18:56:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 18:56:49 +0000 Subject: [PATCH] osmo-bsc[master]: jenkins.sh: Don't build-test with IU/MGCP/SMPP Message-ID: Review at https://gerrit.osmocom.org/3774 jenkins.sh: Don't build-test with IU/MGCP/SMPP Those were all NITB related, not osmo-bsc related Change-Id: I220f4f44bb932d47ff5cb7a0d2ffd8f450827abb --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/74/3774/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..dc3fff4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,15 +27,6 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete - -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh -fi set +x echo @@ -47,11 +38,11 @@ cd "$base" autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I220f4f44bb932d47ff5cb7a0d2ffd8f450827abb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 19:21:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 19:21:49 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_sap.h: Fix SSN for BSSAP and BSSAP-LE Message-ID: Review at https://gerrit.osmocom.org/3775 sccp_sap.h: Fix SSN for BSSAP and BSSAP-LE * BSSAP is 254 on both MSC and BSC side: Add missing define * BSSAP-LE (LCS Extension) has 250/251, adjust name to add -LE suffix Change-Id: Iccec75cfc0cf16bd717a9bd4606d1e772c332ccc --- M examples/m3ua_example.c M include/osmocom/sigtran/sccp_sap.h M src/sccp_sap.c 3 files changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/75/3775/1 diff --git a/examples/m3ua_example.c b/examples/m3ua_example.c index 6c2b146..b3a1505 100644 --- a/examples/m3ua_example.c +++ b/examples/m3ua_example.c @@ -109,7 +109,7 @@ if (client) { g_sccp = osmo_sccp_simple_client(NULL, "client", 23, OSMO_SS7_ASP_PROT_M3UA, 0, NULL, M3UA_PORT, "127.0.0.2"); - sccp_test_user_vty_install(g_sccp, OSMO_SCCP_SSN_BSC_BSSAP); + sccp_test_user_vty_install(g_sccp, OSMO_SCCP_SSN_BSSAP); } else { g_sccp = sua_server_helper(); sccp_test_server_init(g_sccp); diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 5524bd8..7a4f9bf 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -129,10 +129,11 @@ OSMO_SCCP_SSN_GGSN_MAP = 150, /* national network SSN within GSM/UMTS: 32-128 + 151-254 */ OSMO_SCCP_SSN_PCAP = 249, - OSMO_SCCP_SSN_BSC_BSSAP = 250, - OSMO_SCCP_SSN_MSC_BSSAP = 251, + OSMO_SCCP_SSN_BSC_BSSAP_LE = 250, + OSMO_SCCP_SSN_MSC_BSSAP_LE = 251, OSMO_SCCP_SSN_SMLC_BSSAP = 252, OSMO_SCCP_SSN_BSS_OAM = 253, + OSMO_SCCP_SSN_BSSAP = 254, }; extern const struct value_string osmo_sccp_ssn_names[]; diff --git a/src/sccp_sap.c b/src/sccp_sap.c index e5addb1..3646685 100644 --- a/src/sccp_sap.c +++ b/src/sccp_sap.c @@ -126,9 +126,10 @@ { OSMO_SCCP_SSN_SGSN_MAP, "SGSN_MAP" }, { OSMO_SCCP_SSN_GGSN_MAP, "GGSN_MAP" }, { OSMO_SCCP_SSN_PCAP, "PCAP" }, - { OSMO_SCCP_SSN_BSC_BSSAP, "BSC_BSSAP" }, - { OSMO_SCCP_SSN_MSC_BSSAP, "MSC_BSSAP" }, + { OSMO_SCCP_SSN_BSC_BSSAP_LE, "BSC_BSSAP_LE" }, + { OSMO_SCCP_SSN_MSC_BSSAP_LE, "MSC_BSSAP_LE" }, { OSMO_SCCP_SSN_SMLC_BSSAP, "SMLC_BSSAP" }, { OSMO_SCCP_SSN_BSS_OAM, "BSS_OAM" }, + { OSMO_SCCP_SSN_BSSAP, "BSSAP" }, { 0, NULL } }; -- To view, visit https://gerrit.osmocom.org/3775 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iccec75cfc0cf16bd717a9bd4606d1e772c332ccc Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 19:40:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 19:40:06 +0000 Subject: [PATCH] osmo-bsc[master]: jenkins.sh: Don't build-test with IU/MGCP/SMPP In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3774 to look at the new patch set (#3). jenkins.sh: Don't build-test with IU/MGCP/SMPP Those were all NITB related, not osmo-bsc related Change-Id: I220f4f44bb932d47ff5cb7a0d2ffd8f450827abb --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/74/3774/3 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..2685d04 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,15 +27,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete - -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh -fi +osmo-build-dep.sh osmo-mgw set +x echo @@ -47,11 +39,11 @@ cd "$base" autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I220f4f44bb932d47ff5cb7a0d2ffd8f450827abb Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:00:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:00:44 +0000 Subject: osmo-bsc[master]: configure.ac: remove --enable-osmo-bsc, --enable-nat In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:00:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:00:47 +0000 Subject: osmo-bsc[master]: configure.ac: remove smpp_mirror, which has no relation to a... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:00:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:00:49 +0000 Subject: osmo-bsc[master]: configure.ac: Remove --enable-mgcp-transcoding In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bf619922001ce4a8a229fe028109361a3fad986 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:00:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:00:51 +0000 Subject: osmo-bsc[master]: configure.ac: Remove --enable-iu In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:00:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:00:54 +0000 Subject: osmo-bsc[master]: configure.ac: Remove checks for libgtp + c-ares In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:00:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:00:57 +0000 Subject: osmo-bsc[master]: configure.ac: Remove check for GMTOFF In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I337201ec2c2457100b229b5df2cbabbcb801236f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:00:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:00:59 +0000 Subject: osmo-bsc[master]: configure.ac: Package is now called osmo-bsc, not openbsc In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I85511946316a34877080ac55553c5b88e34bd1be Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:05:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:05:33 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: remove --enable-osmo-bsc, --enable-nat In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3767 to look at the new patch set (#4). configure.ac: remove --enable-osmo-bsc, --enable-nat This is the OsmoBSC project. Disabling the build of the BSC would be somewhat odd, so let's remove the option. Also, OsmoBSC depends on libosmo-sccp now, so we must unconditionally depend on it. As a result, we can remove the --enable-nat option, as this was only to avoid a mandatory libosmo-sccp requirement in historical times. Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 --- M configure.ac M debian/rules M src/Makefile.am M tests/Makefile.am 4 files changed, 3 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/3767/4 diff --git a/configure.ac b/configure.ac index 1050f3d..e7f0546 100644 --- a/configure.ac +++ b/configure.ac @@ -48,24 +48,7 @@ PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) - -# Enabke/disable the NAT? -AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], - [osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"]) -if test "$osmo_ac_build_nat" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -fi -AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") -AC_SUBST(osmo_ac_build_nat) - -# Enable/disable the BSC? -AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], - [osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"]) -if test "$osmo_ac_build_bsc" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) -fi -AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") -AC_SUBST(osmo_ac_build_bsc) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], diff --git a/debian/rules b/debian/rules index 72a7d18..7fe538a 100755 --- a/debian/rules +++ b/debian/rules @@ -44,7 +44,6 @@ %: dh $@ --with autoreconf -CONFIGURE_FLAGS += --enable-osmo-bsc override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_FLAGS) # diff --git a/src/Makefile.am b/src/Makefile.am index 9a26a7b..d04f025 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,17 +32,6 @@ SUBDIRS += \ utils \ ipaccess \ - $(NULL) - -# Conditional Programs -if BUILD_NAT -SUBDIRS += \ + osmo-bsc \ osmo-bsc_nat \ $(NULL) -endif - -if BUILD_BSC -SUBDIRS += \ - osmo-bsc \ - $(NULL) -endif diff --git a/tests/Makefile.am b/tests/Makefile.am index fc7fc57..aff05bb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,23 +1,14 @@ SUBDIRS = \ + bsc \ gsm0408 \ channel \ abis \ trau \ subscr \ nanobts_omlattr \ - $(NULL) - -if BUILD_NAT -SUBDIRS += \ bsc-nat \ bsc-nat-trie \ $(NULL) -endif -if BUILD_BSC -SUBDIRS += \ - bsc \ - $(NULL) -endif # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac -- To view, visit https://gerrit.osmocom.org/3767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:05:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:05:33 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Package is now called osmo-bsc, not openbsc In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3773 to look at the new patch set (#4). configure.ac: Package is now called osmo-bsc, not openbsc Change-Id: I85511946316a34877080ac55553c5b88e34bd1be --- M configure.ac M debian/osmo-bsc.install 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/73/3773/4 diff --git a/configure.ac b/configure.ac index a091b39..5d684ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT([openbsc], +AC_INIT([osmo-bsc], m4_esyscmd([./git-version-gen .tarball-version]), [openbsc at lists.osmocom.org]) diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install index 85e2103..cce0f65 100644 --- a/debian/osmo-bsc.install +++ b/debian/osmo-bsc.install @@ -1,2 +1,2 @@ usr/bin -usr/share/doc/openbsc/examples/osmo-bsc +usr/share/doc/osmo-bsc/examples/osmo-bsc -- To view, visit https://gerrit.osmocom.org/3773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I85511946316a34877080ac55553c5b88e34bd1be Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:06:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:06:22 +0000 Subject: osmo-bsc[master]: configure.ac: Package is now called osmo-bsc, not openbsc In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I85511946316a34877080ac55553c5b88e34bd1be Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:06:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:06:29 +0000 Subject: osmo-bsc[master]: configure.ac: remove --enable-osmo-bsc, --enable-nat In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:31:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:31:31 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: remove --enable-osmo-bsc, --enable-nat In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3767 to look at the new patch set (#5). configure.ac: remove --enable-osmo-bsc, --enable-nat This is the OsmoBSC project. Disabling the build of the BSC would be somewhat odd, so let's remove the option. Also, OsmoBSC depends on libosmo-sccp now, so we must unconditionally depend on it. As a result, we can remove the --enable-nat option, as this was only to avoid a mandatory libosmo-sccp requirement in historical times. Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 --- M configure.ac M contrib/jenkins.sh M debian/rules M src/Makefile.am M tests/Makefile.am 5 files changed, 5 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/3767/5 diff --git a/configure.ac b/configure.ac index 1050f3d..e7f0546 100644 --- a/configure.ac +++ b/configure.ac @@ -48,24 +48,7 @@ PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) - -# Enabke/disable the NAT? -AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], - [osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"]) -if test "$osmo_ac_build_nat" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -fi -AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") -AC_SUBST(osmo_ac_build_nat) - -# Enable/disable the BSC? -AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], - [osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"]) -if test "$osmo_ac_build_bsc" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) -fi -AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") -AC_SUBST(osmo_ac_build_bsc) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..a227dda 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -47,11 +47,11 @@ cd "$base" autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="$SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/debian/rules b/debian/rules index 72a7d18..7fe538a 100755 --- a/debian/rules +++ b/debian/rules @@ -44,7 +44,6 @@ %: dh $@ --with autoreconf -CONFIGURE_FLAGS += --enable-osmo-bsc override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_FLAGS) # diff --git a/src/Makefile.am b/src/Makefile.am index 9a26a7b..d04f025 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,17 +32,6 @@ SUBDIRS += \ utils \ ipaccess \ - $(NULL) - -# Conditional Programs -if BUILD_NAT -SUBDIRS += \ + osmo-bsc \ osmo-bsc_nat \ $(NULL) -endif - -if BUILD_BSC -SUBDIRS += \ - osmo-bsc \ - $(NULL) -endif diff --git a/tests/Makefile.am b/tests/Makefile.am index fc7fc57..aff05bb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,23 +1,14 @@ SUBDIRS = \ + bsc \ gsm0408 \ channel \ abis \ trau \ subscr \ nanobts_omlattr \ - $(NULL) - -if BUILD_NAT -SUBDIRS += \ bsc-nat \ bsc-nat-trie \ $(NULL) -endif -if BUILD_BSC -SUBDIRS += \ - bsc \ - $(NULL) -endif # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac -- To view, visit https://gerrit.osmocom.org/3767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:31:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:31:31 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: remove smpp_mirror, which has no relation to a... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3768 to look at the new patch set (#5). configure.ac: remove smpp_mirror, which has no relation to a BSC smpp_mirror is maintained in osmo-msc.git, so let's remove it (and the associated libsmpp34 build requirement). Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 --- M configure.ac M contrib/jenkins.sh M src/utils/Makefile.am D src/utils/smpp_mirror.c 4 files changed, 2 insertions(+), 390 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/68/3768/5 diff --git a/configure.ac b/configure.ac index e7f0546..795a307 100644 --- a/configure.ac +++ b/configure.ac @@ -50,16 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable smpp support in the msc? -AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], - [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) -if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) - AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) -fi -AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -AC_SUBST(osmo_ac_build_smpp) - # Enable/disable transcoding within osmo-bsc_mgcp? AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index a227dda..e26cd8b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,7 +27,6 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete @@ -47,11 +46,11 @@ cd "$base" autoreconf --install --force -./configure $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure $MGCP $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="$SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="$MGCP $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 26494e1..d3f6d62 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -11,7 +11,6 @@ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ - $(LIBSMPP34_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -43,12 +42,6 @@ $(NULL) endif -if BUILD_SMPP -noinst_PROGRAMS = \ - smpp_mirror \ - $(NULL) -endif - bs11_config_SOURCES = \ bs11_config.c \ $(NULL) @@ -65,17 +58,6 @@ isdnsync_SOURCES = \ isdnsync.c \ - $(NULL) - -smpp_mirror_SOURCES = \ - smpp_mirror.c \ - $(NULL) - -smpp_mirror_LDADD = \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBSMPP34_LIBS) \ $(NULL) meas_vis_SOURCES = \ diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c deleted file mode 100644 index c570505..0000000 --- a/src/utils/smpp_mirror.c +++ /dev/null @@ -1,359 +0,0 @@ -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* FIXME: merge with smpp_smsc.c */ -#define SMPP_SYS_ID_LEN 16 -enum esme_read_state { - READ_ST_IN_LEN = 0, - READ_ST_IN_MSG = 1, -}; -/* FIXME: merge with smpp_smsc.c */ - -struct esme { - struct osmo_fd ofd; - - uint32_t own_seq_nr; - - struct osmo_wqueue wqueue; - enum esme_read_state read_state; - uint32_t read_len; - uint32_t read_idx; - struct msgb *read_msg; - - uint8_t smpp_version; - char system_id[SMPP_SYS_ID_LEN+1]; - char password[SMPP_SYS_ID_LEN+1]; -}; - -/* FIXME: merge with smpp_smsc.c */ -#define SMPP34_UNPACK(rc, type, str, data, len) \ - memset(str, 0, sizeof(*str)); \ - rc = smpp34_unpack(type, str, data, len) -#define INIT_RESP(type, resp, req) { \ - memset((resp), 0, sizeof(*(resp))); \ - (resp)->command_length = 0; \ - (resp)->command_id = type; \ - (resp)->command_status = ESME_ROK; \ - (resp)->sequence_number = (req)->sequence_number; \ -} -#define PACK_AND_SEND(esme, ptr) pack_and_send(esme, (ptr)->command_id, ptr) -static inline uint32_t smpp_msgb_cmdid(struct msgb *msg) -{ - uint8_t *tmp = msgb_data(msg) + 4; - return ntohl(*(uint32_t *)tmp); -} -static uint32_t esme_inc_seq_nr(struct esme *esme) -{ - esme->own_seq_nr++; - if (esme->own_seq_nr > 0x7fffffff) - esme->own_seq_nr = 1; - - return esme->own_seq_nr; -} -static int pack_and_send(struct esme *esme, uint32_t type, void *ptr) -{ - struct msgb *msg = msgb_alloc(4096, "SMPP_Tx"); - int rc, rlen; - if (!msg) - return -ENOMEM; - - rc = smpp34_pack(type, msg->tail, msgb_tailroom(msg), &rlen, ptr); - if (rc != 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Error during smpp34_pack(): %s\n", - esme->system_id, smpp34_strerror); - msgb_free(msg); - return -EINVAL; - } - msgb_put(msg, rlen); - - if (osmo_wqueue_enqueue(&esme->wqueue, msg) != 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Write queue full. Dropping message\n", - esme->system_id); - msgb_free(msg); - return -EAGAIN; - } - return 0; -} -/* FIXME: merge with smpp_smsc.c */ - -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) -{ - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; - } - return NULL; -} - -static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) -{ - struct deliver_sm_t deliver; - struct deliver_sm_resp_t deliver_r; - struct submit_sm_t submit; - tlv_t *t; - int rc; - - memset(&deliver, 0, sizeof(deliver)); - SMPP34_UNPACK(rc, DELIVER_SM, &deliver, msgb_data(msg), msgb_length(msg)); - if (rc < 0) - return rc; - - INIT_RESP(DELIVER_SM_RESP, &deliver_r, &deliver); - - PACK_AND_SEND(esme, &deliver_r); - - memset(&submit, 0, sizeof(submit)); - submit.command_id = SUBMIT_SM; - submit.command_status = ESME_ROK; - submit.sequence_number = esme_inc_seq_nr(esme); - - submit.dest_addr_ton = deliver.source_addr_ton; - submit.dest_addr_npi = deliver.source_addr_npi; - memcpy(submit.destination_addr, deliver.source_addr, - OSMO_MIN(sizeof(submit.destination_addr), - sizeof(deliver.source_addr))); - - submit.source_addr_ton = deliver.dest_addr_ton; - submit.source_addr_npi = deliver.dest_addr_npi; - memcpy(submit.source_addr, deliver.destination_addr, - OSMO_MIN(sizeof(submit.source_addr), - sizeof(deliver.destination_addr))); - - /* Mirror delivery receipts as a delivery acknowledgements. */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); - submit.esm_class = 0x08; - } else { - submit.esm_class = deliver.esm_class; - } - - submit.registered_delivery = deliver.registered_delivery; - submit.protocol_id = deliver.protocol_id; - submit.priority_flag = deliver.priority_flag; - memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, - OSMO_MIN(sizeof(submit.schedule_delivery_time), - sizeof(deliver.schedule_delivery_time))); - memcpy(submit.validity_period, deliver.validity_period, - OSMO_MIN(sizeof(submit.validity_period), - sizeof(deliver.validity_period))); - submit.registered_delivery = deliver.registered_delivery; - submit.replace_if_present_flag = deliver.replace_if_present_flag; - submit.data_coding = deliver.data_coding; - submit.sm_default_msg_id = deliver.sm_default_msg_id; - submit.sm_length = deliver.sm_length; - memcpy(submit.short_message, deliver.short_message, - OSMO_MIN(sizeof(submit.short_message), - sizeof(deliver.short_message))); - - /* FIXME: More TLV? */ - t = find_tlv(deliver.tlv, TLVID_user_message_reference); - if (t) { - tlv_t tlv; - - memset(&tlv, 0, sizeof(tlv)); - tlv.tag = TLVID_user_message_reference; - tlv.length = 2; - tlv.value.val16 = t->value.val16; - build_tlv(&submit.tlv, &tlv); - } - - return PACK_AND_SEND(esme, &submit); -} - -static int bind_transceiver(struct esme *esme) -{ - struct bind_transceiver_t bind; - - memset(&bind, 0, sizeof(bind)); - bind.command_id = BIND_TRANSCEIVER; - bind.sequence_number = esme_inc_seq_nr(esme); - snprintf((char *)bind.system_id, sizeof(bind.system_id), "%s", esme->system_id); - snprintf((char *)bind.password, sizeof(bind.password), "%s", esme->password); - snprintf((char *)bind.system_type, sizeof(bind.system_type), "mirror"); - bind.interface_version = esme->smpp_version; - - return PACK_AND_SEND(esme, &bind); -} - -static int smpp_pdu_rx(struct esme *esme, struct msgb *msg) -{ - uint32_t cmd_id = smpp_msgb_cmdid(msg); - int rc; - - switch (cmd_id) { - case DELIVER_SM: - rc = smpp_handle_deliver(esme, msg); - break; - default: - LOGP(DSMPP, LOGL_NOTICE, "unhandled case %d\n", cmd_id); - rc = 0; - break; - } - - return rc; -} - -/* FIXME: merge with smpp_smsc.c */ -static int esme_read_cb(struct osmo_fd *ofd) -{ - struct esme *esme = ofd->data; - uint32_t len; - uint8_t *lenptr = (uint8_t *) &len; - uint8_t *cur; - struct msgb *msg; - int rdlen; - int rc; - - switch (esme->read_state) { - case READ_ST_IN_LEN: - rdlen = sizeof(uint32_t) - esme->read_idx; - rc = read(ofd->fd, lenptr + esme->read_idx, rdlen); - if (rc < 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); - } else if (rc == 0) { - goto dead_socket; - } else - esme->read_idx += rc; - if (esme->read_idx >= sizeof(uint32_t)) { - esme->read_len = ntohl(len); - msg = msgb_alloc(esme->read_len, "SMPP Rx"); - if (!msg) - return -ENOMEM; - esme->read_msg = msg; - cur = msgb_put(msg, sizeof(uint32_t)); - memcpy(cur, lenptr, sizeof(uint32_t)); - esme->read_state = READ_ST_IN_MSG; - esme->read_idx = sizeof(uint32_t); - } - break; - case READ_ST_IN_MSG: - msg = esme->read_msg; - rdlen = esme->read_len - esme->read_idx; - rc = read(ofd->fd, msg->tail, OSMO_MIN(rdlen, msgb_tailroom(msg))); - if (rc < 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); - } else if (rc == 0) { - goto dead_socket; - } else { - esme->read_idx += rc; - msgb_put(msg, rc); - } - - if (esme->read_idx >= esme->read_len) { - rc = smpp_pdu_rx(esme, esme->read_msg); - esme->read_msg = NULL; - esme->read_idx = 0; - esme->read_len = 0; - esme->read_state = READ_ST_IN_LEN; - } - break; - } - - return 0; -dead_socket: - msgb_free(esme->read_msg); - osmo_fd_unregister(&esme->wqueue.bfd); - close(esme->wqueue.bfd.fd); - esme->wqueue.bfd.fd = -1; - exit(2342); - - return 0; -} - -static int esme_write_cb(struct osmo_fd *ofd, struct msgb *msg) -{ - struct esme *esme = ofd->data; - int rc; - - rc = write(ofd->fd, msgb_data(msg), msgb_length(msg)); - if (rc == 0) { - osmo_fd_unregister(&esme->wqueue.bfd); - close(esme->wqueue.bfd.fd); - esme->wqueue.bfd.fd = -1; - exit(99); - } else if (rc < msgb_length(msg)) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Short write\n", esme->system_id); - return 0; - } - - return 0; -} - -static int smpp_esme_init(struct esme *esme, const char *host, uint16_t port) -{ - int rc; - - if (port == 0) - port = 2775; - - esme->own_seq_nr = rand(); - esme_inc_seq_nr(esme); - osmo_wqueue_init(&esme->wqueue, 10); - esme->wqueue.bfd.data = esme; - esme->wqueue.read_cb = esme_read_cb; - esme->wqueue.write_cb = esme_write_cb; - - rc = osmo_sock_init_ofd(&esme->wqueue.bfd, AF_UNSPEC, SOCK_STREAM, - IPPROTO_TCP, host, port, OSMO_SOCK_F_CONNECT); - if (rc < 0) - return rc; - - return bind_transceiver(esme); -} - - -int main(int argc, char **argv) -{ - struct esme esme; - char *host = "localhost"; - int port = 0; - int rc; - - msgb_talloc_ctx_init(NULL, 0); - - memset(&esme, 0, sizeof(esme)); - - osmo_init_logging(&log_info); - - snprintf((char *) esme.system_id, sizeof(esme.system_id), "mirror"); - snprintf((char *) esme.password, sizeof(esme.password), "mirror"); - esme.smpp_version = 0x34; - - if (argc >= 2) - host = argv[1]; - if (argc >= 3) - port = atoi(argv[2]); - - rc = smpp_esme_init(&esme, host, port); - if (rc < 0) - exit(1); - - while (1) { - osmo_select_main(0); - } - - exit(0); -} -- To view, visit https://gerrit.osmocom.org/3768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:31:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:31:31 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Remove --enable-iu In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3770 to look at the new patch set (#5). configure.ac: Remove --enable-iu There is no Iu in a BSC, this was from old times with OsmoNITB. This configure option now lives in osmo-msc.git Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea --- M configure.ac M contrib/jenkins.sh 2 files changed, 2 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/3770/5 diff --git a/configure.ac b/configure.ac index 588d5ef..03e7cc4 100644 --- a/configure.ac +++ b/configure.ac @@ -50,18 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable 3G aka IuPS + IuCS support? -AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], - [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) -if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? - AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) -fi -AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -AC_SUBST(osmo_ac_iu) - - found_libgtp=yes PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 860b3a3..46ac062 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -30,12 +30,6 @@ osmo-build-dep.sh openggsn osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh -fi - set +x echo echo @@ -46,11 +40,11 @@ cd "$base" autoreconf --install --force -./configure $IU --enable-vty-tests --enable-external-tests +./configure --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="$IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:31:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:31:31 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Remove checks for libgtp + c-ares In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3771 to look at the new patch set (#5). configure.ac: Remove checks for libgtp + c-ares Those are requirements of sgsn/gtphub and live in osmo-sgsn.git Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 --- M configure.ac M contrib/jenkins.sh 2 files changed, 0 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/3771/5 diff --git a/configure.ac b/configure.ac index 03e7cc4..a54bcf0 100644 --- a/configure.ac +++ b/configure.ac @@ -50,25 +50,8 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -found_libgtp=yes -PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) -AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) -AC_SUBST(found_libgtp) - -found_libcares=yes -PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no]) -AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes) -AC_SUBST(found_libcares) - -found_libgtp_and_libcares=no -if test "$found_libgtp" = "yes" -a "$found_libcares" = "yes"; then - found_libgtp_and_libcares=yes -fi -AC_SUBST(found_libgtp_and_libcares) - dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) found_pcap=yes AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 46ac062..50a20db 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,7 +27,6 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -osmo-build-dep.sh openggsn osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete set +x -- To view, visit https://gerrit.osmocom.org/3771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:31:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 20:31:32 +0000 Subject: [PATCH] osmo-bsc[master]: contrib/jenkins.sh: MGCP is unconditional now Message-ID: Review at https://gerrit.osmocom.org/3776 contrib/jenkins.sh: MGCP is unconditional now Change-Id: I88338b91eb09554c33c893d86fcaa3d6eb09a22b --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/3776/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index e26cd8b..860b3a3 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -46,11 +46,11 @@ cd "$base" autoreconf --install --force -./configure $MGCP $IU --enable-vty-tests --enable-external-tests +./configure $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="$MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="$IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3776 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88338b91eb09554c33c893d86fcaa3d6eb09a22b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:45:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 20:45:51 +0000 Subject: [PATCH] osmo-bsc[master]: jenkins: fix build: osmo-mgw from master, not pre_release Message-ID: Review at https://gerrit.osmocom.org/3777 jenkins: fix build: osmo-mgw from master, not pre_release pre_release is gone, we need to build from master now. Change-Id: I985274e48f310e6e38bb54c7e57db28f8e1a6833 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/77/3777/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..a7313c5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,7 @@ osmo-build-dep.sh libosmo-sccp PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete +osmo-build-dep.sh osmo-mgw if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I985274e48f310e6e38bb54c7e57db28f8e1a6833 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:49:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 20:49:19 +0000 Subject: [PATCH] osmo-msc[master]: jenkins: fix build: osmo-mgw from master, not pre_release Message-ID: Review at https://gerrit.osmocom.org/3778 jenkins: fix build: osmo-mgw from master, not pre_release pre_release is gone, we need to build from master now. Change-Id: I86a50c523ab04d96575aade624daa5a2f9fd6d83 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/78/3778/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..a7313c5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,7 @@ osmo-build-dep.sh libosmo-sccp PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete +osmo-build-dep.sh osmo-mgw if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I86a50c523ab04d96575aade624daa5a2f9fd6d83 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:51:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 20:51:43 +0000 Subject: [PATCH] osmo-sgsn[master]: jenkins: fix build: remove unused dependencies Message-ID: Review at https://gerrit.osmocom.org/3779 jenkins: fix build: remove unused dependencies Change-Id: Ice81f8541eda2cd5beeacbfd481f3e4283211331 --- M contrib/jenkins.sh 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/79/3779/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..2882989 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,9 +27,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice81f8541eda2cd5beeacbfd481f3e4283211331 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:53:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 20:53:32 +0000 Subject: osmo-bsc[master]: jenkins: fix build: osmo-mgw from master, not pre_release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I985274e48f310e6e38bb54c7e57db28f8e1a6833 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 20:53:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 20:53:34 +0000 Subject: [MERGED] osmo-bsc[master]: jenkins: fix build: osmo-mgw from master, not pre_release In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: fix build: osmo-mgw from master, not pre_release ...................................................................... jenkins: fix build: osmo-mgw from master, not pre_release pre_release is gone, we need to build from master now. Change-Id: I985274e48f310e6e38bb54c7e57db28f8e1a6833 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..a7313c5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,7 @@ osmo-build-dep.sh libosmo-sccp PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete +osmo-build-dep.sh osmo-mgw if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I985274e48f310e6e38bb54c7e57db28f8e1a6833 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:00:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:00:30 +0000 Subject: [PATCH] osmo-bsc[master]: configure.ac: Remove checks for libgtp + c-ares In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3771 to look at the new patch set (#6). configure.ac: Remove checks for libgtp + c-ares Those are requirements of sgsn/gtphub and live in osmo-sgsn.git Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 --- M configure.ac M contrib/jenkins.sh 2 files changed, 0 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/3771/6 diff --git a/configure.ac b/configure.ac index 03e7cc4..a54bcf0 100644 --- a/configure.ac +++ b/configure.ac @@ -50,25 +50,8 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -found_libgtp=yes -PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) -AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) -AC_SUBST(found_libgtp) - -found_libcares=yes -PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no]) -AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes) -AC_SUBST(found_libcares) - -found_libgtp_and_libcares=no -if test "$found_libgtp" = "yes" -a "$found_libcares" = "yes"; then - found_libgtp_and_libcares=yes -fi -AC_SUBST(found_libgtp_and_libcares) - dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) found_pcap=yes AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 9f1c4bd..2685d04 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,7 +27,6 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -osmo-build-dep.sh openggsn osmo-build-dep.sh osmo-mgw set +x -- To view, visit https://gerrit.osmocom.org/3771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:03:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:03:23 +0000 Subject: osmo-bsc[master]: configure.ac: remove smpp_mirror, which has no relation to a... In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:04:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:04:00 +0000 Subject: osmo-bsc[master]: configure.ac: Remove check for GMTOFF In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I337201ec2c2457100b229b5df2cbabbcb801236f Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:04:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:04:39 +0000 Subject: osmo-bsc[master]: configure.ac: Remove --enable-iu In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:05:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:05:04 +0000 Subject: osmo-bsc[master]: configure.ac: Package is now called osmo-bsc, not openbsc In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I85511946316a34877080ac55553c5b88e34bd1be Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:05:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:05:26 +0000 Subject: osmo-bsc[master]: configure.ac: No more libosmogb dependency In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3766 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7c96d74687847964fd6d73c9e903e1d26ae47e1e Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:06:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:06:32 +0000 Subject: osmo-bsc[master]: configure.ac: remove --enable-osmo-bsc, --enable-nat In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:07:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:07:07 +0000 Subject: osmo-bsc[master]: configure.ac: Remove --enable-mgcp-transcoding In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bf619922001ce4a8a229fe028109361a3fad986 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:08:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:08:33 +0000 Subject: osmo-bsc[master]: configure.ac: Remove checks for libgtp + c-ares In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3771/6/configure.ac File configure.ac: Line 71 (techincally unrelated to commit message, but I would even have done all of these patches in one, so not going to make an issue of it) -- To view, visit https://gerrit.osmocom.org/3771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:08:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:08:49 +0000 Subject: osmo-bsc[master]: contrib/jenkins.sh: MGCP is unconditional now In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3776 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I88338b91eb09554c33c893d86fcaa3d6eb09a22b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:09:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:09:58 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: remove smpp_mirror, which has no relation to a... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: remove smpp_mirror, which has no relation to a BSC ...................................................................... configure.ac: remove smpp_mirror, which has no relation to a BSC smpp_mirror is maintained in osmo-msc.git, so let's remove it (and the associated libsmpp34 build requirement). Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 --- M configure.ac M contrib/jenkins.sh M src/utils/Makefile.am D src/utils/smpp_mirror.c 4 files changed, 2 insertions(+), 390 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index e7f0546..795a307 100644 --- a/configure.ac +++ b/configure.ac @@ -50,16 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable smpp support in the msc? -AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], - [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) -if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) - AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) -fi -AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -AC_SUBST(osmo_ac_build_smpp) - # Enable/disable transcoding within osmo-bsc_mgcp? AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index cb0f8b1..32c2d4e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,7 +27,6 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn osmo-build-dep.sh osmo-mgw @@ -47,11 +46,11 @@ cd "$base" autoreconf --install --force -./configure $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure $MGCP $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="$SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="$MGCP $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 26494e1..d3f6d62 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -11,7 +11,6 @@ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ - $(LIBSMPP34_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -43,12 +42,6 @@ $(NULL) endif -if BUILD_SMPP -noinst_PROGRAMS = \ - smpp_mirror \ - $(NULL) -endif - bs11_config_SOURCES = \ bs11_config.c \ $(NULL) @@ -65,17 +58,6 @@ isdnsync_SOURCES = \ isdnsync.c \ - $(NULL) - -smpp_mirror_SOURCES = \ - smpp_mirror.c \ - $(NULL) - -smpp_mirror_LDADD = \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBSMPP34_LIBS) \ $(NULL) meas_vis_SOURCES = \ diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c deleted file mode 100644 index c570505..0000000 --- a/src/utils/smpp_mirror.c +++ /dev/null @@ -1,359 +0,0 @@ -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* FIXME: merge with smpp_smsc.c */ -#define SMPP_SYS_ID_LEN 16 -enum esme_read_state { - READ_ST_IN_LEN = 0, - READ_ST_IN_MSG = 1, -}; -/* FIXME: merge with smpp_smsc.c */ - -struct esme { - struct osmo_fd ofd; - - uint32_t own_seq_nr; - - struct osmo_wqueue wqueue; - enum esme_read_state read_state; - uint32_t read_len; - uint32_t read_idx; - struct msgb *read_msg; - - uint8_t smpp_version; - char system_id[SMPP_SYS_ID_LEN+1]; - char password[SMPP_SYS_ID_LEN+1]; -}; - -/* FIXME: merge with smpp_smsc.c */ -#define SMPP34_UNPACK(rc, type, str, data, len) \ - memset(str, 0, sizeof(*str)); \ - rc = smpp34_unpack(type, str, data, len) -#define INIT_RESP(type, resp, req) { \ - memset((resp), 0, sizeof(*(resp))); \ - (resp)->command_length = 0; \ - (resp)->command_id = type; \ - (resp)->command_status = ESME_ROK; \ - (resp)->sequence_number = (req)->sequence_number; \ -} -#define PACK_AND_SEND(esme, ptr) pack_and_send(esme, (ptr)->command_id, ptr) -static inline uint32_t smpp_msgb_cmdid(struct msgb *msg) -{ - uint8_t *tmp = msgb_data(msg) + 4; - return ntohl(*(uint32_t *)tmp); -} -static uint32_t esme_inc_seq_nr(struct esme *esme) -{ - esme->own_seq_nr++; - if (esme->own_seq_nr > 0x7fffffff) - esme->own_seq_nr = 1; - - return esme->own_seq_nr; -} -static int pack_and_send(struct esme *esme, uint32_t type, void *ptr) -{ - struct msgb *msg = msgb_alloc(4096, "SMPP_Tx"); - int rc, rlen; - if (!msg) - return -ENOMEM; - - rc = smpp34_pack(type, msg->tail, msgb_tailroom(msg), &rlen, ptr); - if (rc != 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Error during smpp34_pack(): %s\n", - esme->system_id, smpp34_strerror); - msgb_free(msg); - return -EINVAL; - } - msgb_put(msg, rlen); - - if (osmo_wqueue_enqueue(&esme->wqueue, msg) != 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Write queue full. Dropping message\n", - esme->system_id); - msgb_free(msg); - return -EAGAIN; - } - return 0; -} -/* FIXME: merge with smpp_smsc.c */ - -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) -{ - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; - } - return NULL; -} - -static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) -{ - struct deliver_sm_t deliver; - struct deliver_sm_resp_t deliver_r; - struct submit_sm_t submit; - tlv_t *t; - int rc; - - memset(&deliver, 0, sizeof(deliver)); - SMPP34_UNPACK(rc, DELIVER_SM, &deliver, msgb_data(msg), msgb_length(msg)); - if (rc < 0) - return rc; - - INIT_RESP(DELIVER_SM_RESP, &deliver_r, &deliver); - - PACK_AND_SEND(esme, &deliver_r); - - memset(&submit, 0, sizeof(submit)); - submit.command_id = SUBMIT_SM; - submit.command_status = ESME_ROK; - submit.sequence_number = esme_inc_seq_nr(esme); - - submit.dest_addr_ton = deliver.source_addr_ton; - submit.dest_addr_npi = deliver.source_addr_npi; - memcpy(submit.destination_addr, deliver.source_addr, - OSMO_MIN(sizeof(submit.destination_addr), - sizeof(deliver.source_addr))); - - submit.source_addr_ton = deliver.dest_addr_ton; - submit.source_addr_npi = deliver.dest_addr_npi; - memcpy(submit.source_addr, deliver.destination_addr, - OSMO_MIN(sizeof(submit.source_addr), - sizeof(deliver.destination_addr))); - - /* Mirror delivery receipts as a delivery acknowledgements. */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); - submit.esm_class = 0x08; - } else { - submit.esm_class = deliver.esm_class; - } - - submit.registered_delivery = deliver.registered_delivery; - submit.protocol_id = deliver.protocol_id; - submit.priority_flag = deliver.priority_flag; - memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, - OSMO_MIN(sizeof(submit.schedule_delivery_time), - sizeof(deliver.schedule_delivery_time))); - memcpy(submit.validity_period, deliver.validity_period, - OSMO_MIN(sizeof(submit.validity_period), - sizeof(deliver.validity_period))); - submit.registered_delivery = deliver.registered_delivery; - submit.replace_if_present_flag = deliver.replace_if_present_flag; - submit.data_coding = deliver.data_coding; - submit.sm_default_msg_id = deliver.sm_default_msg_id; - submit.sm_length = deliver.sm_length; - memcpy(submit.short_message, deliver.short_message, - OSMO_MIN(sizeof(submit.short_message), - sizeof(deliver.short_message))); - - /* FIXME: More TLV? */ - t = find_tlv(deliver.tlv, TLVID_user_message_reference); - if (t) { - tlv_t tlv; - - memset(&tlv, 0, sizeof(tlv)); - tlv.tag = TLVID_user_message_reference; - tlv.length = 2; - tlv.value.val16 = t->value.val16; - build_tlv(&submit.tlv, &tlv); - } - - return PACK_AND_SEND(esme, &submit); -} - -static int bind_transceiver(struct esme *esme) -{ - struct bind_transceiver_t bind; - - memset(&bind, 0, sizeof(bind)); - bind.command_id = BIND_TRANSCEIVER; - bind.sequence_number = esme_inc_seq_nr(esme); - snprintf((char *)bind.system_id, sizeof(bind.system_id), "%s", esme->system_id); - snprintf((char *)bind.password, sizeof(bind.password), "%s", esme->password); - snprintf((char *)bind.system_type, sizeof(bind.system_type), "mirror"); - bind.interface_version = esme->smpp_version; - - return PACK_AND_SEND(esme, &bind); -} - -static int smpp_pdu_rx(struct esme *esme, struct msgb *msg) -{ - uint32_t cmd_id = smpp_msgb_cmdid(msg); - int rc; - - switch (cmd_id) { - case DELIVER_SM: - rc = smpp_handle_deliver(esme, msg); - break; - default: - LOGP(DSMPP, LOGL_NOTICE, "unhandled case %d\n", cmd_id); - rc = 0; - break; - } - - return rc; -} - -/* FIXME: merge with smpp_smsc.c */ -static int esme_read_cb(struct osmo_fd *ofd) -{ - struct esme *esme = ofd->data; - uint32_t len; - uint8_t *lenptr = (uint8_t *) &len; - uint8_t *cur; - struct msgb *msg; - int rdlen; - int rc; - - switch (esme->read_state) { - case READ_ST_IN_LEN: - rdlen = sizeof(uint32_t) - esme->read_idx; - rc = read(ofd->fd, lenptr + esme->read_idx, rdlen); - if (rc < 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); - } else if (rc == 0) { - goto dead_socket; - } else - esme->read_idx += rc; - if (esme->read_idx >= sizeof(uint32_t)) { - esme->read_len = ntohl(len); - msg = msgb_alloc(esme->read_len, "SMPP Rx"); - if (!msg) - return -ENOMEM; - esme->read_msg = msg; - cur = msgb_put(msg, sizeof(uint32_t)); - memcpy(cur, lenptr, sizeof(uint32_t)); - esme->read_state = READ_ST_IN_MSG; - esme->read_idx = sizeof(uint32_t); - } - break; - case READ_ST_IN_MSG: - msg = esme->read_msg; - rdlen = esme->read_len - esme->read_idx; - rc = read(ofd->fd, msg->tail, OSMO_MIN(rdlen, msgb_tailroom(msg))); - if (rc < 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); - } else if (rc == 0) { - goto dead_socket; - } else { - esme->read_idx += rc; - msgb_put(msg, rc); - } - - if (esme->read_idx >= esme->read_len) { - rc = smpp_pdu_rx(esme, esme->read_msg); - esme->read_msg = NULL; - esme->read_idx = 0; - esme->read_len = 0; - esme->read_state = READ_ST_IN_LEN; - } - break; - } - - return 0; -dead_socket: - msgb_free(esme->read_msg); - osmo_fd_unregister(&esme->wqueue.bfd); - close(esme->wqueue.bfd.fd); - esme->wqueue.bfd.fd = -1; - exit(2342); - - return 0; -} - -static int esme_write_cb(struct osmo_fd *ofd, struct msgb *msg) -{ - struct esme *esme = ofd->data; - int rc; - - rc = write(ofd->fd, msgb_data(msg), msgb_length(msg)); - if (rc == 0) { - osmo_fd_unregister(&esme->wqueue.bfd); - close(esme->wqueue.bfd.fd); - esme->wqueue.bfd.fd = -1; - exit(99); - } else if (rc < msgb_length(msg)) { - LOGP(DSMPP, LOGL_ERROR, "[%s] Short write\n", esme->system_id); - return 0; - } - - return 0; -} - -static int smpp_esme_init(struct esme *esme, const char *host, uint16_t port) -{ - int rc; - - if (port == 0) - port = 2775; - - esme->own_seq_nr = rand(); - esme_inc_seq_nr(esme); - osmo_wqueue_init(&esme->wqueue, 10); - esme->wqueue.bfd.data = esme; - esme->wqueue.read_cb = esme_read_cb; - esme->wqueue.write_cb = esme_write_cb; - - rc = osmo_sock_init_ofd(&esme->wqueue.bfd, AF_UNSPEC, SOCK_STREAM, - IPPROTO_TCP, host, port, OSMO_SOCK_F_CONNECT); - if (rc < 0) - return rc; - - return bind_transceiver(esme); -} - - -int main(int argc, char **argv) -{ - struct esme esme; - char *host = "localhost"; - int port = 0; - int rc; - - msgb_talloc_ctx_init(NULL, 0); - - memset(&esme, 0, sizeof(esme)); - - osmo_init_logging(&log_info); - - snprintf((char *) esme.system_id, sizeof(esme.system_id), "mirror"); - snprintf((char *) esme.password, sizeof(esme.password), "mirror"); - esme.smpp_version = 0x34; - - if (argc >= 2) - host = argv[1]; - if (argc >= 3) - port = atoi(argv[2]); - - rc = smpp_esme_init(&esme, host, port); - if (rc < 0) - exit(1); - - while (1) { - osmo_select_main(0); - } - - exit(0); -} -- To view, visit https://gerrit.osmocom.org/3768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:09:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:09:59 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: remove --enable-osmo-bsc, --enable-nat In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: remove --enable-osmo-bsc, --enable-nat ...................................................................... configure.ac: remove --enable-osmo-bsc, --enable-nat This is the OsmoBSC project. Disabling the build of the BSC would be somewhat odd, so let's remove the option. Also, OsmoBSC depends on libosmo-sccp now, so we must unconditionally depend on it. As a result, we can remove the --enable-nat option, as this was only to avoid a mandatory libosmo-sccp requirement in historical times. Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 --- M configure.ac M contrib/jenkins.sh M debian/rules M src/Makefile.am M tests/Makefile.am 5 files changed, 5 insertions(+), 43 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 1050f3d..e7f0546 100644 --- a/configure.ac +++ b/configure.ac @@ -48,24 +48,7 @@ PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) - -# Enabke/disable the NAT? -AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], - [osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"]) -if test "$osmo_ac_build_nat" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -fi -AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") -AC_SUBST(osmo_ac_build_nat) - -# Enable/disable the BSC? -AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], - [osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"]) -if test "$osmo_ac_build_bsc" = "yes" ; then - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) -fi -AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") -AC_SUBST(osmo_ac_build_bsc) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index a7313c5..cb0f8b1 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -47,11 +47,11 @@ cd "$base" autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="$SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/debian/rules b/debian/rules index 72a7d18..7fe538a 100755 --- a/debian/rules +++ b/debian/rules @@ -44,7 +44,6 @@ %: dh $@ --with autoreconf -CONFIGURE_FLAGS += --enable-osmo-bsc override_dh_auto_configure: dh_auto_configure -- $(CONFIGURE_FLAGS) # diff --git a/src/Makefile.am b/src/Makefile.am index 9a26a7b..d04f025 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,17 +32,6 @@ SUBDIRS += \ utils \ ipaccess \ - $(NULL) - -# Conditional Programs -if BUILD_NAT -SUBDIRS += \ + osmo-bsc \ osmo-bsc_nat \ $(NULL) -endif - -if BUILD_BSC -SUBDIRS += \ - osmo-bsc \ - $(NULL) -endif diff --git a/tests/Makefile.am b/tests/Makefile.am index fc7fc57..aff05bb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,23 +1,14 @@ SUBDIRS = \ + bsc \ gsm0408 \ channel \ abis \ trau \ subscr \ nanobts_omlattr \ - $(NULL) - -if BUILD_NAT -SUBDIRS += \ bsc-nat \ bsc-nat-trie \ $(NULL) -endif -if BUILD_BSC -SUBDIRS += \ - bsc \ - $(NULL) -endif # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac -- To view, visit https://gerrit.osmocom.org/3767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:09:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:09:59 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: No more libosmogb dependency In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: No more libosmogb dependency ...................................................................... configure.ac: No more libosmogb dependency Change-Id: I7c96d74687847964fd6d73c9e903e1d26ae47e1e --- M configure.ac 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index cc07f7a..1050f3d 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,6 @@ PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -- To view, visit https://gerrit.osmocom.org/3766 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c96d74687847964fd6d73c9e903e1d26ae47e1e Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:09:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:09:59 +0000 Subject: [MERGED] osmo-bsc[master]: contrib/jenkins.sh: MGCP is unconditional now In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: contrib/jenkins.sh: MGCP is unconditional now ...................................................................... contrib/jenkins.sh: MGCP is unconditional now Change-Id: I88338b91eb09554c33c893d86fcaa3d6eb09a22b --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 32c2d4e..cba37bf 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -46,11 +46,11 @@ cd "$base" autoreconf --install --force -./configure $MGCP $IU --enable-vty-tests --enable-external-tests +./configure $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="$MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="$IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3776 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88338b91eb09554c33c893d86fcaa3d6eb09a22b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:09:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:09:59 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: Remove --enable-iu In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: Remove --enable-iu ...................................................................... configure.ac: Remove --enable-iu There is no Iu in a BSC, this was from old times with OsmoNITB. This configure option now lives in osmo-msc.git Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea --- M configure.ac M contrib/jenkins.sh 2 files changed, 2 insertions(+), 20 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 588d5ef..03e7cc4 100644 --- a/configure.ac +++ b/configure.ac @@ -50,18 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable 3G aka IuPS + IuCS support? -AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], - [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) -if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? - AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) -fi -AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -AC_SUBST(osmo_ac_iu) - - found_libgtp=yes PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index cba37bf..9f1c4bd 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -30,12 +30,6 @@ osmo-build-dep.sh openggsn osmo-build-dep.sh osmo-mgw -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh -fi - set +x echo echo @@ -46,11 +40,11 @@ cd "$base" autoreconf --install --force -./configure $IU --enable-vty-tests --enable-external-tests +./configure --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="$IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9cf1c430855fe8a59fea1cf0abb3242c38d45cea Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:10:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:10:00 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: Remove checks for libgtp + c-ares In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: Remove checks for libgtp + c-ares ...................................................................... configure.ac: Remove checks for libgtp + c-ares Those are requirements of sgsn/gtphub and live in osmo-sgsn.git Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 --- M configure.ac M contrib/jenkins.sh 2 files changed, 0 insertions(+), 18 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 03e7cc4..a54bcf0 100644 --- a/configure.ac +++ b/configure.ac @@ -50,25 +50,8 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -found_libgtp=yes -PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) -AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) -AC_SUBST(found_libgtp) - -found_libcares=yes -PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no]) -AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes) -AC_SUBST(found_libcares) - -found_libgtp_and_libcares=no -if test "$found_libgtp" = "yes" -a "$found_libcares" = "yes"; then - found_libgtp_and_libcares=yes -fi -AC_SUBST(found_libgtp_and_libcares) - dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) found_pcap=yes AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 9f1c4bd..2685d04 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,7 +27,6 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -osmo-build-dep.sh openggsn osmo-build-dep.sh osmo-mgw set +x -- To view, visit https://gerrit.osmocom.org/3771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6054444aba84b37e5c05da065e1e73e5c8669205 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:10:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:10:00 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: Remove --enable-mgcp-transcoding In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: Remove --enable-mgcp-transcoding ...................................................................... configure.ac: Remove --enable-mgcp-transcoding This was for osmo-bsc_mgcp, whichc is now in osmo-mgw.git Change-Id: I5bf619922001ce4a8a229fe028109361a3fad986 --- M configure.ac 1 file changed, 0 insertions(+), 16 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 795a307..588d5ef 100644 --- a/configure.ac +++ b/configure.ac @@ -50,22 +50,6 @@ PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) -# Enable/disable transcoding within osmo-bsc_mgcp? -AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], - [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) -AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) - -if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi - AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support]) -fi -AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") -AC_SUBST(osmo_ac_mgcp_transcoding) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) -- To view, visit https://gerrit.osmocom.org/3769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5bf619922001ce4a8a229fe028109361a3fad986 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:10:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:10:00 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: Package is now called osmo-bsc, not openbsc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: Package is now called osmo-bsc, not openbsc ...................................................................... configure.ac: Package is now called osmo-bsc, not openbsc Change-Id: I85511946316a34877080ac55553c5b88e34bd1be --- M configure.ac M debian/osmo-bsc.install 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index a091b39..5d684ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT([openbsc], +AC_INIT([osmo-bsc], m4_esyscmd([./git-version-gen .tarball-version]), [openbsc at lists.osmocom.org]) diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install index 85e2103..cce0f65 100644 --- a/debian/osmo-bsc.install +++ b/debian/osmo-bsc.install @@ -1,2 +1,2 @@ usr/bin -usr/share/doc/openbsc/examples/osmo-bsc +usr/share/doc/osmo-bsc/examples/osmo-bsc -- To view, visit https://gerrit.osmocom.org/3773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I85511946316a34877080ac55553c5b88e34bd1be Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:10:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:10:00 +0000 Subject: [MERGED] osmo-bsc[master]: configure.ac: Remove check for GMTOFF In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: Remove check for GMTOFF ...................................................................... configure.ac: Remove check for GMTOFF this was from NITB days and now in osmo-msc.git Change-Id: I337201ec2c2457100b229b5df2cbabbcb801236f --- M configure.ac 1 file changed, 0 insertions(+), 25 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index a54bcf0..a091b39 100644 --- a/configure.ac +++ b/configure.ac @@ -101,31 +101,6 @@ AC_SUBST([COVERAGE_LDFLAGS]) fi -AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ - AC_CACHE_CHECK( - [whether struct tm has tm_gmtoff member], - osmo_cv_tm_includes_tm_gmtoff, - [AC_LINK_IFELSE([ - AC_LANG_PROGRAM([ - #include - ], [ - time_t t = time(NULL); - struct tm* lt = localtime(&t); - int off = lt->tm_gmtoff; - ]) - ], - osmo_cv_tm_includes_tm_gmtoff=yes, - osmo_cv_tm_includes_tm_gmtoff=no - )] - ) - if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then - AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1, - [Define if struct tm has tm_gmtoff member.]) - fi -]) - -CHECK_TM_INCLUDES_TM_GMTOFF - AC_ARG_ENABLE([vty_tests], AC_HELP_STRING([--enable-vty-tests], [Include the VTY/CTRL tests in make check (deprecated) -- To view, visit https://gerrit.osmocom.org/3772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I337201ec2c2457100b229b5df2cbabbcb801236f Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:11:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 3 Sep 2017 21:11:45 +0000 Subject: [ABANDON] osmo-bsc[master]: jenkins.sh: Don't build-test with IU/MGCP/SMPP In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: jenkins.sh: Don't build-test with IU/MGCP/SMPP ...................................................................... Abandoned rebased onto current master, this becomes an empty commit, so dropping it -- To view, visit https://gerrit.osmocom.org/3774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I220f4f44bb932d47ff5cb7a0d2ffd8f450827abb Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:12:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 21:12:39 +0000 Subject: libosmo-sccp[master]: sccp_sap.h: Fix SSN for BSSAP and BSSAP-LE In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3775 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iccec75cfc0cf16bd717a9bd4606d1e772c332ccc Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:12:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 21:12:42 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_sap.h: Fix SSN for BSSAP and BSSAP-LE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_sap.h: Fix SSN for BSSAP and BSSAP-LE ...................................................................... sccp_sap.h: Fix SSN for BSSAP and BSSAP-LE * BSSAP is 254 on both MSC and BSC side: Add missing define * BSSAP-LE (LCS Extension) has 250/251, adjust name to add -LE suffix Change-Id: Iccec75cfc0cf16bd717a9bd4606d1e772c332ccc --- M examples/m3ua_example.c M include/osmocom/sigtran/sccp_sap.h M src/sccp_sap.c 3 files changed, 7 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/examples/m3ua_example.c b/examples/m3ua_example.c index 6c2b146..b3a1505 100644 --- a/examples/m3ua_example.c +++ b/examples/m3ua_example.c @@ -109,7 +109,7 @@ if (client) { g_sccp = osmo_sccp_simple_client(NULL, "client", 23, OSMO_SS7_ASP_PROT_M3UA, 0, NULL, M3UA_PORT, "127.0.0.2"); - sccp_test_user_vty_install(g_sccp, OSMO_SCCP_SSN_BSC_BSSAP); + sccp_test_user_vty_install(g_sccp, OSMO_SCCP_SSN_BSSAP); } else { g_sccp = sua_server_helper(); sccp_test_server_init(g_sccp); diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 5524bd8..7a4f9bf 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -129,10 +129,11 @@ OSMO_SCCP_SSN_GGSN_MAP = 150, /* national network SSN within GSM/UMTS: 32-128 + 151-254 */ OSMO_SCCP_SSN_PCAP = 249, - OSMO_SCCP_SSN_BSC_BSSAP = 250, - OSMO_SCCP_SSN_MSC_BSSAP = 251, + OSMO_SCCP_SSN_BSC_BSSAP_LE = 250, + OSMO_SCCP_SSN_MSC_BSSAP_LE = 251, OSMO_SCCP_SSN_SMLC_BSSAP = 252, OSMO_SCCP_SSN_BSS_OAM = 253, + OSMO_SCCP_SSN_BSSAP = 254, }; extern const struct value_string osmo_sccp_ssn_names[]; diff --git a/src/sccp_sap.c b/src/sccp_sap.c index e5addb1..3646685 100644 --- a/src/sccp_sap.c +++ b/src/sccp_sap.c @@ -126,9 +126,10 @@ { OSMO_SCCP_SSN_SGSN_MAP, "SGSN_MAP" }, { OSMO_SCCP_SSN_GGSN_MAP, "GGSN_MAP" }, { OSMO_SCCP_SSN_PCAP, "PCAP" }, - { OSMO_SCCP_SSN_BSC_BSSAP, "BSC_BSSAP" }, - { OSMO_SCCP_SSN_MSC_BSSAP, "MSC_BSSAP" }, + { OSMO_SCCP_SSN_BSC_BSSAP_LE, "BSC_BSSAP_LE" }, + { OSMO_SCCP_SSN_MSC_BSSAP_LE, "MSC_BSSAP_LE" }, { OSMO_SCCP_SSN_SMLC_BSSAP, "SMLC_BSSAP" }, { OSMO_SCCP_SSN_BSS_OAM, "BSS_OAM" }, + { OSMO_SCCP_SSN_BSSAP, "BSSAP" }, { 0, NULL } }; -- To view, visit https://gerrit.osmocom.org/3775 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iccec75cfc0cf16bd717a9bd4606d1e772c332ccc Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:13:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 21:13:02 +0000 Subject: osmo-sgsn[master]: jenkins: fix build: remove unused dependencies In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice81f8541eda2cd5beeacbfd481f3e4283211331 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:13:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 21:13:03 +0000 Subject: [MERGED] osmo-sgsn[master]: jenkins: fix build: remove unused dependencies In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: fix build: remove unused dependencies ...................................................................... jenkins: fix build: remove unused dependencies Change-Id: Ice81f8541eda2cd5beeacbfd481f3e4283211331 --- M contrib/jenkins.sh 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..2882989 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,9 +27,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ice81f8541eda2cd5beeacbfd481f3e4283211331 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:13:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 21:13:12 +0000 Subject: osmo-msc[master]: jenkins: fix build: osmo-mgw from master, not pre_release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I86a50c523ab04d96575aade624daa5a2f9fd6d83 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 3 21:13:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 3 Sep 2017 21:13:14 +0000 Subject: [MERGED] osmo-msc[master]: jenkins: fix build: osmo-mgw from master, not pre_release In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: fix build: osmo-mgw from master, not pre_release ...................................................................... jenkins: fix build: osmo-mgw from master, not pre_release pre_release is gone, we need to build from master now. Change-Id: I86a50c523ab04d96575aade624daa5a2f9fd6d83 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7380189..a7313c5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,7 @@ osmo-build-dep.sh libosmo-sccp PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw pre_release # move to 'master' once the split is complete +osmo-build-dep.sh osmo-mgw if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/3778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I86a50c523ab04d96575aade624daa5a2f9fd6d83 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:38:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:38:04 +0000 Subject: [PATCH] osmo-mgw[master]: drop files unrelated to osmo-mgw Message-ID: Review at https://gerrit.osmocom.org/3780 drop files unrelated to osmo-mgw These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-mgw. The ctrl_test_runner.py from openbsc.git still sticks around, but osmo-bsc_mgcp has no CTRL interface (yet). If it gets one, we can re-add the ctrl_test_runner. Change-Id: I623ba8c053bef91a327e58de214e05f0d6768605 --- D doc/BS11-OML.txt D doc/call-routing.txt D doc/channel_release.txt D doc/e1-data-model.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/bscs.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/gsm-hopping.txt D doc/handover.txt D doc/ipa-sccp.txt D doc/oml-interface.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt D include/openbsc/gsm_04_14.h D include/openbsc/iu_dummy.h D src/libmsc/gsm_04_14.c M tests/Makefile.am D tests/ctrl_test_runner.py D tools/hlrstat.pl 28 files changed, 0 insertions(+), 1,977 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/80/3780/1 diff --git a/doc/BS11-OML.txt b/doc/BS11-OML.txt deleted file mode 100644 index e5c3299..0000000 --- a/doc/BS11-OML.txt +++ /dev/null @@ -1,31 +0,0 @@ -The Siemens BS-11 supports the following additional GSM 12.21 OML operations: - - -CREATE OBJECT - -abis_om_fom_hdr.obj_class can be -A3: -A5: ALCO, BBSIG, CCLK, GPSU, LI, PA -A8: EnvaBTSE -A9: BPORT - -the abis_om_obj_inst.trx_nr field indicates the index of object, whereas the -abis_om_fom_hdr.bts_nr indicates the type of the object. - -enum abis_bs11_objtype { - BS11_OBJ_ALCO = 0x01, - BS11_OBJ_BBSIG = 0x02, /* obj_class: 0,1 */ - BS11_OBJ_TRX1 = 0x03, /* only DEACTIVATE TRX1 */ - BS11_OBJ_CCLK = 0x04, - BS11_OBJ_GPSU = 0x06, - BS11_OBJ_LI = 0x07, - BS11_OBJ_PA = 0x09, /* obj_class: 0, 1*/ -}; - -In case of CREATE ENVABTSE, the abis_om_obj_inst.trx_nr indicates the EnvaBTSEx -number. - -In case of A9 (CREAETE BPORT), the abis_om_obj_inst.bts_nr indicates which BPORT -shall be used. - - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/channel_release.txt b/doc/channel_release.txt deleted file mode 100644 index c9cdfeb..0000000 --- a/doc/channel_release.txt +++ /dev/null @@ -1,95 +0,0 @@ - -GSM 04.08 7.1.7 / 9.1.7 RR CHANNEL RELESE - -RSL 08.58 3.4 / ? RLL Link Release Request - -RSL 08.58 4.6 / 8.4.5 DEACTivate SACCH - * Deactivate SACCH according to Channel Release Proc 04.08 - * to be sent after RR CHANNEL RELEASE is sent to MS - -RSL 08.58 4.7 / 8.4.14 RF CHANnel RELease - * tells the BTS to release a radio channel - * "when an activated radio channel is no longer needed" - * BTS responds with RF CHANnel RELease ACKnowledge - - -GSM 04.08 3.4.13: RR connection release procedure - -* network sends RR CHANNEL RELEASE to MS on the DCCH - * start T3109 - * deactivate SACCH -* MS disconnects main signalling link (by sending DISC) - * all other data links are disconnected by local end link release -* network receives DISC (BTS sends RLL REL IND to BSC) - * stop T3109 - * start T3111 -* when T3111 times out, the network can reuse the channls -* if T3109 times out, the network deactivates the channels - and can reuse them - * this probably means simply RF CHANnel RELease - - -== Implementation in OpenBSC == - -There are two possible reasons a gsm_subscriber_connection -will be released. One is a network failure, the other is -the completion of an operation/transaction. - -=== Failure === -The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback -and the MSC part will release all transactions, operations and such -and the channels will be released as error case. - -=== Success === -Every time an 'operation' or 'transaction' is finished msc_release_connection -will be called and it will determine if the gsm_subscriber_connection can -be released. - -In case it can be released bsc_api.c:gsm0808_clear will be called -which will release all lchan's associated with the connection. For the -primary channel a SACH Deactivate will be send with the release -reason NORMAL RELEASE. - - -bsc_api.c:gsm0808_clear - * Release a channel used for handover - * Release the primary lchan with normal release, SACH deactivate - -chan_alloc.c:lchan_release(chan, sacch_deactivate, reason) - * Start the release procedure. It is working in steps with callbacks - coming from the abis_rsl.c code. - * Release all SAPI's > 0 as local end (The BTS should send a - REL_CONF a message) - * Send SACH Deactivate on SAPI=0 if required. - * Start T3109 (stop it when the main signalling link is disconnected) - or when the channel released. On timeout start the error handling. - * abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are - released and after T3111 has timed out or there is an error. - -RX of RELease INDication: - * Calls internal rsl_handle_release which might release the RF. - -RX of RELease CONFirmation: - * Calls internal rsl_handle_release which might release the RF. - -* RX of RF_CHAN_REL_ACK - * call lchan_free() - - -=== Integration with SMS === - -* RX of CP_ERROR or unimplemented MT - * trigger trans_free() which will msc_release_connection() - -* CP TC1* expired while waiting for CP-ACK - * trigger trans_free() which will msc_release_connection() - -* RX of RP_ERROR - * trigger trans_free() which will msc_release_connection() - -* TX of CP-ACK in MT DELIVER - * trigger trans_free() which will msc_release_connection() - -* RX of CP-ACK in MO SUBMIT - * trigger trans_free() which will msc_release_connection() - diff --git a/doc/e1-data-model.txt b/doc/e1-data-model.txt deleted file mode 100644 index 509004f..0000000 --- a/doc/e1-data-model.txt +++ /dev/null @@ -1,172 +0,0 @@ -E1 related data model - -This data model describes the physical relationship of the individual -parts in the network, it is not the logical/protocol side of the GSM -network. - -A BTS is connected to the BSC by some physical link. It could be an actual -E1 link, but it could also be abis-over-IP with a mixture of TCP and RTP/UDP. - -To further complicate the fact, multiple BTS can share one such pysical -link. On a single E1 line, we can easily accomodate up to three BTS with -two TRX each. - -Thus, it is best for OpenBSC to have some kind of abstraction layer. The BSC's -view of a BTS connected to it. We call this 'bts_link'. A bts_link can be -* all the TCP and UDP streams of a Abis-over-IP BTS -* a set of E1 timeslots for OML, RSL and TRAU connections on a E1 link -* a serial line exclusively used for OML messages (T-Link) - -A bts_link can be registered with the OpenBSC core at runtime. - -struct trx_link { - struct gsm_bts_trx *trx; -}; - -struct bts_link { - struct gsm_bts *bts; - struct trx_link trx_links[NUM_TRX]; -}; - -Interface from stack to input core: -====================================================================== -int abis_rsl_sendmsg(struct msgb *msg); - send a message through a RSL link to the TRX specified by the caller in - msg->trx. - -int abis_rsl_rcvmsg(struct msgb *msg); - receive a message from a RSL link from the TRX specified by the - caller in msg->trx. - -int abis_nm_sendmsg(struct msgb *msg); - send a message through a OML link to the BTS specified by the caller in - msg->trx->bts. The caller can just use bts->c0 to get the first TRX - in a BTS. (OML messages are not really sent to a TRX but to the BTS) - -int abis_nm_rcvmsg(struct msgb *msg); - receive a message from a OML link from the BTS specified by the caller - in msg->trx->bts. The caller can just use bts->c0 to get the first - TRX in a BTS. - -int abis_link_event(int event, void *data); - signal some event (such as layer 1 connect/disconnect) from the - input core to the stack. - -int subch_demux_in(mx, const uint8_t *data, int len); - receive 'len' bytes from a given E1 timeslot (TRAU frames) - -int subchan_mux_out(mx, uint8_t *data, int len); - obtain 'len' bytes of output data to be sent on E1 timeslot - -Intrface by Input Core for Input Plugins -====================================================================== - -int btslink_register_plugin(); - - -Configuration for the E1 input module -====================================================================== - -BTS - BTS number - number of TRX - OML link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TRX - RSL link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TS - E1 line number - timeslot number - subslot number - - -E1 input module data model -====================================================================== - - -enum e1inp_sign_type { - E1INP_SIGN_NONE, - E1INP_SIGN_OML, - E1INP_SIGN_RSL, -}; - -struct e1inp_sign_link { - /* list of signalling links */ - struct llist_head list; - - enum e1inp_sign_type type; - - /* trx for msg->trx of received msgs */ - struct gsm_bts_trx *trx; - - /* msgb queue of to-be-transmitted msgs */ - struct llist_head tx_list; - - /* SAPI and TEI on the E1 TS */ - uint8_t sapi; - uint8_t tei; -} - -enum e1inp_ts_type { - E1INP_TS_TYPE_NONE, - E1INP_TS_TYPE_SIGN, - E1INP_TS_TYPE_TRAU, -}; - -/* A timeslot in the E1 interface */ -struct e1inp_ts { - enum e1inp_ts_type type; - struct e1inp_line *line; - union { - struct { - struct llist_head sign_links; - } sign; - struct { - /* subchannel demuxer for frames from E1 */ - struct subch_demux demux; - /* subchannel muxer for frames to E1 */ - struct subch_mux mux; - } trau; - }; - union { - struct { - /* mISDN driver has one fd for each ts */ - struct osmo_fd; - } misdn; - } driver; -}; - -struct e1inp_line { - unsigned int num; - char *name; - - struct e1inp_ts ts[NR_E1_TS]; - - char *e1inp_driver; - void *driver_data; -}; - -/* Call from the Stack: configuration of this TS has changed */ -int e1inp_update_ts(struct e1inp_ts *ts); - -/* Receive a packet from the E1 driver */ -int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, - uint8_t tei, uint8_t sapi); - -/* Send a packet, callback function in the driver */ -int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg) - - -struct e1inp_driver { - const char *name; - int (*want_write)(struct e1inp_ts *ts); -}; diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg deleted file mode 100644 index 7c10e9d..0000000 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ /dev/null @@ -1,101 +0,0 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login -! -e1_input - e1_line 0 driver ipa -network - network country code 1 - mobile network code 1 - short name OsmoBSC - long name OsmoBSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - neci 1 - paging any use tch 0 - rrlp mode none - mm info 1 - handover 0 - handover window rxlev averaging 10 - handover window rxqual averaging 1 - handover window rxlev neighbor averaging 10 - handover power budget interval 6 - handover power budget hysteresis 3 - handover maximum distance 9999 - bts 0 - type nanobts - band DCS1800 - cell_identity 0 - location_area_code 1 - training_sequence_code 7 - base_station_id_code 63 - ms max power 15 - cell reselection hysteresis 4 - rxlev access min 0 - channel allocator ascending - rach tx integer 9 - rach max transmission 7 - dtx uplink force - dtx downlink - ip.access unit_id 0 0 - oml ip.access stream_id 255 line 0 - neighbor-list mode manual-si5 - neighbor-list add arfcn 100 - neighbor-list add arfcn 200 - si5 neighbor-list add arfcn 10 - si5 neighbor-list add arfcn 20 - gprs mode none - trx 0 - rf_locked 0 - arfcn 871 - nominal power 23 - max_power_red 20 - rsl e1 tei 0 - timeslot 0 - phys_chan_config CCCH+SDCCH4 - hopping enabled 0 - timeslot 1 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 2 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 3 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 4 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 5 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 6 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 7 - phys_chan_config TCH/F - hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote - ip.access rtp-base 4000 - timeout-ping 20 - timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name -bsc - no access-list-name - access-list-name bsc-list diff --git a/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg deleted file mode 100644 index d36179d..0000000 --- a/doc/examples/osmo-bsc_nat/black-list.cfg +++ /dev/null @@ -1 +0,0 @@ -678012512671923:6:6: diff --git a/doc/examples/osmo-bsc_nat/bscs.cfg b/doc/examples/osmo-bsc_nat/bscs.cfg deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.cfg +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg deleted file mode 100644 index e835e06..0000000 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ /dev/null @@ -1,66 +0,0 @@ -! -! OsmoBSCNAT (0.12.0.266-2daa9) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level rll notice - logging level cc notice - logging level mm notice - logging level rr notice - logging level rsl notice - logging level nm info - logging level mncc notice - logging level pag notice - logging level meas notice - logging level sccp notice - logging level msc notice - logging level mgcp notice - logging level ho notice - logging level db notice - logging level ref notice - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level llc debug - logging level sndcp debug - logging level nat notice - logging level ctrl notice - logging level smpp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -mgcp - bind ip 0.0.0.0 - bind port 2427 - rtp bts-base 4000 - rtp net-base 16000 - rtp ip-dscp 0 - no rtcp-omit - sdp audio-payload number 126 - sdp audio-payload name AMR/8000 - loop 0 - number endpoints 1 - call-agent ip 127.0.0.1 - rtp transcoder-base 0 - transcoder-remote-base 4000 -nat - msc ip 127.0.0.1 - msc port 5000 - timeout auth 2 - timeout ping 20 - timeout pong 5 - ip-dscp 0 - bscs-config-file bscs.cfg - access-list bla imsi-allow ^11$ diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg deleted file mode 100644 index 15fd74a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg +++ /dev/null @@ -1,44 +0,0 @@ -! -! OsmoGbProxy (UNKNOWN) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -ns - nse 666 nsvci 666 - nse 666 remote-role sgsn -! nse 666 encapsulation framerelay-gre -! nse 666 remote-ip 172.16.1.70 -! nse 666 fr-dlci 666 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-port 23000 -! encapsulation framerelay-gre enabled 1 -gbproxy - sgsn nsei 666 - core-mobile-country-code 666 - core-mobile-network-code 6 - core-access-point-name none match-imsi ^666066|^66607 - tlli-list max-length 200 diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg deleted file mode 100644 index 0c3917a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty -!! -! -line vty - no login -! -gbproxy - sgsn nsei 101 -ns - nse 101 nsvci 101 - nse 101 remote-role sgsn - nse 101 encapsulation udp - nse 101 remote-ip 192.168.100.239 - nse 101 remote-port 7777 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation framerelay-gre enabled 0 - encapsulation framerelay-gre local-ip 0.0.0.0 - encapsulation udp local-port 23000 diff --git a/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt deleted file mode 100644 index 9c65f92..0000000 --- a/doc/examples/osmo-gtphub/gtphub-example.txt +++ /dev/null @@ -1,90 +0,0 @@ -Here is a simple setup to test GTPHub operations. The IP addresses picked will -work well only on a system that creates local addresses (127.0.0.123) on the -fly (like linux) -- you may pick of course different IP addresses. - -Overview of the example setup: - - sgsnemu gtphub ggsn - 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 - -Prerequisites: openggsn. - -Have a local directory where you store config files and from which you launch -the GSNs and the hub (they will store restart counter files in that dir). -In it, have these config files: - -ggsn.conf: - - # GGSN local address - listen 127.0.0.2 - - # End User Addresses are picked from this range - net 10.23.42.0/24 - - pcodns1 8.8.8.8 - - logfile /tmp/foo - -gtphub.conf: - - gtphub - bind-to-sgsns 127.0.0.3 - bind-to-ggsns 127.0.0.4 - ggsn-proxy 127.0.0.2 - end - - -( -You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX -address and GGSN IP address to /etc/hosts something like: - - 127.0.0.2 internet.mnc070.mcc901.gprs - -) - - -Once the config files are in place, start the programs, in separate terminals. -GGSN and SGSN need to be started with root priviliges to be able to create tun -interfaces. GTPHub may run as unprivileged user. - -The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. - - -1. GGSN: - - sudo -s - cd - LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf - -2. GTPHub: - - cd - path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level - -3. SGSN tests: - - sudo -s - cd - /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --imsi 420001214365100 --contexts=3 - -Add more SGSNs using different IMSIs and local ports (if the same IMSI is used, -the GGSN will reuse TEIs and tunnels will be discarded automatically): - - /usr/local/bin/sgsnemu --createif -l 127.0.0.11 -r 127.0.0.3 --imsi 420001214365300 --contexts=3 - -This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu -still needs some effort to announce a mobile subscriber or the like (I have -used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). - -The core capability of GTPHub is to manage more than two GSNs, e.g. an SGSN -contacting various GGSNs over the single GTPHub link. You would configure the -SGSN to use one fixed GGSN (sending to gtphub) and gtphub will resolve the -GGSNs once it has received the messages. So the SGSN may be behind NAT (add -"sgsn-use-sender" to gtphub.conf) and communicate to various GGSNs over a -single link to gtphub. - -I hope this helps to get you going. -Any suggestions/patches are welcome! - -~Neels - diff --git a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg deleted file mode 100644 index 3913d2c..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! -! This file is used for VTY tests, referenced by openbsc/osmoappdesc.py -! For the test, try to use most config commands. -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, both on one interface. - ! The side towards SGSN uses nonstandard ports. - bind-to-sgsns ctrl 127.0.0.1 12123 user 127.0.0.1 12153 - ! The GGSN side with standard ports. - bind-to-ggsns 127.0.0.1 - - ! Proxy: unconditionally direct all traffic to... - sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg deleted file mode 100644 index 0dc4150..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, each on standard ports - ! 2123 and 2152. Setting these addresses is mandatory. - bind-to-sgsns 127.0.0.1 - bind-to-ggsns 127.0.0.2 - - ! Local nonstandard ports or separate IPs: - !bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223 - - ! Proxy: unconditionally direct all traffic to... - !ggsn-proxy 127.0.0.3 - !sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - !ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - !grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg deleted file mode 100644 index 1b1d192..0000000 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! OsmoMSC configuration saved from vty -! -line vty - no login -! -network - network country code 1 - mobile network code 1 - short name OsmoMSC - long name OsmoMSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - rrlp mode none - mm info 1 -msc - mgcpgw remote-ip 10.23.24.1 - assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg deleted file mode 100644 index 5e64342..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ /dev/null @@ -1,27 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy accept-all -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg deleted file mode 100644 index 06f035f..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ /dev/null @@ -1,29 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy remote - gsup remote-ip 127.0.0.1 - gsup remote-port 4222 -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/handover.txt b/doc/handover.txt deleted file mode 100644 index ac19e87..0000000 --- a/doc/handover.txt +++ /dev/null @@ -1,89 +0,0 @@ -Ideas about a handover algorithm -====================================================================== - -This is mostly based on the results presented in Chapter 8 of "Performance -Enhancements in a Frequency Hopping GSM Network" by Thomas Toftegaard Nielsen -and Joeroen Wigard. - - -=== Reasons for performing handover === - -Section 2.1.1: Handover used in their CAPACITY simulation: - -1) Interference Handover - -Average RXLEV is satisfactory high, but average RXQUAL too low indicates -interference to the channel. Handover should be made. - -2) Bad Quality - -Averaged RXQUAL is lower than a threshold - -3) Low Level / Signal Strength - -Average RXLEV is lower than a threshold - -4) Distance Handover - -MS is too far away from a cell (measured by TA) - -5) Power budget / Better Cell - -RX Level of neighbor cell is at least "HO Margin dB" dB better than the -current serving cell. - -=== Ideal parameters for HO algorithm === - -Chapter 8, Section 2.2, Table 24: - -Window RXLEV averaging: 10 SACCH frames (no weighting) -Window RXQUAL averaging: 1 SACCH frame (no averaging) -Level Threashold: 1 of the last 1 AV-RXLEV values < -110dBm -Quality Threshold: 3 of the last 4 AV-RXQUAL values >= 5 -Interference Threshold: 1 of the last AV-RXLEV > -85 dBm & - 3 of the last 4 AV-RXQUAL values >= 5 -Power Budget: Level of neighbor cell > 3 dB better -Power Budget Interval: Every 6 SACCH frames (6 seconds ?!?) -Distance Handover: Disabled -Evaluation rule 1: RXLEV of the candidate cell a tleast -104 dBm -Evaluation rule 2: Level of candidate cell > 3dB better own cell -Timer Successful HO: 5 SACCH frames -Timer Unsuccessful HO: 1 SACCH frame - -In a non-frequency hopping case, RXQUAL threshold can be decreased to -RXLEV >= 4 - -When frequency hopping is enabled, the following additional parameters -should be introduced: - -* No intra-cell handover -* Use a HO Margin of 2dB - -=== Handover Channel Reservation === - -In loaded network, each cell should reserve some channels for handovers, -rather than using all of them for new call establishment. This reduces the -need to drop calls due to failing handovers, at the expense of failing new call -attempts. - -=== Dynamic HO Margin === - -The handover margin (hysteresis) should depend on the RXQUAL. Optimal results -were achieved with the following settings: -* RXQUAL <= 4: 9 dB -* RXQUAL == 5: 6 dB -* RXQUAL >= 6: 1 dB - - - -== Actual Handover on a protocol level == - -After the BSC has decided a handover shall be done, it has to - -# allocate a channel at the new BTS -# allocate a handover reference -# activate the channel on the BTS side using RSL CHANNEL ACTIVATION, - indicating the HO reference -# BTS responds with CHAN ACT ACK, including GSM frame number -# BSC sends 04.08 HO CMD to MS using old BTS - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/oml-interface.txt b/doc/oml-interface.txt deleted file mode 100644 index 02bead7..0000000 --- a/doc/oml-interface.txt +++ /dev/null @@ -1,22 +0,0 @@ -oml interface design notes - -problems: - -* there is no way how to tag a command sent to the BTS, with the response - having the same tag to identify the originator of the command -* therefore, we can have e.g. both the BSC and the OML interface send a - SET ATTRIBUTE message, where the responses would end up at the wrong - query. -* The BTS has 10s to ACK/NACK a command. We do not run any timers. - -the only possible solutions i can imagine: -* have some kind of exclusive locking, where the OML interface gets blocked - from the BSC and is exclusively assigned to the OML console until all commands - of the OML console have terminated. This can either be done explicitly - dynamically or on demand - -* use the OML interface synchronously, i.e. always wait for the response from - the BTS before - -* unilateral / unsolicited messages need to be broadcasted to both the BSC and - the OML console diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h deleted file mode 100644 index 3cdbe04..0000000 --- a/include/openbsc/gsm_04_14.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode); -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs); -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology); - -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h deleted file mode 100644 index d5e1428..0000000 --- a/include/openbsc/iu_dummy.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include - -struct msgb; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -struct ranap_ue_conn_ctx { - struct llist_head list; - uint32_t conn_id; -}; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi); -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck); -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c deleted file mode 100644 index b529f4c..0000000 --- a/src/libmsc/gsm_04_14.c +++ /dev/null @@ -1,133 +0,0 @@ -/* GSM MS Testing Layer 3 messages - * 3GPP TS 44.014 / GSM TS 04.14 */ - -/* (C) 2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include "bscconfig.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static struct msgb *create_gsm0414_msg(uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_TEST; - gh->msg_type = msg_type; - return msg; -} - -static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - return msc_tx_dtap(conn, msg); -} - -static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) -{ - struct msgb *msg = create_gsm0414_msg(msg_type); - - return gsm0414_conn_sendmsg(conn, msg); -} - - -/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); - uint8_t subch; - - subch = (loop_mode << 1); - msgb_put_u8(msg, subch); - - msg->lchan = conn->lchan; - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a OPEN_LOOP_CMD according to Section 8.3 */ -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); -} - -/* Send a ACT_EMMI_CMD according to Section 8.8 */ -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); -} - -/* Send a DEACT_EMMI_CMD according to Section 8.10 */ -int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); -} - -/* Send a TEST_INTERFACE according to Section 8.11 */ -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); - msgb_put_u8(msg, tested_devs); - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); - msgb_put_u8(msg, technology); - return gsm0414_conn_sendmsg(conn, msg); -} - - - -/* Entry point for incoming GSM48_PDISC_TEST received from MS */ -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - - if (msgb_l3len(msg) < sizeof(*gh)) - return -1; - - LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", - get_value_string(gsm414_msgt_names, gh->msg_type)); - - return 0; -} diff --git a/tests/Makefile.am b/tests/Makefile.am index 4a1f27a..f6cb938 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,7 +25,6 @@ $(srcdir)/package.m4 \ $(TESTSUITE) \ vty_test_runner.py \ - ctrl_test_runner.py \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -39,7 +38,6 @@ osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v $(PYTHON) $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v - $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py deleted file mode 100644 index 2e59e13..0000000 --- a/tests/ctrl_test_runner.py +++ /dev/null @@ -1,575 +0,0 @@ -#!/usr/bin/env python - -# (C) 2013 by Jacob Erlbeck -# (C) 2014 by Holger Hans Peter Freyther -# based on vty_test_runner.py: -# (C) 2013 by Katerina Barone-Adesi -# (C) 2013 by Holger Hans Peter Freyther -# based on bsc_control.py. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import os -import time -import unittest -import socket -import sys -import struct - -import osmopy.obscvty as obscvty -import osmopy.osmoutil as osmoutil - -# add $top_srcdir/contrib to find ipa.py -sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) - -from ipa import Ctrl, IPA - -# to be able to find $top_srcdir/doc/... -confpath = os.path.join(sys.path[0], '..') -verbose = False - -class TestCtrlBase(unittest.TestCase): - - def ctrl_command(self): - raise Exception("Needs to be implemented by a subclass") - - def ctrl_app(self): - raise Exception("Needs to be implemented by a subclass") - - def setUp(self): - osmo_ctrl_cmd = self.ctrl_command()[:] - config_index = osmo_ctrl_cmd.index('-c') - if config_index: - cfi = config_index + 1 - osmo_ctrl_cmd[cfi] = os.path.join(confpath, osmo_ctrl_cmd[cfi]) - - try: - self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) - except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" - time.sleep(2) - - appstring = self.ctrl_app()[2] - appport = self.ctrl_app()[0] - self.connect("127.0.0.1", appport) - self.next_id = 1000 - - def tearDown(self): - self.disconnect() - osmoutil.end_proc(self.proc) - - def disconnect(self): - if not (self.sock is None): - self.sock.close() - - def connect(self, host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - retries = 30 - while True: - try: - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - except IOError: - retries -= 1 - if retries <= 0: - raise - time.sleep(.1) - continue - break - self.sock = sck - return sck - - def send(self, data): - if verbose: - print "Sending \"%s\"" %(data) - data = Ctrl().add_header(data) - return self.sock.send(data) == len(data) - - def send_set(self, var, value, id): - setmsg = "SET %s %s %s" %(id, var, value) - return self.send(setmsg) - - def send_get(self, var, id): - getmsg = "GET %s %s" %(id, var) - return self.send(getmsg) - - def do_set(self, var, value): - id = self.next_id - self.next_id += 1 - self.send_set(var, value, id) - return self.recv_msgs()[id] - - def do_get(self, var): - id = self.next_id - self.next_id += 1 - self.send_get(var, id) - return self.recv_msgs()[id] - - def recv_msgs(self): - responses = {} - data = self.sock.recv(4096) - while (len(data)>0): - (head, data) = IPA().split_combined(data) - answer = Ctrl().rem_header(head) - if verbose: - print "Got message:", answer - (mtype, id, msg) = answer.split(None, 2) - id = int(id) - rsp = {'mtype': mtype, 'id': id} - if mtype == "ERROR": - rsp['error'] = msg - else: - split = msg.split(None, 1) - rsp['var'] = split[0] - if len(split) > 1: - rsp['value'] = split[1] - else: - rsp['value'] = None - responses[id] = rsp - - if verbose: - print "Decoded replies: ", responses - - return responses - - -class TestCtrlBSC(TestCtrlBase): - - def tearDown(self): - TestCtrlBase.tearDown(self) - os.unlink("tmp_dummy_sock") - - def ctrl_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-r", "tmp_dummy_sock", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] - - def ctrl_app(self): - return (4249, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") - - def testCtrlErrs(self): - r = self.do_get('invalid') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Command not found') - - r = self.do_set('rf_locked', '999') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Value failed verification.') - - r = self.do_get('bts') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Error while parsing the index.') - - r = self.do_get('bts.999') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Error while resolving object') - - def testBtsLac(self): - r = self.do_get('bts.0.location-area-code') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.location-area-code') - self.assertEquals(r['value'], '1') - - r = self.do_set('bts.0.location-area-code', '23') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.location-area-code') - self.assertEquals(r['value'], '23') - - r = self.do_get('bts.0.location-area-code') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.location-area-code') - self.assertEquals(r['value'], '23') - - r = self.do_set('bts.0.location-area-code', '-1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Input not within the range') - - def testBtsCi(self): - r = self.do_get('bts.0.cell-identity') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.cell-identity') - self.assertEquals(r['value'], '0') - - r = self.do_set('bts.0.cell-identity', '23') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.cell-identity') - self.assertEquals(r['value'], '23') - - r = self.do_get('bts.0.cell-identity') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.cell-identity') - self.assertEquals(r['value'], '23') - - r = self.do_set('bts.0.cell-identity', '-1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Input not within the range') - - def testBtsGenerateSystemInformation(self): - r = self.do_get('bts.0.send-new-system-informations') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Write Only attribute') - - # No RSL links so it will fail - r = self.do_set('bts.0.send-new-system-informations', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Failed to generate SI') - - def testBtsChannelLoad(self): - r = self.do_set('bts.0.channel-load', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Read Only attribute') - - # No RSL link so everything is 0 - r = self.do_get('bts.0.channel-load') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['value'], - 'CCCH+SDCCH4,0,0 TCH/F,0,0 TCH/H,0,0 SDCCH8,0,0' - + ' TCH/F_PDCH,0,0 CCCH+SDCCH4+CBCH,0,0' - + ' SDCCH8+CBCH,0,0 TCH/F_TCH/H_PDCH,0,0') - - def testBtsOmlConnectionState(self): - """Check OML state. It will not be connected""" - r = self.do_set('bts.0.oml-connection-state', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Read Only attribute') - - # No RSL link so everything is 0 - r = self.do_get('bts.0.oml-connection-state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['value'], 'disconnected') - - def testTrxPowerRed(self): - r = self.do_get('bts.0.trx.0.max-power-reduction') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction') - self.assertEquals(r['value'], '20') - - r = self.do_set('bts.0.trx.0.max-power-reduction', '22') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction') - self.assertEquals(r['value'], '22') - - r = self.do_get('bts.0.trx.0.max-power-reduction') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction') - self.assertEquals(r['value'], '22') - - r = self.do_set('bts.0.trx.0.max-power-reduction', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Value must be even') - - def testTrxArfcn(self): - r = self.do_get('bts.0.trx.0.arfcn') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.arfcn') - self.assertEquals(r['value'], '871') - - r = self.do_set('bts.0.trx.0.arfcn', '873') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.arfcn') - self.assertEquals(r['value'], '873') - - r = self.do_get('bts.0.trx.0.arfcn') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.arfcn') - self.assertEquals(r['value'], '873') - - r = self.do_set('bts.0.trx.0.arfcn', '2000') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Input not within the range') - - def testRfLock(self): - r = self.do_get('bts.0.rf_state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.rf_state') - self.assertEquals(r['value'], 'inoperational,unlocked,on') - - r = self.do_set('rf_locked', '1') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], '1') - - time.sleep(1.5) - - r = self.do_get('bts.0.rf_state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.rf_state') - self.assertEquals(r['value'], 'inoperational,locked,off') - - r = self.do_get('rf_locked') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], 'state=off,policy=off') - - r = self.do_set('rf_locked', '0') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], '0') - - time.sleep(1.5) - - r = self.do_get('bts.0.rf_state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.rf_state') - self.assertEquals(r['value'], 'inoperational,unlocked,on') - - r = self.do_get('rf_locked') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], 'state=off,policy=on') - - def testTimezone(self): - r = self.do_get('timezone') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], 'off') - - r = self.do_set('timezone', '-2,15,2') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], '-2,15,2') - - r = self.do_get('timezone') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], '-2,15,2') - - # Test invalid input - r = self.do_set('timezone', '-2,15,2,5,6,7') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], '-2,15,2') - - r = self.do_set('timezone', '-2,15') - self.assertEquals(r['mtype'], 'ERROR') - r = self.do_set('timezone', '-2') - self.assertEquals(r['mtype'], 'ERROR') - r = self.do_set('timezone', '1') - - r = self.do_set('timezone', 'off') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], 'off') - - r = self.do_get('timezone') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], 'off') - - def testMcc(self): - r = self.do_set('mcc', '23') - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '23') - - r = self.do_set('mcc', '023') - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '23') - - def testMnc(self): - r = self.do_set('mnc', '9') - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '9') - - r = self.do_set('mnc', '09') - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '9') - - - def testMccMncApply(self): - # Test some invalid input - r = self.do_set('mcc-mnc-apply', 'WRONG') - self.assertEquals(r['mtype'], 'ERROR') - - r = self.do_set('mcc-mnc-apply', '1,') - self.assertEquals(r['mtype'], 'ERROR') - - r = self.do_set('mcc-mnc-apply', '200,3') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - # Set it again - r = self.do_set('mcc-mnc-apply', '200,3') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Nothing changed') - - # Change it - r = self.do_set('mcc-mnc-apply', '200,4') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - # Change it - r = self.do_set('mcc-mnc-apply', '201,4') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - # Verify - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '4') - - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '201') - - # Change it - r = self.do_set('mcc-mnc-apply', '202,03') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '3') - - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '202') - -class TestCtrlNAT(TestCtrlBase): - - def ctrl_command(self): - return ["./src/osmo-bsc_nat/osmo-bsc_nat", "-c", - "doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"] - - def ctrl_app(self): - return (4250, "./src/osmo-bsc_nat/osmo-bsc_nat", "OsmoNAT", "nat") - - def testAccessList(self): - r = self.do_get('net.0.bsc_cfg.0.access-list-name') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], None) - - r = self.do_set('net.0.bsc_cfg.0.access-list-name', 'bla') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], 'bla') - - r = self.do_get('net.0.bsc_cfg.0.access-list-name') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], 'bla') - - r = self.do_set('net.0.bsc_cfg.0.no-access-list-name', '1') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], None) - - r = self.do_get('net.0.bsc_cfg.0.access-list-name') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], None) - - def testAccessListManagement(self): - r = self.do_set("net.0.add.allow.access-list.404", "abc") - self.assertEquals(r['mtype'], 'ERROR') - - r = self.do_set("net.0.add.allow.access-list.bla", "^234$") - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'net.0.add.allow.access-list.bla') - self.assertEquals(r['value'], 'IMSI allow added to access list') - - # TODO.. find a way to actually see if this rule has been - # added. e.g. by implementing a get for the list. - -class TestCtrlSGSN(TestCtrlBase): - def ctrl_command(self): - return ["./src/gprs/osmo-sgsn", "-c", - "doc/examples/osmo-sgsn/osmo-sgsn.cfg"] - - def ctrl_app(self): - return (4251, "./src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn") - - def testListSubscribers(self): - # TODO. Add command to mark a subscriber as active - r = self.do_get('subscriber-list-active-v1') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'subscriber-list-active-v1') - self.assertEquals(r['value'], None) - -def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): - print("Skipping the BSC test") - return - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlBSC) - suite.addTest(test) - -def add_nat_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc_nat/osmo-bsc_nat")): - print("Skipping the NAT test") - return - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlNAT) - suite.addTest(test) - -def add_sgsn_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/gprs/osmo-sgsn")): - print("Skipping the SGSN test") - return - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlSGSN) - suite.addTest(test) - -if __name__ == '__main__': - import argparse - import sys - - workdir = '.' - - parser = argparse.ArgumentParser() - parser.add_argument("-v", "--verbose", dest="verbose", - action="store_true", help="verbose mode") - parser.add_argument("-p", "--pythonconfpath", dest="p", - help="searchpath for config") - parser.add_argument("-w", "--workdir", dest="w", - help="Working directory") - args = parser.parse_args() - - verbose_level = 1 - if args.verbose: - verbose_level = 2 - verbose = True - - if args.w: - workdir = args.w - - if args.p: - confpath = args.p - - print "confpath %s, workdir %s" % (confpath, workdir) - os.chdir(workdir) - print "Running tests for specific control commands" - suite = unittest.TestSuite() - add_bsc_test(suite, workdir) - add_nat_test(suite, workdir) - add_sgsn_test(suite, workdir) - res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) - sys.exit(len(res.errors) + len(res.failures)) diff --git a/tools/hlrstat.pl b/tools/hlrstat.pl deleted file mode 100755 index 668fc9a..0000000 --- a/tools/hlrstat.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -use strict; -use DBI; -my $dbh = DBI->connect("dbi:SQLite:dbname=hlr.sqlite3","",""); - - -my %mcc_names; -my %mcc_mnc_names; - -sub get_mcc_mnc_name($) -{ - my $mcc_mnc = shift; - my $ret = $mcc_mnc; - - if ($mcc_mnc_names{$mcc_mnc} ne '') { - $ret = $mcc_mnc_names{$mcc_mnc}; - } - - return $ret; -} - -sub read_networks($) -{ - my $filename = shift; - my $cur_name; - - open(INFILE, $filename); - while (my $l = ) { - chomp($l); - if ($l =~ /^#/) { - next; - } - if ($l =~ /^\t/) { - my ($mcc, $mnc, $brand, $r) = split(' ', $l, 4); - #printf("%s|%s|%s\n", $mcc, $mnc, $brand); - $mcc_mnc_names{"$mcc-$mnc"} = $brand; - $mcc_names{$mcc} = $cur_name; - } elsif ($l =~ /^(\w\w)\t(.*)/) { - #printf("%s|%s\n", $1, $2); - $cur_name = $2; - } - } - close(INFILE); -} - -read_networks("networks.tab"); - -my %oper_count; -my %country_count; - -#my $sth = $dbh->prepare("SELECT imsi FROM subscriber where authorized=1"); -my $sth = $dbh->prepare("SELECT imsi FROM subscriber"); - -$sth->execute(); - -while (my $href = $sth->fetchrow_hashref) { - my ($mcc, $mnc) = $$href{imsi} =~ /(\d{3})(\d{2}).*/; - #printf("%s %s-%s \n", $$href{imsi}, $mcc, $mnc); - $oper_count{"$mcc-$mnc"}++; - $country_count{$mcc}++; -} - - -foreach my $c (sort{$country_count{$b} <=> $country_count{$a}} keys %country_count) { - printf("%s: %d\n", $mcc_names{$c}, $country_count{$c}); - - foreach my $k (sort{$oper_count{$b} <=> $oper_count{$a}} keys %oper_count) { - if ($k =~ /^$c-/) { - printf("\t%s: %d\n", get_mcc_mnc_name($k), $oper_count{$k}); - } - } -} -- To view, visit https://gerrit.osmocom.org/3780 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I623ba8c053bef91a327e58de214e05f0d6768605 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:38:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:38:04 +0000 Subject: [PATCH] osmo-mgw[master]: debian: fix VCS links, tweak descriptions and copyright Message-ID: Review at https://gerrit.osmocom.org/3781 debian: fix VCS links, tweak descriptions and copyright Change-Id: I4a444cf40839c20a0d3d5237f9d4d01d71e01d60 --- M debian/control M debian/copyright 2 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/81/3781/1 diff --git a/debian/control b/debian/control index a1e4704..af49dc7 100644 --- a/debian/control +++ b/debian/control @@ -9,9 +9,9 @@ libosmocore-dev, libosmo-netif-dev Standards-Version: 3.9.8 -Vcs-Git: git://git.osmocom.org/osmo-iuh.git -Vcs-Browser: https://git.osmocom.org/osmo-iuh/ -Homepage: https://projects.osmocom.org/projects/osmohnbgw +Vcs-Git: git://git.osmocom.org/osmo-mgw.git +Vcs-Browser: https://git.osmocom.org/osmo-mgw/ +Homepage: https://osmocom.org/projects/osmo-mgw Package: osmo-mgw Architecture: any @@ -32,18 +32,18 @@ Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks +Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library Package: libosmo-legacy-mgcp-dbg Section: debug Architecture: any Multi-Arch: same Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks +Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library Package: libosmo-legacy-mgcp-dev Section: libdevel Architecture: any Multi-Arch: same Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks +Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library diff --git a/debian/copyright b/debian/copyright index f1dada2..83e29df 100644 --- a/debian/copyright +++ b/debian/copyright @@ -6,7 +6,7 @@ Copyright: 2009-2014 On-Waves 2009-2015 Holger Hans Peter Freyther 2013 Jacob Erlbeck - 2016 sysmocom s.m.f.c. GmbH + 2016-2017 sysmocom s.m.f.c. GmbH License: AGPL-3.0+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by -- To view, visit https://gerrit.osmocom.org/3781 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a444cf40839c20a0d3d5237f9d4d01d71e01d60 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:38:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:38:04 +0000 Subject: [PATCH] osmo-mgw[master]: rewrite README Message-ID: Review at https://gerrit.osmocom.org/3782 rewrite README Change-Id: I84cba73b4366c6b403f7da587f46cf621e58c33f --- M README 1 file changed, 21 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/82/3782/1 diff --git a/README b/README index d01b2cf..7f55fe6 100644 --- a/README +++ b/README @@ -1,39 +1,28 @@ -About OpenBSC +About OsmoMGW ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoMGW originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoMGW was one of the parts split off from the old openbsc.git. It originated +as a solution to merely navigate RTP streams through a NAT, but has since +matured to a Media Gateway implementation that is capable of streaming RTP for +2G (AoIP) and 3G (IuCS) GSM networks as well as (still not implemented at time +of writing) transcoding between TRAU, various RTP payloads and IuUP. -Various interfaces towards the BTS are supported, among which are: +The OsmoMGW program exposes an MGCP interface towards clients like OsmoMSC and +OsmoBSC, and receives and sends RTP streams as configured via MGCP. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. +The libosmo-mgcp-client library exposes utilities used by e.g. OsmoMSC (found +in osmo-msc.git) to instruct OsmoMGW via its MGCP service. - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. +The libosmo-mgcp library exposes MGCP server utilities used by e.g. OsmoBSC-NAT +(found in osmo-bsc.git) to navigate RTP streams through a NAT. +(At time of writing, this is still called libosmo-legacy-mgcp.) - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoMGW issue tracker and wiki online at +https://osmocom.org/projects/osmo-mgw +https://osmocom.org/projects/osmo-mgw/wiki -- To view, visit https://gerrit.osmocom.org/3782 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84cba73b4366c6b403f7da587f46cf621e58c33f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:38:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:38:05 +0000 Subject: [PATCH] osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code Message-ID: Review at https://gerrit.osmocom.org/3783 separate libosmo-mgcp-client from mgcp server code osmo-{msc,bsc} need only MGCP client code, to not require them to link the unused libgsm, this MGCP client code should be separate from the MGCP server code. The mgcp client code does use some definitions from mgcp.h and mgcp_common.c. For simplicity, link mgcp_common.c in both libosmo-legacy-mgcp as well as libosmo-mgcp-client. That means it is not possible to link both libosmo-legacy-mgcp and libosmo-mgcp-client in the same binary because of duplicate symbols, but currently that is sufficient. (An alternative would be code dup or yet another libosmo-mgcp-common library.) Add libosmo-mgcp-client to debian packaging. Related: OS#2488 Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 --- M Makefile.am M configure.ac M debian/control M debian/rules M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/mgcp_client/Makefile.am R include/osmocom/mgcp_client/mgcpgw_client.h R include/osmocom/mgcp_client/mgcpgw_client_internal.h A libosmo-mgcp-client.pc.in M src/Makefile.am M src/libosmo-legacy-mgcp/Makefile.am A src/libosmo-mgcp-client/Makefile.am R src/libosmo-mgcp-client/mgcpgw_client.c R src/libosmo-mgcp-client/mgcpgw_client_vty.c M tests/Makefile.am M tests/legacy_mgcp/Makefile.am A tests/mgcp_client/Makefile.am R tests/mgcp_client/mgcpgw_client_test.c R tests/mgcp_client/mgcpgw_client_test.err R tests/mgcp_client/mgcpgw_client_test.ok M tests/testsuite.at 23 files changed, 133 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/83/3783/1 diff --git a/Makefile.am b/Makefile.am index c5c3137..8fb6e6c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,10 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libosmo-legacy-mgcp.pc +pkgconfig_DATA = \ + libosmo-legacy-mgcp.pc \ + libosmo-mgcp-client.pc \ + $(NULL) BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 5482b8c..86c3bc5 100644 --- a/configure.ac +++ b/configure.ac @@ -118,15 +118,19 @@ AC_OUTPUT( libosmo-legacy-mgcp.pc + libosmo-mgcp-client.pc include/Makefile include/osmocom/Makefile include/osmocom/legacy_mgcp/Makefile + include/osmocom/mgcp_client/Makefile src/Makefile src/libosmo-legacy-mgcp/Makefile + src/libosmo-mgcp-client/Makefile src/osmo-bsc_mgcp/Makefile tests/Makefile tests/atlocal tests/legacy_mgcp/Makefile + tests/mgcp_client/Makefile doc/Makefile doc/examples/Makefile contrib/Makefile diff --git a/debian/control b/debian/control index af49dc7..6556370 100644 --- a/debian/control +++ b/debian/control @@ -47,3 +47,25 @@ Multi-Arch: same Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library + +Package: libosmo-mgcp-client0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities + +Package: libosmo-mgcp-client-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities + +Package: libosmo-mgcp-client-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities diff --git a/debian/rules b/debian/rules index ee680cc..8976ede 100755 --- a/debian/rules +++ b/debian/rules @@ -32,3 +32,4 @@ override_dh_strip: dh_strip --dbg-package=osmo-mgw-dbg dh_strip --dbg-package=libosmo-legacy-mgcp-dbg + dh_strip --dbg-package=libosmo-mgcp-client-dbg diff --git a/include/Makefile.am b/include/Makefile.am index 73b1b3e..e2baf41 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,6 +5,6 @@ nobase_include_HEADERS = \ osmocom/legacy_mgcp/mgcp.h \ osmocom/legacy_mgcp/mgcp_internal.h \ - osmocom/legacy_mgcp/mgcpgw_client.h \ osmocom/legacy_mgcp/osmux.h \ + osmocom/mgcp_client/mgcpgw_client.h \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am index 6514436..be9f1ca 100644 --- a/include/osmocom/Makefile.am +++ b/include/osmocom/Makefile.am @@ -1,3 +1,4 @@ SUBDIRS = \ legacy_mgcp \ + mgcp_client \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/Makefile.am b/include/osmocom/legacy_mgcp/Makefile.am index 52f0b5b..4a9550c 100644 --- a/include/osmocom/legacy_mgcp/Makefile.am +++ b/include/osmocom/legacy_mgcp/Makefile.am @@ -1,5 +1,4 @@ noinst_HEADERS = \ - mgcpgw_client_internal.h \ mgcp_transcode.h \ vty.h \ $(NULL) diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am new file mode 100644 index 0000000..224a7dc --- /dev/null +++ b/include/osmocom/mgcp_client/Makefile.am @@ -0,0 +1,3 @@ +noinst_HEADERS = \ + mgcpgw_client_internal.h \ + $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client.h b/include/osmocom/mgcp_client/mgcpgw_client.h similarity index 100% rename from include/osmocom/legacy_mgcp/mgcpgw_client.h rename to include/osmocom/mgcp_client/mgcpgw_client.h diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client_internal.h b/include/osmocom/mgcp_client/mgcpgw_client_internal.h similarity index 100% rename from include/osmocom/legacy_mgcp/mgcpgw_client_internal.h rename to include/osmocom/mgcp_client/mgcpgw_client_internal.h diff --git a/libosmo-mgcp-client.pc.in b/libosmo-mgcp-client.pc.in new file mode 100644 index 0000000..aee86dc --- /dev/null +++ b/libosmo-mgcp-client.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom Media Gateway Control Protocol Client library +Description: C Utility Library +Version: @VERSION@ +Libs: -L${libdir} -losmo-mgcp-client +Cflags: -I${includedir}/ diff --git a/src/Makefile.am b/src/Makefile.am index f47bc00..922bbda 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libosmo-legacy-mgcp \ + libosmo-mgcp-client \ $(NULL) # Programs diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 42f25c0..32902b9 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -41,8 +41,6 @@ mgcp_vty.c \ mgcp_osmux.c \ mgcp_sdp.c \ - mgcpgw_client.c \ - mgcpgw_client_vty.c \ $(NULL) if BUILD_MGCP_TRANSCODING libosmo_legacy_mgcp_la_SOURCES += \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am new file mode 100644 index 0000000..02b9177 --- /dev/null +++ b/src/libosmo-mgcp-client/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_builddir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMONETIF_LIBS) \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +# This is _NOT_ the library release version, it's an API version. +# Please read Chapter 6 "Library interface versions" of the libtool +# documentation before making any modification +MGCP_CLIENT_LIBVERSION=1:0:0 + +lib_LTLIBRARIES = \ + libosmo-mgcp-client.la \ + $(NULL) + +libosmo_mgcp_client_la_SOURCES = \ + mgcpgw_client.c \ + mgcpgw_client_vty.c \ + ../libosmo-legacy-mgcp/mgcp_common.c \ + $(NULL) + +libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client.c b/src/libosmo-mgcp-client/mgcpgw_client.c similarity index 99% rename from src/libosmo-legacy-mgcp/mgcpgw_client.c rename to src/libosmo-mgcp-client/mgcpgw_client.c index 810ba16..7ed4b07 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client.c +++ b/src/libosmo-mgcp-client/mgcpgw_client.c @@ -24,10 +24,10 @@ #include #include -#include #include #include -#include +#include +#include #include #include diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client_vty.c b/src/libosmo-mgcp-client/mgcpgw_client_vty.c similarity index 98% rename from src/libosmo-legacy-mgcp/mgcpgw_client_vty.c rename to src/libosmo-mgcp-client/mgcpgw_client_vty.c index d101ded..034c84c 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client_vty.c +++ b/src/libosmo-mgcp-client/mgcpgw_client_vty.c @@ -28,7 +28,7 @@ #include #include -#include +#include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/Makefile.am b/tests/Makefile.am index f6cb938..ae51f89 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ legacy_mgcp \ + mgcp_client \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/legacy_mgcp/Makefile.am b/tests/legacy_mgcp/Makefile.am index e5f6888..f043124 100644 --- a/tests/legacy_mgcp/Makefile.am +++ b/tests/legacy_mgcp/Makefile.am @@ -20,13 +20,10 @@ EXTRA_DIST = \ mgcp_test.ok \ mgcp_transcoding_test.ok \ - mgcpgw_client_test.ok \ - mgcpgw_client_test.err \ $(NULL) noinst_PROGRAMS = \ mgcp_test \ - mgcpgw_client_test \ $(NULL) if BUILD_MGCP_TRANSCODING noinst_PROGRAMS += \ @@ -61,17 +58,4 @@ $(LIBOSMONETIF_LIBS) \ $(LIBRARY_GSM) \ -lm \ - $(NULL) - -mgcpgw_client_test_SOURCES = \ - mgcpgw_client_test.c \ - $(NULL) - -mgcpgw_client_test_LDADD = \ - $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBRARY_DL) \ - $(LIBOSMONETIF_LIBS) \ - $(LIBRARY_GSM) \ $(NULL) diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am new file mode 100644 index 0000000..2253770 --- /dev/null +++ b/tests/mgcp_client/Makefile.am @@ -0,0 +1,38 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + mgcpgw_client_test.ok \ + mgcpgw_client_test.err \ + $(NULL) + +noinst_PROGRAMS = \ + mgcpgw_client_test \ + $(NULL) + +mgcpgw_client_test_SOURCES = \ + mgcpgw_client_test.c \ + $(NULL) + +mgcpgw_client_test_LDADD = \ + $(top_builddir)/src/libosmo-mgcp-client/libosmo-mgcp-client.la \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBRARY_DL) \ + $(LIBOSMONETIF_LIBS) \ + $(NULL) diff --git a/tests/legacy_mgcp/mgcpgw_client_test.c b/tests/mgcp_client/mgcpgw_client_test.c similarity index 97% rename from tests/legacy_mgcp/mgcpgw_client_test.c rename to tests/mgcp_client/mgcpgw_client_test.c index 51d5272..e90a4ed 100644 --- a/tests/legacy_mgcp/mgcpgw_client_test.c +++ b/tests/mgcp_client/mgcpgw_client_test.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include void *ctx; diff --git a/tests/legacy_mgcp/mgcpgw_client_test.err b/tests/mgcp_client/mgcpgw_client_test.err similarity index 100% rename from tests/legacy_mgcp/mgcpgw_client_test.err rename to tests/mgcp_client/mgcpgw_client_test.err diff --git a/tests/legacy_mgcp/mgcpgw_client_test.ok b/tests/mgcp_client/mgcpgw_client_test.ok similarity index 100% rename from tests/legacy_mgcp/mgcpgw_client_test.ok rename to tests/mgcp_client/mgcpgw_client_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index dd59f2c..37347b3 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -14,9 +14,9 @@ AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcp_transcoding_test], [], [expout], [ignore]) AT_CLEANUP -AT_SETUP([legacy_mgcpgw_client]) -AT_KEYWORDS([legacy_mgcpgw_client]) -cat $abs_srcdir/legacy_mgcp/mgcpgw_client_test.ok > expout -cat $abs_srcdir/legacy_mgcp/mgcpgw_client_test.err > experr -AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcpgw_client_test], [], [expout], [experr]) +AT_SETUP([mgcpgw_client]) +AT_KEYWORDS([mgcpgw_client]) +cat $abs_srcdir/mgcp_client/mgcpgw_client_test.ok > expout +cat $abs_srcdir/mgcp_client/mgcpgw_client_test.err > experr +AT_CHECK([$abs_top_builddir/tests/mgcp_client/mgcpgw_client_test], [], [expout], [experr]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:38:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:38:05 +0000 Subject: [PATCH] osmo-mgw[master]: rename mgcpgw_client_* to mgcp_client_* Message-ID: Review at https://gerrit.osmocom.org/3784 rename mgcpgw_client_* to mgcp_client_* The name "mgcpgw_client" referred to an MGCP gateway, which is rather an MGW (Media Gateway). But this client code is more generally a client for the MGCP protocol, independently from what the server program is called. Rename the files as well as the function prefixes to drop the "gw". It is purely cosmetic and not strictly necessary, but a good point in time for fixes like this. osmo-msc build will be adjusted by I093ad02ca0e532f659447c785e09678b3e6f220d. osmo-bsc build will be adjusted by I6402c7cbe58dacae7630f7f03819f8102e54c699. These should be applied right after this here is merged to avoid fallout. Change-Id: I99f7faab637cfcc22ece64a1dbcbe590f2042187 --- M include/Makefile.am M include/osmocom/mgcp_client/Makefile.am A include/osmocom/mgcp_client/mgcp_client.h R include/osmocom/mgcp_client/mgcp_client_internal.h D include/osmocom/mgcp_client/mgcpgw_client.h M src/libosmo-mgcp-client/Makefile.am R src/libosmo-mgcp-client/mgcp_client.c R src/libosmo-mgcp-client/mgcp_client_vty.c M tests/mgcp_client/Makefile.am R tests/mgcp_client/mgcp_client_test.c R tests/mgcp_client/mgcp_client_test.err R tests/mgcp_client/mgcp_client_test.ok M tests/testsuite.at 13 files changed, 175 insertions(+), 175 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/84/3784/1 diff --git a/include/Makefile.am b/include/Makefile.am index e2baf41..94d74bb 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -6,5 +6,5 @@ osmocom/legacy_mgcp/mgcp.h \ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ - osmocom/mgcp_client/mgcpgw_client.h \ + osmocom/mgcp_client/mgcp_client.h \ $(NULL) diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 224a7dc..24401f1 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -1,3 +1,3 @@ noinst_HEADERS = \ - mgcpgw_client_internal.h \ + mgcp_client_internal.h \ $(NULL) diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h new file mode 100644 index 0000000..df73811 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -0,0 +1,73 @@ +#pragma once + +#include + +#define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" +#define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 +#define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" +#define MGCP_CLIENT_REMOTE_PORT_DEFAULT 2427 + +struct msgb; +struct vty; +struct mgcp_client; + +struct mgcp_client_conf { + const char *local_addr; + int local_port; + const char *remote_addr; + int remote_port; + uint16_t first_endpoint; + uint16_t last_endpoint; + uint16_t bts_base; +}; + +typedef unsigned int mgcp_trans_id_t; + +struct mgcp_response_head { + int response_code; + mgcp_trans_id_t trans_id; + const char *comment; +}; + +struct mgcp_response { + char *body; + struct mgcp_response_head head; + uint16_t audio_port; +}; + +void mgcp_client_conf_init(struct mgcp_client_conf *conf); +void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); +int mgcp_client_config_write(struct vty *vty, const char *indent); +struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp); + +struct mgcp_client *mgcp_client_init(void *ctx, + struct mgcp_client_conf *conf); +int mgcp_client_connect(struct mgcp_client *mgcp); + +const char *mgcp_client_remote_addr_str(struct mgcp_client *mgcp); +uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp); +uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp); + +int mgcp_client_next_endpoint(struct mgcp_client *client); +void mgcp_client_release_endpoint(uint16_t id, struct mgcp_client *client); + +/* Invoked when an MGCP response is received or sending failed. When the + * response is passed as NULL, this indicates failure during transmission. */ +typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv); +int mgcp_response_parse_params(struct mgcp_response *r); + +int mgcp_client_tx(struct mgcp_client *mgcp, struct msgb *msg, + mgcp_response_cb_t response_cb, void *priv); + +enum mgcp_connection_mode; + +struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, + uint16_t rtp_endpoint, unsigned int call_id, + enum mgcp_connection_mode mode); + +struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, + uint16_t rtp_endpoint, const char *rtp_conn_addr, + uint16_t rtp_port, enum mgcp_connection_mode mode); + +struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, + unsigned int call_id); diff --git a/include/osmocom/mgcp_client/mgcpgw_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h similarity index 69% rename from include/osmocom/mgcp_client/mgcpgw_client_internal.h rename to include/osmocom/mgcp_client/mgcp_client_internal.h index d3a7849..1b149e2 100644 --- a/include/osmocom/mgcp_client/mgcpgw_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -2,8 +2,8 @@ #define MSGB_CB_MGCP_TRANS_ID 0 -struct mgcpgw_client { - struct mgcpgw_client_conf actual; +struct mgcp_client { + struct mgcp_client_conf actual; uint32_t remote_addr; struct osmo_wqueue wq; mgcp_trans_id_t next_trans_id; @@ -24,10 +24,10 @@ void *priv; }; -int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg); +int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg); -struct mgcp_response_pending * mgcpgw_client_pending_add( - struct mgcpgw_client *mgcp, +struct mgcp_response_pending * mgcp_client_pending_add( + struct mgcp_client *mgcp, mgcp_trans_id_t trans_id, mgcp_response_cb_t response_cb, void *priv); diff --git a/include/osmocom/mgcp_client/mgcpgw_client.h b/include/osmocom/mgcp_client/mgcpgw_client.h deleted file mode 100644 index 09db816..0000000 --- a/include/osmocom/mgcp_client/mgcpgw_client.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -#include - -#define MGCPGW_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" -#define MGCPGW_CLIENT_LOCAL_PORT_DEFAULT 0 -#define MGCPGW_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" -#define MGCPGW_CLIENT_REMOTE_PORT_DEFAULT 2427 - -struct msgb; -struct vty; -struct mgcpgw_client; - -struct mgcpgw_client_conf { - const char *local_addr; - int local_port; - const char *remote_addr; - int remote_port; - uint16_t first_endpoint; - uint16_t last_endpoint; - uint16_t bts_base; -}; - -typedef unsigned int mgcp_trans_id_t; - -struct mgcp_response_head { - int response_code; - mgcp_trans_id_t trans_id; - const char *comment; -}; - -struct mgcp_response { - char *body; - struct mgcp_response_head head; - uint16_t audio_port; -}; - -void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf); -void mgcpgw_client_vty_init(void *talloc_ctx, int node, struct mgcpgw_client_conf *conf); -int mgcpgw_client_config_write(struct vty *vty, const char *indent); -struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp); - -struct mgcpgw_client *mgcpgw_client_init(void *ctx, - struct mgcpgw_client_conf *conf); -int mgcpgw_client_connect(struct mgcpgw_client *mgcp); - -const char *mgcpgw_client_remote_addr_str(struct mgcpgw_client *mgcp); -uint16_t mgcpgw_client_remote_port(struct mgcpgw_client *mgcp); -uint32_t mgcpgw_client_remote_addr_n(struct mgcpgw_client *mgcp); - -int mgcpgw_client_next_endpoint(struct mgcpgw_client *client); -void mgcpgw_client_release_endpoint(uint16_t id, struct mgcpgw_client *client); - -/* Invoked when an MGCP response is received or sending failed. When the - * response is passed as NULL, this indicates failure during transmission. */ -typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv); -int mgcp_response_parse_params(struct mgcp_response *r); - -int mgcpgw_client_tx(struct mgcpgw_client *mgcp, struct msgb *msg, - mgcp_response_cb_t response_cb, void *priv); - -enum mgcp_connection_mode; - -struct msgb *mgcp_msg_crcx(struct mgcpgw_client *mgcp, - uint16_t rtp_endpoint, unsigned int call_id, - enum mgcp_connection_mode mode); - -struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp, - uint16_t rtp_endpoint, const char *rtp_conn_addr, - uint16_t rtp_port, enum mgcp_connection_mode mode); - -struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint, - unsigned int call_id); diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 02b9177..dbbd303 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -29,8 +29,8 @@ $(NULL) libosmo_mgcp_client_la_SOURCES = \ - mgcpgw_client.c \ - mgcpgw_client_vty.c \ + mgcp_client.c \ + mgcp_client_vty.c \ ../libosmo-legacy-mgcp/mgcp_common.c \ $(NULL) diff --git a/src/libosmo-mgcp-client/mgcpgw_client.c b/src/libosmo-mgcp-client/mgcp_client.c similarity index 85% rename from src/libosmo-mgcp-client/mgcpgw_client.c rename to src/libosmo-mgcp-client/mgcp_client.c index 7ed4b07..b72fc50 100644 --- a/src/libosmo-mgcp-client/mgcpgw_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -36,10 +36,10 @@ #include #include -void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf) +void mgcp_client_conf_init(struct mgcp_client_conf *conf) { - /* NULL and -1 default to MGCPGW_CLIENT_*_DEFAULT values */ - *conf = (struct mgcpgw_client_conf){ + /* NULL and -1 default to MGCP_CLIENT_*_DEFAULT values */ + *conf = (struct mgcp_client_conf){ .local_addr = NULL, .local_port = -1, .remote_addr = NULL, @@ -51,7 +51,7 @@ } /* Test if a given endpoint id is currently in use */ -static bool endpoint_in_use(uint16_t id, struct mgcpgw_client *client) +static bool endpoint_in_use(uint16_t id, struct mgcp_client *client) { struct mgcp_inuse_endpoint *endpoint; llist_for_each_entry(endpoint, &client->inuse_endpoints, entry) { @@ -63,7 +63,7 @@ } /* Find and seize an unsused endpoint id */ -int mgcpgw_client_next_endpoint(struct mgcpgw_client *client) +int mgcp_client_next_endpoint(struct mgcp_client *client) { int i; uint16_t first_endpoint = client->actual.first_endpoint; @@ -96,7 +96,7 @@ } /* Release a seized endpoint id to make it available again for other calls */ -void mgcpgw_client_release_endpoint(uint16_t id, struct mgcpgw_client *client) +void mgcp_client_release_endpoint(uint16_t id, struct mgcp_client *client) { struct mgcp_inuse_endpoint *endpoint; struct mgcp_inuse_endpoint *endpoint_tmp; @@ -108,9 +108,9 @@ } } -static void mgcpgw_client_handle_response(struct mgcpgw_client *mgcp, - struct mgcp_response_pending *pending, - struct mgcp_response *response) +static void mgcp_client_handle_response(struct mgcp_client *mgcp, + struct mgcp_response_pending *pending, + struct mgcp_response *response) { if (!pending) { LOGP(DLMGCP, LOGL_ERROR, @@ -226,8 +226,8 @@ return 0; } -static struct mgcp_response_pending *mgcpgw_client_response_pending_get( - struct mgcpgw_client *mgcp, +static struct mgcp_response_pending *mgcp_client_response_pending_get( + struct mgcp_client *mgcp, struct mgcp_response *r) { struct mgcp_response_pending *pending; @@ -248,7 +248,7 @@ * mgcp_do_read that reads from the socket connected to the MGCP gateway. This * function is published mainly to be able to feed data from the test suite. */ -int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg) +int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg) { struct mgcp_response r = { 0 }; struct mgcp_response_pending *pending; @@ -260,7 +260,7 @@ return -1; } - pending = mgcpgw_client_response_pending_get(mgcp, &r); + pending = mgcp_client_response_pending_get(mgcp, &r); if (!pending) { LOGP(DLMGCP, LOGL_ERROR, "Cannot find matching MGCP transaction for trans_id %d\n", @@ -268,13 +268,13 @@ return -1; } - mgcpgw_client_handle_response(mgcp, pending, &r); + mgcp_client_handle_response(mgcp, pending, &r); return 0; } static int mgcp_do_read(struct osmo_fd *fd) { - struct mgcpgw_client *mgcp = fd->data; + struct mgcp_client *mgcp = fd->data; struct msgb *msg; int ret; @@ -296,7 +296,7 @@ } msg->l2h = msgb_put(msg, ret); - ret = mgcpgw_client_rx(mgcp, msg); + ret = mgcp_client_rx(mgcp, msg); talloc_free(msg); return ret; } @@ -327,12 +327,12 @@ return ret; } -struct mgcpgw_client *mgcpgw_client_init(void *ctx, - struct mgcpgw_client_conf *conf) +struct mgcp_client *mgcp_client_init(void *ctx, + struct mgcp_client_conf *conf) { - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; - mgcp = talloc_zero(ctx, struct mgcpgw_client); + mgcp = talloc_zero(ctx, struct mgcp_client); INIT_LLIST_HEAD(&mgcp->responses_pending); INIT_LLIST_HEAD(&mgcp->inuse_endpoints); @@ -340,14 +340,14 @@ mgcp->next_trans_id = 1; mgcp->actual.local_addr = conf->local_addr ? conf->local_addr : - MGCPGW_CLIENT_LOCAL_ADDR_DEFAULT; + MGCP_CLIENT_LOCAL_ADDR_DEFAULT; mgcp->actual.local_port = conf->local_port >= 0 ? (uint16_t)conf->local_port : - MGCPGW_CLIENT_LOCAL_PORT_DEFAULT; + MGCP_CLIENT_LOCAL_PORT_DEFAULT; mgcp->actual.remote_addr = conf->remote_addr ? conf->remote_addr : - MGCPGW_CLIENT_REMOTE_ADDR_DEFAULT; + MGCP_CLIENT_REMOTE_ADDR_DEFAULT; mgcp->actual.remote_port = conf->remote_port >= 0 ? (uint16_t)conf->remote_port : - MGCPGW_CLIENT_REMOTE_PORT_DEFAULT; + MGCP_CLIENT_REMOTE_PORT_DEFAULT; mgcp->actual.first_endpoint = conf->first_endpoint > 0 ? (uint16_t)conf->first_endpoint : 0; mgcp->actual.last_endpoint = conf->last_endpoint > 0 ? (uint16_t)conf->last_endpoint : 0; @@ -356,7 +356,7 @@ return mgcp; } -int mgcpgw_client_connect(struct mgcpgw_client *mgcp) +int mgcp_client_connect(struct mgcp_client *mgcp) { int on; struct sockaddr_in addr; @@ -434,24 +434,24 @@ return rc; } -const char *mgcpgw_client_remote_addr_str(struct mgcpgw_client *mgcp) +const char *mgcp_client_remote_addr_str(struct mgcp_client *mgcp) { return mgcp->actual.remote_addr; } -uint16_t mgcpgw_client_remote_port(struct mgcpgw_client *mgcp) +uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp) { return mgcp->actual.remote_port; } /* Return the MGCP GW binary IPv4 address in network byte order. */ -uint32_t mgcpgw_client_remote_addr_n(struct mgcpgw_client *mgcp) +uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp) { return mgcp->remote_addr; } -struct mgcp_response_pending * mgcpgw_client_pending_add( - struct mgcpgw_client *mgcp, +struct mgcp_response_pending * mgcp_client_pending_add( + struct mgcp_client *mgcp, mgcp_trans_id_t trans_id, mgcp_response_cb_t response_cb, void *priv) @@ -472,8 +472,8 @@ * mgcp_response_parse_params(response) to get the parsed parameters -- to * potentially save some CPU cycles, only the head line has been parsed when * the response_cb is invoked. */ -int mgcpgw_client_tx(struct mgcpgw_client *mgcp, struct msgb *msg, - mgcp_response_cb_t response_cb, void *priv) +int mgcp_client_tx(struct mgcp_client *mgcp, struct msgb *msg, + mgcp_response_cb_t response_cb, void *priv) { struct mgcp_response_pending *pending; mgcp_trans_id_t trans_id; @@ -487,7 +487,7 @@ return -EINVAL; } - pending = mgcpgw_client_pending_add(mgcp, trans_id, response_cb, priv); + pending = mgcp_client_pending_add(mgcp, trans_id, response_cb, priv); if (msgb_l2len(msg) > 4096) { LOGP(DLMGCP, LOGL_ERROR, @@ -510,7 +510,7 @@ mgcp_tx_error: /* Pass NULL to response cb to indicate an error */ - mgcpgw_client_handle_response(mgcp, pending, NULL); + mgcp_client_handle_response(mgcp, pending, NULL); return -1; } @@ -562,7 +562,7 @@ return mgcp_msg_from_buf(trans_id, compose, len); } -static mgcp_trans_id_t mgcpgw_client_next_trans_id(struct mgcpgw_client *mgcp) +static mgcp_trans_id_t mgcp_client_next_trans_id(struct mgcp_client *mgcp) { /* avoid zero trans_id to distinguish from unset trans_id */ if (!mgcp->next_trans_id) @@ -570,11 +570,11 @@ return mgcp->next_trans_id ++; } -struct msgb *mgcp_msg_crcx(struct mgcpgw_client *mgcp, +struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode) { - mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp); + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); return mgcp_msg_from_str(trans_id, "CRCX %u %x at mgw MGCP 1.0\r\n" "C: %x\r\n" @@ -587,12 +587,12 @@ mgcp_cmode_name(mode)); } -struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp, +struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode) { - mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp); + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); return mgcp_msg_from_str(trans_id, "MDCX %u %x at mgw MGCP 1.0\r\n" "M: %s\r\n" @@ -607,16 +607,16 @@ rtp_port); } -struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint, +struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id) { - mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp); + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); return mgcp_msg_from_str(trans_id, "DLCX %u %x at mgw MGCP 1.0\r\n" "C: %x\r\n", trans_id, rtp_endpoint, call_id); } -struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp) +struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; } diff --git a/src/libosmo-mgcp-client/mgcpgw_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c similarity index 74% rename from src/libosmo-mgcp-client/mgcpgw_client_vty.c rename to src/libosmo-mgcp-client/mgcp_client_vty.c index 034c84c..1e8bba6 100644 --- a/src/libosmo-mgcp-client/mgcpgw_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -28,23 +28,23 @@ #include #include -#include +#include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" -void *global_mgcpgw_client_ctx = NULL; -struct mgcpgw_client_conf *global_mgcpgw_client_conf = NULL; +void *global_mgcp_client_ctx = NULL; +struct mgcp_client_conf *global_mgcp_client_conf = NULL; DEFUN(cfg_mgcpgw_local_ip, cfg_mgcpgw_local_ip_cmd, "mgcpgw local-ip A.B.C.D", MGCPGW_STR "local bind to connect to MGCP gateway with\n" "local bind IP address\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - OSMO_ASSERT(global_mgcpgw_client_ctx); - global_mgcpgw_client_conf->local_addr = - talloc_strdup(global_mgcpgw_client_ctx, argv[0]); + OSMO_ASSERT(global_mgcp_client_ctx); + global_mgcp_client_conf->local_addr = + talloc_strdup(global_mgcp_client_ctx, argv[0]); return CMD_SUCCESS; } @@ -53,9 +53,9 @@ MGCPGW_STR "local bind to connect to MGCP gateway with\n" "local bind port\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - global_mgcpgw_client_conf->local_port = atoi(argv[0]); + global_mgcp_client_conf->local_port = atoi(argv[0]); return CMD_SUCCESS; } @@ -64,11 +64,11 @@ MGCPGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind IP address\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - OSMO_ASSERT(global_mgcpgw_client_ctx); - global_mgcpgw_client_conf->remote_addr = - talloc_strdup(global_mgcpgw_client_ctx, argv[0]); + OSMO_ASSERT(global_mgcp_client_ctx); + global_mgcp_client_conf->remote_addr = + talloc_strdup(global_mgcp_client_ctx, argv[0]); return CMD_SUCCESS; } @@ -77,9 +77,9 @@ MGCPGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind port\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - global_mgcpgw_client_conf->remote_port = atoi(argv[0]); + global_mgcp_client_conf->remote_port = atoi(argv[0]); return CMD_SUCCESS; } @@ -98,8 +98,8 @@ return CMD_SUCCESS; } - global_mgcpgw_client_conf->first_endpoint = first_endpoint; - global_mgcpgw_client_conf->last_endpoint = last_endpoint; + global_mgcp_client_conf->first_endpoint = first_endpoint; + global_mgcp_client_conf->last_endpoint = last_endpoint; return CMD_SUCCESS; } @@ -112,11 +112,11 @@ BTS_START_STR UDP_PORT_STR) { - global_mgcpgw_client_conf->bts_base = atoi(argv[0]); + global_mgcp_client_conf->bts_base = atoi(argv[0]); return CMD_SUCCESS; } -int mgcpgw_client_config_write(struct vty *vty, const char *indent) +int mgcp_client_config_write(struct vty *vty, const char *indent) { const char *addr; int port; @@ -124,32 +124,32 @@ uint16_t last_endpoint; uint16_t bts_base; - addr = global_mgcpgw_client_conf->local_addr; + addr = global_mgcp_client_conf->local_addr; if (addr) vty_out(vty, "%smgcpgw local-ip %s%s", indent, addr, VTY_NEWLINE); - port = global_mgcpgw_client_conf->local_port; + port = global_mgcp_client_conf->local_port; if (port >= 0) vty_out(vty, "%smgcpgw local-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); - addr = global_mgcpgw_client_conf->remote_addr; + addr = global_mgcp_client_conf->remote_addr; if (addr) vty_out(vty, "%smgcpgw remote-ip %s%s", indent, addr, VTY_NEWLINE); - port = global_mgcpgw_client_conf->remote_port; + port = global_mgcp_client_conf->remote_port; if (port >= 0) vty_out(vty, "%smgcpgw remote-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); - first_endpoint = global_mgcpgw_client_conf->first_endpoint; - last_endpoint = global_mgcpgw_client_conf->last_endpoint; + first_endpoint = global_mgcp_client_conf->first_endpoint; + last_endpoint = global_mgcp_client_conf->last_endpoint; if (last_endpoint != 0) { vty_out(vty, "%smgcpgw endpoint-range %u %u%s", indent, first_endpoint, last_endpoint, VTY_NEWLINE); } - bts_base = global_mgcpgw_client_conf->bts_base; + bts_base = global_mgcp_client_conf->bts_base; if (bts_base) { vty_out(vty, "%smgcpgw bts-base %u%s", indent, bts_base, VTY_NEWLINE); @@ -158,10 +158,10 @@ return CMD_SUCCESS; } -void mgcpgw_client_vty_init(void *talloc_ctx, int node, struct mgcpgw_client_conf *conf) +void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf) { - global_mgcpgw_client_ctx = talloc_ctx; - global_mgcpgw_client_conf = conf; + global_mgcp_client_ctx = talloc_ctx; + global_mgcp_client_conf = conf; install_element(node, &cfg_mgcpgw_local_ip_cmd); install_element(node, &cfg_mgcpgw_local_port_cmd); diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am index 2253770..e33f0e8 100644 --- a/tests/mgcp_client/Makefile.am +++ b/tests/mgcp_client/Makefile.am @@ -17,19 +17,19 @@ $(NULL) EXTRA_DIST = \ - mgcpgw_client_test.ok \ - mgcpgw_client_test.err \ + mgcp_client_test.ok \ + mgcp_client_test.err \ $(NULL) noinst_PROGRAMS = \ - mgcpgw_client_test \ + mgcp_client_test \ $(NULL) -mgcpgw_client_test_SOURCES = \ - mgcpgw_client_test.c \ +mgcp_client_test_SOURCES = \ + mgcp_client_test.c \ $(NULL) -mgcpgw_client_test_LDADD = \ +mgcp_client_test_LDADD = \ $(top_builddir)/src/libosmo-mgcp-client/libosmo-mgcp-client.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ diff --git a/tests/mgcp_client/mgcpgw_client_test.c b/tests/mgcp_client/mgcp_client_test.c similarity index 89% rename from tests/mgcp_client/mgcpgw_client_test.c rename to tests/mgcp_client/mgcp_client_test.c index e90a4ed..6045297 100644 --- a/tests/mgcp_client/mgcpgw_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include void *ctx; @@ -71,8 +71,8 @@ return msg; } -static struct mgcpgw_client_conf conf; -struct mgcpgw_client *mgcp = NULL; +static struct mgcp_client_conf conf; +struct mgcp_client *mgcp = NULL; static void reply_to(mgcp_trans_id_t trans_id, int code, const char *comment, int conn_id, const char *params) @@ -88,7 +88,7 @@ printf("composed response:\n-----\n%s\n-----\n", compose); - mgcpgw_client_rx(mgcp, from_str(compose)); + mgcp_client_rx(mgcp, from_str(compose)); } void test_response_cb(struct mgcp_response *response, void *priv) @@ -114,7 +114,7 @@ trans_id = msg->cb[MSGB_CB_MGCP_TRANS_ID]; char *end; - OSMO_ASSERT(mgcpgw_client_pending_add(mgcp, trans_id, test_response_cb, mgcp)); + OSMO_ASSERT(mgcp_client_pending_add(mgcp, trans_id, test_response_cb, mgcp)); end = (char*)msgb_put(msg, 1); *end = '\0'; @@ -134,7 +134,7 @@ if (mgcp) talloc_free(mgcp); - mgcp = mgcpgw_client_init(ctx, &conf); + mgcp = mgcp_client_init(ctx, &conf); msg = mgcp_msg_crcx(mgcp, 23, 42, MGCP_CONN_LOOPBACK); trans_id = dummy_mgcp_send(msg); @@ -161,11 +161,11 @@ int main(int argc, char **argv) { - ctx = talloc_named_const(NULL, 1, "mgcpgw_client_test"); + ctx = talloc_named_const(NULL, 1, "mgcp_client_test"); msgb_talloc_ctx_init(ctx, 0); osmo_init_logging(&log_info); - mgcpgw_client_conf_init(&conf); + mgcp_client_conf_init(&conf); test_crcx(); diff --git a/tests/mgcp_client/mgcpgw_client_test.err b/tests/mgcp_client/mgcp_client_test.err similarity index 100% rename from tests/mgcp_client/mgcpgw_client_test.err rename to tests/mgcp_client/mgcp_client_test.err diff --git a/tests/mgcp_client/mgcpgw_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok similarity index 100% rename from tests/mgcp_client/mgcpgw_client_test.ok rename to tests/mgcp_client/mgcp_client_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index 37347b3..4f4a303 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -14,9 +14,9 @@ AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcp_transcoding_test], [], [expout], [ignore]) AT_CLEANUP -AT_SETUP([mgcpgw_client]) -AT_KEYWORDS([mgcpgw_client]) -cat $abs_srcdir/mgcp_client/mgcpgw_client_test.ok > expout -cat $abs_srcdir/mgcp_client/mgcpgw_client_test.err > experr -AT_CHECK([$abs_top_builddir/tests/mgcp_client/mgcpgw_client_test], [], [expout], [experr]) +AT_SETUP([mgcp_client]) +AT_KEYWORDS([mgcp_client]) +cat $abs_srcdir/mgcp_client/mgcp_client_test.ok > expout +cat $abs_srcdir/mgcp_client/mgcp_client_test.err > experr +AT_CHECK([$abs_top_builddir/tests/mgcp_client/mgcp_client_test], [], [expout], [experr]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99f7faab637cfcc22ece64a1dbcbe590f2042187 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:41:00 +0000 Subject: [PATCH] osmo-msc[master]: configure.ac: fix to "AC_INIT[osmo-msc]" Message-ID: Review at https://gerrit.osmocom.org/3785 configure.ac: fix to "AC_INIT[osmo-msc]" Change-Id: I3c0dea06e341ccd944448b133381a390fc500c32 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/85/3785/1 diff --git a/configure.ac b/configure.ac index 1942614..cd2af00 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT([openbsc], +AC_INIT([osmo-msc], m4_esyscmd([./git-version-gen .tarball-version]), [openbsc at lists.osmocom.org]) -- To view, visit https://gerrit.osmocom.org/3785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c0dea06e341ccd944448b133381a390fc500c32 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:41:00 +0000 Subject: [PATCH] osmo-msc[master]: --enable-iu by default Message-ID: Review at https://gerrit.osmocom.org/3786 --enable-iu by default It will be the normal way of building to include support for IuCS. If for some reason osmo-iuh is not available, the user may now issue --disable-iu. Change-Id: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f --- M configure.ac 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/86/3786/1 diff --git a/configure.ac b/configure.ac index cd2af00..1b188a9 100644 --- a/configure.ac +++ b/configure.ac @@ -65,11 +65,11 @@ AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) # Enable/disable 3G aka IuPS + IuCS support? -AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], - [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) +AC_ARG_ENABLE([iu], [AS_HELP_STRING([--disable-iu], [Build without 3G support, i.e. without IuPS and IuCS interfaces])], + [osmo_ac_iu="$enableval"],[osmo_ac_iu="yes"]) if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBASN1C, libasn1c, [], [AC_MSG_ERROR(libasn1c not found. Build with --disable-iu?)]) # TODO version? + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap, [], [AC_MSG_ERROR(libosmo-ranap not found. Build with --disable-iu?)]) # TODO version? AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) fi AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -- To view, visit https://gerrit.osmocom.org/3786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:41:00 +0000 Subject: [PATCH] osmo-msc[master]: use separated libosmo-mgcp-client, apply rename to mgcp_clie... Message-ID: Review at https://gerrit.osmocom.org/3787 use separated libosmo-mgcp-client, apply rename to mgcp_client_* After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*. Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is used to contact the MGW (Media Gateway). Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d --- M configure.ac M include/openbsc/gsm_data.h M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 11 files changed, 41 insertions(+), 69 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3787/1 diff --git a/configure.ac b/configure.ac index 1b188a9..46fe5d3 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -125,33 +125,6 @@ COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" AC_SUBST([COVERAGE_CFLAGS]) AC_SUBST([COVERAGE_LDFLAGS]) -fi - -AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ - AC_CACHE_CHECK( - [whether libosmo-legacy-mgcp needs -lgsm], - libosmo_cv_legacy_mgcp_needs_libgsm, [ - SAVE_LDFLAGS="${LDFLAGS}" - LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([ - #include - ], [ - mgcpgw_client_init(0, 0); - ])], - [libosmo_cv_legacy_mgcp_needs_libgsm=no], - [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) - LDFLAGS="${SAVE_LDFLAGS}" - ]) - ]) -CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM -if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], - [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi fi AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 88a4f10..205ab6c 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include /** annotations for msgb ownership */ @@ -486,9 +486,9 @@ uint8_t t3212; struct { - struct mgcpgw_client_conf conf; - struct mgcpgw_client *client; - } mgcpgw; + struct mgcp_client_conf conf; + struct mgcp_client *client; + } mgw; struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index e473b75..3f9f231 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -401,7 +401,7 @@ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcpgw_client_remote_addr_n(gsm_network->mgcpgw.client)); + rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index e8a2293..45d2040 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -557,7 +557,7 @@ { struct gsm_network *network = a_conn_info->network; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct tlv_parsed tp; struct sockaddr_storage rtp_addr; struct sockaddr_in *rtp_addr_in; @@ -567,7 +567,7 @@ if (!conn) goto fail; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; OSMO_ASSERT(mgcp); LOGP(DMSC, LOGL_NOTICE, "BSC sends assignment complete message (conn_id=%i)\n", conn->a.conn_id); diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 90a0431..cad9d9b 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -2667,7 +2667,7 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcpgw_client_remote_addr_n(net->mgcpgw.client); + uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); uint16_t port = trans->conn->rtp.port_cn; /* FIXME: This has to be set to some meaningful value, diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 161a100..c461139 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -192,7 +192,7 @@ conn->rtp.port_cn = r->audio_port; - rtp_ip = mgcpgw_client_remote_addr_n(conn->network->mgcpgw.client); + rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ @@ -222,7 +222,7 @@ int msc_call_assignment(struct gsm_trans *trans) { struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; uint16_t bts_base; @@ -232,7 +232,7 @@ return -EINVAL; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; #ifdef BUILD_IU /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ @@ -242,14 +242,14 @@ #endif conn->rtp.mgcp_rtp_endpoint = - mgcpgw_client_next_endpoint(conn->network->mgcpgw.client); + mgcp_client_next_endpoint(conn->network->mgw.client); /* This will calculate the port we assign to the BTS via AoIP * assignment command (or rab-assignment on 3G) The BTS will send * its RTP traffic to that port on the MGCPGW side. The MGCPGW only * gets the endpoint ID via the CRCX. It will do the same calculation * on his side too to get knowledge of the rtp port. */ - bts_base = mgcpgw_client_conf_actual(mgcp)->bts_base; + bts_base = mgcp_client_conf_actual(mgcp)->bts_base; conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; /* Establish the RTP stream first as looping back to the originator. @@ -257,7 +257,7 @@ * tone instead. */ msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcpgw_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); + return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); } static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); @@ -268,7 +268,7 @@ { struct gsm_subscriber_connection *conn1 = from->conn; struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcpgw_client *mgcp = conn1->network->mgcpgw.client; + struct mgcp_client *mgcp = conn1->network->mgw.client; const char *ip; struct msgb *msg; @@ -278,13 +278,13 @@ from->bridge.state = state; /* Loop back to the same MGCP GW */ - ip = mgcpgw_client_remote_addr_str(mgcp); + ip = mgcp_client_remote_addr_str(mgcp); msg = mgcp_msg_mdcx(mgcp, conn1->rtp.mgcp_rtp_endpoint, ip, conn2->rtp.port_cn, mode); - if (mgcpgw_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) + if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(from->vsub)); @@ -346,7 +346,7 @@ * is in use */ struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; if (!trans) @@ -355,10 +355,10 @@ return -EINVAL; if (!trans->conn->network) return -EINVAL; - if (!trans->conn->network->mgcpgw.client) + if (!trans->conn->network->mgw.client) return -EINVAL; - mgcp = trans->conn->network->mgcpgw.client; + mgcp = trans->conn->network->mgw.client; struct in_addr ip_addr; ip_addr.s_addr = ntohl(ip); @@ -368,7 +368,7 @@ msg = mgcp_msg_mdcx(mgcp, conn->rtp.mgcp_rtp_endpoint, inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcpgw_client_tx(mgcp, msg, NULL, trans)) + if (mgcp_client_tx(mgcp, msg, NULL, trans)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(trans->vsub)); @@ -398,7 +398,7 @@ { struct msgb *msg; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; if (!trans) return; @@ -408,16 +408,16 @@ return; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; /* Send DLCX */ msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint); - if (mgcpgw_client_tx(mgcp, msg, NULL, NULL)) + if (mgcp_client_tx(mgcp, msg, NULL, NULL)) LOGP(DMGCP, LOGL_ERROR, "Failed to send DLCX message for %s\n", vlr_subscr_name(trans->vsub)); /* Release endpoint id */ - mgcpgw_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); + mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 50679aa..198b1dd 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -101,7 +101,7 @@ vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); - mgcpgw_client_config_write(vty, " "); + mgcp_client_config_write(vty, " "); #ifdef BUILD_IU ranap_iu_vty_config_write(vty, " "); #endif @@ -155,7 +155,7 @@ install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd); - mgcpgw_client_vty_init(msc_network, MSC_NODE, &msc_network->mgcpgw.conf); + mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf); #ifdef BUILD_IU ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index a26b4bd..85a5a5a 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -17,7 +17,7 @@ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -45,8 +45,7 @@ $(LIBSMPP34_LIBS) \ $(LIBCRYPTO_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBRARY_GSM) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ -ldbi \ $(NULL) if BUILD_IU diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 30b11d9..3dfc806 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -64,7 +64,7 @@ #include #include #include -#include +#include #ifdef BUILD_IU #include @@ -251,7 +251,7 @@ MSC_HLR_REMOTE_IP_DEFAULT); net->gsup_server_port = MSC_HLR_REMOTE_PORT_DEFAULT; - mgcpgw_client_conf_init(&net->mgcpgw.conf); + mgcp_client_conf_init(&net->mgw.conf); return net; } @@ -553,10 +553,10 @@ if (sms_queue_start(msc_network, 20) != 0) return -1; - msc_network->mgcpgw.client = mgcpgw_client_init( - msc_network, &msc_network->mgcpgw.conf); + msc_network->mgw.client = mgcp_client_init( + msc_network, &msc_network->mgw.conf); - if (mgcpgw_client_connect(msc_network->mgcpgw.client)) { + if (mgcp_client_connect(msc_network->mgw.client)) { printf("MGCPGW connect failed\n"); return 7; } diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index fb4857f..aa2b3fe 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -15,7 +15,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1d3b9da..1f8ee7b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -14,7 +14,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) EXTRA_DIST = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ -- To view, visit https://gerrit.osmocom.org/3787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:42:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:42:02 +0000 Subject: [PATCH] osmo-sgsn[master]: --enable-iu by default Message-ID: Review at https://gerrit.osmocom.org/3788 --enable-iu by default It will be the normal way of building to include support for IuPS. If for some reason osmo-iuh is not available, the user may now issue --disable-iu. Change-Id: I04b07ffead5d5394651d80711d2de06162eeed14 --- M configure.ac 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/88/3788/1 diff --git a/configure.ac b/configure.ac index a90a6ca..359c5c1 100644 --- a/configure.ac +++ b/configure.ac @@ -50,11 +50,11 @@ PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) # Enable/disable 3G aka IuPS + IuCS support? -AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], - [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) +AC_ARG_ENABLE([iu], [AS_HELP_STRING([--disable-iu], [Build without 3G support, i.e. without IuPS and IuCS interfaces])], + [osmo_ac_iu="$enableval"],[osmo_ac_iu="yes"]) if test "x$osmo_ac_iu" = "xyes" ; then - PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? - PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBASN1C, libasn1c, [], [AC_MSG_ERROR(libasn1c not found. Build with --disable-iu?)]) # TODO version? + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap, [], [AC_MSG_ERROR(libosmo-ranap not found. Build with --disable-iu?)]) # TODO version? AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) fi AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") -- To view, visit https://gerrit.osmocom.org/3788 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04b07ffead5d5394651d80711d2de06162eeed14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 00:50:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 00:50:17 +0000 Subject: [PATCH] osmo-bsc[master]: drop MGCP client from osmo-bsc Message-ID: Review at https://gerrit.osmocom.org/3789 drop MGCP client from osmo-bsc After osmo-mgw change I8e0b2d2a399b77086a36606f5e427271c6242df1, there now is a separated libosmo-mgcp-client, and osmo-bsc needs adjusting. But besides having an unused struct in gsm_network, osmo-bsc does not yet use its MGCP client; these are merely plans for the future. Until we do, let's just drop the dependency entirely. Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 --- M include/openbsc/gsm_data.h 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/89/3789/1 diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 74970b9..b21b79c 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -17,7 +17,6 @@ #include #include #include -#include /** annotations for msgb ownership */ @@ -485,11 +484,6 @@ /* Periodic location update default value */ uint8_t t3212; - - struct { - struct mgcpgw_client_conf conf; - struct mgcpgw_client *client; - } mgcpgw; struct { /* CS7 instance id number (set via VTY) */ -- To view, visit https://gerrit.osmocom.org/3789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:31:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:31:37 +0000 Subject: [PATCH] osmo-bsc[master]: prune contrib/ Message-ID: Review at https://gerrit.osmocom.org/3790 prune contrib/ Empty out contrib: remove things that are either obviously unrelated to osmo-bsc, or seem old and/or esoteric. Change-Id: Ic1805b7943e91695619f1e1e45611b1f24f25c32 --- D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/mgcp_server.py D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/systemd/osmo-bsc-mgcp.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c 35 files changed, 0 insertions(+), 1,848 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/90/3790/1 diff --git a/contrib/bsc-test/README b/contrib/bsc-test/README deleted file mode 100644 index adb222e..0000000 --- a/contrib/bsc-test/README +++ /dev/null @@ -1 +0,0 @@ -Some crazy scripts call testing... and MSC link failure simulation diff --git a/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial deleted file mode 100644 index 96e5f00..0000000 --- a/contrib/bsc-test/all_dial +++ /dev/null @@ -1,8 +0,0 @@ -ABORT BUSY -ABORT 'NO CARRIER' -ABORT 'OK' - -'' AT -SAY "Dialing a number\n" -'OK' ATD05660066; - diff --git a/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh deleted file mode 100755 index e5e19f6..0000000 --- a/contrib/bsc-test/dial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Evil dial script.. - -while true; -do - chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0 - sleep 5s - chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0 - sleep 2s -done - diff --git a/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh deleted file mode 100755 index 84eead7..0000000 --- a/contrib/bsc-test/drop-oml.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -sleep 3 -echo "enable" -sleep 1 -echo "drop bts connection 0 oml" -sleep 1 diff --git a/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh deleted file mode 100755 index c7b66ba..0000000 --- a/contrib/bsc-test/drop.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Going to drop the OML connection" - ./drop-oml.sh | telnet 127.0.0.1 4242 - sleep 58m -done diff --git a/contrib/bsc-test/hangup b/contrib/bsc-test/hangup deleted file mode 100644 index cad6870..0000000 --- a/contrib/bsc-test/hangup +++ /dev/null @@ -1,4 +0,0 @@ -TIMEOUT 10 -'' ^Z -SAY "Waiting for hangup confirm\n" -'' ATH; diff --git a/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh deleted file mode 100755 index bec011d..0000000 --- a/contrib/bsc-test/msc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` - sleep 58s -done diff --git a/contrib/bt.py b/contrib/bt.py deleted file mode 100755 index 1b111ef..0000000 --- a/contrib/bt.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os - -f = open("unbalanced") -lines = [] -for line in f: - lines.append(line) - -filenames = {} - -output = [] -for line in lines: - if "[0x" in line: - start = line.find("[") - end = line.find("]") - addr = line[start+1:end] - try: - file = filenames[addr] - except KeyError: - r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr) - all = r.read().replace("\n", ",") - file = all - filenames[addr] = file - - line = line.replace(addr, file) - output.append(line) - -g = open("unbalanced.2", "w") -g.write("".join(output)) - - - diff --git a/contrib/convert_to_enum.py b/contrib/convert_to_enum.py deleted file mode 100755 index bcd6f2c..0000000 --- a/contrib/convert_to_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# -# Convert ETSI documents to an enum -# - -import re, sys - -def convert(string): - string = string.strip().replace(" ", "").rjust(8, "0") - var = 0 - offset = 7 - for char in string: - assert offset >= 0 - var = var | (int(char) << offset) - offset = offset - 1 - - return var - -def string(name): - name = name.replace(" ", "_") - name = name.replace('"', "") - name = name.replace('/', '_') - name = name.replace('(', '_') - name = name.replace(')', '_') - return "%s_%s" % (sys.argv[2], name.upper()) - -file = open(sys.argv[1]) - - -for line in file: - m = re.match(r"[ \t]*(?P[01 ]+)[ ]+(?P[a-zA-Z /0-9()]+)", line[:-1]) - - if m: - print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"])) - else: - print line[:-1] diff --git a/contrib/ctrl2sse.py b/contrib/ctrl2sse.py deleted file mode 100755 index 8b630ec..0000000 --- a/contrib/ctrl2sse.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python2 - -mod_license = ''' -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -''' - -import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control -from eventsource import listener, request - -''' -N. B: this is not an example of building proper REST API or building secure web application. -It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API. -Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem -from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that. -''' - -token = None -stream = None -url = None - -''' -Returns json according to following schema - see http://json-schema.org/documentation.html for details: -{ - "title": "Ctrl Schema", - "type": "object", - "properties": { - "variable": { - "type": "string" - }, - "varlue": { - "type": "string" - } - }, - "required": ["interface", "variable", "value"] -} -Example validation from command-line: -json validate --schema-file=schema.json --document-file=data.json -The interface is represented as string because it might look different for IPv4 vs v6. -''' - -def read_header(data): - t_length = bsc_control.ipa_ctrl_header(data) - if (t_length): - stream.read_bytes(t_length - 1, callback = read_trap) - else: - print >> sys.stderr, "protocol error: length missing in %s!" % data - - at tornado.gen.coroutine -def read_trap(data): - (t, z, v, p) = data.split() - if (t != 'TRAP' or int(z) != 0): - print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z)) - else: - yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token), - method = 'POST', - headers = {'Content-Type': 'application/json'}, - body = tornado.escape.json_encode({ 'variable' : v, 'value' : p }))) - stream.read_bytes(4, callback = read_header) - - at tornado.gen.coroutine -def trap_setup(host, port, target_host, target_port, tk): - global stream - global url - global token - token = tk - url = "http://%s:%s/sse" % (host, port) - stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port) - stream.read_bytes(4, callback = read_header) - -def get_v(s, v): - return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) } - -class CtrlHandler(tornado.web.RequestHandler): - def initialize(self): - self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port']) - - def get(self, v): - self.write(get_v(self.skt, v)) - - def post(self): - self.write(get_v(self.skt, self.get_argument("variable"))) - -class SetCtrl(CtrlHandler): - def get(self, var, val): - bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val)) - super(SetCtrl, self).get(tornado.escape.native_str(var)) - - def post(self): - bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value"))) - super(SetCtrl, self).post() - -class Slash(tornado.web.RequestHandler): - def get(self): - self.write('%sUsing Tornado framework v%s' - '
' - '' - '' - '
' - '
' - '' - '' - '' - '
' - '' % ("Osmocom Control Interface Proxy", tornado.version)) - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.') - p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port") - p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress") - p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface") - p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface") - p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)") - p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value") - p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000") - args = p.parse_args() - random.seed() - tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver - logging.basicConfig() - application = tornado.web.Application([ - (r"/", Slash), - (r"/get", CtrlHandler), - (r"/get/(.*)", CtrlHandler), - (r"/set", SetCtrl), - (r"/set/(.*)/(.*)", SetCtrl), - (r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)), - ], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port) - application.listen(address = args.host, port = args.port) - trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token) - tornado.ioloop.IOLoop.instance().start() diff --git a/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py deleted file mode 100755 index 0cd4b87..0000000 --- a/contrib/gprs/gb-proxy-unblock-bug.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -""" -demonstrate a unblock bug on the GB Proxy.. -""" - -bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7" -ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7" - -bts_ns_unblock = "\x06" -ns_unblock_ack = "\x07" - -bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02" -ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00" - -bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40" - - -import socket -socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -socket.bind(("0.0.0.0", 0)) -socket.setblocking(1) - - -import sys -port = int(sys.argv[1]) -print "Sending data to port: %d" % port - -def send_and_receive(packet): - socket.sendto(packet, ("127.0.0.1", port)) - - try: - data, addr = socket.recvfrom(4096) - except socket.error, e: - print "ERROR", e - import sys - sys.exit(0) - return data - -#send stuff once - -to_send = [ - (bts_ns_reset, ns_reset_ack, "reset ack"), - (bts_ns_unblock, ns_unblock_ack, "unblock ack"), - (bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"), -] - - -for (out, inp, type) in to_send: - res = send_and_receive(out) - if res != inp: - print "Failed to get the %s" % type - sys.exit(-1) - -import time -time.sleep(3) -res = send_and_receive(bts_bvc_reset_8167) -print "Sent all messages... check wireshark for the last response" diff --git a/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua deleted file mode 100644 index b1ab5df..0000000 --- a/contrib/gprs/gprs-bssgp-histogram.lua +++ /dev/null @@ -1,78 +0,0 @@ --- Simple LUA script to print the size of BSSGP messages over their type... - -do - local ip_bucket = {} - - local pdu_types = {} - pdu_types[ 6] = "PAGING" - pdu_types[11] = "SUSPEND" - pdu_types[12] = "SUSPEND-ACK" - pdu_types[32] = "BVC-BLOCK" - pdu_types[33] = "BVC-BLOCK-ACK" - pdu_types[34] = "BVC-RESET" - pdu_types[35] = "BVC-RESET-ACK" - pdu_types[36] = "UNBLOCK" - pdu_types[37] = "UNBLOCK-ACK" - pdu_types[38] = "FLOW-CONTROL-BVC" - pdu_types[39] = "FLOW-CONTROL-BVC-ACK" - pdu_types[40] = "FLOW-CONTROL-MS" - pdu_types[41] = "FLOW-CONTROL-MS-ACK" - pdu_types[44] = "LLC-DISCARDED" - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local udp_length_get = Field.new("udp.length") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = udp_length_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - pdu = tostring(pdu) - if tonumber(pdu) == 0 or tonumber(pdu) == 1 then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_histo = ip_bucket[ip_src] - if not bssgp_histo then - bssgp_histo = {} - ip_bucket[ip_src] = bssgp_histo - end - - local key = pdu - local bucket = bssgp_histo[key] - if not bucket then - bucket = {} - bssgp_histo[key] = bucket - end - - table.insert(bucket, tostring(len)) - print("IP: " .. ip_src .. " PDU: " .. pdu_types[tonumber(pdu)] .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua deleted file mode 100644 index ca8864a..0000000 --- a/contrib/gprs/gprs-buffer-count.lua +++ /dev/null @@ -1,80 +0,0 @@ --- I count the buffer space needed for LLC PDUs in the worse case and print it - -do - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local bssgp_delay_get = Field.new("bssgp.delay_val") - local llcgprs_get = Field.new("llcgprs") - local pdus = nil - - print("START...") - - local tap = Listener.new("ip", "udp.port == 23000 && bssgp.pdu_type == 0") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = llcgprs_get().len - local delay = bssgp_delay_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - if tonumber(tostring(delay)) == 65535 then - pdus = { next = pdus, - len = len, - expires = -1 } - else - local off = tonumber(tostring(delay)) / 100.0 - pdus = { next = pdus, - len = len, - expires = pinfo.rel_ts + off } - end - local now_time = tonumber(tostring(pinfo.rel_ts)) - local now_size = 0 - local l = pdus - local prev = nil - local count = 0 - while l do - if now_time < l.expires or l.expires == -1 then - now_size = now_size + l.len - prev = l - l = l.next - count = count + 1 - else - -- delete things - if prev == nil then - pdus = nil - l = nil - else - prev.next = l.next - l = l.next - end - end - end --- print("TOTAL: " .. now_time .. " PDU_SIZE: " .. now_size) - print(now_time .. " " .. now_size / 1024.0 .. " " .. count) --- print("NOW: " .. tostring(pinfo.rel_ts) .. " Delay: " .. tostring(delay) .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - print("END") - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua deleted file mode 100644 index 018c377..0000000 --- a/contrib/gprs/gprs-split-trace-by-tlli.lua +++ /dev/null @@ -1,46 +0,0 @@ --- Create a file named by_ip/''ip_addess''.cap with all ip traffic of each ip host. (works for tshark only) --- Dump files are created for both source and destination hosts -do - local dir = "by_tlli" - local dumpers = {} - local function init_listener() - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - local field_tlli = Field.new("bssgp.tlli") - local tap = Listener.new("ip", "udp.port == 23000") - - -- we will be called once for every IP Header. - -- If there's more than one IP header in a given packet we'll dump the packet once per every header - function tap.packet(pinfo,tvb,ip) - local tlli = field_tlli() - if not tlli then - return - end - - local tlli_str = tostring(tlli) - tlli_dmp = dumpers[tlli_str] - if not tlli_dmp then - local tlli_hex = string.format("0x%x", tonumber(tlli_str)) - print("Creating dump for TLLI " .. tlli_hex) - tlli_dmp = Dumper.new_for_current(dir .. "/" .. tlli_hex .. ".pcap") - dumpers[tlli_str] = tlli_dmp - end - tlli_dmp:dump_current() - tlli_dmp:flush() - end - function tap.draw() - for tlli,dumper in pairs(dumpers) do - dumper:flush() - end - end - function tap.reset() - for tlli,dumper in pairs(dumpers) do - dumper:close() - end - dumpers = {} - end - end - init_listener() -end diff --git a/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua deleted file mode 100644 index e44fdd1..0000000 --- a/contrib/gprs/gprs-verify-nu.lua +++ /dev/null @@ -1,59 +0,0 @@ --- This script verifies that the N(U) is increasing... --- -do - local nu_state_src = {} - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- we want to look here... - local llc_sapi_get = Field.new("llcgprs.sapib") - local llc_nu_get = Field.new("llcgprs.nu") - local bssgp_tlli_get = Field.new("bssgp.tlli") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local llc_sapi = llc_sapi_get() - local llc_nu = llc_nu_get() - local bssgp_tlli = bssgp_tlli_get() - - if not llc_sapi or not llc_nu or not bssgp_tlli then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_tlli = tostring(bssgp_tlli) - local llc_nu = tostring(llc_nu) - local llc_sapi = tostring(llc_sapi) - - local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi - local last_nu = nu_state_src[src_key] - if not last_nu then - -- print("Establishing mapping for " .. src_key) - nu_state_src[src_key] = llc_nu - return - end - - local function tohex(number) - return string.format("0x%x", tonumber(number)) - end - - nu_state_src[src_key] = llc_nu - if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then - print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src) - print("\t last: " .. last_nu .. " now: " .. llc_nu) - end - end - - function tap.draw() - end - - function tap.reset() - end - end - init_listener() -end - diff --git a/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql deleted file mode 100644 index 626a331..0000000 --- a/contrib/hlr-remove-old.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Remove old data from the database -DELETE FROM Subscriber - WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1; -DELETE FROM Equipment - WHERE datetime('now', '-10 days') > updated; -DELETE FROM EquipmentWatch - WHERE datetime('now', '-10 days') > updated; -DELETE FROM SMS - WHERE datetime('now', '-10 days') > created; -DELETE FROM VLR - WHERE datetime('now', '-10 days') > updated; -DELETE FROM ApduBlobs - WHERE datetime('now', '-10 days') > created; -DELETE FROM Counters - WHERE datetime('now', '-10 days') > timestamp; -DELETE FROM RateCounters - WHERE datetime('now', '-10 days') > timestamp; -VACUUM; diff --git a/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py deleted file mode 100755 index e4a4955..0000000 --- a/contrib/hlrsync/hlrsync.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python2.5 - -from __future__ import with_statement - -from pysqlite2 import dbapi2 as sqlite3 -import sys - -hlr = sqlite3.connect(sys.argv[1]) -web = sqlite3.connect(sys.argv[2]) - -# switch to autocommit -hlr.isolation_level = None -web.isolation_level = None - -hlr.row_factory = sqlite3.Row -web.row_factory = sqlite3.Row - -with hlr: - hlr_subscrs = hlr.execute(""" - SELECT * FROM Subscriber - """).fetchall() - hlr_tokens = hlr.execute(""" - SELECT * FROM AuthToken - """).fetchall() - -with web: - web_tokens = web.execute(""" - SELECT * FROM reg_tokens - """).fetchall() - web_sms = web.execute(""" - SELECT * FROM sms_queue - """).fetchall() - -# index by subscr id -hlr_subscrs_by_id = {} -hlr_subscrs_by_ext = {} -hlr_tokens_by_subscr_id = {} -for x in hlr_subscrs: - hlr_subscrs_by_id[x['id']] = x - hlr_subscrs_by_ext[x['extension']] = x -del hlr_subscrs -for x in hlr_tokens: - hlr_tokens_by_subscr_id[x['subscriber_id']] = x -del hlr_tokens - -web_tokens_by_subscr_id = {} -for x in web_tokens: - web_tokens_by_subscr_id[x['subscriber_id']] = x -del web_tokens - -# remove leftover web_tokens and correct inconsistent fields -with web: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - web.execute(""" - DELETE FROM reg_tokens WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del web_tokens_by_subscr_id[x['subscriber_id']] - continue - if str(x['imsi']) != str(subscr['imsi']) or \ - x['extension'] != subscr['extension'] or \ - x['tmsi'] != subscr['tmsi'] or \ - x['lac'] != subscr['lac']: - web.execute(""" - UPDATE reg_tokens - SET imsi = ?, extension = ?, tmsi = ?, lac = ? - WHERE subscriber_id = ? - """, (str(subscr['imsi']), subscr['extension'], - subscr['tmsi'], subscr['lac'], x['subscriber_id'])) - -# add missing web_tokens -with web: - for x in hlr_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - hlr.execute(""" - DELETE FROM AuthToken WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del hlr_tokens_by_subscr_id[x['subscriber_id']] - continue - webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None) - if webtoken is None: - web.execute(""" - INSERT INTO reg_tokens - (subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi) - VALUES - (?, ?, 0, ?, '', ?, ?, ?, ?) - """, (x['subscriber_id'], subscr['extension'], subscr['name'], - subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi'])) - -# authorize subscribers -with hlr: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if x['reg_completed'] and not subscr['authorized']: - hlr.execute(""" - UPDATE Subscriber - SET authorized = 1 - WHERE id = ? - """, (x['subscriber_id'],)) - -# Sync SMS from web to hlr -with hlr: - for sms in web_sms: - subscr = hlr_subscrs_by_ext.get(sms['receiver_ext']) - if subscr is None: - print '%s not found' % sms['receiver_ext'] - continue - hlr.execute(""" - INSERT INTO SMS - (created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text) - VALUES - (?, 1, ?, 0, 0, 0, 0, 0, ?) - """, (sms['created'], subscr['id'], sms['text'])) -with web: - for sms in web_sms: - web.execute(""" - DELETE FROM sms_queue WHERE id = ? - """, (sms['id'],)) - - -hlr.close() -web.close() - diff --git a/contrib/mgcp_server.py b/contrib/mgcp_server.py deleted file mode 100755 index 05c489d..0000000 --- a/contrib/mgcp_server.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Simple server for mgcp... send audit, receive response.. - -import socket, time - -MGCP_GATEWAY_PORT = 2427 -MGCP_CALLAGENT_PORT = 2727 - -rsip_resp = """200 321321332\r\n""" -audit_packet = """AUEP %d 13 at mgw MGCP 1.0\r\n""" -crcx_packet = """CRCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n""" -dlcx_packet = """DLCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\n""" -mdcx_packet = """MDCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 258696477 0 IN IP4 172.16.1.107\r\ns=-\r\nc=IN IP4 172.16.1.107\r\nt=0 0\r\nm=audio 6666 RTP/AVP 127\r\na=rtpmap:127 GSM-EFR/8000/1\r\na=ptime:20\r\na=recvonly\r\nm=image 4402 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n""" - -def hexdump(src, length=8): - """Recipe is from http://code.activestate.com/recipes/142812/""" - result = [] - digits = 4 if isinstance(src, unicode) else 2 - for i in xrange(0, len(src), length): - s = src[i:i+length] - hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s]) - text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) - result.append( b"%04X %-*s %s" % (i, length*(digits + 1), hexa, text) ) - return b'\n'.join(result) - -server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -server_socket.bind(("127.0.0.1", MGCP_CALLAGENT_PORT)) -server_socket.setblocking(1) - -last_ci = 1 -def send_and_receive(packet): - global last_ci - server_socket.sendto(packet, ("127.0.0.1", MGCP_GATEWAY_PORT)) - try: - data, addr = server_socket.recvfrom(4096) - - # attempt to store the CI of the response - list = data.split("\n") - for item in list: - if item.startswith("I: "): - last_ci = int(item[3:]) - - print hexdump(data), addr - except socket.error, e: - print e - pass - -def generate_tid(): - import random - return random.randint(0, 65123) - - - -while True: - send_and_receive(audit_packet % generate_tid()) - send_and_receive(crcx_packet % generate_tid() ) - send_and_receive(mdcx_packet % (generate_tid(), last_ci)) - send_and_receive(dlcx_packet % (generate_tid(), last_ci)) - - time.sleep(3) diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c deleted file mode 100644 index 808a703..0000000 --- a/contrib/nat/test_regexp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* make test_regexp */ -#include -#include -#include - - -int main(int argc, char **argv) -{ - regex_t reg; - regmatch_t matches[2]; - - if (argc != 4) { - printf("Invoke with: test_regexp REGEXP REPLACE NR\n"); - return -1; - } - - if (regcomp(®, argv[1], REG_EXTENDED) != 0) { - fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]); - return -1; - } - - if (regexec(®, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1) - printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]); - else - printf("No match.\n"); - - regfree(®); - - return 0; -} diff --git a/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py deleted file mode 100644 index 8f7a58d..0000000 --- a/contrib/nat/ussd_example.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2.7 - -""" -AGPLv3+ 2016 Copyright Holger Hans Peter Freyther - -Example of how to connect to the USSD side-channel and how to respond -with a fixed message. -""" - -import socket -import struct - -ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ussdSocket.connect(('127.0.0.1', 5001)) - -def send_dt1(dstref, data): - dlen = struct.pack('B', len(data)).encode('hex') - hex = '06' + dstref.encode('hex') + '00' + '01' + dlen + data.encode('hex') - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def send_rel(srcref, dstref): - hex = '04' + dstref.encode('hex') + srcref.encode('hex') + '000100' - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def recv_one(): - plen = ussdSocket.recv(3) - (plen,ptype) = struct.unpack(">HB", plen) - data = ussdSocket.recv(plen) - - return ptype, data - -# Assume this is the ID request -data = ussdSocket.recv(4) -ussdSocket.send("\x00\x08\xfe\x05\x00" + "\x05\x01" + "ussd") -# ^len ^len of tag ... and ignore - -# Expect a fake message. see struct ipac_msgt_sccp_state -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) -(srcref, dstref, transid, invokeid) = struct.unpack("<3s3sBB", data[1:9]) -print("New transID %d invoke %d" % (transid, invokeid)) - -# Expect a the invocation.. todo.. extract invoke id -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) - -# Reply with BSSAP + GSM 04.08 + MAP portion -# 00 == invoke id 0f == DCS -res = "01002a9b2a0802e1901c22a220020100301b02013b301604010f041155e7d2f9bc3a41412894991c06a9c9a713" -send_dt1(dstref, res.decode('hex')) - -clear = "000420040109" -send_dt1(dstref, clear.decode('hex')) - -# should be the clear complete -send_rel(srcref, dstref) - -# Give it some time to handle connection shutdown properly -print("Gracefully sleeping") -import time -time.sleep(3) diff --git a/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl deleted file mode 100755 index 47839c1..0000000 --- a/contrib/rtp/gen_rtp_header.erl +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- -%%! -smp disable --module(gen_rtp_header). - -% -mode(compile). - --define(VERSION, "0.1"). - --export([main/1]). - --record(rtp_packet, - { - version = 2, - padding = 0, - marker = 0, - payload_type = 0, - seqno = 0, - timestamp = 0, - ssrc = 0, - csrcs = [], - extension = <<>>, - payload = <<>>, - realtime - }). - - -main(Args) -> - DefaultOpts = [{format, state}, - {ssrc, 16#11223344}, - {rate, 8000}, - {pt, 98}], - {PosArgs, Opts} = getopts_checked(Args, DefaultOpts), - log(debug, fun (Dev) -> - io:format(Dev, "Initial options:~n", []), - dump_opts(Dev, Opts), - io:format(Dev, "~s: ~p~n", ["Args", PosArgs]) - end, [], Opts), - main(PosArgs, Opts). - -main([First | RemArgs], Opts) -> - try - F = list_to_integer(First), - Format = proplists:get_value(format, Opts, state), - PayloadData = proplists:get_value(payload, Opts, undef), - InFile = proplists:get_value(file, Opts, undef), - - Payload = case {PayloadData, InFile} of - {undef, undef} -> - % use default value - #rtp_packet{}#rtp_packet.payload; - {P, undef} -> P; - {_, File} -> - log(info, "Loading file '~s'~n", [File], Opts), - {ok, InDev} = file:open(File, [read]), - DS = [ Pl#rtp_packet.payload || {_T, Pl} <- read_packets(InDev, Opts)], - file:close(InDev), - log(debug, "File '~s' closed, ~w packets read.~n", [File, length(DS)], Opts), - DS - end, - Dev = standard_io, - write_packet_pre(Dev, Format), - do_groups(Dev, Payload, F, RemArgs, Opts), - write_packet_post(Dev, Format), - 0 - catch - _:_ -> - log(debug, "~p~n", [hd(erlang:get_stacktrace())], Opts), - usage(), - halt(1) - end - ; - -main(_, _Opts) -> - usage(), - halt(1). - -%%% group (count + offset) handling %%% - -do_groups(_Dev, _Pl, _F, [], _Opts) -> - ok; - -do_groups(Dev, Pl, F, [L], Opts) -> - do_groups(Dev, Pl, F, [L, 0], Opts); - -do_groups(Dev, Pl, First, [L, O | Args], Opts) -> - Ssrc = proplists:get_value(ssrc, Opts, #rtp_packet.ssrc), - PT = proplists:get_value(pt, Opts, #rtp_packet.payload_type), - Len = list_to_num(L), - Offs = list_to_num(O), - log(info, "Starting group: Ssrc=~.16B, PT=~B, First=~B, Len=~B, Offs=~B~n", - [Ssrc, PT, First, Len, Offs], Opts), - Pkg = #rtp_packet{ssrc = Ssrc, payload_type = PT}, - Pl2 = write_packets(Dev, Pl, Pkg, First, Len, Offs, Opts), - {Args2, Opts2} = getopts_checked(Args, Opts), - log(debug, fun (Io) -> - io:format(Io, "Changed options:~n", []), - dump_opts(Io, Opts2 -- Opts) - end, [], Opts), - do_groups(Dev, Pl2, First+Len, Args2, Opts2). - -%%% error handling helpers %%% - -getopts_checked(Args, Opts) -> - try - getopts(Args, Opts) - catch - C:R -> - log(error, "~s~n", - [explain_error(C, R, erlang:get_stacktrace(), Opts)], Opts), - usage(), - halt(1) - end. - -explain_error(error, badarg, [{erlang,list_to_integer,[S,B]} | _ ], _Opts) -> - io_lib:format("Invalid number '~s' (base ~B)", [S, B]); -explain_error(error, badarg, [{erlang,list_to_integer,[S]} | _ ], _Opts) -> - io_lib:format("Invalid decimal number '~s'", [S]); -explain_error(C, R, [Hd | _ ], _Opts) -> - io_lib:format("~p, ~p:~p", [Hd, C, R]); -explain_error(_, _, [], _Opts) -> - "". - -%%% usage and options %%% - -myname() -> - filename:basename(escript:script_name()). - -usage(Text) -> - io:format(standard_error, "~s: ~s~n", [myname(), Text]), - usage(). - -usage() -> - io:format(standard_error, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n", - [myname()]). - -show_version() -> - io:format(standard_io, - "~s ~s~n", [myname(), ?VERSION]). - -show_help() -> - io:format(standard_io, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n~n" ++ - "Options:~n" ++ - " -h, --help this text~n" ++ - " --version show version info~n" ++ - " -i, --file=FILE reads payload from file (state format by default)~n" ++ - " -f, --frame-size=N read payload as binary frames of size N instead~n" ++ - " -p, --payload=HEX set constant payload~n" ++ - " --verbose=N set verbosity~n" ++ - " -v increase verbosity~n" ++ - " --format=state use state format for output (default)~n" ++ - " -C, --format=c use simple C lines for output~n" ++ - " --format=carray use a C array for output~n" ++ - " -s, --ssrc=SSRC set the SSRC~n" ++ - " -t, --type=N set the payload type~n" ++ - " -r, --rate=N set the RTP rate [8000]~n" ++ - " -D, --duration=N set the packet duration in RTP time units [160]~n" ++ - " -d, --delay=FLOAT add offset to playout timestamp~n" ++ - "~n" ++ - "Arguments:~n" ++ - " Start initial packet (sequence) number~n" ++ - " Count number of packets~n" ++ - " Offs timestamp offset (in RTP units)~n" ++ - "", [myname()]). - -getopts([ "--file=" ++ File | R], Opts) -> - getopts(R, [{file, File} | Opts]); -getopts([ "-i" ++ T | R], Opts) -> - getopts_alias_arg("--file", T, R, Opts); -getopts([ "--frame-size=" ++ N | R], Opts) -> - Size = list_to_integer(N), - getopts(R, [{frame_size, Size}, {in_format, bin} | Opts]); -getopts([ "-f" ++ T | R], Opts) -> - getopts_alias_arg("--frame-size", T, R, Opts); -getopts([ "--duration=" ++ N | R], Opts) -> - Duration = list_to_integer(N), - getopts(R, [{duration, Duration} | Opts]); -getopts([ "-D" ++ T | R], Opts) -> - getopts_alias_arg("--duration", T, R, Opts); -getopts([ "--rate=" ++ N | R], Opts) -> - Rate = list_to_integer(N), - getopts(R, [{rate, Rate} | Opts]); -getopts([ "-r" ++ T | R], Opts) -> - getopts_alias_arg("--rate", T, R, Opts); -getopts([ "--version" | _], _Opts) -> - show_version(), - halt(0); -getopts([ "--help" | _], _Opts) -> - show_help(), - halt(0); -getopts([ "-h" ++ T | R], Opts) -> - getopts_alias_no_arg("--help", T, R, Opts); -getopts([ "--verbose=" ++ V | R], Opts) -> - Verbose = list_to_integer(V), - getopts(R, [{verbose, Verbose} | Opts]); -getopts([ "-v" ++ T | R], Opts) -> - Verbose = proplists:get_value(verbose, Opts, 0), - getopts_short_no_arg(T, R, [ {verbose, Verbose+1} | Opts]); -getopts([ "--format=state" | R], Opts) -> - getopts(R, [{format, state} | Opts]); -getopts([ "--format=c" | R], Opts) -> - getopts(R, [{format, c} | Opts]); -getopts([ "-C" ++ T | R], Opts) -> - getopts_alias_no_arg("--format=c", T, R, Opts); -getopts([ "--format=carray" | R], Opts) -> - getopts(R, [{format, carray} | Opts]); -getopts([ "--payload=" ++ Hex | R], Opts) -> - getopts(R, [{payload, hex_to_bin(Hex)} | Opts]); -getopts([ "--ssrc=" ++ Num | R], Opts) -> - getopts(R, [{ssrc, list_to_num(Num)} | Opts]); -getopts([ "-s" ++ T | R], Opts) -> - getopts_alias_arg("--ssrc", T, R, Opts); -getopts([ "--type=" ++ Num | R], Opts) -> - getopts(R, [{pt, list_to_num(Num)} | Opts]); -getopts([ "-t" ++ T | R], Opts) -> - getopts_alias_arg("--type", T, R, Opts); -getopts([ "--delay=" ++ Num | R], Opts) -> - getopts(R, [{delay, list_to_float(Num)} | Opts]); -getopts([ "-d" ++ T | R], Opts) -> - getopts_alias_arg("--delay", T, R, Opts); - -% parsing helpers -getopts([ "--" | R], Opts) -> - {R, normalize_opts(Opts)}; -getopts([ O = "--" ++ _ | _], _Opts) -> - usage("Invalid option: " ++ O), - halt(1); -getopts([ [ $-, C | _] | _], _Opts) when C < $0; C > $9 -> - usage("Invalid option: -" ++ [C]), - halt(1); - -getopts(R, Opts) -> - {R, normalize_opts(Opts)}. - -getopts_short_no_arg([], R, Opts) -> getopts(R, Opts); -getopts_short_no_arg(T, R, Opts) -> getopts([ "-" ++ T | R], Opts). - -getopts_alias_no_arg(A, [], R, Opts) -> getopts([A | R], Opts); -getopts_alias_no_arg(A, T, R, Opts) -> getopts([A, "-" ++ T | R], Opts). - -getopts_alias_arg(A, [], [T | R], Opts) -> getopts([A ++ "=" ++ T | R], Opts); -getopts_alias_arg(A, T, R, Opts) -> getopts([A ++ "=" ++ T | R], Opts). - -normalize_opts(Opts) -> - [ proplists:lookup(E, Opts) || E <- proplists:get_keys(Opts) ]. - -%%% conversions %%% - -bin_to_hex(Bin) -> [hd(integer_to_list(N,16)) || <> <= Bin]. -hex_to_bin(Hex) -> << <<(list_to_integer([Nib],16)):4>> || Nib <- Hex>>. - -list_to_num("-" ++ Str) -> -list_to_num(Str); -list_to_num("0x" ++ Str) -> list_to_integer(Str, 16); -list_to_num("0b" ++ Str) -> list_to_integer(Str, 2); -list_to_num(Str = [ $0 | _ ]) -> list_to_integer(Str, 8); -list_to_num(Str) -> list_to_integer(Str, 10). - -%%% dumping data %%% - -dump_opts(Dev, Opts) -> - dump_opts2(Dev, Opts, proplists:get_keys(Opts)). - -dump_opts2(Dev, Opts, [OptName | R]) -> - io:format(Dev, " ~-10s: ~p~n", - [OptName, proplists:get_value(OptName, Opts)]), - dump_opts2(Dev, Opts, R); -dump_opts2(_Dev, _Opts, []) -> ok. - -%%% logging %%% - -log(L, Fmt, Args, Opts) when is_list(Opts) -> - log(L, Fmt, Args, proplists:get_value(verbose, Opts, 0), Opts). - -log(debug, Fmt, Args, V, Opts) when V > 2 -> log2("DEBUG", Fmt, Args, Opts); -log(info, Fmt, Args, V, Opts) when V > 1 -> log2("INFO", Fmt, Args, Opts); -log(notice, Fmt, Args, V, Opts) when V > 0 -> log2("NOTICE", Fmt, Args, Opts); -log(warn, Fmt, Args, _V, Opts) -> log2("WARNING", Fmt, Args, Opts); -log(error, Fmt, Args, _V, Opts) -> log2("ERROR", Fmt, Args, Opts); - -log(Lvl, Fmt, Args, V, Opts) when V >= Lvl -> log2("", Fmt, Args, Opts); - -log(_, _, _, _i, _) -> ok. - -log2(Type, Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, "~s: " ++ Fmt, [Type | Args]); -log2("", Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, Fmt, Args); -log2(_Type, Fun, _Args, _Opts) when is_function(Fun, 1) -> - Fun(standard_error). - -%%% RTP packets %%% - -make_rtp_packet(P = #rtp_packet{version = 2}) -> - << (P#rtp_packet.version):2, - 0:1, % P - 0:1, % X - 0:4, % CC - (P#rtp_packet.marker):1, - (P#rtp_packet.payload_type):7, - (P#rtp_packet.seqno):16, - (P#rtp_packet.timestamp):32, - (P#rtp_packet.ssrc):32, - (P#rtp_packet.payload)/bytes - >>. - -parse_rtp_packet( - << 2:2, % Version 2 - 0:1, % P (not supported yet) - 0:1, % X (not supported yet) - 0:4, % CC (not supported yet) - M:1, - PT:7, - SeqNo: 16, - TS:32, - Ssrc:32, - Payload/bytes >>) -> - #rtp_packet{ - version = 0, - marker = M, - payload_type = PT, - seqno = SeqNo, - timestamp = TS, - ssrc = Ssrc, - payload = Payload}. - -%%% payload generation %%% - -next_payload(F) when is_function(F) -> - {F(), F}; -next_payload({F, D}) when is_function(F) -> - {P, D2} = F(D), - {P, {F, D2}}; -next_payload([P | R]) -> - {P, R}; -next_payload([]) -> - undef; -next_payload(Bin = <<_/bytes>>) -> - {Bin, Bin}. - -%%% real writing work %%% - -write_packets(_Dev, DS, _P, _F, 0, _O, _Opts) -> - DS; -write_packets(Dev, DataSource, P = #rtp_packet{}, F, L, O, Opts) -> - Format = proplists:get_value(format, Opts, state), - Ptime = proplists:get_value(duration, Opts, 160), - Delay = proplists:get_value(delay, Opts, 0), - Rate = proplists:get_value(rate, Opts, 8000), - case next_payload(DataSource) of - {Payload, DataSource2} -> - write_packet(Dev, Ptime * F / Rate + Delay, - P#rtp_packet{seqno = F, timestamp = F*Ptime+O, - payload = Payload}, - Format), - write_packets(Dev, DataSource2, P, F+1, L-1, O, Opts); - Other -> Other - end. - -write_packet(Dev, Time, P = #rtp_packet{}, Format) -> - Bin = make_rtp_packet(P), - - write_packet_line(Dev, Time, P, Bin, Format). - -write_packet_pre(Dev, carray) -> - io:format(Dev, - "struct {float t; int len; char *data;} packets[] = {~n", []); - -write_packet_pre(_Dev, _) -> ok. - -write_packet_post(Dev, carray) -> - io:format(Dev, "};~n", []); - -write_packet_post(_Dev, _) -> ok. - -write_packet_line(Dev, Time, _P, Bin, state) -> - io:format(Dev, "~f ~s~n", [Time, bin_to_hex(Bin)]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, c) -> - ByteList = [ [ $0, $x | integer_to_list(Byte, 16) ] || <> <= Bin ], - ByteStr = string:join(ByteList, ", "), - io:format(Dev, "/* time=~f, SeqNo=~B, TS=~B */ {~s}~n", [Time, N, TS, ByteStr]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, carray) -> - io:format(Dev, " /* RTP: SeqNo=~B, TS=~B */~n", [N, TS]), - io:format(Dev, " {~f, ~B, \"", [Time, size(Bin)]), - [ io:format(Dev, "\\x~2.16.0B", [Byte]) || <> <= Bin ], - io:format(Dev, "\"},~n", []). - -%%% real reading work %%% - -read_packets(Dev, Opts) -> - Format = proplists:get_value(in_format, Opts, state), - - read_packets(Dev, Opts, Format). - -read_packets(Dev, Opts, Format) -> - case read_packet(Dev, Opts, Format) of - eof -> []; - Tuple -> [Tuple | read_packets(Dev, Opts, Format)] - end. - -read_packet(Dev, Opts, bin) -> - Size = proplists:get_value(frame_size, Opts), - case file:read(Dev, Size) of - {ok, Data} -> {0, #rtp_packet{payload = iolist_to_binary(Data)}}; - eof -> eof - end; -read_packet(Dev, _Opts, Format) -> - case read_packet_line(Dev, Format) of - {Time, Bin} -> {Time, parse_rtp_packet(Bin)}; - eof -> eof - end. - -read_packet_line(Dev, state) -> - case io:fread(Dev, "", "~f ~s") of - {ok, [Time, Hex]} -> {Time, hex_to_bin(Hex)}; - eof -> eof - end. diff --git a/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st deleted file mode 100644 index e26d073..0000000 --- a/contrib/rtp/rtp_replay.st +++ /dev/null @@ -1,21 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. -FileStream fileIn: 'rtp_replay_shared.st'. - - -Eval [ - | replay file host dport | - - file := Smalltalk arguments at: 1 ifAbsent: [ 'rtpstream.state' ]. - host := Smalltalk arguments at: 2 ifAbsent: [ '127.0.0.1' ]. - dport := (Smalltalk arguments at: 3 ifAbsent: [ '4000' ]) asInteger. - sport := (Smalltalk arguments at: 4 ifAbsent: [ '0' ]) asInteger. - - replay := RTPReplay on: file fromPort: sport. - - Transcript nextPutAll: 'Going to stream now'; nl. - replay streamAudio: host port: dport. -] diff --git a/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st deleted file mode 100644 index 7b68c0f..0000000 --- a/contrib/rtp/rtp_replay_shared.st +++ /dev/null @@ -1,118 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. - -Object subclass: SDPUtils [ - "Look into using PetitParser." - SDPUtils class >> findPort: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'm=audio ') ifTrue: [ - | stream | - stream := line readStream - skip: 'm=audio ' size; - yourself. - ^ Number readFrom: stream. - ] - ]. - - ^ self error: 'Not found'. - ] - - SDPUtils class >> findHost: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'c=IN IP4 ') ifTrue: [ - | stream | - ^ stream := line readStream - skip: 'c=IN IP4 ' size; - upToEnd. - ] - ]. - - ^ self error: 'Not found'. - ] -] - -Object subclass: RTPReplay [ - | filename socket | - RTPReplay class >> on: aFile [ - ^ self new - initialize; - file: aFile; yourself - ] - - RTPReplay class >> on: aFile fromPort: aPort [ - ^ self new - initialize: aPort; - file: aFile; yourself - ] - - initialize [ - self initialize: 0. - ] - - initialize: aPort [ - socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort. - ] - - file: aFile [ - filename := aFile - ] - - localPort [ - ^ socket port - ] - - streamAudio: aHost port: aPort [ - | file last_time last_image udp_send dest | - - last_time := nil. - last_image := nil. - file := FileStream open: filename mode: #read. - - "Send the payload" - dest := Sockets.SocketAddress byName: aHost. - udp_send := [:payload | | datagram | - datagram := Sockets.Datagram data: payload contents address: dest port: aPort. - socket nextPut: datagram - ]. - - [file atEnd] whileFalse: [ - | lineStream time data now_image | - lineStream := file nextLine readStream. - - "Read the time, skip the blank, parse the data" - time := Number readFrom: lineStream. - lineStream skip: 1. - - data := WriteStream on: (ByteArray new: 30). - [lineStream atEnd] whileFalse: [ - | hex | - hex := lineStream next: 2. - data nextPut: (Number readFrom: hex readStream radix: 16). - ]. - - last_time isNil - ifTrue: [ - "First time, send it right now" - last_time := time. - last_image := Time millisecondClockValue. - udp_send value: data. - ] - ifFalse: [ - | wait_image new_image_time | - - "How long to wait?" - wait_image := last_image + ((time - last_time) * 1000). - [ wait_image > Time millisecondClockValue ] - whileTrue: [Processor yield]. - - udp_send value: data. - last_time := time. - last_image := wait_image. - ] - ] - ] -] - diff --git a/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st deleted file mode 100644 index 5f844df..0000000 --- a/contrib/rtp/rtp_replay_sip.st +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create a SIP connection and then stream... -""" - -PackageLoader - fileInPackage: #OsmoSIP. - -"Load for the replay code" -FileStream fileIn: 'rtp_replay_shared.st'. - - -Osmo.SIPCall subclass: StreamCall [ - | sem stream | - - createCall: aSDP [ - | sdp | - stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'. - sdp := aSDP % {stream localPort}. - ^ super createCall: sdp. - ] - - sem: aSemaphore [ - sem := aSemaphore - ] - - sessionNew [ - | host port | - Transcript nextPutAll: 'The call has started'; nl. - Transcript nextPutAll: sdp_result; nl. - - host := SDPUtils findHost: sdp_result. - port := SDPUtils findPort: sdp_result. - - [ - stream streamAudio: host port: port. - Transcript nextPutAll: 'Streaming has finished.'; nl. - ] fork. - ] - - sessionFailed [ - sem signal - ] - - sessionEnd [ - sem signal - ] -] - -Eval [ - | transport agent call sem sdp_fr sdp_amr | - - - sdp_fr := (WriteStream on: String new) - nextPutAll: 'v=0'; cr; nl; - nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 's=-'; cr; nl; - nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 't=0 0'; cr; nl; - nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl; - nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl; - nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl; - nextPutAll: 'a=fmtp:101 0-15'; cr; nl; - nextPutAll: 'a=ptime:20'; cr; nl; - contents. - - sem := Semaphore new. - transport := Osmo.SIPUdpTransport - startOn: '0.0.0.0' port: 5066. - agent := Osmo.SIPUserAgent createOn: transport. - transport start. - - call := (StreamCall - fromUser: 'sip:1000 at sip.zecke.osmocom.org' - host: '127.0.0.1' - port: 5060 - to: 'sip:123456 at 127.0.0.1' - on: agent) - sem: sem; yourself. - - call createCall: sdp_fr. - - - "Wait for the stream to have ended" - sem wait. - - (Delay forSeconds: 4) wait. -] diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua deleted file mode 100644 index c18a06b..0000000 --- a/contrib/rtp/timestamp_rtp.lua +++ /dev/null @@ -1,28 +0,0 @@ -print("Ni hao") - - -do - local tap = Listener.new("ip", "rtp") - local rtp_ssrc = Field.new("rtp.ssrc") - local frame_time = Field.new("frame.time_relative") - local rtp = Field.new("rtp") - - function tap.packet(pinfo, tvb, ip) - local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) - local rtp_data = rtp() - local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" - local f = io.open(filename, "a") - - f:write(tostring(frame_time()) .. " ") - f:write(tostring(rtp_data.value)) - f:write("\n") - f:close() - end - - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end -end diff --git a/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st deleted file mode 100644 index da0643e..0000000 --- a/contrib/sms/fill-hlr.st +++ /dev/null @@ -1,66 +0,0 @@ -"I create output for some simple SQL statements for the HLR db" - - -Eval [ - -"Create tables if they don't exist" -Transcript show: 'CREATE TABLE SMS ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - sent TIMESTAMP, - sender_id INTEGER NOT NULL, - receiver_id INTEGER NOT NULL, - deliver_attempts INTEGER NOT NULL DEFAULT 0, - valid_until TIMESTAMP, - reply_path_req INTEGER NOT NULL, - status_rep_req INTEGER NOT NULL, - protocol_id INTEGER NOT NULL, - data_coding_scheme INTEGER NOT NULL, - ud_hdr_ind INTEGER NOT NULL, - dest_addr TEXT, - user_data BLOB, - header BLOB, - text TEXT);'; nl; - show: 'CREATE TABLE Subscriber ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - updated TIMESTAMP NOT NULL, - imsi NUMERIC UNIQUE NOT NULL, - name TEXT, - extension TEXT UNIQUE, - authorized INTEGER NOT NULL DEFAULT 0, - tmsi TEXT UNIQUE, - lac INTEGER NOT NULL DEFAULT 0);'; nl. - -"Create some dummy subscribers" -num_sub := 1000. -num_sms := 30. -lac := 1. - -Transcript show: 'BEGIN;'; nl. - -1 to: num_sub do: [:each | - Transcript show: 'INSERT INTO Subscriber - (imsi, created, updated, authorized, lac, extension) - VALUES - (%1, datetime(''now''), datetime(''now''), 1, %2, %3);' % - {(274090000000000 + each). lac. each}; nl. -]. - -1 to: num_sms do: [:sms | - 1 to: num_sub do: [:sub | - Transcript show: 'INSERT INTO SMS - (created, sender_id, receiver_id, valid_until, - reply_path_req, status_rep_req, protocol_id, - data_coding_scheme, ud_hdr_ind, dest_addr, - text) VALUES - (datetime(''now''), 1, %1, ''2222-2-2'', - 0, 0, 0, - 0, 0, ''123456'', - ''abc'');' % {sub}; nl. - ] -]. - -Transcript show: 'COMMIT;'; nl. - -] diff --git a/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st deleted file mode 100644 index bd3f97a..0000000 --- a/contrib/sms/hlr-query.st +++ /dev/null @@ -1,10 +0,0 @@ -"Query for one SMS" - -Eval [ -1 to: 100 do: [:each | - Transcript show: 'SELECT SMS.* FROM SMS - JOIN Subscriber ON SMS.receiver_id = Subscriber.id - WHERE SMS.id >= 1 AND SMS.sent IS NULL AND Subscriber.lac > 0 - ORDER BY SMS.id LIMIT 1;'; nl. -]. -] diff --git a/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d deleted file mode 100644 index e75cdfc..0000000 --- a/contrib/sms/sqlite-probe.tap.d +++ /dev/null @@ -1,5 +0,0 @@ -probe process("/usr/lib/libsqlite3.so.0.8.6").function("sqlite3_get_table") -{ - a = user_string($zSql); - printf("sqlite3_get_table called '%s'\n", a); -} diff --git a/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service deleted file mode 100644 index c040e60..0000000 --- a/contrib/systemd/osmo-bsc-mgcp.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC MGCP - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service deleted file mode 100644 index a0b7829..0000000 --- a/contrib/systemd/osmo-gbproxy.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Osmocom Gb proxy - -[Service] -Type=simple -ExecStart=/usr/bin/osmo-gbproxy -c /etc/osmocom/osmo-gbproxy.cfg -Restart=always -RestartSec=2 -RestartPreventExitStatus=1 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service deleted file mode 100644 index 7cebb14..0000000 --- a/contrib/systemd/osmo-msc.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Osmocom Mobile Switching Center (MSC) -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service deleted file mode 100644 index 377497e..0000000 --- a/contrib/systemd/osmo-nitb.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC Network In the Box (NITB) - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3 -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service deleted file mode 100644 index bf6a8e0..0000000 --- a/contrib/systemd/osmo-sgsn.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=OpenBSC SGSN -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-sgsn -c /etc/osmocom/osmo-sgsn.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/testconv/Makefile b/contrib/testconv/Makefile deleted file mode 100644 index bb856f7..0000000 --- a/contrib/testconv/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -OBJS = testconv_main.o - -CC = gcc -CFLAGS = -O0 -ggdb -Wall -LDFLAGS = -CPPFLAGS = -I../.. -I../../include $(shell pkg-config --cflags libosmocore) $(shell pkg-config --cflags libbcg729) -LIBS = ../../src/libmgcp/libmgcp.a ../../src/libcommon/libcommon.a $(shell pkg-config --libs libosmocore) $(shell pkg-config --libs libbcg729) -lgsm -lrt - -testconv: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) - -testconv_main.o: testconv_main.c - -$(OBJS): - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c deleted file mode 100644 index 6c95c55..0000000 --- a/contrib/testconv/testconv_main.c +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "bscconfig.h" -#ifndef BUILD_MGCP_TRANSCODING -#error "Requires MGCP transcoding enabled (see --enable-mgcp-transcoding)" -#endif - -#include "openbsc/mgcp_transcode.h" - -static int audio_name_to_type(const char *name) -{ - if (!strcasecmp(name, "gsm")) - return 3; -#ifdef HAVE_BCG729 - else if (!strcasecmp(name, "g729")) - return 18; -#endif - else if (!strcasecmp(name, "pcma")) - return 8; - else if (!strcasecmp(name, "l16")) - return 11; - return -1; -} - -int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst); - -int main(int argc, char **argv) -{ - char buf[4096] = {0x80, 0}; - int cc, rc; - struct mgcp_rtp_end *dst_end; - struct mgcp_rtp_end *src_end; - struct mgcp_trunk_config tcfg = {{0}}; - struct mgcp_endpoint endp = {0}; - struct mgcp_process_rtp_state *state; - int in_size; - int in_samples = 160; - int out_samples = 0; - uint32_t ts = 0; - uint16_t seq = 0; - - osmo_init_logging(&log_info); - - tcfg.endpoints = &endp; - tcfg.number_endpoints = 1; - endp.tcfg = &tcfg; - mgcp_initialize_endp(&endp); - - dst_end = &endp.bts_end; - src_end = &endp.net_end; - - if (argc <= 2) - errx(1, "Usage: {gsm|g729|pcma|l16} {gsm|g729|pcma|l16} [SPP]"); - - if ((src_end->codec.payload_type = audio_name_to_type(argv[1])) == -1) - errx(1, "invalid input format '%s'", argv[1]); - if ((dst_end->codec.payload_type = audio_name_to_type(argv[2])) == -1) - errx(1, "invalid output format '%s'", argv[2]); - if (argc > 3) - out_samples = atoi(argv[3]); - - if (out_samples) { - dst_end->codec.frame_duration_den = dst_end->codec.rate; - dst_end->codec.frame_duration_num = out_samples; - dst_end->frames_per_packet = 1; - } - - rc = mgcp_transcoding_setup(&endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); - - state = dst_end->rtp_process_data; - OSMO_ASSERT(state != NULL); - - in_size = mgcp_transcoding_get_frame_size(state, in_samples, 0); - OSMO_ASSERT(sizeof(buf) >= in_size + 12); - - buf[1] = src_end->codec.payload_type; - *(uint16_t*)(buf+2) = htons(1); - *(uint32_t*)(buf+4) = htonl(0); - *(uint32_t*)(buf+8) = htonl(0xaabbccdd); - - while ((cc = read(0, buf + 12, in_size))) { - int cont; - int len; - - if (cc != in_size) - err(1, "read"); - - *(uint16_t*)(buf+2) = htonl(seq); - *(uint32_t*)(buf+4) = htonl(ts); - - seq += 1; - ts += in_samples; - - cc += 12; /* include RTP header */ - - len = cc; - - do { - cont = mgcp_transcoding_process_rtp(&endp, dst_end, - buf, &len, sizeof(buf)); - if (cont == -EAGAIN) { - fprintf(stderr, "Got EAGAIN\n"); - break; - } - - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); - - len -= 12; /* ignore RTP header */ - - if (write(1, buf + 12, len) != len) - err(1, "write"); - - len = cont; - } while (len > 0); - } - return 0; -} - -- To view, visit https://gerrit.osmocom.org/3790 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1805b7943e91695619f1e1e45611b1f24f25c32 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:31:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:31:38 +0000 Subject: [PATCH] osmo-bsc[master]: prune doc/ Message-ID: Review at https://gerrit.osmocom.org/3791 prune doc/ Remove files that are obviously unrelated to osmo-bsc or seem outdated. Change-Id: I464443af7a62b698e4cd0b85e4fa65c921ffc271 --- D doc/call-routing.txt D doc/channel_release.txt D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/gsm-hopping.txt D doc/ipa-sccp.txt D doc/oml-interface.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt 16 files changed, 0 insertions(+), 674 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/3791/1 diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/channel_release.txt b/doc/channel_release.txt deleted file mode 100644 index c9cdfeb..0000000 --- a/doc/channel_release.txt +++ /dev/null @@ -1,95 +0,0 @@ - -GSM 04.08 7.1.7 / 9.1.7 RR CHANNEL RELESE - -RSL 08.58 3.4 / ? RLL Link Release Request - -RSL 08.58 4.6 / 8.4.5 DEACTivate SACCH - * Deactivate SACCH according to Channel Release Proc 04.08 - * to be sent after RR CHANNEL RELEASE is sent to MS - -RSL 08.58 4.7 / 8.4.14 RF CHANnel RELease - * tells the BTS to release a radio channel - * "when an activated radio channel is no longer needed" - * BTS responds with RF CHANnel RELease ACKnowledge - - -GSM 04.08 3.4.13: RR connection release procedure - -* network sends RR CHANNEL RELEASE to MS on the DCCH - * start T3109 - * deactivate SACCH -* MS disconnects main signalling link (by sending DISC) - * all other data links are disconnected by local end link release -* network receives DISC (BTS sends RLL REL IND to BSC) - * stop T3109 - * start T3111 -* when T3111 times out, the network can reuse the channls -* if T3109 times out, the network deactivates the channels - and can reuse them - * this probably means simply RF CHANnel RELease - - -== Implementation in OpenBSC == - -There are two possible reasons a gsm_subscriber_connection -will be released. One is a network failure, the other is -the completion of an operation/transaction. - -=== Failure === -The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback -and the MSC part will release all transactions, operations and such -and the channels will be released as error case. - -=== Success === -Every time an 'operation' or 'transaction' is finished msc_release_connection -will be called and it will determine if the gsm_subscriber_connection can -be released. - -In case it can be released bsc_api.c:gsm0808_clear will be called -which will release all lchan's associated with the connection. For the -primary channel a SACH Deactivate will be send with the release -reason NORMAL RELEASE. - - -bsc_api.c:gsm0808_clear - * Release a channel used for handover - * Release the primary lchan with normal release, SACH deactivate - -chan_alloc.c:lchan_release(chan, sacch_deactivate, reason) - * Start the release procedure. It is working in steps with callbacks - coming from the abis_rsl.c code. - * Release all SAPI's > 0 as local end (The BTS should send a - REL_CONF a message) - * Send SACH Deactivate on SAPI=0 if required. - * Start T3109 (stop it when the main signalling link is disconnected) - or when the channel released. On timeout start the error handling. - * abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are - released and after T3111 has timed out or there is an error. - -RX of RELease INDication: - * Calls internal rsl_handle_release which might release the RF. - -RX of RELease CONFirmation: - * Calls internal rsl_handle_release which might release the RF. - -* RX of RF_CHAN_REL_ACK - * call lchan_free() - - -=== Integration with SMS === - -* RX of CP_ERROR or unimplemented MT - * trigger trans_free() which will msc_release_connection() - -* CP TC1* expired while waiting for CP-ACK - * trigger trans_free() which will msc_release_connection() - -* RX of RP_ERROR - * trigger trans_free() which will msc_release_connection() - -* TX of CP-ACK in MT DELIVER - * trigger trans_free() which will msc_release_connection() - -* RX of CP-ACK in MO SUBMIT - * trigger trans_free() which will msc_release_connection() - diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg deleted file mode 100644 index 3c43f1f..0000000 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! MGCP configuration hand edited -! ! -password foo -! -line vty - no login -! -mgcp - !local ip 10.23.24.2 - !bts ip 10.24.24.1 - !bind ip 10.23.24.1 - bind port 2427 - rtp base 4000 - rtp force-ptime 20 - sdp audio payload number 98 - sdp audio payload name AMR/8000 - number endpoints 31 - no rtcp-omit diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg deleted file mode 100644 index 15fd74a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg +++ /dev/null @@ -1,44 +0,0 @@ -! -! OsmoGbProxy (UNKNOWN) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -ns - nse 666 nsvci 666 - nse 666 remote-role sgsn -! nse 666 encapsulation framerelay-gre -! nse 666 remote-ip 172.16.1.70 -! nse 666 fr-dlci 666 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-port 23000 -! encapsulation framerelay-gre enabled 1 -gbproxy - sgsn nsei 666 - core-mobile-country-code 666 - core-mobile-network-code 6 - core-access-point-name none match-imsi ^666066|^66607 - tlli-list max-length 200 diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg deleted file mode 100644 index 0c3917a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty -!! -! -line vty - no login -! -gbproxy - sgsn nsei 101 -ns - nse 101 nsvci 101 - nse 101 remote-role sgsn - nse 101 encapsulation udp - nse 101 remote-ip 192.168.100.239 - nse 101 remote-port 7777 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation framerelay-gre enabled 0 - encapsulation framerelay-gre local-ip 0.0.0.0 - encapsulation udp local-port 23000 diff --git a/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt deleted file mode 100644 index 9c65f92..0000000 --- a/doc/examples/osmo-gtphub/gtphub-example.txt +++ /dev/null @@ -1,90 +0,0 @@ -Here is a simple setup to test GTPHub operations. The IP addresses picked will -work well only on a system that creates local addresses (127.0.0.123) on the -fly (like linux) -- you may pick of course different IP addresses. - -Overview of the example setup: - - sgsnemu gtphub ggsn - 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 - -Prerequisites: openggsn. - -Have a local directory where you store config files and from which you launch -the GSNs and the hub (they will store restart counter files in that dir). -In it, have these config files: - -ggsn.conf: - - # GGSN local address - listen 127.0.0.2 - - # End User Addresses are picked from this range - net 10.23.42.0/24 - - pcodns1 8.8.8.8 - - logfile /tmp/foo - -gtphub.conf: - - gtphub - bind-to-sgsns 127.0.0.3 - bind-to-ggsns 127.0.0.4 - ggsn-proxy 127.0.0.2 - end - - -( -You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX -address and GGSN IP address to /etc/hosts something like: - - 127.0.0.2 internet.mnc070.mcc901.gprs - -) - - -Once the config files are in place, start the programs, in separate terminals. -GGSN and SGSN need to be started with root priviliges to be able to create tun -interfaces. GTPHub may run as unprivileged user. - -The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. - - -1. GGSN: - - sudo -s - cd - LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf - -2. GTPHub: - - cd - path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level - -3. SGSN tests: - - sudo -s - cd - /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --imsi 420001214365100 --contexts=3 - -Add more SGSNs using different IMSIs and local ports (if the same IMSI is used, -the GGSN will reuse TEIs and tunnels will be discarded automatically): - - /usr/local/bin/sgsnemu --createif -l 127.0.0.11 -r 127.0.0.3 --imsi 420001214365300 --contexts=3 - -This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu -still needs some effort to announce a mobile subscriber or the like (I have -used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). - -The core capability of GTPHub is to manage more than two GSNs, e.g. an SGSN -contacting various GGSNs over the single GTPHub link. You would configure the -SGSN to use one fixed GGSN (sending to gtphub) and gtphub will resolve the -GGSNs once it has received the messages. So the SGSN may be behind NAT (add -"sgsn-use-sender" to gtphub.conf) and communicate to various GGSNs over a -single link to gtphub. - -I hope this helps to get you going. -Any suggestions/patches are welcome! - -~Neels - diff --git a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg deleted file mode 100644 index 3913d2c..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! -! This file is used for VTY tests, referenced by openbsc/osmoappdesc.py -! For the test, try to use most config commands. -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, both on one interface. - ! The side towards SGSN uses nonstandard ports. - bind-to-sgsns ctrl 127.0.0.1 12123 user 127.0.0.1 12153 - ! The GGSN side with standard ports. - bind-to-ggsns 127.0.0.1 - - ! Proxy: unconditionally direct all traffic to... - sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg deleted file mode 100644 index 0dc4150..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, each on standard ports - ! 2123 and 2152. Setting these addresses is mandatory. - bind-to-sgsns 127.0.0.1 - bind-to-ggsns 127.0.0.2 - - ! Local nonstandard ports or separate IPs: - !bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223 - - ! Proxy: unconditionally direct all traffic to... - !ggsn-proxy 127.0.0.3 - !sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - !ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - !grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg deleted file mode 100644 index 1b1d192..0000000 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! OsmoMSC configuration saved from vty -! -line vty - no login -! -network - network country code 1 - mobile network code 1 - short name OsmoMSC - long name OsmoMSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - rrlp mode none - mm info 1 -msc - mgcpgw remote-ip 10.23.24.1 - assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg deleted file mode 100644 index 5e64342..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ /dev/null @@ -1,27 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy accept-all -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg deleted file mode 100644 index 06f035f..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ /dev/null @@ -1,29 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy remote - gsup remote-ip 127.0.0.1 - gsup remote-port 4222 -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/oml-interface.txt b/doc/oml-interface.txt deleted file mode 100644 index 02bead7..0000000 --- a/doc/oml-interface.txt +++ /dev/null @@ -1,22 +0,0 @@ -oml interface design notes - -problems: - -* there is no way how to tag a command sent to the BTS, with the response - having the same tag to identify the originator of the command -* therefore, we can have e.g. both the BSC and the OML interface send a - SET ATTRIBUTE message, where the responses would end up at the wrong - query. -* The BTS has 10s to ACK/NACK a command. We do not run any timers. - -the only possible solutions i can imagine: -* have some kind of exclusive locking, where the OML interface gets blocked - from the BSC and is exclusively assigned to the OML console until all commands - of the OML console have terminated. This can either be done explicitly - dynamically or on demand - -* use the OML interface synchronously, i.e. always wait for the response from - the BTS before - -* unilateral / unsolicited messages need to be broadcasted to both the BSC and - the OML console diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. -- To view, visit https://gerrit.osmocom.org/3791 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I464443af7a62b698e4cd0b85e4fa65c921ffc271 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:31:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:31:38 +0000 Subject: [PATCH] osmo-bsc[master]: rename openbsc.pc to osmo-bsc.pc Message-ID: Review at https://gerrit.osmocom.org/3792 rename openbsc.pc to osmo-bsc.pc Change-Id: I99ab9fea01c11841437b587dffd4e1fff17a291f --- M Makefile.am M configure.ac R osmo-bsc.pc.in 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/92/3792/1 diff --git a/Makefile.am b/Makefile.am index 536b3f4..0f0141b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = openbsc.pc +pkgconfig_DATA = osmo-bsc.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 5d684ef..8107047 100644 --- a/configure.ac +++ b/configure.ac @@ -125,7 +125,7 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - openbsc.pc + osmo-bsc.pc include/openbsc/Makefile include/Makefile src/Makefile diff --git a/openbsc.pc.in b/osmo-bsc.pc.in similarity index 70% rename from openbsc.pc.in rename to osmo-bsc.pc.in index 17e265d..f9b0d24 100644 --- a/openbsc.pc.in +++ b/osmo-bsc.pc.in @@ -3,8 +3,8 @@ libdir=@libdir@ includedir=@includedir@/ -Name: OpenBSC -Description: OpenBSC base station controller +Name: OsmoBSC +Description: OsmoBSC base station controller Requires: Version: @VERSION@ Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/3792 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99ab9fea01c11841437b587dffd4e1fff17a291f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:31:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:31:38 +0000 Subject: [PATCH] osmo-bsc[master]: osmoappdesc.py: drop nitb_e1_configs (and some ws) Message-ID: Review at https://gerrit.osmocom.org/3793 osmoappdesc.py: drop nitb_e1_configs (and some ws) Change-Id: I207cb63f7748a44ea3b520bfaf772d198593f92c --- M osmoappdesc.py 1 file changed, 0 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/93/3793/1 diff --git a/osmoappdesc.py b/osmoappdesc.py index 021bf5b..36eb1a7 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -14,24 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see - -# Most systems won't be able to use these, so they're separated out -nitb_e1_configs = [ - "doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc.cfg", - "doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg", - "doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", - "doc/examples/osmo-nitb/rbs2308/openbsc.cfg" -] - - app_configs = { "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } - apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), -- To view, visit https://gerrit.osmocom.org/3793 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I207cb63f7748a44ea3b520bfaf772d198593f92c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:31:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:31:38 +0000 Subject: [PATCH] osmo-bsc[master]: rewrite README Message-ID: Review at https://gerrit.osmocom.org/3794 rewrite README Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d --- M README 1 file changed, 20 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/94/3794/1 diff --git a/README b/README index d01b2cf..e84849b 100644 --- a/README +++ b/README @@ -1,39 +1,26 @@ -About OpenBSC +About OsmoBSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoBSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoBSC was one of the parts split off from the old openbsc.git. Before, it +worked as a standalone osmo-bsc binary as well as a combination of libbsc and +libmsc, i.e. the old OsmoNITB. Since the standalone OsmoMSC with a true A +interface (and IuCS for 3G support) is available, OsmoBSC exists only as a +separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoBSC exposes +- A over IP towards an MSC (e.g. OsmoMSC); +- Abis interfaces towards various kinds of BTS; +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. +Find OsmoBSC issue tracker and wiki online at +https://osmocom.org/projects/osmobsc +https://osmocom.org/projects/osmobsc/wiki - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +OsmoBSC-NAT is a specialized solution to navigating RTP streams through a NAT. +(Todo: describe in more detail) -- To view, visit https://gerrit.osmocom.org/3794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:31:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:31:39 +0000 Subject: [PATCH] osmo-bsc[master]: drop unused files Message-ID: Review at https://gerrit.osmocom.org/3795 drop unused files These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-bsc. Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a --- D include/openbsc/gsm_04_14.h D src/libcommon/oap_client.c D src/libmsc/gsm_04_14.c D tools/hlrstat.pl 4 files changed, 0 insertions(+), 501 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/3795/1 diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h deleted file mode 100644 index 3cdbe04..0000000 --- a/include/openbsc/gsm_04_14.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode); -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs); -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology); - -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg); diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c deleted file mode 100644 index 5128ac1..0000000 --- a/src/libcommon/oap_client.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures ++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c deleted file mode 100644 index b529f4c..0000000 --- a/src/libmsc/gsm_04_14.c +++ /dev/null @@ -1,133 +0,0 @@ -/* GSM MS Testing Layer 3 messages - * 3GPP TS 44.014 / GSM TS 04.14 */ - -/* (C) 2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include "bscconfig.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static struct msgb *create_gsm0414_msg(uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_TEST; - gh->msg_type = msg_type; - return msg; -} - -static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - return msc_tx_dtap(conn, msg); -} - -static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) -{ - struct msgb *msg = create_gsm0414_msg(msg_type); - - return gsm0414_conn_sendmsg(conn, msg); -} - - -/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); - uint8_t subch; - - subch = (loop_mode << 1); - msgb_put_u8(msg, subch); - - msg->lchan = conn->lchan; - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a OPEN_LOOP_CMD according to Section 8.3 */ -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); -} - -/* Send a ACT_EMMI_CMD according to Section 8.8 */ -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); -} - -/* Send a DEACT_EMMI_CMD according to Section 8.10 */ -int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); -} - -/* Send a TEST_INTERFACE according to Section 8.11 */ -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); - msgb_put_u8(msg, tested_devs); - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); - msgb_put_u8(msg, technology); - return gsm0414_conn_sendmsg(conn, msg); -} - - - -/* Entry point for incoming GSM48_PDISC_TEST received from MS */ -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - - if (msgb_l3len(msg) < sizeof(*gh)) - return -1; - - LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", - get_value_string(gsm414_msgt_names, gh->msg_type)); - - return 0; -} diff --git a/tools/hlrstat.pl b/tools/hlrstat.pl deleted file mode 100755 index 668fc9a..0000000 --- a/tools/hlrstat.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -use strict; -use DBI; -my $dbh = DBI->connect("dbi:SQLite:dbname=hlr.sqlite3","",""); - - -my %mcc_names; -my %mcc_mnc_names; - -sub get_mcc_mnc_name($) -{ - my $mcc_mnc = shift; - my $ret = $mcc_mnc; - - if ($mcc_mnc_names{$mcc_mnc} ne '') { - $ret = $mcc_mnc_names{$mcc_mnc}; - } - - return $ret; -} - -sub read_networks($) -{ - my $filename = shift; - my $cur_name; - - open(INFILE, $filename); - while (my $l = ) { - chomp($l); - if ($l =~ /^#/) { - next; - } - if ($l =~ /^\t/) { - my ($mcc, $mnc, $brand, $r) = split(' ', $l, 4); - #printf("%s|%s|%s\n", $mcc, $mnc, $brand); - $mcc_mnc_names{"$mcc-$mnc"} = $brand; - $mcc_names{$mcc} = $cur_name; - } elsif ($l =~ /^(\w\w)\t(.*)/) { - #printf("%s|%s\n", $1, $2); - $cur_name = $2; - } - } - close(INFILE); -} - -read_networks("networks.tab"); - -my %oper_count; -my %country_count; - -#my $sth = $dbh->prepare("SELECT imsi FROM subscriber where authorized=1"); -my $sth = $dbh->prepare("SELECT imsi FROM subscriber"); - -$sth->execute(); - -while (my $href = $sth->fetchrow_hashref) { - my ($mcc, $mnc) = $$href{imsi} =~ /(\d{3})(\d{2}).*/; - #printf("%s %s-%s \n", $$href{imsi}, $mcc, $mnc); - $oper_count{"$mcc-$mnc"}++; - $country_count{$mcc}++; -} - - -foreach my $c (sort{$country_count{$b} <=> $country_count{$a}} keys %country_count) { - printf("%s: %d\n", $mcc_names{$c}, $country_count{$c}); - - foreach my $k (sort{$oper_count{$b} <=> $oper_count{$a}} keys %oper_count) { - if ($k =~ /^$c-/) { - printf("\t%s: %d\n", get_mcc_mnc_name($k), $oper_count{$k}); - } - } -} -- To view, visit https://gerrit.osmocom.org/3795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:58:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:58:25 +0000 Subject: [PATCH] osmo-sgsn[master]: debian: fix osmo-sgsn.install, tweak VCS link and descriptions Message-ID: Review at https://gerrit.osmocom.org/3796 debian: fix osmo-sgsn.install, tweak VCS link and descriptions Change-Id: I6493a7ca7d996fab00d99652a74a709c860a3de7 --- M debian/control M debian/osmo-sgsn.install 2 files changed, 5 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/96/3796/1 diff --git a/debian/control b/debian/control index 16fd244..4a3a07f 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ libosmo-netif-dev Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-sgsn.git -Vcs-Browser: http://git.osmocom.org/gitweb?p=osmo-sgsn.git;a=summary +Vcs-Browser: https://git.osmocom.org/osmo-sgsn Homepage: https://projects.osmocom.org/projects/osmo-sgsn @@ -42,8 +42,7 @@ Package: osmo-gtphub Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. +Description: Osmocom GTP Hub: Proxy for GTP traffic between multiple SGSNs and GGSNs Package: osmo-gtphub-dbg Architecture: any @@ -51,24 +50,19 @@ Priority: extra Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for Osmocom GTP Hub - Make debugging possible Package: osmo-gbproxy Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: osmocom-sgsn +Recommends: osmo-sgsn Description: Osmocom GPRS Gb Interface Proxy The purpose of the Gb proxy is to aggregate the Gb links of multiple BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. Package: osmo-gbproxy-dbg Architecture: any Section: debug Priority: extra Depends: osmo-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible - +Description: Debug symbols for Osmocom GPRS Gb Interface Proxy diff --git a/debian/osmo-sgsn.install b/debian/osmo-sgsn.install index 55086cc..a92ae18 100644 --- a/debian/osmo-sgsn.install +++ b/debian/osmo-sgsn.install @@ -1,4 +1,2 @@ -usr/bin -usr/share/doc/openbsc/examples/osmo-gtphub -usr/share/doc/openbsc/examples/osmo-gbproxy +usr/bin/osmo-sgsn usr/share/doc/openbsc/examples/osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6493a7ca7d996fab00d99652a74a709c860a3de7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 01:58:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 01:58:25 +0000 Subject: [PATCH] osmo-sgsn[master]: drop files unrelated to osmo-sgsn Message-ID: Review at https://gerrit.osmocom.org/3797 drop files unrelated to osmo-sgsn These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-sgsn. Change-Id: Ie9dc7514c3850010d0e9b3ab716b4f4e8d83594f --- D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/mgcp_server.py D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/systemd/osmo-bsc-mgcp.service D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c M debian/copyright D doc/BS11-OML.txt D doc/call-routing.txt D doc/channel_release.txt D doc/e1-data-model.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/bscs.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-msc/osmo-msc.cfg D doc/gsm-hopping.txt D doc/handover.txt D doc/ipa-sccp.txt D doc/oml-interface.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/a_reset.h D include/openbsc/gsm_04_14.h D include/openbsc/iu_dummy.h M src/Makefile.am D src/libmsc/gsm_04_14.c D src/libmsc/iu_dummy.c D tools/hlrstat.pl 59 files changed, 0 insertions(+), 3,583 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/97/3797/1 diff --git a/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua deleted file mode 100644 index f5d5502..0000000 --- a/contrib/a-link/sccp-split-by-con.lua +++ /dev/null @@ -1,170 +0,0 @@ --- Split trace based on SCCP Source --- There are still bugs to find... bugs bugs bugs... hmm -do - local function init_listener() - print("CREATED LISTENER") - local tap = Listener.new("ip", "sccp && (ip.src == 172.16.1.81 || ip.dst == 172.16.1.81)") - local sccp_type_field = Field.new("sccp.message_type") - local sccp_src_field = Field.new("sccp.slr") - local sccp_dst_field = Field.new("sccp.dlr") - local msg_type_field = Field.new("gsm_a.dtap_msg_mm_type") - local lu_rej_field = Field.new("gsm_a.dtap.rej_cause") - local ip_src_field = Field.new("ip.src") - local ip_dst_field = Field.new("ip.dst") - - -- - local bssmap_msgtype_field = Field.new("gsm_a.bssmap_msgtype") - -- assignment failure 0x03 - -- - - -- - local dtap_cause_field = Field.new("gsm_a_dtap.cause") - local dtap_cc_field = Field.new("gsm_a.dtap_msg_cc_type") - - local connections = {} - - function check_failure(con) - check_lu_reject(con) - check_disconnect(con) - check_failures(con) - end - - -- cipher mode reject - function check_failures(con) - local msgtype = bssmap_msgtype_field() - if not msgtype then - return - end - - msgtype = tonumber(msgtype) - if msgtype == 89 then - print("Cipher mode reject") - con[4] = true - elseif msgtype == 0x03 then - print("Assignment failure") - con[4] = true - elseif msgtype == 0x22 then - print("Clear Request... RF failure?") - con[4] = true - end - end - - -- check if a DISCONNECT is normal - function check_disconnect(con) - local msg_type = dtap_cc_field() - if not msg_type then - return - end - - if tonumber(msg_type) ~= 0x25 then - return - end - - local cause = dtap_cause_field() - if not cause then - return - end - - cause = tonumber(cause) - if cause ~= 0x10 then - print("DISCONNECT != Normal") - con[4] = true - end - end - - -- check if we have a LU Reject - function check_lu_reject(con) - local msg_type = msg_type_field() - if not msg_type then - return - end - - msg_type = tonumber(tostring(msg_type)) - if msg_type == 0x04 then - print("LU REJECT with " .. tostring(lu_rej_field())) - con[4] = true - end - end - - function tap.packet(pinfo,tvb,ip) - local ip_src = tostring(ip_src_field()) - local ip_dst = tostring(ip_dst_field()) - local sccp_type = tonumber(tostring(sccp_type_field())) - local sccp_src = sccp_src_field() - local sccp_dst = sccp_dst_field() - - local con - - if sccp_type == 0x01 then - elseif sccp_type == 0x2 then - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local datestring = os.date("%Y%m%d%H%M%S") - local pcap_name = string.format("alink_trace_%s-%s_%s.pcap", src, dst, datestring) - local dumper = Dumper.new_for_current(pcap_name) - - local con = { ip_src, tostring(sccp_src), tostring(sccp_dst), false, dumper, pcap_name } - - dumper:dump_current() - connections[src] = con - connections[dst] = con - elseif sccp_type == 0x4 then - -- close a connection... remove it from the list - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - - local con = connections[src] - if not con then - return - end - - con[5]:dump_current() - con[5]:flush() - - -- this causes a crash on unpacted wireshark - con[5]:close() - - -- the connection had a failure - if con[4] == true then - local datestring = os.date("%Y%m%d%H%M%S") - local new_name = string.format("alink_failure_%s_%s-%s.pcap", datestring, con[2], con[3]) - os.rename(con[6], new_name) - else - os.remove(con[6]) - end - - - -- clear the old connection - connections[src] = nil - connections[dst] = nil - - elseif sccp_type == 0x5 then - -- not handled yet... we should verify stuff here... - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - return - end - con[5]:dump_current() - elseif sccp_type == 0x6 then - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - print("DON'T KNOW THIS CONNECTION for " .. ip_dst) - return - end - con[5]:dump_current() - check_failure(con) - end - - end - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end - end - - init_listener() -end diff --git a/contrib/bsc-test/README b/contrib/bsc-test/README deleted file mode 100644 index adb222e..0000000 --- a/contrib/bsc-test/README +++ /dev/null @@ -1 +0,0 @@ -Some crazy scripts call testing... and MSC link failure simulation diff --git a/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial deleted file mode 100644 index 96e5f00..0000000 --- a/contrib/bsc-test/all_dial +++ /dev/null @@ -1,8 +0,0 @@ -ABORT BUSY -ABORT 'NO CARRIER' -ABORT 'OK' - -'' AT -SAY "Dialing a number\n" -'OK' ATD05660066; - diff --git a/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh deleted file mode 100755 index e5e19f6..0000000 --- a/contrib/bsc-test/dial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Evil dial script.. - -while true; -do - chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0 - sleep 5s - chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0 - sleep 2s -done - diff --git a/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh deleted file mode 100755 index 84eead7..0000000 --- a/contrib/bsc-test/drop-oml.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -sleep 3 -echo "enable" -sleep 1 -echo "drop bts connection 0 oml" -sleep 1 diff --git a/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh deleted file mode 100755 index c7b66ba..0000000 --- a/contrib/bsc-test/drop.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Going to drop the OML connection" - ./drop-oml.sh | telnet 127.0.0.1 4242 - sleep 58m -done diff --git a/contrib/bsc-test/hangup b/contrib/bsc-test/hangup deleted file mode 100644 index cad6870..0000000 --- a/contrib/bsc-test/hangup +++ /dev/null @@ -1,4 +0,0 @@ -TIMEOUT 10 -'' ^Z -SAY "Waiting for hangup confirm\n" -'' ATH; diff --git a/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh deleted file mode 100755 index bec011d..0000000 --- a/contrib/bsc-test/msc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` - sleep 58s -done diff --git a/contrib/bsc_control.py b/contrib/bsc_control.py deleted file mode 100755 index c1b09ce..0000000 --- a/contrib/bsc_control.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/python -# -*- mode: python-mode; py-indent-tabs-mode: nil -*- -""" -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -""" - -from optparse import OptionParser -from ipa import Ctrl -import socket - -verbose = False - -def connect(host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - return sck - -def do_set_get(sck, var, value = None): - (r, c) = Ctrl().cmd(var, value) - sck.send(c) - answer = Ctrl().rem_header(sck.recv(4096)) - return (answer,) + Ctrl().verify(answer, r, var, value) - -def set_var(sck, var, val): - (a, _, _) = do_set_get(sck, var, val) - return a - -def get_var(sck, var): - (_, _, v) = do_set_get(sck, var) - return v - -def _leftovers(sck, fl): - """ - Read outstanding data if any according to flags - """ - try: - data = sck.recv(1024, fl) - except socket.error as (s_errno, strerror): - return False - if len(data) != 0: - tail = data - while True: - (head, tail) = Ctrl().split_combined(tail) - print "Got message:", Ctrl().rem_header(head) - if len(tail) == 0: - break - return True - return False - -if __name__ == '__main__': - parser = OptionParser("Usage: %prog [options] var [value]") - parser.add_option("-d", "--host", dest="host", - help="connect to HOST", metavar="HOST") - parser.add_option("-p", "--port", dest="port", type="int", - help="use PORT", metavar="PORT", default=4249) - parser.add_option("-g", "--get", action="store_true", - dest="cmd_get", help="perform GET operation") - parser.add_option("-s", "--set", action="store_true", - dest="cmd_set", help="perform SET operation") - parser.add_option("-v", "--verbose", action="store_true", - dest="verbose", help="be verbose", default=False) - parser.add_option("-m", "--monitor", action="store_true", - dest="monitor", help="monitor the connection for traps", default=False) - - (options, args) = parser.parse_args() - - verbose = options.verbose - - if options.cmd_set and options.cmd_get: - parser.error("Get and set options are mutually exclusive!") - - if not (options.cmd_get or options.cmd_set or options.monitor): - parser.error("One of -m, -g, or -s must be set") - - if not (options.host): - parser.error("Destination host and port required!") - - sock = connect(options.host, options.port) - - if options.cmd_set: - if len(args) < 2: - parser.error("Set requires var and value arguments") - _leftovers(sock, socket.MSG_DONTWAIT) - print "Got message:", set_var(sock, args[0], ' '.join(args[1:])) - - if options.cmd_get: - if len(args) != 1: - parser.error("Get requires the var argument") - _leftovers(sock, socket.MSG_DONTWAIT) - (a, _, _) = do_set_get(sock, args[0]) - print "Got message:", a - - if options.monitor: - while True: - if not _leftovers(sock, 0): - print "Connection is gone." - break - sock.close() diff --git a/contrib/bt.py b/contrib/bt.py deleted file mode 100755 index 1b111ef..0000000 --- a/contrib/bt.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os - -f = open("unbalanced") -lines = [] -for line in f: - lines.append(line) - -filenames = {} - -output = [] -for line in lines: - if "[0x" in line: - start = line.find("[") - end = line.find("]") - addr = line[start+1:end] - try: - file = filenames[addr] - except KeyError: - r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr) - all = r.read().replace("\n", ",") - file = all - filenames[addr] = file - - line = line.replace(addr, file) - output.append(line) - -g = open("unbalanced.2", "w") -g.write("".join(output)) - - - diff --git a/contrib/convert_to_enum.py b/contrib/convert_to_enum.py deleted file mode 100755 index bcd6f2c..0000000 --- a/contrib/convert_to_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# -# Convert ETSI documents to an enum -# - -import re, sys - -def convert(string): - string = string.strip().replace(" ", "").rjust(8, "0") - var = 0 - offset = 7 - for char in string: - assert offset >= 0 - var = var | (int(char) << offset) - offset = offset - 1 - - return var - -def string(name): - name = name.replace(" ", "_") - name = name.replace('"', "") - name = name.replace('/', '_') - name = name.replace('(', '_') - name = name.replace(')', '_') - return "%s_%s" % (sys.argv[2], name.upper()) - -file = open(sys.argv[1]) - - -for line in file: - m = re.match(r"[ \t]*(?P[01 ]+)[ ]+(?P[a-zA-Z /0-9()]+)", line[:-1]) - - if m: - print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"])) - else: - print line[:-1] diff --git a/contrib/ctrl2sse.py b/contrib/ctrl2sse.py deleted file mode 100755 index 8b630ec..0000000 --- a/contrib/ctrl2sse.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python2 - -mod_license = ''' -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -''' - -import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control -from eventsource import listener, request - -''' -N. B: this is not an example of building proper REST API or building secure web application. -It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API. -Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem -from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that. -''' - -token = None -stream = None -url = None - -''' -Returns json according to following schema - see http://json-schema.org/documentation.html for details: -{ - "title": "Ctrl Schema", - "type": "object", - "properties": { - "variable": { - "type": "string" - }, - "varlue": { - "type": "string" - } - }, - "required": ["interface", "variable", "value"] -} -Example validation from command-line: -json validate --schema-file=schema.json --document-file=data.json -The interface is represented as string because it might look different for IPv4 vs v6. -''' - -def read_header(data): - t_length = bsc_control.ipa_ctrl_header(data) - if (t_length): - stream.read_bytes(t_length - 1, callback = read_trap) - else: - print >> sys.stderr, "protocol error: length missing in %s!" % data - - at tornado.gen.coroutine -def read_trap(data): - (t, z, v, p) = data.split() - if (t != 'TRAP' or int(z) != 0): - print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z)) - else: - yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token), - method = 'POST', - headers = {'Content-Type': 'application/json'}, - body = tornado.escape.json_encode({ 'variable' : v, 'value' : p }))) - stream.read_bytes(4, callback = read_header) - - at tornado.gen.coroutine -def trap_setup(host, port, target_host, target_port, tk): - global stream - global url - global token - token = tk - url = "http://%s:%s/sse" % (host, port) - stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port) - stream.read_bytes(4, callback = read_header) - -def get_v(s, v): - return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) } - -class CtrlHandler(tornado.web.RequestHandler): - def initialize(self): - self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port']) - - def get(self, v): - self.write(get_v(self.skt, v)) - - def post(self): - self.write(get_v(self.skt, self.get_argument("variable"))) - -class SetCtrl(CtrlHandler): - def get(self, var, val): - bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val)) - super(SetCtrl, self).get(tornado.escape.native_str(var)) - - def post(self): - bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value"))) - super(SetCtrl, self).post() - -class Slash(tornado.web.RequestHandler): - def get(self): - self.write('%sUsing Tornado framework v%s' - '
' - '' - '' - '
' - '
' - '' - '' - '' - '
' - '' % ("Osmocom Control Interface Proxy", tornado.version)) - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.') - p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port") - p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress") - p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface") - p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface") - p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)") - p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value") - p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000") - args = p.parse_args() - random.seed() - tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver - logging.basicConfig() - application = tornado.web.Application([ - (r"/", Slash), - (r"/get", CtrlHandler), - (r"/get/(.*)", CtrlHandler), - (r"/set", SetCtrl), - (r"/set/(.*)/(.*)", SetCtrl), - (r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)), - ], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port) - application.listen(address = args.host, port = args.port) - trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token) - tornado.ioloop.IOLoop.instance().start() diff --git a/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql deleted file mode 100644 index 626a331..0000000 --- a/contrib/hlr-remove-old.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Remove old data from the database -DELETE FROM Subscriber - WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1; -DELETE FROM Equipment - WHERE datetime('now', '-10 days') > updated; -DELETE FROM EquipmentWatch - WHERE datetime('now', '-10 days') > updated; -DELETE FROM SMS - WHERE datetime('now', '-10 days') > created; -DELETE FROM VLR - WHERE datetime('now', '-10 days') > updated; -DELETE FROM ApduBlobs - WHERE datetime('now', '-10 days') > created; -DELETE FROM Counters - WHERE datetime('now', '-10 days') > timestamp; -DELETE FROM RateCounters - WHERE datetime('now', '-10 days') > timestamp; -VACUUM; diff --git a/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py deleted file mode 100755 index e4a4955..0000000 --- a/contrib/hlrsync/hlrsync.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python2.5 - -from __future__ import with_statement - -from pysqlite2 import dbapi2 as sqlite3 -import sys - -hlr = sqlite3.connect(sys.argv[1]) -web = sqlite3.connect(sys.argv[2]) - -# switch to autocommit -hlr.isolation_level = None -web.isolation_level = None - -hlr.row_factory = sqlite3.Row -web.row_factory = sqlite3.Row - -with hlr: - hlr_subscrs = hlr.execute(""" - SELECT * FROM Subscriber - """).fetchall() - hlr_tokens = hlr.execute(""" - SELECT * FROM AuthToken - """).fetchall() - -with web: - web_tokens = web.execute(""" - SELECT * FROM reg_tokens - """).fetchall() - web_sms = web.execute(""" - SELECT * FROM sms_queue - """).fetchall() - -# index by subscr id -hlr_subscrs_by_id = {} -hlr_subscrs_by_ext = {} -hlr_tokens_by_subscr_id = {} -for x in hlr_subscrs: - hlr_subscrs_by_id[x['id']] = x - hlr_subscrs_by_ext[x['extension']] = x -del hlr_subscrs -for x in hlr_tokens: - hlr_tokens_by_subscr_id[x['subscriber_id']] = x -del hlr_tokens - -web_tokens_by_subscr_id = {} -for x in web_tokens: - web_tokens_by_subscr_id[x['subscriber_id']] = x -del web_tokens - -# remove leftover web_tokens and correct inconsistent fields -with web: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - web.execute(""" - DELETE FROM reg_tokens WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del web_tokens_by_subscr_id[x['subscriber_id']] - continue - if str(x['imsi']) != str(subscr['imsi']) or \ - x['extension'] != subscr['extension'] or \ - x['tmsi'] != subscr['tmsi'] or \ - x['lac'] != subscr['lac']: - web.execute(""" - UPDATE reg_tokens - SET imsi = ?, extension = ?, tmsi = ?, lac = ? - WHERE subscriber_id = ? - """, (str(subscr['imsi']), subscr['extension'], - subscr['tmsi'], subscr['lac'], x['subscriber_id'])) - -# add missing web_tokens -with web: - for x in hlr_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - hlr.execute(""" - DELETE FROM AuthToken WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del hlr_tokens_by_subscr_id[x['subscriber_id']] - continue - webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None) - if webtoken is None: - web.execute(""" - INSERT INTO reg_tokens - (subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi) - VALUES - (?, ?, 0, ?, '', ?, ?, ?, ?) - """, (x['subscriber_id'], subscr['extension'], subscr['name'], - subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi'])) - -# authorize subscribers -with hlr: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if x['reg_completed'] and not subscr['authorized']: - hlr.execute(""" - UPDATE Subscriber - SET authorized = 1 - WHERE id = ? - """, (x['subscriber_id'],)) - -# Sync SMS from web to hlr -with hlr: - for sms in web_sms: - subscr = hlr_subscrs_by_ext.get(sms['receiver_ext']) - if subscr is None: - print '%s not found' % sms['receiver_ext'] - continue - hlr.execute(""" - INSERT INTO SMS - (created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text) - VALUES - (?, 1, ?, 0, 0, 0, 0, 0, ?) - """, (sms['created'], subscr['id'], sms['text'])) -with web: - for sms in web_sms: - web.execute(""" - DELETE FROM sms_queue WHERE id = ? - """, (sms['id'],)) - - -hlr.close() -web.close() - diff --git a/contrib/mgcp_server.py b/contrib/mgcp_server.py deleted file mode 100755 index 05c489d..0000000 --- a/contrib/mgcp_server.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Simple server for mgcp... send audit, receive response.. - -import socket, time - -MGCP_GATEWAY_PORT = 2427 -MGCP_CALLAGENT_PORT = 2727 - -rsip_resp = """200 321321332\r\n""" -audit_packet = """AUEP %d 13 at mgw MGCP 1.0\r\n""" -crcx_packet = """CRCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n""" -dlcx_packet = """DLCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\n""" -mdcx_packet = """MDCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 258696477 0 IN IP4 172.16.1.107\r\ns=-\r\nc=IN IP4 172.16.1.107\r\nt=0 0\r\nm=audio 6666 RTP/AVP 127\r\na=rtpmap:127 GSM-EFR/8000/1\r\na=ptime:20\r\na=recvonly\r\nm=image 4402 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n""" - -def hexdump(src, length=8): - """Recipe is from http://code.activestate.com/recipes/142812/""" - result = [] - digits = 4 if isinstance(src, unicode) else 2 - for i in xrange(0, len(src), length): - s = src[i:i+length] - hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s]) - text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) - result.append( b"%04X %-*s %s" % (i, length*(digits + 1), hexa, text) ) - return b'\n'.join(result) - -server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -server_socket.bind(("127.0.0.1", MGCP_CALLAGENT_PORT)) -server_socket.setblocking(1) - -last_ci = 1 -def send_and_receive(packet): - global last_ci - server_socket.sendto(packet, ("127.0.0.1", MGCP_GATEWAY_PORT)) - try: - data, addr = server_socket.recvfrom(4096) - - # attempt to store the CI of the response - list = data.split("\n") - for item in list: - if item.startswith("I: "): - last_ci = int(item[3:]) - - print hexdump(data), addr - except socket.error, e: - print e - pass - -def generate_tid(): - import random - return random.randint(0, 65123) - - - -while True: - send_and_receive(audit_packet % generate_tid()) - send_and_receive(crcx_packet % generate_tid() ) - send_and_receive(mdcx_packet % (generate_tid(), last_ci)) - send_and_receive(dlcx_packet % (generate_tid(), last_ci)) - - time.sleep(3) diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c deleted file mode 100644 index 808a703..0000000 --- a/contrib/nat/test_regexp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* make test_regexp */ -#include -#include -#include - - -int main(int argc, char **argv) -{ - regex_t reg; - regmatch_t matches[2]; - - if (argc != 4) { - printf("Invoke with: test_regexp REGEXP REPLACE NR\n"); - return -1; - } - - if (regcomp(®, argv[1], REG_EXTENDED) != 0) { - fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]); - return -1; - } - - if (regexec(®, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1) - printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]); - else - printf("No match.\n"); - - regfree(®); - - return 0; -} diff --git a/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py deleted file mode 100644 index 8f7a58d..0000000 --- a/contrib/nat/ussd_example.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2.7 - -""" -AGPLv3+ 2016 Copyright Holger Hans Peter Freyther - -Example of how to connect to the USSD side-channel and how to respond -with a fixed message. -""" - -import socket -import struct - -ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ussdSocket.connect(('127.0.0.1', 5001)) - -def send_dt1(dstref, data): - dlen = struct.pack('B', len(data)).encode('hex') - hex = '06' + dstref.encode('hex') + '00' + '01' + dlen + data.encode('hex') - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def send_rel(srcref, dstref): - hex = '04' + dstref.encode('hex') + srcref.encode('hex') + '000100' - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def recv_one(): - plen = ussdSocket.recv(3) - (plen,ptype) = struct.unpack(">HB", plen) - data = ussdSocket.recv(plen) - - return ptype, data - -# Assume this is the ID request -data = ussdSocket.recv(4) -ussdSocket.send("\x00\x08\xfe\x05\x00" + "\x05\x01" + "ussd") -# ^len ^len of tag ... and ignore - -# Expect a fake message. see struct ipac_msgt_sccp_state -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) -(srcref, dstref, transid, invokeid) = struct.unpack("<3s3sBB", data[1:9]) -print("New transID %d invoke %d" % (transid, invokeid)) - -# Expect a the invocation.. todo.. extract invoke id -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) - -# Reply with BSSAP + GSM 04.08 + MAP portion -# 00 == invoke id 0f == DCS -res = "01002a9b2a0802e1901c22a220020100301b02013b301604010f041155e7d2f9bc3a41412894991c06a9c9a713" -send_dt1(dstref, res.decode('hex')) - -clear = "000420040109" -send_dt1(dstref, clear.decode('hex')) - -# should be the clear complete -send_rel(srcref, dstref) - -# Give it some time to handle connection shutdown properly -print("Gracefully sleeping") -import time -time.sleep(3) diff --git a/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl deleted file mode 100755 index 47839c1..0000000 --- a/contrib/rtp/gen_rtp_header.erl +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- -%%! -smp disable --module(gen_rtp_header). - -% -mode(compile). - --define(VERSION, "0.1"). - --export([main/1]). - --record(rtp_packet, - { - version = 2, - padding = 0, - marker = 0, - payload_type = 0, - seqno = 0, - timestamp = 0, - ssrc = 0, - csrcs = [], - extension = <<>>, - payload = <<>>, - realtime - }). - - -main(Args) -> - DefaultOpts = [{format, state}, - {ssrc, 16#11223344}, - {rate, 8000}, - {pt, 98}], - {PosArgs, Opts} = getopts_checked(Args, DefaultOpts), - log(debug, fun (Dev) -> - io:format(Dev, "Initial options:~n", []), - dump_opts(Dev, Opts), - io:format(Dev, "~s: ~p~n", ["Args", PosArgs]) - end, [], Opts), - main(PosArgs, Opts). - -main([First | RemArgs], Opts) -> - try - F = list_to_integer(First), - Format = proplists:get_value(format, Opts, state), - PayloadData = proplists:get_value(payload, Opts, undef), - InFile = proplists:get_value(file, Opts, undef), - - Payload = case {PayloadData, InFile} of - {undef, undef} -> - % use default value - #rtp_packet{}#rtp_packet.payload; - {P, undef} -> P; - {_, File} -> - log(info, "Loading file '~s'~n", [File], Opts), - {ok, InDev} = file:open(File, [read]), - DS = [ Pl#rtp_packet.payload || {_T, Pl} <- read_packets(InDev, Opts)], - file:close(InDev), - log(debug, "File '~s' closed, ~w packets read.~n", [File, length(DS)], Opts), - DS - end, - Dev = standard_io, - write_packet_pre(Dev, Format), - do_groups(Dev, Payload, F, RemArgs, Opts), - write_packet_post(Dev, Format), - 0 - catch - _:_ -> - log(debug, "~p~n", [hd(erlang:get_stacktrace())], Opts), - usage(), - halt(1) - end - ; - -main(_, _Opts) -> - usage(), - halt(1). - -%%% group (count + offset) handling %%% - -do_groups(_Dev, _Pl, _F, [], _Opts) -> - ok; - -do_groups(Dev, Pl, F, [L], Opts) -> - do_groups(Dev, Pl, F, [L, 0], Opts); - -do_groups(Dev, Pl, First, [L, O | Args], Opts) -> - Ssrc = proplists:get_value(ssrc, Opts, #rtp_packet.ssrc), - PT = proplists:get_value(pt, Opts, #rtp_packet.payload_type), - Len = list_to_num(L), - Offs = list_to_num(O), - log(info, "Starting group: Ssrc=~.16B, PT=~B, First=~B, Len=~B, Offs=~B~n", - [Ssrc, PT, First, Len, Offs], Opts), - Pkg = #rtp_packet{ssrc = Ssrc, payload_type = PT}, - Pl2 = write_packets(Dev, Pl, Pkg, First, Len, Offs, Opts), - {Args2, Opts2} = getopts_checked(Args, Opts), - log(debug, fun (Io) -> - io:format(Io, "Changed options:~n", []), - dump_opts(Io, Opts2 -- Opts) - end, [], Opts), - do_groups(Dev, Pl2, First+Len, Args2, Opts2). - -%%% error handling helpers %%% - -getopts_checked(Args, Opts) -> - try - getopts(Args, Opts) - catch - C:R -> - log(error, "~s~n", - [explain_error(C, R, erlang:get_stacktrace(), Opts)], Opts), - usage(), - halt(1) - end. - -explain_error(error, badarg, [{erlang,list_to_integer,[S,B]} | _ ], _Opts) -> - io_lib:format("Invalid number '~s' (base ~B)", [S, B]); -explain_error(error, badarg, [{erlang,list_to_integer,[S]} | _ ], _Opts) -> - io_lib:format("Invalid decimal number '~s'", [S]); -explain_error(C, R, [Hd | _ ], _Opts) -> - io_lib:format("~p, ~p:~p", [Hd, C, R]); -explain_error(_, _, [], _Opts) -> - "". - -%%% usage and options %%% - -myname() -> - filename:basename(escript:script_name()). - -usage(Text) -> - io:format(standard_error, "~s: ~s~n", [myname(), Text]), - usage(). - -usage() -> - io:format(standard_error, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n", - [myname()]). - -show_version() -> - io:format(standard_io, - "~s ~s~n", [myname(), ?VERSION]). - -show_help() -> - io:format(standard_io, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n~n" ++ - "Options:~n" ++ - " -h, --help this text~n" ++ - " --version show version info~n" ++ - " -i, --file=FILE reads payload from file (state format by default)~n" ++ - " -f, --frame-size=N read payload as binary frames of size N instead~n" ++ - " -p, --payload=HEX set constant payload~n" ++ - " --verbose=N set verbosity~n" ++ - " -v increase verbosity~n" ++ - " --format=state use state format for output (default)~n" ++ - " -C, --format=c use simple C lines for output~n" ++ - " --format=carray use a C array for output~n" ++ - " -s, --ssrc=SSRC set the SSRC~n" ++ - " -t, --type=N set the payload type~n" ++ - " -r, --rate=N set the RTP rate [8000]~n" ++ - " -D, --duration=N set the packet duration in RTP time units [160]~n" ++ - " -d, --delay=FLOAT add offset to playout timestamp~n" ++ - "~n" ++ - "Arguments:~n" ++ - " Start initial packet (sequence) number~n" ++ - " Count number of packets~n" ++ - " Offs timestamp offset (in RTP units)~n" ++ - "", [myname()]). - -getopts([ "--file=" ++ File | R], Opts) -> - getopts(R, [{file, File} | Opts]); -getopts([ "-i" ++ T | R], Opts) -> - getopts_alias_arg("--file", T, R, Opts); -getopts([ "--frame-size=" ++ N | R], Opts) -> - Size = list_to_integer(N), - getopts(R, [{frame_size, Size}, {in_format, bin} | Opts]); -getopts([ "-f" ++ T | R], Opts) -> - getopts_alias_arg("--frame-size", T, R, Opts); -getopts([ "--duration=" ++ N | R], Opts) -> - Duration = list_to_integer(N), - getopts(R, [{duration, Duration} | Opts]); -getopts([ "-D" ++ T | R], Opts) -> - getopts_alias_arg("--duration", T, R, Opts); -getopts([ "--rate=" ++ N | R], Opts) -> - Rate = list_to_integer(N), - getopts(R, [{rate, Rate} | Opts]); -getopts([ "-r" ++ T | R], Opts) -> - getopts_alias_arg("--rate", T, R, Opts); -getopts([ "--version" | _], _Opts) -> - show_version(), - halt(0); -getopts([ "--help" | _], _Opts) -> - show_help(), - halt(0); -getopts([ "-h" ++ T | R], Opts) -> - getopts_alias_no_arg("--help", T, R, Opts); -getopts([ "--verbose=" ++ V | R], Opts) -> - Verbose = list_to_integer(V), - getopts(R, [{verbose, Verbose} | Opts]); -getopts([ "-v" ++ T | R], Opts) -> - Verbose = proplists:get_value(verbose, Opts, 0), - getopts_short_no_arg(T, R, [ {verbose, Verbose+1} | Opts]); -getopts([ "--format=state" | R], Opts) -> - getopts(R, [{format, state} | Opts]); -getopts([ "--format=c" | R], Opts) -> - getopts(R, [{format, c} | Opts]); -getopts([ "-C" ++ T | R], Opts) -> - getopts_alias_no_arg("--format=c", T, R, Opts); -getopts([ "--format=carray" | R], Opts) -> - getopts(R, [{format, carray} | Opts]); -getopts([ "--payload=" ++ Hex | R], Opts) -> - getopts(R, [{payload, hex_to_bin(Hex)} | Opts]); -getopts([ "--ssrc=" ++ Num | R], Opts) -> - getopts(R, [{ssrc, list_to_num(Num)} | Opts]); -getopts([ "-s" ++ T | R], Opts) -> - getopts_alias_arg("--ssrc", T, R, Opts); -getopts([ "--type=" ++ Num | R], Opts) -> - getopts(R, [{pt, list_to_num(Num)} | Opts]); -getopts([ "-t" ++ T | R], Opts) -> - getopts_alias_arg("--type", T, R, Opts); -getopts([ "--delay=" ++ Num | R], Opts) -> - getopts(R, [{delay, list_to_float(Num)} | Opts]); -getopts([ "-d" ++ T | R], Opts) -> - getopts_alias_arg("--delay", T, R, Opts); - -% parsing helpers -getopts([ "--" | R], Opts) -> - {R, normalize_opts(Opts)}; -getopts([ O = "--" ++ _ | _], _Opts) -> - usage("Invalid option: " ++ O), - halt(1); -getopts([ [ $-, C | _] | _], _Opts) when C < $0; C > $9 -> - usage("Invalid option: -" ++ [C]), - halt(1); - -getopts(R, Opts) -> - {R, normalize_opts(Opts)}. - -getopts_short_no_arg([], R, Opts) -> getopts(R, Opts); -getopts_short_no_arg(T, R, Opts) -> getopts([ "-" ++ T | R], Opts). - -getopts_alias_no_arg(A, [], R, Opts) -> getopts([A | R], Opts); -getopts_alias_no_arg(A, T, R, Opts) -> getopts([A, "-" ++ T | R], Opts). - -getopts_alias_arg(A, [], [T | R], Opts) -> getopts([A ++ "=" ++ T | R], Opts); -getopts_alias_arg(A, T, R, Opts) -> getopts([A ++ "=" ++ T | R], Opts). - -normalize_opts(Opts) -> - [ proplists:lookup(E, Opts) || E <- proplists:get_keys(Opts) ]. - -%%% conversions %%% - -bin_to_hex(Bin) -> [hd(integer_to_list(N,16)) || <> <= Bin]. -hex_to_bin(Hex) -> << <<(list_to_integer([Nib],16)):4>> || Nib <- Hex>>. - -list_to_num("-" ++ Str) -> -list_to_num(Str); -list_to_num("0x" ++ Str) -> list_to_integer(Str, 16); -list_to_num("0b" ++ Str) -> list_to_integer(Str, 2); -list_to_num(Str = [ $0 | _ ]) -> list_to_integer(Str, 8); -list_to_num(Str) -> list_to_integer(Str, 10). - -%%% dumping data %%% - -dump_opts(Dev, Opts) -> - dump_opts2(Dev, Opts, proplists:get_keys(Opts)). - -dump_opts2(Dev, Opts, [OptName | R]) -> - io:format(Dev, " ~-10s: ~p~n", - [OptName, proplists:get_value(OptName, Opts)]), - dump_opts2(Dev, Opts, R); -dump_opts2(_Dev, _Opts, []) -> ok. - -%%% logging %%% - -log(L, Fmt, Args, Opts) when is_list(Opts) -> - log(L, Fmt, Args, proplists:get_value(verbose, Opts, 0), Opts). - -log(debug, Fmt, Args, V, Opts) when V > 2 -> log2("DEBUG", Fmt, Args, Opts); -log(info, Fmt, Args, V, Opts) when V > 1 -> log2("INFO", Fmt, Args, Opts); -log(notice, Fmt, Args, V, Opts) when V > 0 -> log2("NOTICE", Fmt, Args, Opts); -log(warn, Fmt, Args, _V, Opts) -> log2("WARNING", Fmt, Args, Opts); -log(error, Fmt, Args, _V, Opts) -> log2("ERROR", Fmt, Args, Opts); - -log(Lvl, Fmt, Args, V, Opts) when V >= Lvl -> log2("", Fmt, Args, Opts); - -log(_, _, _, _i, _) -> ok. - -log2(Type, Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, "~s: " ++ Fmt, [Type | Args]); -log2("", Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, Fmt, Args); -log2(_Type, Fun, _Args, _Opts) when is_function(Fun, 1) -> - Fun(standard_error). - -%%% RTP packets %%% - -make_rtp_packet(P = #rtp_packet{version = 2}) -> - << (P#rtp_packet.version):2, - 0:1, % P - 0:1, % X - 0:4, % CC - (P#rtp_packet.marker):1, - (P#rtp_packet.payload_type):7, - (P#rtp_packet.seqno):16, - (P#rtp_packet.timestamp):32, - (P#rtp_packet.ssrc):32, - (P#rtp_packet.payload)/bytes - >>. - -parse_rtp_packet( - << 2:2, % Version 2 - 0:1, % P (not supported yet) - 0:1, % X (not supported yet) - 0:4, % CC (not supported yet) - M:1, - PT:7, - SeqNo: 16, - TS:32, - Ssrc:32, - Payload/bytes >>) -> - #rtp_packet{ - version = 0, - marker = M, - payload_type = PT, - seqno = SeqNo, - timestamp = TS, - ssrc = Ssrc, - payload = Payload}. - -%%% payload generation %%% - -next_payload(F) when is_function(F) -> - {F(), F}; -next_payload({F, D}) when is_function(F) -> - {P, D2} = F(D), - {P, {F, D2}}; -next_payload([P | R]) -> - {P, R}; -next_payload([]) -> - undef; -next_payload(Bin = <<_/bytes>>) -> - {Bin, Bin}. - -%%% real writing work %%% - -write_packets(_Dev, DS, _P, _F, 0, _O, _Opts) -> - DS; -write_packets(Dev, DataSource, P = #rtp_packet{}, F, L, O, Opts) -> - Format = proplists:get_value(format, Opts, state), - Ptime = proplists:get_value(duration, Opts, 160), - Delay = proplists:get_value(delay, Opts, 0), - Rate = proplists:get_value(rate, Opts, 8000), - case next_payload(DataSource) of - {Payload, DataSource2} -> - write_packet(Dev, Ptime * F / Rate + Delay, - P#rtp_packet{seqno = F, timestamp = F*Ptime+O, - payload = Payload}, - Format), - write_packets(Dev, DataSource2, P, F+1, L-1, O, Opts); - Other -> Other - end. - -write_packet(Dev, Time, P = #rtp_packet{}, Format) -> - Bin = make_rtp_packet(P), - - write_packet_line(Dev, Time, P, Bin, Format). - -write_packet_pre(Dev, carray) -> - io:format(Dev, - "struct {float t; int len; char *data;} packets[] = {~n", []); - -write_packet_pre(_Dev, _) -> ok. - -write_packet_post(Dev, carray) -> - io:format(Dev, "};~n", []); - -write_packet_post(_Dev, _) -> ok. - -write_packet_line(Dev, Time, _P, Bin, state) -> - io:format(Dev, "~f ~s~n", [Time, bin_to_hex(Bin)]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, c) -> - ByteList = [ [ $0, $x | integer_to_list(Byte, 16) ] || <> <= Bin ], - ByteStr = string:join(ByteList, ", "), - io:format(Dev, "/* time=~f, SeqNo=~B, TS=~B */ {~s}~n", [Time, N, TS, ByteStr]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, carray) -> - io:format(Dev, " /* RTP: SeqNo=~B, TS=~B */~n", [N, TS]), - io:format(Dev, " {~f, ~B, \"", [Time, size(Bin)]), - [ io:format(Dev, "\\x~2.16.0B", [Byte]) || <> <= Bin ], - io:format(Dev, "\"},~n", []). - -%%% real reading work %%% - -read_packets(Dev, Opts) -> - Format = proplists:get_value(in_format, Opts, state), - - read_packets(Dev, Opts, Format). - -read_packets(Dev, Opts, Format) -> - case read_packet(Dev, Opts, Format) of - eof -> []; - Tuple -> [Tuple | read_packets(Dev, Opts, Format)] - end. - -read_packet(Dev, Opts, bin) -> - Size = proplists:get_value(frame_size, Opts), - case file:read(Dev, Size) of - {ok, Data} -> {0, #rtp_packet{payload = iolist_to_binary(Data)}}; - eof -> eof - end; -read_packet(Dev, _Opts, Format) -> - case read_packet_line(Dev, Format) of - {Time, Bin} -> {Time, parse_rtp_packet(Bin)}; - eof -> eof - end. - -read_packet_line(Dev, state) -> - case io:fread(Dev, "", "~f ~s") of - {ok, [Time, Hex]} -> {Time, hex_to_bin(Hex)}; - eof -> eof - end. diff --git a/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st deleted file mode 100644 index e26d073..0000000 --- a/contrib/rtp/rtp_replay.st +++ /dev/null @@ -1,21 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. -FileStream fileIn: 'rtp_replay_shared.st'. - - -Eval [ - | replay file host dport | - - file := Smalltalk arguments at: 1 ifAbsent: [ 'rtpstream.state' ]. - host := Smalltalk arguments at: 2 ifAbsent: [ '127.0.0.1' ]. - dport := (Smalltalk arguments at: 3 ifAbsent: [ '4000' ]) asInteger. - sport := (Smalltalk arguments at: 4 ifAbsent: [ '0' ]) asInteger. - - replay := RTPReplay on: file fromPort: sport. - - Transcript nextPutAll: 'Going to stream now'; nl. - replay streamAudio: host port: dport. -] diff --git a/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st deleted file mode 100644 index 7b68c0f..0000000 --- a/contrib/rtp/rtp_replay_shared.st +++ /dev/null @@ -1,118 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. - -Object subclass: SDPUtils [ - "Look into using PetitParser." - SDPUtils class >> findPort: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'm=audio ') ifTrue: [ - | stream | - stream := line readStream - skip: 'm=audio ' size; - yourself. - ^ Number readFrom: stream. - ] - ]. - - ^ self error: 'Not found'. - ] - - SDPUtils class >> findHost: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'c=IN IP4 ') ifTrue: [ - | stream | - ^ stream := line readStream - skip: 'c=IN IP4 ' size; - upToEnd. - ] - ]. - - ^ self error: 'Not found'. - ] -] - -Object subclass: RTPReplay [ - | filename socket | - RTPReplay class >> on: aFile [ - ^ self new - initialize; - file: aFile; yourself - ] - - RTPReplay class >> on: aFile fromPort: aPort [ - ^ self new - initialize: aPort; - file: aFile; yourself - ] - - initialize [ - self initialize: 0. - ] - - initialize: aPort [ - socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort. - ] - - file: aFile [ - filename := aFile - ] - - localPort [ - ^ socket port - ] - - streamAudio: aHost port: aPort [ - | file last_time last_image udp_send dest | - - last_time := nil. - last_image := nil. - file := FileStream open: filename mode: #read. - - "Send the payload" - dest := Sockets.SocketAddress byName: aHost. - udp_send := [:payload | | datagram | - datagram := Sockets.Datagram data: payload contents address: dest port: aPort. - socket nextPut: datagram - ]. - - [file atEnd] whileFalse: [ - | lineStream time data now_image | - lineStream := file nextLine readStream. - - "Read the time, skip the blank, parse the data" - time := Number readFrom: lineStream. - lineStream skip: 1. - - data := WriteStream on: (ByteArray new: 30). - [lineStream atEnd] whileFalse: [ - | hex | - hex := lineStream next: 2. - data nextPut: (Number readFrom: hex readStream radix: 16). - ]. - - last_time isNil - ifTrue: [ - "First time, send it right now" - last_time := time. - last_image := Time millisecondClockValue. - udp_send value: data. - ] - ifFalse: [ - | wait_image new_image_time | - - "How long to wait?" - wait_image := last_image + ((time - last_time) * 1000). - [ wait_image > Time millisecondClockValue ] - whileTrue: [Processor yield]. - - udp_send value: data. - last_time := time. - last_image := wait_image. - ] - ] - ] -] - diff --git a/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st deleted file mode 100644 index 5f844df..0000000 --- a/contrib/rtp/rtp_replay_sip.st +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create a SIP connection and then stream... -""" - -PackageLoader - fileInPackage: #OsmoSIP. - -"Load for the replay code" -FileStream fileIn: 'rtp_replay_shared.st'. - - -Osmo.SIPCall subclass: StreamCall [ - | sem stream | - - createCall: aSDP [ - | sdp | - stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'. - sdp := aSDP % {stream localPort}. - ^ super createCall: sdp. - ] - - sem: aSemaphore [ - sem := aSemaphore - ] - - sessionNew [ - | host port | - Transcript nextPutAll: 'The call has started'; nl. - Transcript nextPutAll: sdp_result; nl. - - host := SDPUtils findHost: sdp_result. - port := SDPUtils findPort: sdp_result. - - [ - stream streamAudio: host port: port. - Transcript nextPutAll: 'Streaming has finished.'; nl. - ] fork. - ] - - sessionFailed [ - sem signal - ] - - sessionEnd [ - sem signal - ] -] - -Eval [ - | transport agent call sem sdp_fr sdp_amr | - - - sdp_fr := (WriteStream on: String new) - nextPutAll: 'v=0'; cr; nl; - nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 's=-'; cr; nl; - nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 't=0 0'; cr; nl; - nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl; - nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl; - nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl; - nextPutAll: 'a=fmtp:101 0-15'; cr; nl; - nextPutAll: 'a=ptime:20'; cr; nl; - contents. - - sem := Semaphore new. - transport := Osmo.SIPUdpTransport - startOn: '0.0.0.0' port: 5066. - agent := Osmo.SIPUserAgent createOn: transport. - transport start. - - call := (StreamCall - fromUser: 'sip:1000 at sip.zecke.osmocom.org' - host: '127.0.0.1' - port: 5060 - to: 'sip:123456 at 127.0.0.1' - on: agent) - sem: sem; yourself. - - call createCall: sdp_fr. - - - "Wait for the stream to have ended" - sem wait. - - (Delay forSeconds: 4) wait. -] diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua deleted file mode 100644 index c18a06b..0000000 --- a/contrib/rtp/timestamp_rtp.lua +++ /dev/null @@ -1,28 +0,0 @@ -print("Ni hao") - - -do - local tap = Listener.new("ip", "rtp") - local rtp_ssrc = Field.new("rtp.ssrc") - local frame_time = Field.new("frame.time_relative") - local rtp = Field.new("rtp") - - function tap.packet(pinfo, tvb, ip) - local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) - local rtp_data = rtp() - local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" - local f = io.open(filename, "a") - - f:write(tostring(frame_time()) .. " ") - f:write(tostring(rtp_data.value)) - f:write("\n") - f:close() - end - - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end -end diff --git a/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st deleted file mode 100644 index da0643e..0000000 --- a/contrib/sms/fill-hlr.st +++ /dev/null @@ -1,66 +0,0 @@ -"I create output for some simple SQL statements for the HLR db" - - -Eval [ - -"Create tables if they don't exist" -Transcript show: 'CREATE TABLE SMS ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - sent TIMESTAMP, - sender_id INTEGER NOT NULL, - receiver_id INTEGER NOT NULL, - deliver_attempts INTEGER NOT NULL DEFAULT 0, - valid_until TIMESTAMP, - reply_path_req INTEGER NOT NULL, - status_rep_req INTEGER NOT NULL, - protocol_id INTEGER NOT NULL, - data_coding_scheme INTEGER NOT NULL, - ud_hdr_ind INTEGER NOT NULL, - dest_addr TEXT, - user_data BLOB, - header BLOB, - text TEXT);'; nl; - show: 'CREATE TABLE Subscriber ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - updated TIMESTAMP NOT NULL, - imsi NUMERIC UNIQUE NOT NULL, - name TEXT, - extension TEXT UNIQUE, - authorized INTEGER NOT NULL DEFAULT 0, - tmsi TEXT UNIQUE, - lac INTEGER NOT NULL DEFAULT 0);'; nl. - -"Create some dummy subscribers" -num_sub := 1000. -num_sms := 30. -lac := 1. - -Transcript show: 'BEGIN;'; nl. - -1 to: num_sub do: [:each | - Transcript show: 'INSERT INTO Subscriber - (imsi, created, updated, authorized, lac, extension) - VALUES - (%1, datetime(''now''), datetime(''now''), 1, %2, %3);' % - {(274090000000000 + each). lac. each}; nl. -]. - -1 to: num_sms do: [:sms | - 1 to: num_sub do: [:sub | - Transcript show: 'INSERT INTO SMS - (created, sender_id, receiver_id, valid_until, - reply_path_req, status_rep_req, protocol_id, - data_coding_scheme, ud_hdr_ind, dest_addr, - text) VALUES - (datetime(''now''), 1, %1, ''2222-2-2'', - 0, 0, 0, - 0, 0, ''123456'', - ''abc'');' % {sub}; nl. - ] -]. - -Transcript show: 'COMMIT;'; nl. - -] diff --git a/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st deleted file mode 100644 index bd3f97a..0000000 --- a/contrib/sms/hlr-query.st +++ /dev/null @@ -1,10 +0,0 @@ -"Query for one SMS" - -Eval [ -1 to: 100 do: [:each | - Transcript show: 'SELECT SMS.* FROM SMS - JOIN Subscriber ON SMS.receiver_id = Subscriber.id - WHERE SMS.id >= 1 AND SMS.sent IS NULL AND Subscriber.lac > 0 - ORDER BY SMS.id LIMIT 1;'; nl. -]. -] diff --git a/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d deleted file mode 100644 index e75cdfc..0000000 --- a/contrib/sms/sqlite-probe.tap.d +++ /dev/null @@ -1,5 +0,0 @@ -probe process("/usr/lib/libsqlite3.so.0.8.6").function("sqlite3_get_table") -{ - a = user_string($zSql); - printf("sqlite3_get_table called '%s'\n", a); -} diff --git a/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service deleted file mode 100644 index c040e60..0000000 --- a/contrib/systemd/osmo-bsc-mgcp.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC MGCP - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service deleted file mode 100644 index 4047fef..0000000 --- a/contrib/systemd/osmo-bsc.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=OpenBSC BSC -Wants=osmo-bsc-mgcp.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service deleted file mode 100644 index 7cebb14..0000000 --- a/contrib/systemd/osmo-msc.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Osmocom Mobile Switching Center (MSC) -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service deleted file mode 100644 index 377497e..0000000 --- a/contrib/systemd/osmo-nitb.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC Network In the Box (NITB) - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3 -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/testconv/Makefile b/contrib/testconv/Makefile deleted file mode 100644 index bb856f7..0000000 --- a/contrib/testconv/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -OBJS = testconv_main.o - -CC = gcc -CFLAGS = -O0 -ggdb -Wall -LDFLAGS = -CPPFLAGS = -I../.. -I../../include $(shell pkg-config --cflags libosmocore) $(shell pkg-config --cflags libbcg729) -LIBS = ../../src/libmgcp/libmgcp.a ../../src/libcommon/libcommon.a $(shell pkg-config --libs libosmocore) $(shell pkg-config --libs libbcg729) -lgsm -lrt - -testconv: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) - -testconv_main.o: testconv_main.c - -$(OBJS): - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c deleted file mode 100644 index 6c95c55..0000000 --- a/contrib/testconv/testconv_main.c +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "bscconfig.h" -#ifndef BUILD_MGCP_TRANSCODING -#error "Requires MGCP transcoding enabled (see --enable-mgcp-transcoding)" -#endif - -#include "openbsc/mgcp_transcode.h" - -static int audio_name_to_type(const char *name) -{ - if (!strcasecmp(name, "gsm")) - return 3; -#ifdef HAVE_BCG729 - else if (!strcasecmp(name, "g729")) - return 18; -#endif - else if (!strcasecmp(name, "pcma")) - return 8; - else if (!strcasecmp(name, "l16")) - return 11; - return -1; -} - -int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst); - -int main(int argc, char **argv) -{ - char buf[4096] = {0x80, 0}; - int cc, rc; - struct mgcp_rtp_end *dst_end; - struct mgcp_rtp_end *src_end; - struct mgcp_trunk_config tcfg = {{0}}; - struct mgcp_endpoint endp = {0}; - struct mgcp_process_rtp_state *state; - int in_size; - int in_samples = 160; - int out_samples = 0; - uint32_t ts = 0; - uint16_t seq = 0; - - osmo_init_logging(&log_info); - - tcfg.endpoints = &endp; - tcfg.number_endpoints = 1; - endp.tcfg = &tcfg; - mgcp_initialize_endp(&endp); - - dst_end = &endp.bts_end; - src_end = &endp.net_end; - - if (argc <= 2) - errx(1, "Usage: {gsm|g729|pcma|l16} {gsm|g729|pcma|l16} [SPP]"); - - if ((src_end->codec.payload_type = audio_name_to_type(argv[1])) == -1) - errx(1, "invalid input format '%s'", argv[1]); - if ((dst_end->codec.payload_type = audio_name_to_type(argv[2])) == -1) - errx(1, "invalid output format '%s'", argv[2]); - if (argc > 3) - out_samples = atoi(argv[3]); - - if (out_samples) { - dst_end->codec.frame_duration_den = dst_end->codec.rate; - dst_end->codec.frame_duration_num = out_samples; - dst_end->frames_per_packet = 1; - } - - rc = mgcp_transcoding_setup(&endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); - - state = dst_end->rtp_process_data; - OSMO_ASSERT(state != NULL); - - in_size = mgcp_transcoding_get_frame_size(state, in_samples, 0); - OSMO_ASSERT(sizeof(buf) >= in_size + 12); - - buf[1] = src_end->codec.payload_type; - *(uint16_t*)(buf+2) = htons(1); - *(uint32_t*)(buf+4) = htonl(0); - *(uint32_t*)(buf+8) = htonl(0xaabbccdd); - - while ((cc = read(0, buf + 12, in_size))) { - int cont; - int len; - - if (cc != in_size) - err(1, "read"); - - *(uint16_t*)(buf+2) = htonl(seq); - *(uint32_t*)(buf+4) = htonl(ts); - - seq += 1; - ts += in_samples; - - cc += 12; /* include RTP header */ - - len = cc; - - do { - cont = mgcp_transcoding_process_rtp(&endp, dst_end, - buf, &len, sizeof(buf)); - if (cont == -EAGAIN) { - fprintf(stderr, "Got EAGAIN\n"); - break; - } - - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); - - len -= 12; /* ignore RTP header */ - - if (write(1, buf + 12, len) != len) - err(1, "write"); - - len = cont; - } while (len > 0); - } - return 0; -} - diff --git a/debian/copyright b/debian/copyright index 8d731ee..b58117e 100644 --- a/debian/copyright +++ b/debian/copyright @@ -78,7 +78,6 @@ doc/osmo-nitb-data_structures.dot doc/paging.txt include/Makefile.am - include/compat_af_isdn.h include/openbsc/Makefile.am include/openbsc/common.h include/openbsc/crc24.h @@ -340,21 +339,6 @@ . On Debian systems, the complete text of the GNU General Public License Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -Files: include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - This code is free software; you can redistribute it and/or modify - it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE - version 2.1 as published by the Free Software Foundation. - . - This code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU LESSER GENERAL PUBLIC LICENSE for more details. - . - On Debian systems, the complete text of the GNU Lesser General Public License - Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. Files: src/gprs/v42bis.c Copyright: 2005-2011 Steve Underwood diff --git a/doc/BS11-OML.txt b/doc/BS11-OML.txt deleted file mode 100644 index e5c3299..0000000 --- a/doc/BS11-OML.txt +++ /dev/null @@ -1,31 +0,0 @@ -The Siemens BS-11 supports the following additional GSM 12.21 OML operations: - - -CREATE OBJECT - -abis_om_fom_hdr.obj_class can be -A3: -A5: ALCO, BBSIG, CCLK, GPSU, LI, PA -A8: EnvaBTSE -A9: BPORT - -the abis_om_obj_inst.trx_nr field indicates the index of object, whereas the -abis_om_fom_hdr.bts_nr indicates the type of the object. - -enum abis_bs11_objtype { - BS11_OBJ_ALCO = 0x01, - BS11_OBJ_BBSIG = 0x02, /* obj_class: 0,1 */ - BS11_OBJ_TRX1 = 0x03, /* only DEACTIVATE TRX1 */ - BS11_OBJ_CCLK = 0x04, - BS11_OBJ_GPSU = 0x06, - BS11_OBJ_LI = 0x07, - BS11_OBJ_PA = 0x09, /* obj_class: 0, 1*/ -}; - -In case of CREATE ENVABTSE, the abis_om_obj_inst.trx_nr indicates the EnvaBTSEx -number. - -In case of A9 (CREAETE BPORT), the abis_om_obj_inst.bts_nr indicates which BPORT -shall be used. - - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/channel_release.txt b/doc/channel_release.txt deleted file mode 100644 index c9cdfeb..0000000 --- a/doc/channel_release.txt +++ /dev/null @@ -1,95 +0,0 @@ - -GSM 04.08 7.1.7 / 9.1.7 RR CHANNEL RELESE - -RSL 08.58 3.4 / ? RLL Link Release Request - -RSL 08.58 4.6 / 8.4.5 DEACTivate SACCH - * Deactivate SACCH according to Channel Release Proc 04.08 - * to be sent after RR CHANNEL RELEASE is sent to MS - -RSL 08.58 4.7 / 8.4.14 RF CHANnel RELease - * tells the BTS to release a radio channel - * "when an activated radio channel is no longer needed" - * BTS responds with RF CHANnel RELease ACKnowledge - - -GSM 04.08 3.4.13: RR connection release procedure - -* network sends RR CHANNEL RELEASE to MS on the DCCH - * start T3109 - * deactivate SACCH -* MS disconnects main signalling link (by sending DISC) - * all other data links are disconnected by local end link release -* network receives DISC (BTS sends RLL REL IND to BSC) - * stop T3109 - * start T3111 -* when T3111 times out, the network can reuse the channls -* if T3109 times out, the network deactivates the channels - and can reuse them - * this probably means simply RF CHANnel RELease - - -== Implementation in OpenBSC == - -There are two possible reasons a gsm_subscriber_connection -will be released. One is a network failure, the other is -the completion of an operation/transaction. - -=== Failure === -The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback -and the MSC part will release all transactions, operations and such -and the channels will be released as error case. - -=== Success === -Every time an 'operation' or 'transaction' is finished msc_release_connection -will be called and it will determine if the gsm_subscriber_connection can -be released. - -In case it can be released bsc_api.c:gsm0808_clear will be called -which will release all lchan's associated with the connection. For the -primary channel a SACH Deactivate will be send with the release -reason NORMAL RELEASE. - - -bsc_api.c:gsm0808_clear - * Release a channel used for handover - * Release the primary lchan with normal release, SACH deactivate - -chan_alloc.c:lchan_release(chan, sacch_deactivate, reason) - * Start the release procedure. It is working in steps with callbacks - coming from the abis_rsl.c code. - * Release all SAPI's > 0 as local end (The BTS should send a - REL_CONF a message) - * Send SACH Deactivate on SAPI=0 if required. - * Start T3109 (stop it when the main signalling link is disconnected) - or when the channel released. On timeout start the error handling. - * abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are - released and after T3111 has timed out or there is an error. - -RX of RELease INDication: - * Calls internal rsl_handle_release which might release the RF. - -RX of RELease CONFirmation: - * Calls internal rsl_handle_release which might release the RF. - -* RX of RF_CHAN_REL_ACK - * call lchan_free() - - -=== Integration with SMS === - -* RX of CP_ERROR or unimplemented MT - * trigger trans_free() which will msc_release_connection() - -* CP TC1* expired while waiting for CP-ACK - * trigger trans_free() which will msc_release_connection() - -* RX of RP_ERROR - * trigger trans_free() which will msc_release_connection() - -* TX of CP-ACK in MT DELIVER - * trigger trans_free() which will msc_release_connection() - -* RX of CP-ACK in MO SUBMIT - * trigger trans_free() which will msc_release_connection() - diff --git a/doc/e1-data-model.txt b/doc/e1-data-model.txt deleted file mode 100644 index 509004f..0000000 --- a/doc/e1-data-model.txt +++ /dev/null @@ -1,172 +0,0 @@ -E1 related data model - -This data model describes the physical relationship of the individual -parts in the network, it is not the logical/protocol side of the GSM -network. - -A BTS is connected to the BSC by some physical link. It could be an actual -E1 link, but it could also be abis-over-IP with a mixture of TCP and RTP/UDP. - -To further complicate the fact, multiple BTS can share one such pysical -link. On a single E1 line, we can easily accomodate up to three BTS with -two TRX each. - -Thus, it is best for OpenBSC to have some kind of abstraction layer. The BSC's -view of a BTS connected to it. We call this 'bts_link'. A bts_link can be -* all the TCP and UDP streams of a Abis-over-IP BTS -* a set of E1 timeslots for OML, RSL and TRAU connections on a E1 link -* a serial line exclusively used for OML messages (T-Link) - -A bts_link can be registered with the OpenBSC core at runtime. - -struct trx_link { - struct gsm_bts_trx *trx; -}; - -struct bts_link { - struct gsm_bts *bts; - struct trx_link trx_links[NUM_TRX]; -}; - -Interface from stack to input core: -====================================================================== -int abis_rsl_sendmsg(struct msgb *msg); - send a message through a RSL link to the TRX specified by the caller in - msg->trx. - -int abis_rsl_rcvmsg(struct msgb *msg); - receive a message from a RSL link from the TRX specified by the - caller in msg->trx. - -int abis_nm_sendmsg(struct msgb *msg); - send a message through a OML link to the BTS specified by the caller in - msg->trx->bts. The caller can just use bts->c0 to get the first TRX - in a BTS. (OML messages are not really sent to a TRX but to the BTS) - -int abis_nm_rcvmsg(struct msgb *msg); - receive a message from a OML link from the BTS specified by the caller - in msg->trx->bts. The caller can just use bts->c0 to get the first - TRX in a BTS. - -int abis_link_event(int event, void *data); - signal some event (such as layer 1 connect/disconnect) from the - input core to the stack. - -int subch_demux_in(mx, const uint8_t *data, int len); - receive 'len' bytes from a given E1 timeslot (TRAU frames) - -int subchan_mux_out(mx, uint8_t *data, int len); - obtain 'len' bytes of output data to be sent on E1 timeslot - -Intrface by Input Core for Input Plugins -====================================================================== - -int btslink_register_plugin(); - - -Configuration for the E1 input module -====================================================================== - -BTS - BTS number - number of TRX - OML link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TRX - RSL link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TS - E1 line number - timeslot number - subslot number - - -E1 input module data model -====================================================================== - - -enum e1inp_sign_type { - E1INP_SIGN_NONE, - E1INP_SIGN_OML, - E1INP_SIGN_RSL, -}; - -struct e1inp_sign_link { - /* list of signalling links */ - struct llist_head list; - - enum e1inp_sign_type type; - - /* trx for msg->trx of received msgs */ - struct gsm_bts_trx *trx; - - /* msgb queue of to-be-transmitted msgs */ - struct llist_head tx_list; - - /* SAPI and TEI on the E1 TS */ - uint8_t sapi; - uint8_t tei; -} - -enum e1inp_ts_type { - E1INP_TS_TYPE_NONE, - E1INP_TS_TYPE_SIGN, - E1INP_TS_TYPE_TRAU, -}; - -/* A timeslot in the E1 interface */ -struct e1inp_ts { - enum e1inp_ts_type type; - struct e1inp_line *line; - union { - struct { - struct llist_head sign_links; - } sign; - struct { - /* subchannel demuxer for frames from E1 */ - struct subch_demux demux; - /* subchannel muxer for frames to E1 */ - struct subch_mux mux; - } trau; - }; - union { - struct { - /* mISDN driver has one fd for each ts */ - struct osmo_fd; - } misdn; - } driver; -}; - -struct e1inp_line { - unsigned int num; - char *name; - - struct e1inp_ts ts[NR_E1_TS]; - - char *e1inp_driver; - void *driver_data; -}; - -/* Call from the Stack: configuration of this TS has changed */ -int e1inp_update_ts(struct e1inp_ts *ts); - -/* Receive a packet from the E1 driver */ -int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, - uint8_t tei, uint8_t sapi); - -/* Send a packet, callback function in the driver */ -int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg) - - -struct e1inp_driver { - const char *name; - int (*want_write)(struct e1inp_ts *ts); -}; diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg deleted file mode 100644 index 7c10e9d..0000000 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ /dev/null @@ -1,101 +0,0 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login -! -e1_input - e1_line 0 driver ipa -network - network country code 1 - mobile network code 1 - short name OsmoBSC - long name OsmoBSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - neci 1 - paging any use tch 0 - rrlp mode none - mm info 1 - handover 0 - handover window rxlev averaging 10 - handover window rxqual averaging 1 - handover window rxlev neighbor averaging 10 - handover power budget interval 6 - handover power budget hysteresis 3 - handover maximum distance 9999 - bts 0 - type nanobts - band DCS1800 - cell_identity 0 - location_area_code 1 - training_sequence_code 7 - base_station_id_code 63 - ms max power 15 - cell reselection hysteresis 4 - rxlev access min 0 - channel allocator ascending - rach tx integer 9 - rach max transmission 7 - dtx uplink force - dtx downlink - ip.access unit_id 0 0 - oml ip.access stream_id 255 line 0 - neighbor-list mode manual-si5 - neighbor-list add arfcn 100 - neighbor-list add arfcn 200 - si5 neighbor-list add arfcn 10 - si5 neighbor-list add arfcn 20 - gprs mode none - trx 0 - rf_locked 0 - arfcn 871 - nominal power 23 - max_power_red 20 - rsl e1 tei 0 - timeslot 0 - phys_chan_config CCCH+SDCCH4 - hopping enabled 0 - timeslot 1 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 2 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 3 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 4 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 5 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 6 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 7 - phys_chan_config TCH/F - hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote - ip.access rtp-base 4000 - timeout-ping 20 - timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name -bsc - no access-list-name - access-list-name bsc-list diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg deleted file mode 100644 index 3c43f1f..0000000 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! MGCP configuration hand edited -! ! -password foo -! -line vty - no login -! -mgcp - !local ip 10.23.24.2 - !bts ip 10.24.24.1 - !bind ip 10.23.24.1 - bind port 2427 - rtp base 4000 - rtp force-ptime 20 - sdp audio payload number 98 - sdp audio payload name AMR/8000 - number endpoints 31 - no rtcp-omit diff --git a/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg deleted file mode 100644 index d36179d..0000000 --- a/doc/examples/osmo-bsc_nat/black-list.cfg +++ /dev/null @@ -1 +0,0 @@ -678012512671923:6:6: diff --git a/doc/examples/osmo-bsc_nat/bscs.cfg b/doc/examples/osmo-bsc_nat/bscs.cfg deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.cfg +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg deleted file mode 100644 index e835e06..0000000 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ /dev/null @@ -1,66 +0,0 @@ -! -! OsmoBSCNAT (0.12.0.266-2daa9) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level rll notice - logging level cc notice - logging level mm notice - logging level rr notice - logging level rsl notice - logging level nm info - logging level mncc notice - logging level pag notice - logging level meas notice - logging level sccp notice - logging level msc notice - logging level mgcp notice - logging level ho notice - logging level db notice - logging level ref notice - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level llc debug - logging level sndcp debug - logging level nat notice - logging level ctrl notice - logging level smpp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -mgcp - bind ip 0.0.0.0 - bind port 2427 - rtp bts-base 4000 - rtp net-base 16000 - rtp ip-dscp 0 - no rtcp-omit - sdp audio-payload number 126 - sdp audio-payload name AMR/8000 - loop 0 - number endpoints 1 - call-agent ip 127.0.0.1 - rtp transcoder-base 0 - transcoder-remote-base 4000 -nat - msc ip 127.0.0.1 - msc port 5000 - timeout auth 2 - timeout ping 20 - timeout pong 5 - ip-dscp 0 - bscs-config-file bscs.cfg - access-list bla imsi-allow ^11$ diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg deleted file mode 100644 index 1b1d192..0000000 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! OsmoMSC configuration saved from vty -! -line vty - no login -! -network - network country code 1 - mobile network code 1 - short name OsmoMSC - long name OsmoMSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - rrlp mode none - mm info 1 -msc - mgcpgw remote-ip 10.23.24.1 - assign-tmsi diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/handover.txt b/doc/handover.txt deleted file mode 100644 index ac19e87..0000000 --- a/doc/handover.txt +++ /dev/null @@ -1,89 +0,0 @@ -Ideas about a handover algorithm -====================================================================== - -This is mostly based on the results presented in Chapter 8 of "Performance -Enhancements in a Frequency Hopping GSM Network" by Thomas Toftegaard Nielsen -and Joeroen Wigard. - - -=== Reasons for performing handover === - -Section 2.1.1: Handover used in their CAPACITY simulation: - -1) Interference Handover - -Average RXLEV is satisfactory high, but average RXQUAL too low indicates -interference to the channel. Handover should be made. - -2) Bad Quality - -Averaged RXQUAL is lower than a threshold - -3) Low Level / Signal Strength - -Average RXLEV is lower than a threshold - -4) Distance Handover - -MS is too far away from a cell (measured by TA) - -5) Power budget / Better Cell - -RX Level of neighbor cell is at least "HO Margin dB" dB better than the -current serving cell. - -=== Ideal parameters for HO algorithm === - -Chapter 8, Section 2.2, Table 24: - -Window RXLEV averaging: 10 SACCH frames (no weighting) -Window RXQUAL averaging: 1 SACCH frame (no averaging) -Level Threashold: 1 of the last 1 AV-RXLEV values < -110dBm -Quality Threshold: 3 of the last 4 AV-RXQUAL values >= 5 -Interference Threshold: 1 of the last AV-RXLEV > -85 dBm & - 3 of the last 4 AV-RXQUAL values >= 5 -Power Budget: Level of neighbor cell > 3 dB better -Power Budget Interval: Every 6 SACCH frames (6 seconds ?!?) -Distance Handover: Disabled -Evaluation rule 1: RXLEV of the candidate cell a tleast -104 dBm -Evaluation rule 2: Level of candidate cell > 3dB better own cell -Timer Successful HO: 5 SACCH frames -Timer Unsuccessful HO: 1 SACCH frame - -In a non-frequency hopping case, RXQUAL threshold can be decreased to -RXLEV >= 4 - -When frequency hopping is enabled, the following additional parameters -should be introduced: - -* No intra-cell handover -* Use a HO Margin of 2dB - -=== Handover Channel Reservation === - -In loaded network, each cell should reserve some channels for handovers, -rather than using all of them for new call establishment. This reduces the -need to drop calls due to failing handovers, at the expense of failing new call -attempts. - -=== Dynamic HO Margin === - -The handover margin (hysteresis) should depend on the RXQUAL. Optimal results -were achieved with the following settings: -* RXQUAL <= 4: 9 dB -* RXQUAL == 5: 6 dB -* RXQUAL >= 6: 1 dB - - - -== Actual Handover on a protocol level == - -After the BSC has decided a handover shall be done, it has to - -# allocate a channel at the new BTS -# allocate a handover reference -# activate the channel on the BTS side using RSL CHANNEL ACTIVATION, - indicating the HO reference -# BTS responds with CHAN ACT ACK, including GSM frame number -# BSC sends 04.08 HO CMD to MS using old BTS - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/oml-interface.txt b/doc/oml-interface.txt deleted file mode 100644 index 02bead7..0000000 --- a/doc/oml-interface.txt +++ /dev/null @@ -1,22 +0,0 @@ -oml interface design notes - -problems: - -* there is no way how to tag a command sent to the BTS, with the response - having the same tag to identify the originator of the command -* therefore, we can have e.g. both the BSC and the OML interface send a - SET ATTRIBUTE message, where the responses would end up at the wrong - query. -* The BTS has 10s to ACK/NACK a command. We do not run any timers. - -the only possible solutions i can imagine: -* have some kind of exclusive locking, where the OML interface gets blocked - from the BSC and is exclusively assigned to the OML console until all commands - of the OML console have terminated. This can either be done explicitly - dynamically or on demand - -* use the OML interface synchronously, i.e. always wait for the response from - the BTS before - -* unilateral / unsolicited messages need to be broadcasted to both the BSC and - the OML console diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/include/Makefile.am b/include/Makefile.am index 3234e62..677eec3 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,8 +1,3 @@ SUBDIRS = \ openbsc \ $(NULL) - -noinst_HEADERS = \ - mISDNif.h \ - compat_af_isdn.h \ - $(NULL) diff --git a/include/compat_af_isdn.h b/include/compat_af_isdn.h deleted file mode 100644 index 56cbfb3..0000000 --- a/include/compat_af_isdn.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifdef MISDN_OLD_AF_COMPATIBILITY -#undef AF_ISDN -#undef PF_ISDN - -extern int AF_ISDN; -#define PF_ISDN AF_ISDN - -int AF_ISDN; - -#endif - -extern void init_af_isdn(void); - -#ifdef AF_COMPATIBILITY_FUNC -#ifdef MISDN_OLD_AF_COMPATIBILITY -void init_af_isdn(void) -{ - int s; - - /* test for new value */ - AF_ISDN = 34; - s = socket(AF_ISDN, SOCK_RAW, ISDN_P_BASE); - if (s >= 0) { - close(s); - return; - } - AF_ISDN = 27; - s = socket(AF_ISDN, SOCK_RAW, ISDN_P_BASE); - if (s >= 0) { - close(s); - return; - } -} -#else -void init_af_isdn(void) -{ -} -#endif -#endif diff --git a/include/mISDNif.h b/include/mISDNif.h deleted file mode 100644 index 8e065d2..0000000 --- a/include/mISDNif.h +++ /dev/null @@ -1,387 +0,0 @@ -/* - * - * Author Karsten Keil - * - * Copyright 2008 by Karsten Keil - * - * This code is free software; you can redistribute it and/or modify - * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE - * version 2.1 as published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU LESSER GENERAL PUBLIC LICENSE for more details. - * - */ - -#ifndef mISDNIF_H -#define mISDNIF_H - -#include -#ifdef linux -#include -#include -#include -#else -#include -#include -#include -#endif - -/* - * ABI Version 32 bit - * - * <8 bit> Major version - * - changed if any interface become backwards incompatible - * - * <8 bit> Minor version - * - changed if any interface is extended but backwards compatible - * - * <16 bit> Release number - * - should be incremented on every checkin - */ -#define MISDN_MAJOR_VERSION 1 -#define MISDN_MINOR_VERSION 1 -#define MISDN_RELEASE 20 - -/* primitives for information exchange - * generell format - * <16 bit 0 > - * <8 bit command> - * BIT 8 = 1 LAYER private - * BIT 7 = 1 answer - * BIT 6 = 1 DATA - * <8 bit target layer mask> - * - * Layer = 00 is reserved for general commands - Layer = 01 L2 -> HW - Layer = 02 HW -> L2 - Layer = 04 L3 -> L2 - Layer = 08 L2 -> L3 - * Layer = FF is reserved for broadcast commands - */ - -#define MISDN_CMDMASK 0xff00 -#define MISDN_LAYERMASK 0x00ff - -/* generell commands */ -#define OPEN_CHANNEL 0x0100 -#define CLOSE_CHANNEL 0x0200 -#define CONTROL_CHANNEL 0x0300 -#define CHECK_DATA 0x0400 - -/* layer 2 -> layer 1 */ -#define PH_ACTIVATE_REQ 0x0101 -#define PH_DEACTIVATE_REQ 0x0201 -#define PH_DATA_REQ 0x2001 -#define MPH_ACTIVATE_REQ 0x0501 -#define MPH_DEACTIVATE_REQ 0x0601 -#define MPH_INFORMATION_REQ 0x0701 -#define PH_CONTROL_REQ 0x0801 - -/* layer 1 -> layer 2 */ -#define PH_ACTIVATE_IND 0x0102 -#define PH_ACTIVATE_CNF 0x4102 -#define PH_DEACTIVATE_IND 0x0202 -#define PH_DEACTIVATE_CNF 0x4202 -#define PH_DATA_IND 0x2002 -#define PH_DATA_E_IND 0x3002 -#define MPH_ACTIVATE_IND 0x0502 -#define MPH_DEACTIVATE_IND 0x0602 -#define MPH_INFORMATION_IND 0x0702 -#define PH_DATA_CNF 0x6002 -#define PH_CONTROL_IND 0x0802 -#define PH_CONTROL_CNF 0x4802 - -/* layer 3 -> layer 2 */ -#define DL_ESTABLISH_REQ 0x1004 -#define DL_RELEASE_REQ 0x1104 -#define DL_DATA_REQ 0x3004 -#define DL_UNITDATA_REQ 0x3104 -#define DL_INFORMATION_REQ 0x0004 - -/* layer 2 -> layer 3 */ -#define DL_ESTABLISH_IND 0x1008 -#define DL_ESTABLISH_CNF 0x5008 -#define DL_RELEASE_IND 0x1108 -#define DL_RELEASE_CNF 0x5108 -#define DL_DATA_IND 0x3008 -#define DL_UNITDATA_IND 0x3108 -#define DL_INFORMATION_IND 0x0008 - -/* intern layer 2 managment */ -#define MDL_ASSIGN_REQ 0x1804 -#define MDL_ASSIGN_IND 0x1904 -#define MDL_REMOVE_REQ 0x1A04 -#define MDL_REMOVE_IND 0x1B04 -#define MDL_STATUS_UP_IND 0x1C04 -#define MDL_STATUS_DOWN_IND 0x1D04 -#define MDL_STATUS_UI_IND 0x1E04 -#define MDL_ERROR_IND 0x1F04 -#define MDL_ERROR_RSP 0x5F04 - -/* DL_INFORMATION_IND types */ -#define DL_INFO_L2_CONNECT 0x0001 -#define DL_INFO_L2_REMOVED 0x0002 - -/* PH_CONTROL types */ -/* TOUCH TONE IS 0x20XX XX "0"..."9", "A","B","C","D","*","#" */ -#define DTMF_TONE_VAL 0x2000 -#define DTMF_TONE_MASK 0x007F -#define DTMF_TONE_START 0x2100 -#define DTMF_TONE_STOP 0x2200 -#define DTMF_HFC_COEF 0x4000 -#define DSP_CONF_JOIN 0x2403 -#define DSP_CONF_SPLIT 0x2404 -#define DSP_RECEIVE_OFF 0x2405 -#define DSP_RECEIVE_ON 0x2406 -#define DSP_ECHO_ON 0x2407 -#define DSP_ECHO_OFF 0x2408 -#define DSP_MIX_ON 0x2409 -#define DSP_MIX_OFF 0x240a -#define DSP_DELAY 0x240b -#define DSP_JITTER 0x240c -#define DSP_TXDATA_ON 0x240d -#define DSP_TXDATA_OFF 0x240e -#define DSP_TX_DEJITTER 0x240f -#define DSP_TX_DEJ_OFF 0x2410 -#define DSP_TONE_PATT_ON 0x2411 -#define DSP_TONE_PATT_OFF 0x2412 -#define DSP_VOL_CHANGE_TX 0x2413 -#define DSP_VOL_CHANGE_RX 0x2414 -#define DSP_BF_ENABLE_KEY 0x2415 -#define DSP_BF_DISABLE 0x2416 -#define DSP_BF_ACCEPT 0x2416 -#define DSP_BF_REJECT 0x2417 -#define DSP_PIPELINE_CFG 0x2418 -#define HFC_VOL_CHANGE_TX 0x2601 -#define HFC_VOL_CHANGE_RX 0x2602 -#define HFC_SPL_LOOP_ON 0x2603 -#define HFC_SPL_LOOP_OFF 0x2604 - -/* DSP_TONE_PATT_ON parameter */ -#define TONE_OFF 0x0000 -#define TONE_GERMAN_DIALTONE 0x0001 -#define TONE_GERMAN_OLDDIALTONE 0x0002 -#define TONE_AMERICAN_DIALTONE 0x0003 -#define TONE_GERMAN_DIALPBX 0x0004 -#define TONE_GERMAN_OLDDIALPBX 0x0005 -#define TONE_AMERICAN_DIALPBX 0x0006 -#define TONE_GERMAN_RINGING 0x0007 -#define TONE_GERMAN_OLDRINGING 0x0008 -#define TONE_AMERICAN_RINGPBX 0x000b -#define TONE_GERMAN_RINGPBX 0x000c -#define TONE_GERMAN_OLDRINGPBX 0x000d -#define TONE_AMERICAN_RINGING 0x000e -#define TONE_GERMAN_BUSY 0x000f -#define TONE_GERMAN_OLDBUSY 0x0010 -#define TONE_AMERICAN_BUSY 0x0011 -#define TONE_GERMAN_HANGUP 0x0012 -#define TONE_GERMAN_OLDHANGUP 0x0013 -#define TONE_AMERICAN_HANGUP 0x0014 -#define TONE_SPECIAL_INFO 0x0015 -#define TONE_GERMAN_GASSENBESETZT 0x0016 -#define TONE_GERMAN_AUFSCHALTTON 0x0016 - -/* MPH_INFORMATION_IND */ -#define L1_SIGNAL_LOS_OFF 0x0010 -#define L1_SIGNAL_LOS_ON 0x0011 -#define L1_SIGNAL_AIS_OFF 0x0012 -#define L1_SIGNAL_AIS_ON 0x0013 -#define L1_SIGNAL_RDI_OFF 0x0014 -#define L1_SIGNAL_RDI_ON 0x0015 -#define L1_SIGNAL_SLIP_RX 0x0020 -#define L1_SIGNAL_SLIP_TX 0x0021 - -/* - * protocol ids - * D channel 1-31 - * B channel 33 - 63 - */ - -#define ISDN_P_NONE 0 -#define ISDN_P_BASE 0 -#define ISDN_P_TE_S0 0x01 -#define ISDN_P_NT_S0 0x02 -#define ISDN_P_TE_E1 0x03 -#define ISDN_P_NT_E1 0x04 -#define ISDN_P_TE_UP0 0x05 -#define ISDN_P_NT_UP0 0x06 - -#define IS_ISDN_P_TE(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_TE_E1) || \ - (p == ISDN_P_TE_UP0) || (p == ISDN_P_LAPD_TE)) -#define IS_ISDN_P_NT(p) ((p == ISDN_P_NT_S0) || (p == ISDN_P_NT_E1) || \ - (p == ISDN_P_NT_UP0) || (p == ISDN_P_LAPD_NT)) -#define IS_ISDN_P_S0(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_NT_S0)) -#define IS_ISDN_P_E1(p) ((p == ISDN_P_TE_E1) || (p == ISDN_P_NT_E1)) -#define IS_ISDN_P_UP0(p) ((p == ISDN_P_TE_UP0) || (p == ISDN_P_NT_UP0)) - - -#define ISDN_P_LAPD_TE 0x10 -#define ISDN_P_LAPD_NT 0x11 - -#define ISDN_P_B_MASK 0x1f -#define ISDN_P_B_START 0x20 - -#define ISDN_P_B_RAW 0x21 -#define ISDN_P_B_HDLC 0x22 -#define ISDN_P_B_X75SLP 0x23 -#define ISDN_P_B_L2DTMF 0x24 -#define ISDN_P_B_L2DSP 0x25 -#define ISDN_P_B_L2DSPHDLC 0x26 - -#define OPTION_L2_PMX 1 -#define OPTION_L2_PTP 2 -#define OPTION_L2_FIXEDTEI 3 -#define OPTION_L2_CLEANUP 4 - -/* should be in sync with linux/kobject.h:KOBJ_NAME_LEN */ -#define MISDN_MAX_IDLEN 20 - -struct mISDNhead { - unsigned int prim; - unsigned int id; -} __attribute__((packed)); - -#define MISDN_HEADER_LEN sizeof(struct mISDNhead) -#define MAX_DATA_SIZE 2048 -#define MAX_DATA_MEM (MAX_DATA_SIZE + MISDN_HEADER_LEN) -#define MAX_DFRAME_LEN 260 - -#define MISDN_ID_ADDR_MASK 0xFFFF -#define MISDN_ID_TEI_MASK 0xFF00 -#define MISDN_ID_SAPI_MASK 0x00FF -#define MISDN_ID_TEI_ANY 0x7F00 - -#define MISDN_ID_ANY 0xFFFF -#define MISDN_ID_NONE 0xFFFE - -#define GROUP_TEI 127 -#define TEI_SAPI 63 -#define CTRL_SAPI 0 - -#define MISDN_MAX_CHANNEL 127 -#define MISDN_CHMAP_SIZE ((MISDN_MAX_CHANNEL + 1) >> 3) - -#define SOL_MISDN 0 - -struct sockaddr_mISDN { - sa_family_t family; - unsigned char dev; - unsigned char channel; - unsigned char sapi; - unsigned char tei; -}; - -struct mISDNversion { - unsigned char major; - unsigned char minor; - unsigned short release; -}; - -#define MAX_DEVICE_ID 63 - -struct mISDN_devinfo { - u_int id; - u_int Dprotocols; - u_int Bprotocols; - u_int protocol; - u_char channelmap[MISDN_CHMAP_SIZE]; - u_int nrbchan; - char name[MISDN_MAX_IDLEN]; -}; - -struct mISDN_devrename { - u_int id; - char name[MISDN_MAX_IDLEN]; -}; - -struct ph_info_ch { - int32_t protocol; - int64_t Flags; -}; - -struct ph_info_dch { - struct ph_info_ch ch; - int16_t state; - int16_t num_bch; -}; - -struct ph_info { - struct ph_info_dch dch; - struct ph_info_ch bch[]; -}; - -/* timer device ioctl */ -#define IMADDTIMER _IOR('I', 64, int) -#define IMDELTIMER _IOR('I', 65, int) -/* socket ioctls */ -#define IMGETVERSION _IOR('I', 66, int) -#define IMGETCOUNT _IOR('I', 67, int) -#define IMGETDEVINFO _IOR('I', 68, int) -#define IMCTRLREQ _IOR('I', 69, int) -#define IMCLEAR_L2 _IOR('I', 70, int) -#define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename) - -static inline int -test_channelmap(u_int nr, u_char *map) -{ - if (nr <= MISDN_MAX_CHANNEL) - return map[nr >> 3] & (1 << (nr & 7)); - else - return 0; -} - -static inline void -set_channelmap(u_int nr, u_char *map) -{ - map[nr >> 3] |= (1 << (nr & 7)); -} - -static inline void -clear_channelmap(u_int nr, u_char *map) -{ - map[nr >> 3] &= ~(1 << (nr & 7)); -} - -/* CONTROL_CHANNEL parameters */ -#define MISDN_CTRL_GETOP 0x0000 -#define MISDN_CTRL_LOOP 0x0001 -#define MISDN_CTRL_CONNECT 0x0002 -#define MISDN_CTRL_DISCONNECT 0x0004 -#define MISDN_CTRL_PCMCONNECT 0x0010 -#define MISDN_CTRL_PCMDISCONNECT 0x0020 -#define MISDN_CTRL_SETPEER 0x0040 -#define MISDN_CTRL_UNSETPEER 0x0080 -#define MISDN_CTRL_RX_OFF 0x0100 -#define MISDN_CTRL_FILL_EMPTY 0x0200 -#define MISDN_CTRL_GETPEER 0x0400 -#define MISDN_CTRL_HW_FEATURES_OP 0x2000 -#define MISDN_CTRL_HW_FEATURES 0x2001 -#define MISDN_CTRL_HFC_OP 0x4000 -#define MISDN_CTRL_HFC_PCM_CONN 0x4001 -#define MISDN_CTRL_HFC_PCM_DISC 0x4002 -#define MISDN_CTRL_HFC_CONF_JOIN 0x4003 -#define MISDN_CTRL_HFC_CONF_SPLIT 0x4004 -#define MISDN_CTRL_HFC_RECEIVE_OFF 0x4005 -#define MISDN_CTRL_HFC_RECEIVE_ON 0x4006 -#define MISDN_CTRL_HFC_ECHOCAN_ON 0x4007 -#define MISDN_CTRL_HFC_ECHOCAN_OFF 0x4008 - - -/* socket options */ -#define MISDN_TIME_STAMP 0x0001 - -struct mISDN_ctrl_req { - int op; - int channel; - int p1; - int p2; -}; - -/* muxer options */ -#define MISDN_OPT_ALL 1 -#define MISDN_OPT_TEIMGR 2 - -#endif /* mISDNIF_H */ diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 031ef79..1502129 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -1,5 +1,4 @@ noinst_HEADERS = \ - a_reset.h \ common.h \ crc24.h \ debug.h \ diff --git a/include/openbsc/a_reset.h b/include/openbsc/a_reset.h deleted file mode 100644 index 7aaab06..0000000 --- a/include/openbsc/a_reset.h +++ /dev/null @@ -1,63 +0,0 @@ -/* (C) 2017 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - - - -/* Reset context data (callbacks, state machine etc...) */ -struct a_reset_ctx { - - /* FSM instance, which handles the reset procedure */ - struct osmo_fsm_inst *fsm; - - /* Connection failure counter. When this counter - * reaches a certain threshold, the reset procedure - * will be triggered */ - int conn_loss_counter; - - /* A human readable name to display in the logs */ - char name[256]; - - /* Callback function to be called when a connection - * failure is detected and a rest must occur */ - void (*cb)(void *priv); - - /* Privated data for the callback function */ - void *priv; -}; - -/* Create and start state machine which handles the reset/reset-ack procedure */ -struct a_reset_ctx *a_reset_alloc(const void *ctx, const char *name, void *cb, void *priv); - -/* Tear down state machine */ -void a_reset_free(struct a_reset_ctx *reset); - -/* Confirm that we sucessfully received a reset acknowlege message */ -void a_reset_ack_confirm(struct a_reset_ctx *reset); - -/* Report a failed connection */ -void a_reset_conn_fail(struct a_reset_ctx *reset); - -/* Report a successful connection */ -void a_reset_conn_success(struct a_reset_ctx *reset); - -/* Check if we have a connection to a specified msc */ -bool a_reset_conn_ready(struct a_reset_ctx *reset); diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h deleted file mode 100644 index 3cdbe04..0000000 --- a/include/openbsc/gsm_04_14.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode); -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs); -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology); - -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h deleted file mode 100644 index d5e1428..0000000 --- a/include/openbsc/iu_dummy.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include - -struct msgb; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -struct ranap_ue_conn_ctx { - struct llist_head list; - uint32_t conn_id; -}; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi); -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck); -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/src/Makefile.am b/src/Makefile.am index 4d1bba4..d2dcb9f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,25 +1,3 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) - -# Programs SUBDIRS = \ gprs \ $(NULL) diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c deleted file mode 100644 index b529f4c..0000000 --- a/src/libmsc/gsm_04_14.c +++ /dev/null @@ -1,133 +0,0 @@ -/* GSM MS Testing Layer 3 messages - * 3GPP TS 44.014 / GSM TS 04.14 */ - -/* (C) 2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include "bscconfig.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static struct msgb *create_gsm0414_msg(uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_TEST; - gh->msg_type = msg_type; - return msg; -} - -static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - return msc_tx_dtap(conn, msg); -} - -static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) -{ - struct msgb *msg = create_gsm0414_msg(msg_type); - - return gsm0414_conn_sendmsg(conn, msg); -} - - -/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); - uint8_t subch; - - subch = (loop_mode << 1); - msgb_put_u8(msg, subch); - - msg->lchan = conn->lchan; - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a OPEN_LOOP_CMD according to Section 8.3 */ -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); -} - -/* Send a ACT_EMMI_CMD according to Section 8.8 */ -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); -} - -/* Send a DEACT_EMMI_CMD according to Section 8.10 */ -int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); -} - -/* Send a TEST_INTERFACE according to Section 8.11 */ -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); - msgb_put_u8(msg, tested_devs); - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); - msgb_put_u8(msg, technology); - return gsm0414_conn_sendmsg(conn, msg); -} - - - -/* Entry point for incoming GSM48_PDISC_TEST received from MS */ -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - - if (msgb_l3len(msg) < sizeof(*gh)) - return -1; - - LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", - get_value_string(gsm414_msgt_names, gh->msg_type)); - - return 0; -} diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c deleted file mode 100644 index e9d335e..0000000 --- a/src/libmsc/iu_dummy.c +++ /dev/null @@ -1,93 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include "../../bscconfig.h" -#ifndef BUILD_IU - -#include - -#include -#include -#include - -struct msgb; -struct ranap_ue_conn_ctx; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", - msg->len, osmo_hexdump(msg->data, msg->len)); - return 0; -} - -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); - return 0; -} - -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); - return 23; -} - -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); - return 0; -} - -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap) -{ - LOGP(DLGLOBAL, LOGL_INFO, "ranap_new_msg_rab_assign_voice() dummy called, NOT composing RAB Assignment\n"); - return NULL; -} - -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); - return 0; -} - -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); - return 0; -} - -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); - return 0; -} - -#endif diff --git a/tools/hlrstat.pl b/tools/hlrstat.pl deleted file mode 100755 index 668fc9a..0000000 --- a/tools/hlrstat.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -use strict; -use DBI; -my $dbh = DBI->connect("dbi:SQLite:dbname=hlr.sqlite3","",""); - - -my %mcc_names; -my %mcc_mnc_names; - -sub get_mcc_mnc_name($) -{ - my $mcc_mnc = shift; - my $ret = $mcc_mnc; - - if ($mcc_mnc_names{$mcc_mnc} ne '') { - $ret = $mcc_mnc_names{$mcc_mnc}; - } - - return $ret; -} - -sub read_networks($) -{ - my $filename = shift; - my $cur_name; - - open(INFILE, $filename); - while (my $l = ) { - chomp($l); - if ($l =~ /^#/) { - next; - } - if ($l =~ /^\t/) { - my ($mcc, $mnc, $brand, $r) = split(' ', $l, 4); - #printf("%s|%s|%s\n", $mcc, $mnc, $brand); - $mcc_mnc_names{"$mcc-$mnc"} = $brand; - $mcc_names{$mcc} = $cur_name; - } elsif ($l =~ /^(\w\w)\t(.*)/) { - #printf("%s|%s\n", $1, $2); - $cur_name = $2; - } - } - close(INFILE); -} - -read_networks("networks.tab"); - -my %oper_count; -my %country_count; - -#my $sth = $dbh->prepare("SELECT imsi FROM subscriber where authorized=1"); -my $sth = $dbh->prepare("SELECT imsi FROM subscriber"); - -$sth->execute(); - -while (my $href = $sth->fetchrow_hashref) { - my ($mcc, $mnc) = $$href{imsi} =~ /(\d{3})(\d{2}).*/; - #printf("%s %s-%s \n", $$href{imsi}, $mcc, $mnc); - $oper_count{"$mcc-$mnc"}++; - $country_count{$mcc}++; -} - - -foreach my $c (sort{$country_count{$b} <=> $country_count{$a}} keys %country_count) { - printf("%s: %d\n", $mcc_names{$c}, $country_count{$c}); - - foreach my $k (sort{$oper_count{$b} <=> $oper_count{$a}} keys %oper_count) { - if ($k =~ /^$c-/) { - printf("\t%s: %d\n", get_mcc_mnc_name($k), $oper_count{$k}); - } - } -} -- To view, visit https://gerrit.osmocom.org/3797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9dc7514c3850010d0e9b3ab716b4f4e8d83594f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:00:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:00:43 +0000 Subject: [PATCH] osmo-bsc[master]: drop files unrelated to osmo-bsc In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3795 to look at the new patch set (#2). drop files unrelated to osmo-bsc These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-bsc. Empty out contrib: remove things that are either obviously unrelated to osmo-bsc, or seem old and/or esoteric. osmoappdesc.py: drop nitb_e1_configs (and some ws) Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a --- D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/mgcp_server.py D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/systemd/osmo-bsc-mgcp.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D doc/call-routing.txt D doc/channel_release.txt D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/gsm-hopping.txt D doc/ipa-sccp.txt D doc/oml-interface.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt D include/openbsc/gsm_04_14.h M osmoappdesc.py D src/libcommon/oap_client.c D src/libmsc/gsm_04_14.c D tools/hlrstat.pl 56 files changed, 0 insertions(+), 3,037 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/3795/2 diff --git a/contrib/bsc-test/README b/contrib/bsc-test/README deleted file mode 100644 index adb222e..0000000 --- a/contrib/bsc-test/README +++ /dev/null @@ -1 +0,0 @@ -Some crazy scripts call testing... and MSC link failure simulation diff --git a/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial deleted file mode 100644 index 96e5f00..0000000 --- a/contrib/bsc-test/all_dial +++ /dev/null @@ -1,8 +0,0 @@ -ABORT BUSY -ABORT 'NO CARRIER' -ABORT 'OK' - -'' AT -SAY "Dialing a number\n" -'OK' ATD05660066; - diff --git a/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh deleted file mode 100755 index e5e19f6..0000000 --- a/contrib/bsc-test/dial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Evil dial script.. - -while true; -do - chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0 - sleep 5s - chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0 - sleep 2s -done - diff --git a/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh deleted file mode 100755 index 84eead7..0000000 --- a/contrib/bsc-test/drop-oml.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -sleep 3 -echo "enable" -sleep 1 -echo "drop bts connection 0 oml" -sleep 1 diff --git a/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh deleted file mode 100755 index c7b66ba..0000000 --- a/contrib/bsc-test/drop.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Going to drop the OML connection" - ./drop-oml.sh | telnet 127.0.0.1 4242 - sleep 58m -done diff --git a/contrib/bsc-test/hangup b/contrib/bsc-test/hangup deleted file mode 100644 index cad6870..0000000 --- a/contrib/bsc-test/hangup +++ /dev/null @@ -1,4 +0,0 @@ -TIMEOUT 10 -'' ^Z -SAY "Waiting for hangup confirm\n" -'' ATH; diff --git a/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh deleted file mode 100755 index bec011d..0000000 --- a/contrib/bsc-test/msc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` - sleep 58s -done diff --git a/contrib/bt.py b/contrib/bt.py deleted file mode 100755 index 1b111ef..0000000 --- a/contrib/bt.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os - -f = open("unbalanced") -lines = [] -for line in f: - lines.append(line) - -filenames = {} - -output = [] -for line in lines: - if "[0x" in line: - start = line.find("[") - end = line.find("]") - addr = line[start+1:end] - try: - file = filenames[addr] - except KeyError: - r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr) - all = r.read().replace("\n", ",") - file = all - filenames[addr] = file - - line = line.replace(addr, file) - output.append(line) - -g = open("unbalanced.2", "w") -g.write("".join(output)) - - - diff --git a/contrib/convert_to_enum.py b/contrib/convert_to_enum.py deleted file mode 100755 index bcd6f2c..0000000 --- a/contrib/convert_to_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# -# Convert ETSI documents to an enum -# - -import re, sys - -def convert(string): - string = string.strip().replace(" ", "").rjust(8, "0") - var = 0 - offset = 7 - for char in string: - assert offset >= 0 - var = var | (int(char) << offset) - offset = offset - 1 - - return var - -def string(name): - name = name.replace(" ", "_") - name = name.replace('"', "") - name = name.replace('/', '_') - name = name.replace('(', '_') - name = name.replace(')', '_') - return "%s_%s" % (sys.argv[2], name.upper()) - -file = open(sys.argv[1]) - - -for line in file: - m = re.match(r"[ \t]*(?P[01 ]+)[ ]+(?P[a-zA-Z /0-9()]+)", line[:-1]) - - if m: - print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"])) - else: - print line[:-1] diff --git a/contrib/ctrl2sse.py b/contrib/ctrl2sse.py deleted file mode 100755 index 8b630ec..0000000 --- a/contrib/ctrl2sse.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python2 - -mod_license = ''' -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -''' - -import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control -from eventsource import listener, request - -''' -N. B: this is not an example of building proper REST API or building secure web application. -It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API. -Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem -from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that. -''' - -token = None -stream = None -url = None - -''' -Returns json according to following schema - see http://json-schema.org/documentation.html for details: -{ - "title": "Ctrl Schema", - "type": "object", - "properties": { - "variable": { - "type": "string" - }, - "varlue": { - "type": "string" - } - }, - "required": ["interface", "variable", "value"] -} -Example validation from command-line: -json validate --schema-file=schema.json --document-file=data.json -The interface is represented as string because it might look different for IPv4 vs v6. -''' - -def read_header(data): - t_length = bsc_control.ipa_ctrl_header(data) - if (t_length): - stream.read_bytes(t_length - 1, callback = read_trap) - else: - print >> sys.stderr, "protocol error: length missing in %s!" % data - - at tornado.gen.coroutine -def read_trap(data): - (t, z, v, p) = data.split() - if (t != 'TRAP' or int(z) != 0): - print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z)) - else: - yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token), - method = 'POST', - headers = {'Content-Type': 'application/json'}, - body = tornado.escape.json_encode({ 'variable' : v, 'value' : p }))) - stream.read_bytes(4, callback = read_header) - - at tornado.gen.coroutine -def trap_setup(host, port, target_host, target_port, tk): - global stream - global url - global token - token = tk - url = "http://%s:%s/sse" % (host, port) - stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port) - stream.read_bytes(4, callback = read_header) - -def get_v(s, v): - return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) } - -class CtrlHandler(tornado.web.RequestHandler): - def initialize(self): - self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port']) - - def get(self, v): - self.write(get_v(self.skt, v)) - - def post(self): - self.write(get_v(self.skt, self.get_argument("variable"))) - -class SetCtrl(CtrlHandler): - def get(self, var, val): - bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val)) - super(SetCtrl, self).get(tornado.escape.native_str(var)) - - def post(self): - bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value"))) - super(SetCtrl, self).post() - -class Slash(tornado.web.RequestHandler): - def get(self): - self.write('%sUsing Tornado framework v%s' - '
' - '' - '' - '
' - '
' - '' - '' - '' - '
' - '' % ("Osmocom Control Interface Proxy", tornado.version)) - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.') - p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port") - p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress") - p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface") - p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface") - p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)") - p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value") - p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000") - args = p.parse_args() - random.seed() - tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver - logging.basicConfig() - application = tornado.web.Application([ - (r"/", Slash), - (r"/get", CtrlHandler), - (r"/get/(.*)", CtrlHandler), - (r"/set", SetCtrl), - (r"/set/(.*)/(.*)", SetCtrl), - (r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)), - ], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port) - application.listen(address = args.host, port = args.port) - trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token) - tornado.ioloop.IOLoop.instance().start() diff --git a/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py deleted file mode 100755 index 0cd4b87..0000000 --- a/contrib/gprs/gb-proxy-unblock-bug.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -""" -demonstrate a unblock bug on the GB Proxy.. -""" - -bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7" -ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7" - -bts_ns_unblock = "\x06" -ns_unblock_ack = "\x07" - -bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02" -ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00" - -bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40" - - -import socket -socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -socket.bind(("0.0.0.0", 0)) -socket.setblocking(1) - - -import sys -port = int(sys.argv[1]) -print "Sending data to port: %d" % port - -def send_and_receive(packet): - socket.sendto(packet, ("127.0.0.1", port)) - - try: - data, addr = socket.recvfrom(4096) - except socket.error, e: - print "ERROR", e - import sys - sys.exit(0) - return data - -#send stuff once - -to_send = [ - (bts_ns_reset, ns_reset_ack, "reset ack"), - (bts_ns_unblock, ns_unblock_ack, "unblock ack"), - (bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"), -] - - -for (out, inp, type) in to_send: - res = send_and_receive(out) - if res != inp: - print "Failed to get the %s" % type - sys.exit(-1) - -import time -time.sleep(3) -res = send_and_receive(bts_bvc_reset_8167) -print "Sent all messages... check wireshark for the last response" diff --git a/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua deleted file mode 100644 index b1ab5df..0000000 --- a/contrib/gprs/gprs-bssgp-histogram.lua +++ /dev/null @@ -1,78 +0,0 @@ --- Simple LUA script to print the size of BSSGP messages over their type... - -do - local ip_bucket = {} - - local pdu_types = {} - pdu_types[ 6] = "PAGING" - pdu_types[11] = "SUSPEND" - pdu_types[12] = "SUSPEND-ACK" - pdu_types[32] = "BVC-BLOCK" - pdu_types[33] = "BVC-BLOCK-ACK" - pdu_types[34] = "BVC-RESET" - pdu_types[35] = "BVC-RESET-ACK" - pdu_types[36] = "UNBLOCK" - pdu_types[37] = "UNBLOCK-ACK" - pdu_types[38] = "FLOW-CONTROL-BVC" - pdu_types[39] = "FLOW-CONTROL-BVC-ACK" - pdu_types[40] = "FLOW-CONTROL-MS" - pdu_types[41] = "FLOW-CONTROL-MS-ACK" - pdu_types[44] = "LLC-DISCARDED" - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local udp_length_get = Field.new("udp.length") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = udp_length_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - pdu = tostring(pdu) - if tonumber(pdu) == 0 or tonumber(pdu) == 1 then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_histo = ip_bucket[ip_src] - if not bssgp_histo then - bssgp_histo = {} - ip_bucket[ip_src] = bssgp_histo - end - - local key = pdu - local bucket = bssgp_histo[key] - if not bucket then - bucket = {} - bssgp_histo[key] = bucket - end - - table.insert(bucket, tostring(len)) - print("IP: " .. ip_src .. " PDU: " .. pdu_types[tonumber(pdu)] .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua deleted file mode 100644 index ca8864a..0000000 --- a/contrib/gprs/gprs-buffer-count.lua +++ /dev/null @@ -1,80 +0,0 @@ --- I count the buffer space needed for LLC PDUs in the worse case and print it - -do - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local bssgp_delay_get = Field.new("bssgp.delay_val") - local llcgprs_get = Field.new("llcgprs") - local pdus = nil - - print("START...") - - local tap = Listener.new("ip", "udp.port == 23000 && bssgp.pdu_type == 0") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = llcgprs_get().len - local delay = bssgp_delay_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - if tonumber(tostring(delay)) == 65535 then - pdus = { next = pdus, - len = len, - expires = -1 } - else - local off = tonumber(tostring(delay)) / 100.0 - pdus = { next = pdus, - len = len, - expires = pinfo.rel_ts + off } - end - local now_time = tonumber(tostring(pinfo.rel_ts)) - local now_size = 0 - local l = pdus - local prev = nil - local count = 0 - while l do - if now_time < l.expires or l.expires == -1 then - now_size = now_size + l.len - prev = l - l = l.next - count = count + 1 - else - -- delete things - if prev == nil then - pdus = nil - l = nil - else - prev.next = l.next - l = l.next - end - end - end --- print("TOTAL: " .. now_time .. " PDU_SIZE: " .. now_size) - print(now_time .. " " .. now_size / 1024.0 .. " " .. count) --- print("NOW: " .. tostring(pinfo.rel_ts) .. " Delay: " .. tostring(delay) .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - print("END") - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua deleted file mode 100644 index 018c377..0000000 --- a/contrib/gprs/gprs-split-trace-by-tlli.lua +++ /dev/null @@ -1,46 +0,0 @@ --- Create a file named by_ip/''ip_addess''.cap with all ip traffic of each ip host. (works for tshark only) --- Dump files are created for both source and destination hosts -do - local dir = "by_tlli" - local dumpers = {} - local function init_listener() - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - local field_tlli = Field.new("bssgp.tlli") - local tap = Listener.new("ip", "udp.port == 23000") - - -- we will be called once for every IP Header. - -- If there's more than one IP header in a given packet we'll dump the packet once per every header - function tap.packet(pinfo,tvb,ip) - local tlli = field_tlli() - if not tlli then - return - end - - local tlli_str = tostring(tlli) - tlli_dmp = dumpers[tlli_str] - if not tlli_dmp then - local tlli_hex = string.format("0x%x", tonumber(tlli_str)) - print("Creating dump for TLLI " .. tlli_hex) - tlli_dmp = Dumper.new_for_current(dir .. "/" .. tlli_hex .. ".pcap") - dumpers[tlli_str] = tlli_dmp - end - tlli_dmp:dump_current() - tlli_dmp:flush() - end - function tap.draw() - for tlli,dumper in pairs(dumpers) do - dumper:flush() - end - end - function tap.reset() - for tlli,dumper in pairs(dumpers) do - dumper:close() - end - dumpers = {} - end - end - init_listener() -end diff --git a/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua deleted file mode 100644 index e44fdd1..0000000 --- a/contrib/gprs/gprs-verify-nu.lua +++ /dev/null @@ -1,59 +0,0 @@ --- This script verifies that the N(U) is increasing... --- -do - local nu_state_src = {} - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- we want to look here... - local llc_sapi_get = Field.new("llcgprs.sapib") - local llc_nu_get = Field.new("llcgprs.nu") - local bssgp_tlli_get = Field.new("bssgp.tlli") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local llc_sapi = llc_sapi_get() - local llc_nu = llc_nu_get() - local bssgp_tlli = bssgp_tlli_get() - - if not llc_sapi or not llc_nu or not bssgp_tlli then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_tlli = tostring(bssgp_tlli) - local llc_nu = tostring(llc_nu) - local llc_sapi = tostring(llc_sapi) - - local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi - local last_nu = nu_state_src[src_key] - if not last_nu then - -- print("Establishing mapping for " .. src_key) - nu_state_src[src_key] = llc_nu - return - end - - local function tohex(number) - return string.format("0x%x", tonumber(number)) - end - - nu_state_src[src_key] = llc_nu - if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then - print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src) - print("\t last: " .. last_nu .. " now: " .. llc_nu) - end - end - - function tap.draw() - end - - function tap.reset() - end - end - init_listener() -end - diff --git a/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql deleted file mode 100644 index 626a331..0000000 --- a/contrib/hlr-remove-old.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Remove old data from the database -DELETE FROM Subscriber - WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1; -DELETE FROM Equipment - WHERE datetime('now', '-10 days') > updated; -DELETE FROM EquipmentWatch - WHERE datetime('now', '-10 days') > updated; -DELETE FROM SMS - WHERE datetime('now', '-10 days') > created; -DELETE FROM VLR - WHERE datetime('now', '-10 days') > updated; -DELETE FROM ApduBlobs - WHERE datetime('now', '-10 days') > created; -DELETE FROM Counters - WHERE datetime('now', '-10 days') > timestamp; -DELETE FROM RateCounters - WHERE datetime('now', '-10 days') > timestamp; -VACUUM; diff --git a/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py deleted file mode 100755 index e4a4955..0000000 --- a/contrib/hlrsync/hlrsync.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python2.5 - -from __future__ import with_statement - -from pysqlite2 import dbapi2 as sqlite3 -import sys - -hlr = sqlite3.connect(sys.argv[1]) -web = sqlite3.connect(sys.argv[2]) - -# switch to autocommit -hlr.isolation_level = None -web.isolation_level = None - -hlr.row_factory = sqlite3.Row -web.row_factory = sqlite3.Row - -with hlr: - hlr_subscrs = hlr.execute(""" - SELECT * FROM Subscriber - """).fetchall() - hlr_tokens = hlr.execute(""" - SELECT * FROM AuthToken - """).fetchall() - -with web: - web_tokens = web.execute(""" - SELECT * FROM reg_tokens - """).fetchall() - web_sms = web.execute(""" - SELECT * FROM sms_queue - """).fetchall() - -# index by subscr id -hlr_subscrs_by_id = {} -hlr_subscrs_by_ext = {} -hlr_tokens_by_subscr_id = {} -for x in hlr_subscrs: - hlr_subscrs_by_id[x['id']] = x - hlr_subscrs_by_ext[x['extension']] = x -del hlr_subscrs -for x in hlr_tokens: - hlr_tokens_by_subscr_id[x['subscriber_id']] = x -del hlr_tokens - -web_tokens_by_subscr_id = {} -for x in web_tokens: - web_tokens_by_subscr_id[x['subscriber_id']] = x -del web_tokens - -# remove leftover web_tokens and correct inconsistent fields -with web: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - web.execute(""" - DELETE FROM reg_tokens WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del web_tokens_by_subscr_id[x['subscriber_id']] - continue - if str(x['imsi']) != str(subscr['imsi']) or \ - x['extension'] != subscr['extension'] or \ - x['tmsi'] != subscr['tmsi'] or \ - x['lac'] != subscr['lac']: - web.execute(""" - UPDATE reg_tokens - SET imsi = ?, extension = ?, tmsi = ?, lac = ? - WHERE subscriber_id = ? - """, (str(subscr['imsi']), subscr['extension'], - subscr['tmsi'], subscr['lac'], x['subscriber_id'])) - -# add missing web_tokens -with web: - for x in hlr_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - hlr.execute(""" - DELETE FROM AuthToken WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del hlr_tokens_by_subscr_id[x['subscriber_id']] - continue - webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None) - if webtoken is None: - web.execute(""" - INSERT INTO reg_tokens - (subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi) - VALUES - (?, ?, 0, ?, '', ?, ?, ?, ?) - """, (x['subscriber_id'], subscr['extension'], subscr['name'], - subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi'])) - -# authorize subscribers -with hlr: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if x['reg_completed'] and not subscr['authorized']: - hlr.execute(""" - UPDATE Subscriber - SET authorized = 1 - WHERE id = ? - """, (x['subscriber_id'],)) - -# Sync SMS from web to hlr -with hlr: - for sms in web_sms: - subscr = hlr_subscrs_by_ext.get(sms['receiver_ext']) - if subscr is None: - print '%s not found' % sms['receiver_ext'] - continue - hlr.execute(""" - INSERT INTO SMS - (created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text) - VALUES - (?, 1, ?, 0, 0, 0, 0, 0, ?) - """, (sms['created'], subscr['id'], sms['text'])) -with web: - for sms in web_sms: - web.execute(""" - DELETE FROM sms_queue WHERE id = ? - """, (sms['id'],)) - - -hlr.close() -web.close() - diff --git a/contrib/mgcp_server.py b/contrib/mgcp_server.py deleted file mode 100755 index 05c489d..0000000 --- a/contrib/mgcp_server.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Simple server for mgcp... send audit, receive response.. - -import socket, time - -MGCP_GATEWAY_PORT = 2427 -MGCP_CALLAGENT_PORT = 2727 - -rsip_resp = """200 321321332\r\n""" -audit_packet = """AUEP %d 13 at mgw MGCP 1.0\r\n""" -crcx_packet = """CRCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n""" -dlcx_packet = """DLCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\n""" -mdcx_packet = """MDCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 258696477 0 IN IP4 172.16.1.107\r\ns=-\r\nc=IN IP4 172.16.1.107\r\nt=0 0\r\nm=audio 6666 RTP/AVP 127\r\na=rtpmap:127 GSM-EFR/8000/1\r\na=ptime:20\r\na=recvonly\r\nm=image 4402 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n""" - -def hexdump(src, length=8): - """Recipe is from http://code.activestate.com/recipes/142812/""" - result = [] - digits = 4 if isinstance(src, unicode) else 2 - for i in xrange(0, len(src), length): - s = src[i:i+length] - hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s]) - text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) - result.append( b"%04X %-*s %s" % (i, length*(digits + 1), hexa, text) ) - return b'\n'.join(result) - -server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -server_socket.bind(("127.0.0.1", MGCP_CALLAGENT_PORT)) -server_socket.setblocking(1) - -last_ci = 1 -def send_and_receive(packet): - global last_ci - server_socket.sendto(packet, ("127.0.0.1", MGCP_GATEWAY_PORT)) - try: - data, addr = server_socket.recvfrom(4096) - - # attempt to store the CI of the response - list = data.split("\n") - for item in list: - if item.startswith("I: "): - last_ci = int(item[3:]) - - print hexdump(data), addr - except socket.error, e: - print e - pass - -def generate_tid(): - import random - return random.randint(0, 65123) - - - -while True: - send_and_receive(audit_packet % generate_tid()) - send_and_receive(crcx_packet % generate_tid() ) - send_and_receive(mdcx_packet % (generate_tid(), last_ci)) - send_and_receive(dlcx_packet % (generate_tid(), last_ci)) - - time.sleep(3) diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c deleted file mode 100644 index 808a703..0000000 --- a/contrib/nat/test_regexp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* make test_regexp */ -#include -#include -#include - - -int main(int argc, char **argv) -{ - regex_t reg; - regmatch_t matches[2]; - - if (argc != 4) { - printf("Invoke with: test_regexp REGEXP REPLACE NR\n"); - return -1; - } - - if (regcomp(®, argv[1], REG_EXTENDED) != 0) { - fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]); - return -1; - } - - if (regexec(®, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1) - printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]); - else - printf("No match.\n"); - - regfree(®); - - return 0; -} diff --git a/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py deleted file mode 100644 index 8f7a58d..0000000 --- a/contrib/nat/ussd_example.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2.7 - -""" -AGPLv3+ 2016 Copyright Holger Hans Peter Freyther - -Example of how to connect to the USSD side-channel and how to respond -with a fixed message. -""" - -import socket -import struct - -ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ussdSocket.connect(('127.0.0.1', 5001)) - -def send_dt1(dstref, data): - dlen = struct.pack('B', len(data)).encode('hex') - hex = '06' + dstref.encode('hex') + '00' + '01' + dlen + data.encode('hex') - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def send_rel(srcref, dstref): - hex = '04' + dstref.encode('hex') + srcref.encode('hex') + '000100' - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def recv_one(): - plen = ussdSocket.recv(3) - (plen,ptype) = struct.unpack(">HB", plen) - data = ussdSocket.recv(plen) - - return ptype, data - -# Assume this is the ID request -data = ussdSocket.recv(4) -ussdSocket.send("\x00\x08\xfe\x05\x00" + "\x05\x01" + "ussd") -# ^len ^len of tag ... and ignore - -# Expect a fake message. see struct ipac_msgt_sccp_state -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) -(srcref, dstref, transid, invokeid) = struct.unpack("<3s3sBB", data[1:9]) -print("New transID %d invoke %d" % (transid, invokeid)) - -# Expect a the invocation.. todo.. extract invoke id -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) - -# Reply with BSSAP + GSM 04.08 + MAP portion -# 00 == invoke id 0f == DCS -res = "01002a9b2a0802e1901c22a220020100301b02013b301604010f041155e7d2f9bc3a41412894991c06a9c9a713" -send_dt1(dstref, res.decode('hex')) - -clear = "000420040109" -send_dt1(dstref, clear.decode('hex')) - -# should be the clear complete -send_rel(srcref, dstref) - -# Give it some time to handle connection shutdown properly -print("Gracefully sleeping") -import time -time.sleep(3) diff --git a/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl deleted file mode 100755 index 47839c1..0000000 --- a/contrib/rtp/gen_rtp_header.erl +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- -%%! -smp disable --module(gen_rtp_header). - -% -mode(compile). - --define(VERSION, "0.1"). - --export([main/1]). - --record(rtp_packet, - { - version = 2, - padding = 0, - marker = 0, - payload_type = 0, - seqno = 0, - timestamp = 0, - ssrc = 0, - csrcs = [], - extension = <<>>, - payload = <<>>, - realtime - }). - - -main(Args) -> - DefaultOpts = [{format, state}, - {ssrc, 16#11223344}, - {rate, 8000}, - {pt, 98}], - {PosArgs, Opts} = getopts_checked(Args, DefaultOpts), - log(debug, fun (Dev) -> - io:format(Dev, "Initial options:~n", []), - dump_opts(Dev, Opts), - io:format(Dev, "~s: ~p~n", ["Args", PosArgs]) - end, [], Opts), - main(PosArgs, Opts). - -main([First | RemArgs], Opts) -> - try - F = list_to_integer(First), - Format = proplists:get_value(format, Opts, state), - PayloadData = proplists:get_value(payload, Opts, undef), - InFile = proplists:get_value(file, Opts, undef), - - Payload = case {PayloadData, InFile} of - {undef, undef} -> - % use default value - #rtp_packet{}#rtp_packet.payload; - {P, undef} -> P; - {_, File} -> - log(info, "Loading file '~s'~n", [File], Opts), - {ok, InDev} = file:open(File, [read]), - DS = [ Pl#rtp_packet.payload || {_T, Pl} <- read_packets(InDev, Opts)], - file:close(InDev), - log(debug, "File '~s' closed, ~w packets read.~n", [File, length(DS)], Opts), - DS - end, - Dev = standard_io, - write_packet_pre(Dev, Format), - do_groups(Dev, Payload, F, RemArgs, Opts), - write_packet_post(Dev, Format), - 0 - catch - _:_ -> - log(debug, "~p~n", [hd(erlang:get_stacktrace())], Opts), - usage(), - halt(1) - end - ; - -main(_, _Opts) -> - usage(), - halt(1). - -%%% group (count + offset) handling %%% - -do_groups(_Dev, _Pl, _F, [], _Opts) -> - ok; - -do_groups(Dev, Pl, F, [L], Opts) -> - do_groups(Dev, Pl, F, [L, 0], Opts); - -do_groups(Dev, Pl, First, [L, O | Args], Opts) -> - Ssrc = proplists:get_value(ssrc, Opts, #rtp_packet.ssrc), - PT = proplists:get_value(pt, Opts, #rtp_packet.payload_type), - Len = list_to_num(L), - Offs = list_to_num(O), - log(info, "Starting group: Ssrc=~.16B, PT=~B, First=~B, Len=~B, Offs=~B~n", - [Ssrc, PT, First, Len, Offs], Opts), - Pkg = #rtp_packet{ssrc = Ssrc, payload_type = PT}, - Pl2 = write_packets(Dev, Pl, Pkg, First, Len, Offs, Opts), - {Args2, Opts2} = getopts_checked(Args, Opts), - log(debug, fun (Io) -> - io:format(Io, "Changed options:~n", []), - dump_opts(Io, Opts2 -- Opts) - end, [], Opts), - do_groups(Dev, Pl2, First+Len, Args2, Opts2). - -%%% error handling helpers %%% - -getopts_checked(Args, Opts) -> - try - getopts(Args, Opts) - catch - C:R -> - log(error, "~s~n", - [explain_error(C, R, erlang:get_stacktrace(), Opts)], Opts), - usage(), - halt(1) - end. - -explain_error(error, badarg, [{erlang,list_to_integer,[S,B]} | _ ], _Opts) -> - io_lib:format("Invalid number '~s' (base ~B)", [S, B]); -explain_error(error, badarg, [{erlang,list_to_integer,[S]} | _ ], _Opts) -> - io_lib:format("Invalid decimal number '~s'", [S]); -explain_error(C, R, [Hd | _ ], _Opts) -> - io_lib:format("~p, ~p:~p", [Hd, C, R]); -explain_error(_, _, [], _Opts) -> - "". - -%%% usage and options %%% - -myname() -> - filename:basename(escript:script_name()). - -usage(Text) -> - io:format(standard_error, "~s: ~s~n", [myname(), Text]), - usage(). - -usage() -> - io:format(standard_error, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n", - [myname()]). - -show_version() -> - io:format(standard_io, - "~s ~s~n", [myname(), ?VERSION]). - -show_help() -> - io:format(standard_io, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n~n" ++ - "Options:~n" ++ - " -h, --help this text~n" ++ - " --version show version info~n" ++ - " -i, --file=FILE reads payload from file (state format by default)~n" ++ - " -f, --frame-size=N read payload as binary frames of size N instead~n" ++ - " -p, --payload=HEX set constant payload~n" ++ - " --verbose=N set verbosity~n" ++ - " -v increase verbosity~n" ++ - " --format=state use state format for output (default)~n" ++ - " -C, --format=c use simple C lines for output~n" ++ - " --format=carray use a C array for output~n" ++ - " -s, --ssrc=SSRC set the SSRC~n" ++ - " -t, --type=N set the payload type~n" ++ - " -r, --rate=N set the RTP rate [8000]~n" ++ - " -D, --duration=N set the packet duration in RTP time units [160]~n" ++ - " -d, --delay=FLOAT add offset to playout timestamp~n" ++ - "~n" ++ - "Arguments:~n" ++ - " Start initial packet (sequence) number~n" ++ - " Count number of packets~n" ++ - " Offs timestamp offset (in RTP units)~n" ++ - "", [myname()]). - -getopts([ "--file=" ++ File | R], Opts) -> - getopts(R, [{file, File} | Opts]); -getopts([ "-i" ++ T | R], Opts) -> - getopts_alias_arg("--file", T, R, Opts); -getopts([ "--frame-size=" ++ N | R], Opts) -> - Size = list_to_integer(N), - getopts(R, [{frame_size, Size}, {in_format, bin} | Opts]); -getopts([ "-f" ++ T | R], Opts) -> - getopts_alias_arg("--frame-size", T, R, Opts); -getopts([ "--duration=" ++ N | R], Opts) -> - Duration = list_to_integer(N), - getopts(R, [{duration, Duration} | Opts]); -getopts([ "-D" ++ T | R], Opts) -> - getopts_alias_arg("--duration", T, R, Opts); -getopts([ "--rate=" ++ N | R], Opts) -> - Rate = list_to_integer(N), - getopts(R, [{rate, Rate} | Opts]); -getopts([ "-r" ++ T | R], Opts) -> - getopts_alias_arg("--rate", T, R, Opts); -getopts([ "--version" | _], _Opts) -> - show_version(), - halt(0); -getopts([ "--help" | _], _Opts) -> - show_help(), - halt(0); -getopts([ "-h" ++ T | R], Opts) -> - getopts_alias_no_arg("--help", T, R, Opts); -getopts([ "--verbose=" ++ V | R], Opts) -> - Verbose = list_to_integer(V), - getopts(R, [{verbose, Verbose} | Opts]); -getopts([ "-v" ++ T | R], Opts) -> - Verbose = proplists:get_value(verbose, Opts, 0), - getopts_short_no_arg(T, R, [ {verbose, Verbose+1} | Opts]); -getopts([ "--format=state" | R], Opts) -> - getopts(R, [{format, state} | Opts]); -getopts([ "--format=c" | R], Opts) -> - getopts(R, [{format, c} | Opts]); -getopts([ "-C" ++ T | R], Opts) -> - getopts_alias_no_arg("--format=c", T, R, Opts); -getopts([ "--format=carray" | R], Opts) -> - getopts(R, [{format, carray} | Opts]); -getopts([ "--payload=" ++ Hex | R], Opts) -> - getopts(R, [{payload, hex_to_bin(Hex)} | Opts]); -getopts([ "--ssrc=" ++ Num | R], Opts) -> - getopts(R, [{ssrc, list_to_num(Num)} | Opts]); -getopts([ "-s" ++ T | R], Opts) -> - getopts_alias_arg("--ssrc", T, R, Opts); -getopts([ "--type=" ++ Num | R], Opts) -> - getopts(R, [{pt, list_to_num(Num)} | Opts]); -getopts([ "-t" ++ T | R], Opts) -> - getopts_alias_arg("--type", T, R, Opts); -getopts([ "--delay=" ++ Num | R], Opts) -> - getopts(R, [{delay, list_to_float(Num)} | Opts]); -getopts([ "-d" ++ T | R], Opts) -> - getopts_alias_arg("--delay", T, R, Opts); - -% parsing helpers -getopts([ "--" | R], Opts) -> - {R, normalize_opts(Opts)}; -getopts([ O = "--" ++ _ | _], _Opts) -> - usage("Invalid option: " ++ O), - halt(1); -getopts([ [ $-, C | _] | _], _Opts) when C < $0; C > $9 -> - usage("Invalid option: -" ++ [C]), - halt(1); - -getopts(R, Opts) -> - {R, normalize_opts(Opts)}. - -getopts_short_no_arg([], R, Opts) -> getopts(R, Opts); -getopts_short_no_arg(T, R, Opts) -> getopts([ "-" ++ T | R], Opts). - -getopts_alias_no_arg(A, [], R, Opts) -> getopts([A | R], Opts); -getopts_alias_no_arg(A, T, R, Opts) -> getopts([A, "-" ++ T | R], Opts). - -getopts_alias_arg(A, [], [T | R], Opts) -> getopts([A ++ "=" ++ T | R], Opts); -getopts_alias_arg(A, T, R, Opts) -> getopts([A ++ "=" ++ T | R], Opts). - -normalize_opts(Opts) -> - [ proplists:lookup(E, Opts) || E <- proplists:get_keys(Opts) ]. - -%%% conversions %%% - -bin_to_hex(Bin) -> [hd(integer_to_list(N,16)) || <> <= Bin]. -hex_to_bin(Hex) -> << <<(list_to_integer([Nib],16)):4>> || Nib <- Hex>>. - -list_to_num("-" ++ Str) -> -list_to_num(Str); -list_to_num("0x" ++ Str) -> list_to_integer(Str, 16); -list_to_num("0b" ++ Str) -> list_to_integer(Str, 2); -list_to_num(Str = [ $0 | _ ]) -> list_to_integer(Str, 8); -list_to_num(Str) -> list_to_integer(Str, 10). - -%%% dumping data %%% - -dump_opts(Dev, Opts) -> - dump_opts2(Dev, Opts, proplists:get_keys(Opts)). - -dump_opts2(Dev, Opts, [OptName | R]) -> - io:format(Dev, " ~-10s: ~p~n", - [OptName, proplists:get_value(OptName, Opts)]), - dump_opts2(Dev, Opts, R); -dump_opts2(_Dev, _Opts, []) -> ok. - -%%% logging %%% - -log(L, Fmt, Args, Opts) when is_list(Opts) -> - log(L, Fmt, Args, proplists:get_value(verbose, Opts, 0), Opts). - -log(debug, Fmt, Args, V, Opts) when V > 2 -> log2("DEBUG", Fmt, Args, Opts); -log(info, Fmt, Args, V, Opts) when V > 1 -> log2("INFO", Fmt, Args, Opts); -log(notice, Fmt, Args, V, Opts) when V > 0 -> log2("NOTICE", Fmt, Args, Opts); -log(warn, Fmt, Args, _V, Opts) -> log2("WARNING", Fmt, Args, Opts); -log(error, Fmt, Args, _V, Opts) -> log2("ERROR", Fmt, Args, Opts); - -log(Lvl, Fmt, Args, V, Opts) when V >= Lvl -> log2("", Fmt, Args, Opts); - -log(_, _, _, _i, _) -> ok. - -log2(Type, Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, "~s: " ++ Fmt, [Type | Args]); -log2("", Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, Fmt, Args); -log2(_Type, Fun, _Args, _Opts) when is_function(Fun, 1) -> - Fun(standard_error). - -%%% RTP packets %%% - -make_rtp_packet(P = #rtp_packet{version = 2}) -> - << (P#rtp_packet.version):2, - 0:1, % P - 0:1, % X - 0:4, % CC - (P#rtp_packet.marker):1, - (P#rtp_packet.payload_type):7, - (P#rtp_packet.seqno):16, - (P#rtp_packet.timestamp):32, - (P#rtp_packet.ssrc):32, - (P#rtp_packet.payload)/bytes - >>. - -parse_rtp_packet( - << 2:2, % Version 2 - 0:1, % P (not supported yet) - 0:1, % X (not supported yet) - 0:4, % CC (not supported yet) - M:1, - PT:7, - SeqNo: 16, - TS:32, - Ssrc:32, - Payload/bytes >>) -> - #rtp_packet{ - version = 0, - marker = M, - payload_type = PT, - seqno = SeqNo, - timestamp = TS, - ssrc = Ssrc, - payload = Payload}. - -%%% payload generation %%% - -next_payload(F) when is_function(F) -> - {F(), F}; -next_payload({F, D}) when is_function(F) -> - {P, D2} = F(D), - {P, {F, D2}}; -next_payload([P | R]) -> - {P, R}; -next_payload([]) -> - undef; -next_payload(Bin = <<_/bytes>>) -> - {Bin, Bin}. - -%%% real writing work %%% - -write_packets(_Dev, DS, _P, _F, 0, _O, _Opts) -> - DS; -write_packets(Dev, DataSource, P = #rtp_packet{}, F, L, O, Opts) -> - Format = proplists:get_value(format, Opts, state), - Ptime = proplists:get_value(duration, Opts, 160), - Delay = proplists:get_value(delay, Opts, 0), - Rate = proplists:get_value(rate, Opts, 8000), - case next_payload(DataSource) of - {Payload, DataSource2} -> - write_packet(Dev, Ptime * F / Rate + Delay, - P#rtp_packet{seqno = F, timestamp = F*Ptime+O, - payload = Payload}, - Format), - write_packets(Dev, DataSource2, P, F+1, L-1, O, Opts); - Other -> Other - end. - -write_packet(Dev, Time, P = #rtp_packet{}, Format) -> - Bin = make_rtp_packet(P), - - write_packet_line(Dev, Time, P, Bin, Format). - -write_packet_pre(Dev, carray) -> - io:format(Dev, - "struct {float t; int len; char *data;} packets[] = {~n", []); - -write_packet_pre(_Dev, _) -> ok. - -write_packet_post(Dev, carray) -> - io:format(Dev, "};~n", []); - -write_packet_post(_Dev, _) -> ok. - -write_packet_line(Dev, Time, _P, Bin, state) -> - io:format(Dev, "~f ~s~n", [Time, bin_to_hex(Bin)]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, c) -> - ByteList = [ [ $0, $x | integer_to_list(Byte, 16) ] || <> <= Bin ], - ByteStr = string:join(ByteList, ", "), - io:format(Dev, "/* time=~f, SeqNo=~B, TS=~B */ {~s}~n", [Time, N, TS, ByteStr]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, carray) -> - io:format(Dev, " /* RTP: SeqNo=~B, TS=~B */~n", [N, TS]), - io:format(Dev, " {~f, ~B, \"", [Time, size(Bin)]), - [ io:format(Dev, "\\x~2.16.0B", [Byte]) || <> <= Bin ], - io:format(Dev, "\"},~n", []). - -%%% real reading work %%% - -read_packets(Dev, Opts) -> - Format = proplists:get_value(in_format, Opts, state), - - read_packets(Dev, Opts, Format). - -read_packets(Dev, Opts, Format) -> - case read_packet(Dev, Opts, Format) of - eof -> []; - Tuple -> [Tuple | read_packets(Dev, Opts, Format)] - end. - -read_packet(Dev, Opts, bin) -> - Size = proplists:get_value(frame_size, Opts), - case file:read(Dev, Size) of - {ok, Data} -> {0, #rtp_packet{payload = iolist_to_binary(Data)}}; - eof -> eof - end; -read_packet(Dev, _Opts, Format) -> - case read_packet_line(Dev, Format) of - {Time, Bin} -> {Time, parse_rtp_packet(Bin)}; - eof -> eof - end. - -read_packet_line(Dev, state) -> - case io:fread(Dev, "", "~f ~s") of - {ok, [Time, Hex]} -> {Time, hex_to_bin(Hex)}; - eof -> eof - end. diff --git a/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st deleted file mode 100644 index e26d073..0000000 --- a/contrib/rtp/rtp_replay.st +++ /dev/null @@ -1,21 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. -FileStream fileIn: 'rtp_replay_shared.st'. - - -Eval [ - | replay file host dport | - - file := Smalltalk arguments at: 1 ifAbsent: [ 'rtpstream.state' ]. - host := Smalltalk arguments at: 2 ifAbsent: [ '127.0.0.1' ]. - dport := (Smalltalk arguments at: 3 ifAbsent: [ '4000' ]) asInteger. - sport := (Smalltalk arguments at: 4 ifAbsent: [ '0' ]) asInteger. - - replay := RTPReplay on: file fromPort: sport. - - Transcript nextPutAll: 'Going to stream now'; nl. - replay streamAudio: host port: dport. -] diff --git a/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st deleted file mode 100644 index 7b68c0f..0000000 --- a/contrib/rtp/rtp_replay_shared.st +++ /dev/null @@ -1,118 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. - -Object subclass: SDPUtils [ - "Look into using PetitParser." - SDPUtils class >> findPort: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'm=audio ') ifTrue: [ - | stream | - stream := line readStream - skip: 'm=audio ' size; - yourself. - ^ Number readFrom: stream. - ] - ]. - - ^ self error: 'Not found'. - ] - - SDPUtils class >> findHost: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'c=IN IP4 ') ifTrue: [ - | stream | - ^ stream := line readStream - skip: 'c=IN IP4 ' size; - upToEnd. - ] - ]. - - ^ self error: 'Not found'. - ] -] - -Object subclass: RTPReplay [ - | filename socket | - RTPReplay class >> on: aFile [ - ^ self new - initialize; - file: aFile; yourself - ] - - RTPReplay class >> on: aFile fromPort: aPort [ - ^ self new - initialize: aPort; - file: aFile; yourself - ] - - initialize [ - self initialize: 0. - ] - - initialize: aPort [ - socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort. - ] - - file: aFile [ - filename := aFile - ] - - localPort [ - ^ socket port - ] - - streamAudio: aHost port: aPort [ - | file last_time last_image udp_send dest | - - last_time := nil. - last_image := nil. - file := FileStream open: filename mode: #read. - - "Send the payload" - dest := Sockets.SocketAddress byName: aHost. - udp_send := [:payload | | datagram | - datagram := Sockets.Datagram data: payload contents address: dest port: aPort. - socket nextPut: datagram - ]. - - [file atEnd] whileFalse: [ - | lineStream time data now_image | - lineStream := file nextLine readStream. - - "Read the time, skip the blank, parse the data" - time := Number readFrom: lineStream. - lineStream skip: 1. - - data := WriteStream on: (ByteArray new: 30). - [lineStream atEnd] whileFalse: [ - | hex | - hex := lineStream next: 2. - data nextPut: (Number readFrom: hex readStream radix: 16). - ]. - - last_time isNil - ifTrue: [ - "First time, send it right now" - last_time := time. - last_image := Time millisecondClockValue. - udp_send value: data. - ] - ifFalse: [ - | wait_image new_image_time | - - "How long to wait?" - wait_image := last_image + ((time - last_time) * 1000). - [ wait_image > Time millisecondClockValue ] - whileTrue: [Processor yield]. - - udp_send value: data. - last_time := time. - last_image := wait_image. - ] - ] - ] -] - diff --git a/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st deleted file mode 100644 index 5f844df..0000000 --- a/contrib/rtp/rtp_replay_sip.st +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create a SIP connection and then stream... -""" - -PackageLoader - fileInPackage: #OsmoSIP. - -"Load for the replay code" -FileStream fileIn: 'rtp_replay_shared.st'. - - -Osmo.SIPCall subclass: StreamCall [ - | sem stream | - - createCall: aSDP [ - | sdp | - stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'. - sdp := aSDP % {stream localPort}. - ^ super createCall: sdp. - ] - - sem: aSemaphore [ - sem := aSemaphore - ] - - sessionNew [ - | host port | - Transcript nextPutAll: 'The call has started'; nl. - Transcript nextPutAll: sdp_result; nl. - - host := SDPUtils findHost: sdp_result. - port := SDPUtils findPort: sdp_result. - - [ - stream streamAudio: host port: port. - Transcript nextPutAll: 'Streaming has finished.'; nl. - ] fork. - ] - - sessionFailed [ - sem signal - ] - - sessionEnd [ - sem signal - ] -] - -Eval [ - | transport agent call sem sdp_fr sdp_amr | - - - sdp_fr := (WriteStream on: String new) - nextPutAll: 'v=0'; cr; nl; - nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 's=-'; cr; nl; - nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 't=0 0'; cr; nl; - nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl; - nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl; - nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl; - nextPutAll: 'a=fmtp:101 0-15'; cr; nl; - nextPutAll: 'a=ptime:20'; cr; nl; - contents. - - sem := Semaphore new. - transport := Osmo.SIPUdpTransport - startOn: '0.0.0.0' port: 5066. - agent := Osmo.SIPUserAgent createOn: transport. - transport start. - - call := (StreamCall - fromUser: 'sip:1000 at sip.zecke.osmocom.org' - host: '127.0.0.1' - port: 5060 - to: 'sip:123456 at 127.0.0.1' - on: agent) - sem: sem; yourself. - - call createCall: sdp_fr. - - - "Wait for the stream to have ended" - sem wait. - - (Delay forSeconds: 4) wait. -] diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua deleted file mode 100644 index c18a06b..0000000 --- a/contrib/rtp/timestamp_rtp.lua +++ /dev/null @@ -1,28 +0,0 @@ -print("Ni hao") - - -do - local tap = Listener.new("ip", "rtp") - local rtp_ssrc = Field.new("rtp.ssrc") - local frame_time = Field.new("frame.time_relative") - local rtp = Field.new("rtp") - - function tap.packet(pinfo, tvb, ip) - local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) - local rtp_data = rtp() - local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" - local f = io.open(filename, "a") - - f:write(tostring(frame_time()) .. " ") - f:write(tostring(rtp_data.value)) - f:write("\n") - f:close() - end - - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end -end diff --git a/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st deleted file mode 100644 index da0643e..0000000 --- a/contrib/sms/fill-hlr.st +++ /dev/null @@ -1,66 +0,0 @@ -"I create output for some simple SQL statements for the HLR db" - - -Eval [ - -"Create tables if they don't exist" -Transcript show: 'CREATE TABLE SMS ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - sent TIMESTAMP, - sender_id INTEGER NOT NULL, - receiver_id INTEGER NOT NULL, - deliver_attempts INTEGER NOT NULL DEFAULT 0, - valid_until TIMESTAMP, - reply_path_req INTEGER NOT NULL, - status_rep_req INTEGER NOT NULL, - protocol_id INTEGER NOT NULL, - data_coding_scheme INTEGER NOT NULL, - ud_hdr_ind INTEGER NOT NULL, - dest_addr TEXT, - user_data BLOB, - header BLOB, - text TEXT);'; nl; - show: 'CREATE TABLE Subscriber ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - updated TIMESTAMP NOT NULL, - imsi NUMERIC UNIQUE NOT NULL, - name TEXT, - extension TEXT UNIQUE, - authorized INTEGER NOT NULL DEFAULT 0, - tmsi TEXT UNIQUE, - lac INTEGER NOT NULL DEFAULT 0);'; nl. - -"Create some dummy subscribers" -num_sub := 1000. -num_sms := 30. -lac := 1. - -Transcript show: 'BEGIN;'; nl. - -1 to: num_sub do: [:each | - Transcript show: 'INSERT INTO Subscriber - (imsi, created, updated, authorized, lac, extension) - VALUES - (%1, datetime(''now''), datetime(''now''), 1, %2, %3);' % - {(274090000000000 + each). lac. each}; nl. -]. - -1 to: num_sms do: [:sms | - 1 to: num_sub do: [:sub | - Transcript show: 'INSERT INTO SMS - (created, sender_id, receiver_id, valid_until, - reply_path_req, status_rep_req, protocol_id, - data_coding_scheme, ud_hdr_ind, dest_addr, - text) VALUES - (datetime(''now''), 1, %1, ''2222-2-2'', - 0, 0, 0, - 0, 0, ''123456'', - ''abc'');' % {sub}; nl. - ] -]. - -Transcript show: 'COMMIT;'; nl. - -] diff --git a/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st deleted file mode 100644 index bd3f97a..0000000 --- a/contrib/sms/hlr-query.st +++ /dev/null @@ -1,10 +0,0 @@ -"Query for one SMS" - -Eval [ -1 to: 100 do: [:each | - Transcript show: 'SELECT SMS.* FROM SMS - JOIN Subscriber ON SMS.receiver_id = Subscriber.id - WHERE SMS.id >= 1 AND SMS.sent IS NULL AND Subscriber.lac > 0 - ORDER BY SMS.id LIMIT 1;'; nl. -]. -] diff --git a/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d deleted file mode 100644 index e75cdfc..0000000 --- a/contrib/sms/sqlite-probe.tap.d +++ /dev/null @@ -1,5 +0,0 @@ -probe process("/usr/lib/libsqlite3.so.0.8.6").function("sqlite3_get_table") -{ - a = user_string($zSql); - printf("sqlite3_get_table called '%s'\n", a); -} diff --git a/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service deleted file mode 100644 index c040e60..0000000 --- a/contrib/systemd/osmo-bsc-mgcp.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC MGCP - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service deleted file mode 100644 index a0b7829..0000000 --- a/contrib/systemd/osmo-gbproxy.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Osmocom Gb proxy - -[Service] -Type=simple -ExecStart=/usr/bin/osmo-gbproxy -c /etc/osmocom/osmo-gbproxy.cfg -Restart=always -RestartSec=2 -RestartPreventExitStatus=1 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service deleted file mode 100644 index 7cebb14..0000000 --- a/contrib/systemd/osmo-msc.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Osmocom Mobile Switching Center (MSC) -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service deleted file mode 100644 index 377497e..0000000 --- a/contrib/systemd/osmo-nitb.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC Network In the Box (NITB) - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3 -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service deleted file mode 100644 index bf6a8e0..0000000 --- a/contrib/systemd/osmo-sgsn.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=OpenBSC SGSN -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-sgsn -c /etc/osmocom/osmo-sgsn.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/testconv/Makefile b/contrib/testconv/Makefile deleted file mode 100644 index bb856f7..0000000 --- a/contrib/testconv/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -OBJS = testconv_main.o - -CC = gcc -CFLAGS = -O0 -ggdb -Wall -LDFLAGS = -CPPFLAGS = -I../.. -I../../include $(shell pkg-config --cflags libosmocore) $(shell pkg-config --cflags libbcg729) -LIBS = ../../src/libmgcp/libmgcp.a ../../src/libcommon/libcommon.a $(shell pkg-config --libs libosmocore) $(shell pkg-config --libs libbcg729) -lgsm -lrt - -testconv: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) - -testconv_main.o: testconv_main.c - -$(OBJS): - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c deleted file mode 100644 index 6c95c55..0000000 --- a/contrib/testconv/testconv_main.c +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "bscconfig.h" -#ifndef BUILD_MGCP_TRANSCODING -#error "Requires MGCP transcoding enabled (see --enable-mgcp-transcoding)" -#endif - -#include "openbsc/mgcp_transcode.h" - -static int audio_name_to_type(const char *name) -{ - if (!strcasecmp(name, "gsm")) - return 3; -#ifdef HAVE_BCG729 - else if (!strcasecmp(name, "g729")) - return 18; -#endif - else if (!strcasecmp(name, "pcma")) - return 8; - else if (!strcasecmp(name, "l16")) - return 11; - return -1; -} - -int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst); - -int main(int argc, char **argv) -{ - char buf[4096] = {0x80, 0}; - int cc, rc; - struct mgcp_rtp_end *dst_end; - struct mgcp_rtp_end *src_end; - struct mgcp_trunk_config tcfg = {{0}}; - struct mgcp_endpoint endp = {0}; - struct mgcp_process_rtp_state *state; - int in_size; - int in_samples = 160; - int out_samples = 0; - uint32_t ts = 0; - uint16_t seq = 0; - - osmo_init_logging(&log_info); - - tcfg.endpoints = &endp; - tcfg.number_endpoints = 1; - endp.tcfg = &tcfg; - mgcp_initialize_endp(&endp); - - dst_end = &endp.bts_end; - src_end = &endp.net_end; - - if (argc <= 2) - errx(1, "Usage: {gsm|g729|pcma|l16} {gsm|g729|pcma|l16} [SPP]"); - - if ((src_end->codec.payload_type = audio_name_to_type(argv[1])) == -1) - errx(1, "invalid input format '%s'", argv[1]); - if ((dst_end->codec.payload_type = audio_name_to_type(argv[2])) == -1) - errx(1, "invalid output format '%s'", argv[2]); - if (argc > 3) - out_samples = atoi(argv[3]); - - if (out_samples) { - dst_end->codec.frame_duration_den = dst_end->codec.rate; - dst_end->codec.frame_duration_num = out_samples; - dst_end->frames_per_packet = 1; - } - - rc = mgcp_transcoding_setup(&endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); - - state = dst_end->rtp_process_data; - OSMO_ASSERT(state != NULL); - - in_size = mgcp_transcoding_get_frame_size(state, in_samples, 0); - OSMO_ASSERT(sizeof(buf) >= in_size + 12); - - buf[1] = src_end->codec.payload_type; - *(uint16_t*)(buf+2) = htons(1); - *(uint32_t*)(buf+4) = htonl(0); - *(uint32_t*)(buf+8) = htonl(0xaabbccdd); - - while ((cc = read(0, buf + 12, in_size))) { - int cont; - int len; - - if (cc != in_size) - err(1, "read"); - - *(uint16_t*)(buf+2) = htonl(seq); - *(uint32_t*)(buf+4) = htonl(ts); - - seq += 1; - ts += in_samples; - - cc += 12; /* include RTP header */ - - len = cc; - - do { - cont = mgcp_transcoding_process_rtp(&endp, dst_end, - buf, &len, sizeof(buf)); - if (cont == -EAGAIN) { - fprintf(stderr, "Got EAGAIN\n"); - break; - } - - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); - - len -= 12; /* ignore RTP header */ - - if (write(1, buf + 12, len) != len) - err(1, "write"); - - len = cont; - } while (len > 0); - } - return 0; -} - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/channel_release.txt b/doc/channel_release.txt deleted file mode 100644 index c9cdfeb..0000000 --- a/doc/channel_release.txt +++ /dev/null @@ -1,95 +0,0 @@ - -GSM 04.08 7.1.7 / 9.1.7 RR CHANNEL RELESE - -RSL 08.58 3.4 / ? RLL Link Release Request - -RSL 08.58 4.6 / 8.4.5 DEACTivate SACCH - * Deactivate SACCH according to Channel Release Proc 04.08 - * to be sent after RR CHANNEL RELEASE is sent to MS - -RSL 08.58 4.7 / 8.4.14 RF CHANnel RELease - * tells the BTS to release a radio channel - * "when an activated radio channel is no longer needed" - * BTS responds with RF CHANnel RELease ACKnowledge - - -GSM 04.08 3.4.13: RR connection release procedure - -* network sends RR CHANNEL RELEASE to MS on the DCCH - * start T3109 - * deactivate SACCH -* MS disconnects main signalling link (by sending DISC) - * all other data links are disconnected by local end link release -* network receives DISC (BTS sends RLL REL IND to BSC) - * stop T3109 - * start T3111 -* when T3111 times out, the network can reuse the channls -* if T3109 times out, the network deactivates the channels - and can reuse them - * this probably means simply RF CHANnel RELease - - -== Implementation in OpenBSC == - -There are two possible reasons a gsm_subscriber_connection -will be released. One is a network failure, the other is -the completion of an operation/transaction. - -=== Failure === -The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback -and the MSC part will release all transactions, operations and such -and the channels will be released as error case. - -=== Success === -Every time an 'operation' or 'transaction' is finished msc_release_connection -will be called and it will determine if the gsm_subscriber_connection can -be released. - -In case it can be released bsc_api.c:gsm0808_clear will be called -which will release all lchan's associated with the connection. For the -primary channel a SACH Deactivate will be send with the release -reason NORMAL RELEASE. - - -bsc_api.c:gsm0808_clear - * Release a channel used for handover - * Release the primary lchan with normal release, SACH deactivate - -chan_alloc.c:lchan_release(chan, sacch_deactivate, reason) - * Start the release procedure. It is working in steps with callbacks - coming from the abis_rsl.c code. - * Release all SAPI's > 0 as local end (The BTS should send a - REL_CONF a message) - * Send SACH Deactivate on SAPI=0 if required. - * Start T3109 (stop it when the main signalling link is disconnected) - or when the channel released. On timeout start the error handling. - * abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are - released and after T3111 has timed out or there is an error. - -RX of RELease INDication: - * Calls internal rsl_handle_release which might release the RF. - -RX of RELease CONFirmation: - * Calls internal rsl_handle_release which might release the RF. - -* RX of RF_CHAN_REL_ACK - * call lchan_free() - - -=== Integration with SMS === - -* RX of CP_ERROR or unimplemented MT - * trigger trans_free() which will msc_release_connection() - -* CP TC1* expired while waiting for CP-ACK - * trigger trans_free() which will msc_release_connection() - -* RX of RP_ERROR - * trigger trans_free() which will msc_release_connection() - -* TX of CP-ACK in MT DELIVER - * trigger trans_free() which will msc_release_connection() - -* RX of CP-ACK in MO SUBMIT - * trigger trans_free() which will msc_release_connection() - diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg deleted file mode 100644 index 3c43f1f..0000000 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! MGCP configuration hand edited -! ! -password foo -! -line vty - no login -! -mgcp - !local ip 10.23.24.2 - !bts ip 10.24.24.1 - !bind ip 10.23.24.1 - bind port 2427 - rtp base 4000 - rtp force-ptime 20 - sdp audio payload number 98 - sdp audio payload name AMR/8000 - number endpoints 31 - no rtcp-omit diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg deleted file mode 100644 index 15fd74a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg +++ /dev/null @@ -1,44 +0,0 @@ -! -! OsmoGbProxy (UNKNOWN) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -ns - nse 666 nsvci 666 - nse 666 remote-role sgsn -! nse 666 encapsulation framerelay-gre -! nse 666 remote-ip 172.16.1.70 -! nse 666 fr-dlci 666 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-port 23000 -! encapsulation framerelay-gre enabled 1 -gbproxy - sgsn nsei 666 - core-mobile-country-code 666 - core-mobile-network-code 6 - core-access-point-name none match-imsi ^666066|^66607 - tlli-list max-length 200 diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg deleted file mode 100644 index 0c3917a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty -!! -! -line vty - no login -! -gbproxy - sgsn nsei 101 -ns - nse 101 nsvci 101 - nse 101 remote-role sgsn - nse 101 encapsulation udp - nse 101 remote-ip 192.168.100.239 - nse 101 remote-port 7777 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation framerelay-gre enabled 0 - encapsulation framerelay-gre local-ip 0.0.0.0 - encapsulation udp local-port 23000 diff --git a/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt deleted file mode 100644 index 9c65f92..0000000 --- a/doc/examples/osmo-gtphub/gtphub-example.txt +++ /dev/null @@ -1,90 +0,0 @@ -Here is a simple setup to test GTPHub operations. The IP addresses picked will -work well only on a system that creates local addresses (127.0.0.123) on the -fly (like linux) -- you may pick of course different IP addresses. - -Overview of the example setup: - - sgsnemu gtphub ggsn - 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 - -Prerequisites: openggsn. - -Have a local directory where you store config files and from which you launch -the GSNs and the hub (they will store restart counter files in that dir). -In it, have these config files: - -ggsn.conf: - - # GGSN local address - listen 127.0.0.2 - - # End User Addresses are picked from this range - net 10.23.42.0/24 - - pcodns1 8.8.8.8 - - logfile /tmp/foo - -gtphub.conf: - - gtphub - bind-to-sgsns 127.0.0.3 - bind-to-ggsns 127.0.0.4 - ggsn-proxy 127.0.0.2 - end - - -( -You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX -address and GGSN IP address to /etc/hosts something like: - - 127.0.0.2 internet.mnc070.mcc901.gprs - -) - - -Once the config files are in place, start the programs, in separate terminals. -GGSN and SGSN need to be started with root priviliges to be able to create tun -interfaces. GTPHub may run as unprivileged user. - -The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. - - -1. GGSN: - - sudo -s - cd - LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf - -2. GTPHub: - - cd - path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level - -3. SGSN tests: - - sudo -s - cd - /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --imsi 420001214365100 --contexts=3 - -Add more SGSNs using different IMSIs and local ports (if the same IMSI is used, -the GGSN will reuse TEIs and tunnels will be discarded automatically): - - /usr/local/bin/sgsnemu --createif -l 127.0.0.11 -r 127.0.0.3 --imsi 420001214365300 --contexts=3 - -This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu -still needs some effort to announce a mobile subscriber or the like (I have -used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). - -The core capability of GTPHub is to manage more than two GSNs, e.g. an SGSN -contacting various GGSNs over the single GTPHub link. You would configure the -SGSN to use one fixed GGSN (sending to gtphub) and gtphub will resolve the -GGSNs once it has received the messages. So the SGSN may be behind NAT (add -"sgsn-use-sender" to gtphub.conf) and communicate to various GGSNs over a -single link to gtphub. - -I hope this helps to get you going. -Any suggestions/patches are welcome! - -~Neels - diff --git a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg deleted file mode 100644 index 3913d2c..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! -! This file is used for VTY tests, referenced by openbsc/osmoappdesc.py -! For the test, try to use most config commands. -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, both on one interface. - ! The side towards SGSN uses nonstandard ports. - bind-to-sgsns ctrl 127.0.0.1 12123 user 127.0.0.1 12153 - ! The GGSN side with standard ports. - bind-to-ggsns 127.0.0.1 - - ! Proxy: unconditionally direct all traffic to... - sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg deleted file mode 100644 index 0dc4150..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, each on standard ports - ! 2123 and 2152. Setting these addresses is mandatory. - bind-to-sgsns 127.0.0.1 - bind-to-ggsns 127.0.0.2 - - ! Local nonstandard ports or separate IPs: - !bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223 - - ! Proxy: unconditionally direct all traffic to... - !ggsn-proxy 127.0.0.3 - !sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - !ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - !grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg deleted file mode 100644 index 1b1d192..0000000 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! OsmoMSC configuration saved from vty -! -line vty - no login -! -network - network country code 1 - mobile network code 1 - short name OsmoMSC - long name OsmoMSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - rrlp mode none - mm info 1 -msc - mgcpgw remote-ip 10.23.24.1 - assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg deleted file mode 100644 index 5e64342..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ /dev/null @@ -1,27 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy accept-all -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg deleted file mode 100644 index 06f035f..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ /dev/null @@ -1,29 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy remote - gsup remote-ip 127.0.0.1 - gsup remote-port 4222 -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/oml-interface.txt b/doc/oml-interface.txt deleted file mode 100644 index 02bead7..0000000 --- a/doc/oml-interface.txt +++ /dev/null @@ -1,22 +0,0 @@ -oml interface design notes - -problems: - -* there is no way how to tag a command sent to the BTS, with the response - having the same tag to identify the originator of the command -* therefore, we can have e.g. both the BSC and the OML interface send a - SET ATTRIBUTE message, where the responses would end up at the wrong - query. -* The BTS has 10s to ACK/NACK a command. We do not run any timers. - -the only possible solutions i can imagine: -* have some kind of exclusive locking, where the OML interface gets blocked - from the BSC and is exclusively assigned to the OML console until all commands - of the OML console have terminated. This can either be done explicitly - dynamically or on demand - -* use the OML interface synchronously, i.e. always wait for the response from - the BTS before - -* unilateral / unsolicited messages need to be broadcasted to both the BSC and - the OML console diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h deleted file mode 100644 index 3cdbe04..0000000 --- a/include/openbsc/gsm_04_14.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode); -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs); -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology); - -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg); diff --git a/osmoappdesc.py b/osmoappdesc.py index 021bf5b..36eb1a7 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -14,24 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see - -# Most systems won't be able to use these, so they're separated out -nitb_e1_configs = [ - "doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc.cfg", - "doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg", - "doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", - "doc/examples/osmo-nitb/rbs2308/openbsc.cfg" -] - - app_configs = { "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } - apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c deleted file mode 100644 index 5128ac1..0000000 --- a/src/libcommon/oap_client.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures ++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c deleted file mode 100644 index b529f4c..0000000 --- a/src/libmsc/gsm_04_14.c +++ /dev/null @@ -1,133 +0,0 @@ -/* GSM MS Testing Layer 3 messages - * 3GPP TS 44.014 / GSM TS 04.14 */ - -/* (C) 2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include "bscconfig.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static struct msgb *create_gsm0414_msg(uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_TEST; - gh->msg_type = msg_type; - return msg; -} - -static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - return msc_tx_dtap(conn, msg); -} - -static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) -{ - struct msgb *msg = create_gsm0414_msg(msg_type); - - return gsm0414_conn_sendmsg(conn, msg); -} - - -/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); - uint8_t subch; - - subch = (loop_mode << 1); - msgb_put_u8(msg, subch); - - msg->lchan = conn->lchan; - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a OPEN_LOOP_CMD according to Section 8.3 */ -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); -} - -/* Send a ACT_EMMI_CMD according to Section 8.8 */ -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); -} - -/* Send a DEACT_EMMI_CMD according to Section 8.10 */ -int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); -} - -/* Send a TEST_INTERFACE according to Section 8.11 */ -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); - msgb_put_u8(msg, tested_devs); - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); - msgb_put_u8(msg, technology); - return gsm0414_conn_sendmsg(conn, msg); -} - - - -/* Entry point for incoming GSM48_PDISC_TEST received from MS */ -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - - if (msgb_l3len(msg) < sizeof(*gh)) - return -1; - - LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", - get_value_string(gsm414_msgt_names, gh->msg_type)); - - return 0; -} diff --git a/tools/hlrstat.pl b/tools/hlrstat.pl deleted file mode 100755 index 668fc9a..0000000 --- a/tools/hlrstat.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -use strict; -use DBI; -my $dbh = DBI->connect("dbi:SQLite:dbname=hlr.sqlite3","",""); - - -my %mcc_names; -my %mcc_mnc_names; - -sub get_mcc_mnc_name($) -{ - my $mcc_mnc = shift; - my $ret = $mcc_mnc; - - if ($mcc_mnc_names{$mcc_mnc} ne '') { - $ret = $mcc_mnc_names{$mcc_mnc}; - } - - return $ret; -} - -sub read_networks($) -{ - my $filename = shift; - my $cur_name; - - open(INFILE, $filename); - while (my $l = ) { - chomp($l); - if ($l =~ /^#/) { - next; - } - if ($l =~ /^\t/) { - my ($mcc, $mnc, $brand, $r) = split(' ', $l, 4); - #printf("%s|%s|%s\n", $mcc, $mnc, $brand); - $mcc_mnc_names{"$mcc-$mnc"} = $brand; - $mcc_names{$mcc} = $cur_name; - } elsif ($l =~ /^(\w\w)\t(.*)/) { - #printf("%s|%s\n", $1, $2); - $cur_name = $2; - } - } - close(INFILE); -} - -read_networks("networks.tab"); - -my %oper_count; -my %country_count; - -#my $sth = $dbh->prepare("SELECT imsi FROM subscriber where authorized=1"); -my $sth = $dbh->prepare("SELECT imsi FROM subscriber"); - -$sth->execute(); - -while (my $href = $sth->fetchrow_hashref) { - my ($mcc, $mnc) = $$href{imsi} =~ /(\d{3})(\d{2}).*/; - #printf("%s %s-%s \n", $$href{imsi}, $mcc, $mnc); - $oper_count{"$mcc-$mnc"}++; - $country_count{$mcc}++; -} - - -foreach my $c (sort{$country_count{$b} <=> $country_count{$a}} keys %country_count) { - printf("%s: %d\n", $mcc_names{$c}, $country_count{$c}); - - foreach my $k (sort{$oper_count{$b} <=> $oper_count{$a}} keys %oper_count) { - if ($k =~ /^$c-/) { - printf("\t%s: %d\n", get_mcc_mnc_name($k), $oper_count{$k}); - } - } -} -- To view, visit https://gerrit.osmocom.org/3795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:01:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:01:29 +0000 Subject: [ABANDON] osmo-bsc[master]: prune contrib/ In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: prune contrib/ ...................................................................... Abandoned squashed into G#3795 -- To view, visit https://gerrit.osmocom.org/3790 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic1805b7943e91695619f1e1e45611b1f24f25c32 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:01:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:01:34 +0000 Subject: [ABANDON] osmo-bsc[master]: prune doc/ In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: prune doc/ ...................................................................... Abandoned squashed into G#3795 -- To view, visit https://gerrit.osmocom.org/3791 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I464443af7a62b698e4cd0b85e4fa65c921ffc271 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:01:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:01:39 +0000 Subject: [ABANDON] osmo-bsc[master]: osmoappdesc.py: drop nitb_e1_configs (and some ws) In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: osmoappdesc.py: drop nitb_e1_configs (and some ws) ...................................................................... Abandoned squashed into G#3795 -- To view, visit https://gerrit.osmocom.org/3793 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I207cb63f7748a44ea3b520bfaf772d198593f92c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:03:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:03:35 +0000 Subject: [PATCH] osmo-msc[master]: use separated libosmo-mgcp-client, apply rename to mgcp_clie... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3787 to look at the new patch set (#2). use separated libosmo-mgcp-client, apply rename to mgcp_client_* After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*. Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is used to contact the MGW (Media Gateway). Depends: I8e0b2d2a399b77086a36606f5e427271c6242df1 (osmo-mgw) I99f7faab637cfcc22ece64a1dbcbe590f2042187 (osmo-mgw) Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d --- M configure.ac M include/openbsc/gsm_data.h M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 11 files changed, 41 insertions(+), 69 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3787/2 diff --git a/configure.ac b/configure.ac index 1b188a9..46fe5d3 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -125,33 +125,6 @@ COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" AC_SUBST([COVERAGE_CFLAGS]) AC_SUBST([COVERAGE_LDFLAGS]) -fi - -AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ - AC_CACHE_CHECK( - [whether libosmo-legacy-mgcp needs -lgsm], - libosmo_cv_legacy_mgcp_needs_libgsm, [ - SAVE_LDFLAGS="${LDFLAGS}" - LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([ - #include - ], [ - mgcpgw_client_init(0, 0); - ])], - [libosmo_cv_legacy_mgcp_needs_libgsm=no], - [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) - LDFLAGS="${SAVE_LDFLAGS}" - ]) - ]) -CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM -if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], - [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi fi AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 88a4f10..205ab6c 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include /** annotations for msgb ownership */ @@ -486,9 +486,9 @@ uint8_t t3212; struct { - struct mgcpgw_client_conf conf; - struct mgcpgw_client *client; - } mgcpgw; + struct mgcp_client_conf conf; + struct mgcp_client *client; + } mgw; struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index e473b75..3f9f231 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -401,7 +401,7 @@ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcpgw_client_remote_addr_n(gsm_network->mgcpgw.client)); + rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index e8a2293..45d2040 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -557,7 +557,7 @@ { struct gsm_network *network = a_conn_info->network; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct tlv_parsed tp; struct sockaddr_storage rtp_addr; struct sockaddr_in *rtp_addr_in; @@ -567,7 +567,7 @@ if (!conn) goto fail; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; OSMO_ASSERT(mgcp); LOGP(DMSC, LOGL_NOTICE, "BSC sends assignment complete message (conn_id=%i)\n", conn->a.conn_id); diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 90a0431..cad9d9b 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -2667,7 +2667,7 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcpgw_client_remote_addr_n(net->mgcpgw.client); + uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); uint16_t port = trans->conn->rtp.port_cn; /* FIXME: This has to be set to some meaningful value, diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 161a100..c461139 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -192,7 +192,7 @@ conn->rtp.port_cn = r->audio_port; - rtp_ip = mgcpgw_client_remote_addr_n(conn->network->mgcpgw.client); + rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ @@ -222,7 +222,7 @@ int msc_call_assignment(struct gsm_trans *trans) { struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; uint16_t bts_base; @@ -232,7 +232,7 @@ return -EINVAL; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; #ifdef BUILD_IU /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ @@ -242,14 +242,14 @@ #endif conn->rtp.mgcp_rtp_endpoint = - mgcpgw_client_next_endpoint(conn->network->mgcpgw.client); + mgcp_client_next_endpoint(conn->network->mgw.client); /* This will calculate the port we assign to the BTS via AoIP * assignment command (or rab-assignment on 3G) The BTS will send * its RTP traffic to that port on the MGCPGW side. The MGCPGW only * gets the endpoint ID via the CRCX. It will do the same calculation * on his side too to get knowledge of the rtp port. */ - bts_base = mgcpgw_client_conf_actual(mgcp)->bts_base; + bts_base = mgcp_client_conf_actual(mgcp)->bts_base; conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; /* Establish the RTP stream first as looping back to the originator. @@ -257,7 +257,7 @@ * tone instead. */ msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcpgw_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); + return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); } static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); @@ -268,7 +268,7 @@ { struct gsm_subscriber_connection *conn1 = from->conn; struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcpgw_client *mgcp = conn1->network->mgcpgw.client; + struct mgcp_client *mgcp = conn1->network->mgw.client; const char *ip; struct msgb *msg; @@ -278,13 +278,13 @@ from->bridge.state = state; /* Loop back to the same MGCP GW */ - ip = mgcpgw_client_remote_addr_str(mgcp); + ip = mgcp_client_remote_addr_str(mgcp); msg = mgcp_msg_mdcx(mgcp, conn1->rtp.mgcp_rtp_endpoint, ip, conn2->rtp.port_cn, mode); - if (mgcpgw_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) + if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(from->vsub)); @@ -346,7 +346,7 @@ * is in use */ struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; if (!trans) @@ -355,10 +355,10 @@ return -EINVAL; if (!trans->conn->network) return -EINVAL; - if (!trans->conn->network->mgcpgw.client) + if (!trans->conn->network->mgw.client) return -EINVAL; - mgcp = trans->conn->network->mgcpgw.client; + mgcp = trans->conn->network->mgw.client; struct in_addr ip_addr; ip_addr.s_addr = ntohl(ip); @@ -368,7 +368,7 @@ msg = mgcp_msg_mdcx(mgcp, conn->rtp.mgcp_rtp_endpoint, inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcpgw_client_tx(mgcp, msg, NULL, trans)) + if (mgcp_client_tx(mgcp, msg, NULL, trans)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(trans->vsub)); @@ -398,7 +398,7 @@ { struct msgb *msg; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; if (!trans) return; @@ -408,16 +408,16 @@ return; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; /* Send DLCX */ msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint); - if (mgcpgw_client_tx(mgcp, msg, NULL, NULL)) + if (mgcp_client_tx(mgcp, msg, NULL, NULL)) LOGP(DMGCP, LOGL_ERROR, "Failed to send DLCX message for %s\n", vlr_subscr_name(trans->vsub)); /* Release endpoint id */ - mgcpgw_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); + mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 50679aa..198b1dd 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -101,7 +101,7 @@ vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); - mgcpgw_client_config_write(vty, " "); + mgcp_client_config_write(vty, " "); #ifdef BUILD_IU ranap_iu_vty_config_write(vty, " "); #endif @@ -155,7 +155,7 @@ install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd); - mgcpgw_client_vty_init(msc_network, MSC_NODE, &msc_network->mgcpgw.conf); + mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf); #ifdef BUILD_IU ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index a26b4bd..85a5a5a 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -17,7 +17,7 @@ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -45,8 +45,7 @@ $(LIBSMPP34_LIBS) \ $(LIBCRYPTO_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBRARY_GSM) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ -ldbi \ $(NULL) if BUILD_IU diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 30b11d9..3dfc806 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -64,7 +64,7 @@ #include #include #include -#include +#include #ifdef BUILD_IU #include @@ -251,7 +251,7 @@ MSC_HLR_REMOTE_IP_DEFAULT); net->gsup_server_port = MSC_HLR_REMOTE_PORT_DEFAULT; - mgcpgw_client_conf_init(&net->mgcpgw.conf); + mgcp_client_conf_init(&net->mgw.conf); return net; } @@ -553,10 +553,10 @@ if (sms_queue_start(msc_network, 20) != 0) return -1; - msc_network->mgcpgw.client = mgcpgw_client_init( - msc_network, &msc_network->mgcpgw.conf); + msc_network->mgw.client = mgcp_client_init( + msc_network, &msc_network->mgw.conf); - if (mgcpgw_client_connect(msc_network->mgcpgw.client)) { + if (mgcp_client_connect(msc_network->mgw.client)) { printf("MGCPGW connect failed\n"); return 7; } diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index fb4857f..aa2b3fe 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -15,7 +15,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1d3b9da..1f8ee7b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -14,7 +14,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) EXTRA_DIST = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ -- To view, visit https://gerrit.osmocom.org/3787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:21:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:21:00 +0000 Subject: [PATCH] osmo-msc[master]: rename openbsc.pc to osmo-msc.pc Message-ID: Review at https://gerrit.osmocom.org/3798 rename openbsc.pc to osmo-msc.pc Change-Id: Ibe73012cb2a27d886b5faf931a62d5efbddd8120 --- M Makefile.am M configure.ac R osmo-msc.pc.in 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/3798/1 diff --git a/Makefile.am b/Makefile.am index 536b3f4..9a92b08 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = openbsc.pc +pkgconfig_DATA = osmo-msc.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 46fe5d3..0549ed3 100644 --- a/configure.ac +++ b/configure.ac @@ -176,7 +176,7 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - openbsc.pc + osmo-msc.pc include/openbsc/Makefile include/Makefile src/Makefile diff --git a/openbsc.pc.in b/osmo-msc.pc.in similarity index 69% rename from openbsc.pc.in rename to osmo-msc.pc.in index 17e265d..c406061 100644 --- a/openbsc.pc.in +++ b/osmo-msc.pc.in @@ -3,8 +3,8 @@ libdir=@libdir@ includedir=@includedir@/ -Name: OpenBSC -Description: OpenBSC base station controller +Name: OsmoMSC +Description: Osmocom Mobile Switching Center Requires: Version: @VERSION@ Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/3798 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe73012cb2a27d886b5faf931a62d5efbddd8120 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:21:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:21:01 +0000 Subject: [PATCH] osmo-msc[master]: debian: fix web and VCS links, tweak osmo-msc.install Message-ID: Review at https://gerrit.osmocom.org/3799 debian: fix web and VCS links, tweak osmo-msc.install Change-Id: I3fffa73722c5437c969d25294e0ff86de5385087 --- M debian/control M debian/osmo-msc.install 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/99/3799/1 diff --git a/debian/control b/debian/control index 907ec38..13d4806 100644 --- a/debian/control +++ b/debian/control @@ -23,9 +23,9 @@ libosmo-netif-dev, libosmo-ranap-dev Standards-Version: 3.9.8 -Vcs-Git: git://git.osmocom.org/osmo-bsc.git -Vcs-Browser: https://git.osmocom.org/osmo-bsc/ -Homepage: https://projects.osmocom.org/projects/osmo-bsc +Vcs-Git: git://git.osmocom.org/osmo-msc.git +Vcs-Browser: https://git.osmocom.org/osmo-msc/ +Homepage: https://osmocom.org/projects/osmomsc Package: osmo-msc Architecture: any diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 2c733e0..145d25d 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ -usr/bin +usr/bin/osmo-msc usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg -- To view, visit https://gerrit.osmocom.org/3799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3fffa73722c5437c969d25294e0ff86de5385087 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:21:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:21:02 +0000 Subject: [PATCH] osmo-msc[master]: rewrite README Message-ID: Review at https://gerrit.osmocom.org/3800 rewrite README Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 --- M README 1 file changed, 19 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/00/3800/1 diff --git a/README b/README index d01b2cf..5ecad2d 100644 --- a/README +++ b/README @@ -1,39 +1,24 @@ -About OpenBSC +About OsmoMSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoMSC was one of the parts split off from the old openbsc.git. Before, it was +the libmsc part of the old OsmoNITB. Since a true A interface and IuCS for 3G +support is available, OsmoMSC exists only as a separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoMSC exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards a HNG-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC +- SMPP +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoMSC issue tracker and wiki online at +https://osmocom.org/projects/osmomsc +https://osmocom.org/projects/osmomsc/wiki -- To view, visit https://gerrit.osmocom.org/3800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:21:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:21:02 +0000 Subject: [PATCH] osmo-msc[master]: drop files unrelated to osmo-msc Message-ID: Review at https://gerrit.osmocom.org/3801 drop files unrelated to osmo-msc These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-msc. Empty out contrib: remove things that are either obviously unrelated to osmo-msc, or seem old and/or esoteric. Change-Id: I49957769e09eed6d723bf7c3777024b62b3480fd --- D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/mgcp_server.py D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/systemd/osmo-bsc-mgcp.service D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D doc/call-routing.txt D doc/e1-data-model.txt D doc/examples/osmo-bsc_nat/bscs.cfg D doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg D doc/gsm-hopping.txt D doc/handover.txt D doc/ipa-sccp.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt M osmoappdesc.py 47 files changed, 0 insertions(+), 2,705 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/01/3801/1 diff --git a/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua deleted file mode 100644 index f5d5502..0000000 --- a/contrib/a-link/sccp-split-by-con.lua +++ /dev/null @@ -1,170 +0,0 @@ --- Split trace based on SCCP Source --- There are still bugs to find... bugs bugs bugs... hmm -do - local function init_listener() - print("CREATED LISTENER") - local tap = Listener.new("ip", "sccp && (ip.src == 172.16.1.81 || ip.dst == 172.16.1.81)") - local sccp_type_field = Field.new("sccp.message_type") - local sccp_src_field = Field.new("sccp.slr") - local sccp_dst_field = Field.new("sccp.dlr") - local msg_type_field = Field.new("gsm_a.dtap_msg_mm_type") - local lu_rej_field = Field.new("gsm_a.dtap.rej_cause") - local ip_src_field = Field.new("ip.src") - local ip_dst_field = Field.new("ip.dst") - - -- - local bssmap_msgtype_field = Field.new("gsm_a.bssmap_msgtype") - -- assignment failure 0x03 - -- - - -- - local dtap_cause_field = Field.new("gsm_a_dtap.cause") - local dtap_cc_field = Field.new("gsm_a.dtap_msg_cc_type") - - local connections = {} - - function check_failure(con) - check_lu_reject(con) - check_disconnect(con) - check_failures(con) - end - - -- cipher mode reject - function check_failures(con) - local msgtype = bssmap_msgtype_field() - if not msgtype then - return - end - - msgtype = tonumber(msgtype) - if msgtype == 89 then - print("Cipher mode reject") - con[4] = true - elseif msgtype == 0x03 then - print("Assignment failure") - con[4] = true - elseif msgtype == 0x22 then - print("Clear Request... RF failure?") - con[4] = true - end - end - - -- check if a DISCONNECT is normal - function check_disconnect(con) - local msg_type = dtap_cc_field() - if not msg_type then - return - end - - if tonumber(msg_type) ~= 0x25 then - return - end - - local cause = dtap_cause_field() - if not cause then - return - end - - cause = tonumber(cause) - if cause ~= 0x10 then - print("DISCONNECT != Normal") - con[4] = true - end - end - - -- check if we have a LU Reject - function check_lu_reject(con) - local msg_type = msg_type_field() - if not msg_type then - return - end - - msg_type = tonumber(tostring(msg_type)) - if msg_type == 0x04 then - print("LU REJECT with " .. tostring(lu_rej_field())) - con[4] = true - end - end - - function tap.packet(pinfo,tvb,ip) - local ip_src = tostring(ip_src_field()) - local ip_dst = tostring(ip_dst_field()) - local sccp_type = tonumber(tostring(sccp_type_field())) - local sccp_src = sccp_src_field() - local sccp_dst = sccp_dst_field() - - local con - - if sccp_type == 0x01 then - elseif sccp_type == 0x2 then - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local datestring = os.date("%Y%m%d%H%M%S") - local pcap_name = string.format("alink_trace_%s-%s_%s.pcap", src, dst, datestring) - local dumper = Dumper.new_for_current(pcap_name) - - local con = { ip_src, tostring(sccp_src), tostring(sccp_dst), false, dumper, pcap_name } - - dumper:dump_current() - connections[src] = con - connections[dst] = con - elseif sccp_type == 0x4 then - -- close a connection... remove it from the list - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - - local con = connections[src] - if not con then - return - end - - con[5]:dump_current() - con[5]:flush() - - -- this causes a crash on unpacted wireshark - con[5]:close() - - -- the connection had a failure - if con[4] == true then - local datestring = os.date("%Y%m%d%H%M%S") - local new_name = string.format("alink_failure_%s_%s-%s.pcap", datestring, con[2], con[3]) - os.rename(con[6], new_name) - else - os.remove(con[6]) - end - - - -- clear the old connection - connections[src] = nil - connections[dst] = nil - - elseif sccp_type == 0x5 then - -- not handled yet... we should verify stuff here... - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - return - end - con[5]:dump_current() - elseif sccp_type == 0x6 then - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - print("DON'T KNOW THIS CONNECTION for " .. ip_dst) - return - end - con[5]:dump_current() - check_failure(con) - end - - end - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end - end - - init_listener() -end diff --git a/contrib/bsc-test/README b/contrib/bsc-test/README deleted file mode 100644 index adb222e..0000000 --- a/contrib/bsc-test/README +++ /dev/null @@ -1 +0,0 @@ -Some crazy scripts call testing... and MSC link failure simulation diff --git a/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial deleted file mode 100644 index 96e5f00..0000000 --- a/contrib/bsc-test/all_dial +++ /dev/null @@ -1,8 +0,0 @@ -ABORT BUSY -ABORT 'NO CARRIER' -ABORT 'OK' - -'' AT -SAY "Dialing a number\n" -'OK' ATD05660066; - diff --git a/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh deleted file mode 100755 index e5e19f6..0000000 --- a/contrib/bsc-test/dial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Evil dial script.. - -while true; -do - chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0 - sleep 5s - chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0 - sleep 2s -done - diff --git a/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh deleted file mode 100755 index 84eead7..0000000 --- a/contrib/bsc-test/drop-oml.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -sleep 3 -echo "enable" -sleep 1 -echo "drop bts connection 0 oml" -sleep 1 diff --git a/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh deleted file mode 100755 index c7b66ba..0000000 --- a/contrib/bsc-test/drop.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Going to drop the OML connection" - ./drop-oml.sh | telnet 127.0.0.1 4242 - sleep 58m -done diff --git a/contrib/bsc-test/hangup b/contrib/bsc-test/hangup deleted file mode 100644 index cad6870..0000000 --- a/contrib/bsc-test/hangup +++ /dev/null @@ -1,4 +0,0 @@ -TIMEOUT 10 -'' ^Z -SAY "Waiting for hangup confirm\n" -'' ATH; diff --git a/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh deleted file mode 100755 index bec011d..0000000 --- a/contrib/bsc-test/msc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` - sleep 58s -done diff --git a/contrib/bsc_control.py b/contrib/bsc_control.py deleted file mode 100755 index c1b09ce..0000000 --- a/contrib/bsc_control.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/python -# -*- mode: python-mode; py-indent-tabs-mode: nil -*- -""" -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -""" - -from optparse import OptionParser -from ipa import Ctrl -import socket - -verbose = False - -def connect(host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - return sck - -def do_set_get(sck, var, value = None): - (r, c) = Ctrl().cmd(var, value) - sck.send(c) - answer = Ctrl().rem_header(sck.recv(4096)) - return (answer,) + Ctrl().verify(answer, r, var, value) - -def set_var(sck, var, val): - (a, _, _) = do_set_get(sck, var, val) - return a - -def get_var(sck, var): - (_, _, v) = do_set_get(sck, var) - return v - -def _leftovers(sck, fl): - """ - Read outstanding data if any according to flags - """ - try: - data = sck.recv(1024, fl) - except socket.error as (s_errno, strerror): - return False - if len(data) != 0: - tail = data - while True: - (head, tail) = Ctrl().split_combined(tail) - print "Got message:", Ctrl().rem_header(head) - if len(tail) == 0: - break - return True - return False - -if __name__ == '__main__': - parser = OptionParser("Usage: %prog [options] var [value]") - parser.add_option("-d", "--host", dest="host", - help="connect to HOST", metavar="HOST") - parser.add_option("-p", "--port", dest="port", type="int", - help="use PORT", metavar="PORT", default=4249) - parser.add_option("-g", "--get", action="store_true", - dest="cmd_get", help="perform GET operation") - parser.add_option("-s", "--set", action="store_true", - dest="cmd_set", help="perform SET operation") - parser.add_option("-v", "--verbose", action="store_true", - dest="verbose", help="be verbose", default=False) - parser.add_option("-m", "--monitor", action="store_true", - dest="monitor", help="monitor the connection for traps", default=False) - - (options, args) = parser.parse_args() - - verbose = options.verbose - - if options.cmd_set and options.cmd_get: - parser.error("Get and set options are mutually exclusive!") - - if not (options.cmd_get or options.cmd_set or options.monitor): - parser.error("One of -m, -g, or -s must be set") - - if not (options.host): - parser.error("Destination host and port required!") - - sock = connect(options.host, options.port) - - if options.cmd_set: - if len(args) < 2: - parser.error("Set requires var and value arguments") - _leftovers(sock, socket.MSG_DONTWAIT) - print "Got message:", set_var(sock, args[0], ' '.join(args[1:])) - - if options.cmd_get: - if len(args) != 1: - parser.error("Get requires the var argument") - _leftovers(sock, socket.MSG_DONTWAIT) - (a, _, _) = do_set_get(sock, args[0]) - print "Got message:", a - - if options.monitor: - while True: - if not _leftovers(sock, 0): - print "Connection is gone." - break - sock.close() diff --git a/contrib/bt.py b/contrib/bt.py deleted file mode 100755 index 1b111ef..0000000 --- a/contrib/bt.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os - -f = open("unbalanced") -lines = [] -for line in f: - lines.append(line) - -filenames = {} - -output = [] -for line in lines: - if "[0x" in line: - start = line.find("[") - end = line.find("]") - addr = line[start+1:end] - try: - file = filenames[addr] - except KeyError: - r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr) - all = r.read().replace("\n", ",") - file = all - filenames[addr] = file - - line = line.replace(addr, file) - output.append(line) - -g = open("unbalanced.2", "w") -g.write("".join(output)) - - - diff --git a/contrib/convert_to_enum.py b/contrib/convert_to_enum.py deleted file mode 100755 index bcd6f2c..0000000 --- a/contrib/convert_to_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# -# Convert ETSI documents to an enum -# - -import re, sys - -def convert(string): - string = string.strip().replace(" ", "").rjust(8, "0") - var = 0 - offset = 7 - for char in string: - assert offset >= 0 - var = var | (int(char) << offset) - offset = offset - 1 - - return var - -def string(name): - name = name.replace(" ", "_") - name = name.replace('"', "") - name = name.replace('/', '_') - name = name.replace('(', '_') - name = name.replace(')', '_') - return "%s_%s" % (sys.argv[2], name.upper()) - -file = open(sys.argv[1]) - - -for line in file: - m = re.match(r"[ \t]*(?P[01 ]+)[ ]+(?P[a-zA-Z /0-9()]+)", line[:-1]) - - if m: - print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"])) - else: - print line[:-1] diff --git a/contrib/ctrl2sse.py b/contrib/ctrl2sse.py deleted file mode 100755 index 8b630ec..0000000 --- a/contrib/ctrl2sse.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python2 - -mod_license = ''' -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -''' - -import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control -from eventsource import listener, request - -''' -N. B: this is not an example of building proper REST API or building secure web application. -It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API. -Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem -from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that. -''' - -token = None -stream = None -url = None - -''' -Returns json according to following schema - see http://json-schema.org/documentation.html for details: -{ - "title": "Ctrl Schema", - "type": "object", - "properties": { - "variable": { - "type": "string" - }, - "varlue": { - "type": "string" - } - }, - "required": ["interface", "variable", "value"] -} -Example validation from command-line: -json validate --schema-file=schema.json --document-file=data.json -The interface is represented as string because it might look different for IPv4 vs v6. -''' - -def read_header(data): - t_length = bsc_control.ipa_ctrl_header(data) - if (t_length): - stream.read_bytes(t_length - 1, callback = read_trap) - else: - print >> sys.stderr, "protocol error: length missing in %s!" % data - - at tornado.gen.coroutine -def read_trap(data): - (t, z, v, p) = data.split() - if (t != 'TRAP' or int(z) != 0): - print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z)) - else: - yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token), - method = 'POST', - headers = {'Content-Type': 'application/json'}, - body = tornado.escape.json_encode({ 'variable' : v, 'value' : p }))) - stream.read_bytes(4, callback = read_header) - - at tornado.gen.coroutine -def trap_setup(host, port, target_host, target_port, tk): - global stream - global url - global token - token = tk - url = "http://%s:%s/sse" % (host, port) - stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port) - stream.read_bytes(4, callback = read_header) - -def get_v(s, v): - return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) } - -class CtrlHandler(tornado.web.RequestHandler): - def initialize(self): - self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port']) - - def get(self, v): - self.write(get_v(self.skt, v)) - - def post(self): - self.write(get_v(self.skt, self.get_argument("variable"))) - -class SetCtrl(CtrlHandler): - def get(self, var, val): - bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val)) - super(SetCtrl, self).get(tornado.escape.native_str(var)) - - def post(self): - bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value"))) - super(SetCtrl, self).post() - -class Slash(tornado.web.RequestHandler): - def get(self): - self.write('%sUsing Tornado framework v%s' - '
' - '' - '' - '
' - '
' - '' - '' - '' - '
' - '' % ("Osmocom Control Interface Proxy", tornado.version)) - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.') - p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port") - p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress") - p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface") - p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface") - p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)") - p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value") - p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000") - args = p.parse_args() - random.seed() - tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver - logging.basicConfig() - application = tornado.web.Application([ - (r"/", Slash), - (r"/get", CtrlHandler), - (r"/get/(.*)", CtrlHandler), - (r"/set", SetCtrl), - (r"/set/(.*)/(.*)", SetCtrl), - (r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)), - ], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port) - application.listen(address = args.host, port = args.port) - trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token) - tornado.ioloop.IOLoop.instance().start() diff --git a/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py deleted file mode 100755 index 0cd4b87..0000000 --- a/contrib/gprs/gb-proxy-unblock-bug.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -""" -demonstrate a unblock bug on the GB Proxy.. -""" - -bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7" -ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7" - -bts_ns_unblock = "\x06" -ns_unblock_ack = "\x07" - -bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02" -ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00" - -bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40" - - -import socket -socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -socket.bind(("0.0.0.0", 0)) -socket.setblocking(1) - - -import sys -port = int(sys.argv[1]) -print "Sending data to port: %d" % port - -def send_and_receive(packet): - socket.sendto(packet, ("127.0.0.1", port)) - - try: - data, addr = socket.recvfrom(4096) - except socket.error, e: - print "ERROR", e - import sys - sys.exit(0) - return data - -#send stuff once - -to_send = [ - (bts_ns_reset, ns_reset_ack, "reset ack"), - (bts_ns_unblock, ns_unblock_ack, "unblock ack"), - (bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"), -] - - -for (out, inp, type) in to_send: - res = send_and_receive(out) - if res != inp: - print "Failed to get the %s" % type - sys.exit(-1) - -import time -time.sleep(3) -res = send_and_receive(bts_bvc_reset_8167) -print "Sent all messages... check wireshark for the last response" diff --git a/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua deleted file mode 100644 index b1ab5df..0000000 --- a/contrib/gprs/gprs-bssgp-histogram.lua +++ /dev/null @@ -1,78 +0,0 @@ --- Simple LUA script to print the size of BSSGP messages over their type... - -do - local ip_bucket = {} - - local pdu_types = {} - pdu_types[ 6] = "PAGING" - pdu_types[11] = "SUSPEND" - pdu_types[12] = "SUSPEND-ACK" - pdu_types[32] = "BVC-BLOCK" - pdu_types[33] = "BVC-BLOCK-ACK" - pdu_types[34] = "BVC-RESET" - pdu_types[35] = "BVC-RESET-ACK" - pdu_types[36] = "UNBLOCK" - pdu_types[37] = "UNBLOCK-ACK" - pdu_types[38] = "FLOW-CONTROL-BVC" - pdu_types[39] = "FLOW-CONTROL-BVC-ACK" - pdu_types[40] = "FLOW-CONTROL-MS" - pdu_types[41] = "FLOW-CONTROL-MS-ACK" - pdu_types[44] = "LLC-DISCARDED" - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local udp_length_get = Field.new("udp.length") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = udp_length_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - pdu = tostring(pdu) - if tonumber(pdu) == 0 or tonumber(pdu) == 1 then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_histo = ip_bucket[ip_src] - if not bssgp_histo then - bssgp_histo = {} - ip_bucket[ip_src] = bssgp_histo - end - - local key = pdu - local bucket = bssgp_histo[key] - if not bucket then - bucket = {} - bssgp_histo[key] = bucket - end - - table.insert(bucket, tostring(len)) - print("IP: " .. ip_src .. " PDU: " .. pdu_types[tonumber(pdu)] .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua deleted file mode 100644 index ca8864a..0000000 --- a/contrib/gprs/gprs-buffer-count.lua +++ /dev/null @@ -1,80 +0,0 @@ --- I count the buffer space needed for LLC PDUs in the worse case and print it - -do - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local bssgp_delay_get = Field.new("bssgp.delay_val") - local llcgprs_get = Field.new("llcgprs") - local pdus = nil - - print("START...") - - local tap = Listener.new("ip", "udp.port == 23000 && bssgp.pdu_type == 0") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = llcgprs_get().len - local delay = bssgp_delay_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - if tonumber(tostring(delay)) == 65535 then - pdus = { next = pdus, - len = len, - expires = -1 } - else - local off = tonumber(tostring(delay)) / 100.0 - pdus = { next = pdus, - len = len, - expires = pinfo.rel_ts + off } - end - local now_time = tonumber(tostring(pinfo.rel_ts)) - local now_size = 0 - local l = pdus - local prev = nil - local count = 0 - while l do - if now_time < l.expires or l.expires == -1 then - now_size = now_size + l.len - prev = l - l = l.next - count = count + 1 - else - -- delete things - if prev == nil then - pdus = nil - l = nil - else - prev.next = l.next - l = l.next - end - end - end --- print("TOTAL: " .. now_time .. " PDU_SIZE: " .. now_size) - print(now_time .. " " .. now_size / 1024.0 .. " " .. count) --- print("NOW: " .. tostring(pinfo.rel_ts) .. " Delay: " .. tostring(delay) .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - print("END") - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua deleted file mode 100644 index 018c377..0000000 --- a/contrib/gprs/gprs-split-trace-by-tlli.lua +++ /dev/null @@ -1,46 +0,0 @@ --- Create a file named by_ip/''ip_addess''.cap with all ip traffic of each ip host. (works for tshark only) --- Dump files are created for both source and destination hosts -do - local dir = "by_tlli" - local dumpers = {} - local function init_listener() - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - local field_tlli = Field.new("bssgp.tlli") - local tap = Listener.new("ip", "udp.port == 23000") - - -- we will be called once for every IP Header. - -- If there's more than one IP header in a given packet we'll dump the packet once per every header - function tap.packet(pinfo,tvb,ip) - local tlli = field_tlli() - if not tlli then - return - end - - local tlli_str = tostring(tlli) - tlli_dmp = dumpers[tlli_str] - if not tlli_dmp then - local tlli_hex = string.format("0x%x", tonumber(tlli_str)) - print("Creating dump for TLLI " .. tlli_hex) - tlli_dmp = Dumper.new_for_current(dir .. "/" .. tlli_hex .. ".pcap") - dumpers[tlli_str] = tlli_dmp - end - tlli_dmp:dump_current() - tlli_dmp:flush() - end - function tap.draw() - for tlli,dumper in pairs(dumpers) do - dumper:flush() - end - end - function tap.reset() - for tlli,dumper in pairs(dumpers) do - dumper:close() - end - dumpers = {} - end - end - init_listener() -end diff --git a/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua deleted file mode 100644 index e44fdd1..0000000 --- a/contrib/gprs/gprs-verify-nu.lua +++ /dev/null @@ -1,59 +0,0 @@ --- This script verifies that the N(U) is increasing... --- -do - local nu_state_src = {} - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- we want to look here... - local llc_sapi_get = Field.new("llcgprs.sapib") - local llc_nu_get = Field.new("llcgprs.nu") - local bssgp_tlli_get = Field.new("bssgp.tlli") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local llc_sapi = llc_sapi_get() - local llc_nu = llc_nu_get() - local bssgp_tlli = bssgp_tlli_get() - - if not llc_sapi or not llc_nu or not bssgp_tlli then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_tlli = tostring(bssgp_tlli) - local llc_nu = tostring(llc_nu) - local llc_sapi = tostring(llc_sapi) - - local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi - local last_nu = nu_state_src[src_key] - if not last_nu then - -- print("Establishing mapping for " .. src_key) - nu_state_src[src_key] = llc_nu - return - end - - local function tohex(number) - return string.format("0x%x", tonumber(number)) - end - - nu_state_src[src_key] = llc_nu - if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then - print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src) - print("\t last: " .. last_nu .. " now: " .. llc_nu) - end - end - - function tap.draw() - end - - function tap.reset() - end - end - init_listener() -end - diff --git a/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql deleted file mode 100644 index 626a331..0000000 --- a/contrib/hlr-remove-old.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Remove old data from the database -DELETE FROM Subscriber - WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1; -DELETE FROM Equipment - WHERE datetime('now', '-10 days') > updated; -DELETE FROM EquipmentWatch - WHERE datetime('now', '-10 days') > updated; -DELETE FROM SMS - WHERE datetime('now', '-10 days') > created; -DELETE FROM VLR - WHERE datetime('now', '-10 days') > updated; -DELETE FROM ApduBlobs - WHERE datetime('now', '-10 days') > created; -DELETE FROM Counters - WHERE datetime('now', '-10 days') > timestamp; -DELETE FROM RateCounters - WHERE datetime('now', '-10 days') > timestamp; -VACUUM; diff --git a/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py deleted file mode 100755 index e4a4955..0000000 --- a/contrib/hlrsync/hlrsync.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python2.5 - -from __future__ import with_statement - -from pysqlite2 import dbapi2 as sqlite3 -import sys - -hlr = sqlite3.connect(sys.argv[1]) -web = sqlite3.connect(sys.argv[2]) - -# switch to autocommit -hlr.isolation_level = None -web.isolation_level = None - -hlr.row_factory = sqlite3.Row -web.row_factory = sqlite3.Row - -with hlr: - hlr_subscrs = hlr.execute(""" - SELECT * FROM Subscriber - """).fetchall() - hlr_tokens = hlr.execute(""" - SELECT * FROM AuthToken - """).fetchall() - -with web: - web_tokens = web.execute(""" - SELECT * FROM reg_tokens - """).fetchall() - web_sms = web.execute(""" - SELECT * FROM sms_queue - """).fetchall() - -# index by subscr id -hlr_subscrs_by_id = {} -hlr_subscrs_by_ext = {} -hlr_tokens_by_subscr_id = {} -for x in hlr_subscrs: - hlr_subscrs_by_id[x['id']] = x - hlr_subscrs_by_ext[x['extension']] = x -del hlr_subscrs -for x in hlr_tokens: - hlr_tokens_by_subscr_id[x['subscriber_id']] = x -del hlr_tokens - -web_tokens_by_subscr_id = {} -for x in web_tokens: - web_tokens_by_subscr_id[x['subscriber_id']] = x -del web_tokens - -# remove leftover web_tokens and correct inconsistent fields -with web: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - web.execute(""" - DELETE FROM reg_tokens WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del web_tokens_by_subscr_id[x['subscriber_id']] - continue - if str(x['imsi']) != str(subscr['imsi']) or \ - x['extension'] != subscr['extension'] or \ - x['tmsi'] != subscr['tmsi'] or \ - x['lac'] != subscr['lac']: - web.execute(""" - UPDATE reg_tokens - SET imsi = ?, extension = ?, tmsi = ?, lac = ? - WHERE subscriber_id = ? - """, (str(subscr['imsi']), subscr['extension'], - subscr['tmsi'], subscr['lac'], x['subscriber_id'])) - -# add missing web_tokens -with web: - for x in hlr_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - hlr.execute(""" - DELETE FROM AuthToken WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del hlr_tokens_by_subscr_id[x['subscriber_id']] - continue - webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None) - if webtoken is None: - web.execute(""" - INSERT INTO reg_tokens - (subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi) - VALUES - (?, ?, 0, ?, '', ?, ?, ?, ?) - """, (x['subscriber_id'], subscr['extension'], subscr['name'], - subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi'])) - -# authorize subscribers -with hlr: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if x['reg_completed'] and not subscr['authorized']: - hlr.execute(""" - UPDATE Subscriber - SET authorized = 1 - WHERE id = ? - """, (x['subscriber_id'],)) - -# Sync SMS from web to hlr -with hlr: - for sms in web_sms: - subscr = hlr_subscrs_by_ext.get(sms['receiver_ext']) - if subscr is None: - print '%s not found' % sms['receiver_ext'] - continue - hlr.execute(""" - INSERT INTO SMS - (created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text) - VALUES - (?, 1, ?, 0, 0, 0, 0, 0, ?) - """, (sms['created'], subscr['id'], sms['text'])) -with web: - for sms in web_sms: - web.execute(""" - DELETE FROM sms_queue WHERE id = ? - """, (sms['id'],)) - - -hlr.close() -web.close() - diff --git a/contrib/mgcp_server.py b/contrib/mgcp_server.py deleted file mode 100755 index 05c489d..0000000 --- a/contrib/mgcp_server.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Simple server for mgcp... send audit, receive response.. - -import socket, time - -MGCP_GATEWAY_PORT = 2427 -MGCP_CALLAGENT_PORT = 2727 - -rsip_resp = """200 321321332\r\n""" -audit_packet = """AUEP %d 13 at mgw MGCP 1.0\r\n""" -crcx_packet = """CRCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n""" -dlcx_packet = """DLCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\n""" -mdcx_packet = """MDCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 258696477 0 IN IP4 172.16.1.107\r\ns=-\r\nc=IN IP4 172.16.1.107\r\nt=0 0\r\nm=audio 6666 RTP/AVP 127\r\na=rtpmap:127 GSM-EFR/8000/1\r\na=ptime:20\r\na=recvonly\r\nm=image 4402 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n""" - -def hexdump(src, length=8): - """Recipe is from http://code.activestate.com/recipes/142812/""" - result = [] - digits = 4 if isinstance(src, unicode) else 2 - for i in xrange(0, len(src), length): - s = src[i:i+length] - hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s]) - text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) - result.append( b"%04X %-*s %s" % (i, length*(digits + 1), hexa, text) ) - return b'\n'.join(result) - -server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -server_socket.bind(("127.0.0.1", MGCP_CALLAGENT_PORT)) -server_socket.setblocking(1) - -last_ci = 1 -def send_and_receive(packet): - global last_ci - server_socket.sendto(packet, ("127.0.0.1", MGCP_GATEWAY_PORT)) - try: - data, addr = server_socket.recvfrom(4096) - - # attempt to store the CI of the response - list = data.split("\n") - for item in list: - if item.startswith("I: "): - last_ci = int(item[3:]) - - print hexdump(data), addr - except socket.error, e: - print e - pass - -def generate_tid(): - import random - return random.randint(0, 65123) - - - -while True: - send_and_receive(audit_packet % generate_tid()) - send_and_receive(crcx_packet % generate_tid() ) - send_and_receive(mdcx_packet % (generate_tid(), last_ci)) - send_and_receive(dlcx_packet % (generate_tid(), last_ci)) - - time.sleep(3) diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c deleted file mode 100644 index 808a703..0000000 --- a/contrib/nat/test_regexp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* make test_regexp */ -#include -#include -#include - - -int main(int argc, char **argv) -{ - regex_t reg; - regmatch_t matches[2]; - - if (argc != 4) { - printf("Invoke with: test_regexp REGEXP REPLACE NR\n"); - return -1; - } - - if (regcomp(®, argv[1], REG_EXTENDED) != 0) { - fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]); - return -1; - } - - if (regexec(®, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1) - printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]); - else - printf("No match.\n"); - - regfree(®); - - return 0; -} diff --git a/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py deleted file mode 100644 index 8f7a58d..0000000 --- a/contrib/nat/ussd_example.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2.7 - -""" -AGPLv3+ 2016 Copyright Holger Hans Peter Freyther - -Example of how to connect to the USSD side-channel and how to respond -with a fixed message. -""" - -import socket -import struct - -ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ussdSocket.connect(('127.0.0.1', 5001)) - -def send_dt1(dstref, data): - dlen = struct.pack('B', len(data)).encode('hex') - hex = '06' + dstref.encode('hex') + '00' + '01' + dlen + data.encode('hex') - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def send_rel(srcref, dstref): - hex = '04' + dstref.encode('hex') + srcref.encode('hex') + '000100' - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def recv_one(): - plen = ussdSocket.recv(3) - (plen,ptype) = struct.unpack(">HB", plen) - data = ussdSocket.recv(plen) - - return ptype, data - -# Assume this is the ID request -data = ussdSocket.recv(4) -ussdSocket.send("\x00\x08\xfe\x05\x00" + "\x05\x01" + "ussd") -# ^len ^len of tag ... and ignore - -# Expect a fake message. see struct ipac_msgt_sccp_state -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) -(srcref, dstref, transid, invokeid) = struct.unpack("<3s3sBB", data[1:9]) -print("New transID %d invoke %d" % (transid, invokeid)) - -# Expect a the invocation.. todo.. extract invoke id -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) - -# Reply with BSSAP + GSM 04.08 + MAP portion -# 00 == invoke id 0f == DCS -res = "01002a9b2a0802e1901c22a220020100301b02013b301604010f041155e7d2f9bc3a41412894991c06a9c9a713" -send_dt1(dstref, res.decode('hex')) - -clear = "000420040109" -send_dt1(dstref, clear.decode('hex')) - -# should be the clear complete -send_rel(srcref, dstref) - -# Give it some time to handle connection shutdown properly -print("Gracefully sleeping") -import time -time.sleep(3) diff --git a/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl deleted file mode 100755 index 47839c1..0000000 --- a/contrib/rtp/gen_rtp_header.erl +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- -%%! -smp disable --module(gen_rtp_header). - -% -mode(compile). - --define(VERSION, "0.1"). - --export([main/1]). - --record(rtp_packet, - { - version = 2, - padding = 0, - marker = 0, - payload_type = 0, - seqno = 0, - timestamp = 0, - ssrc = 0, - csrcs = [], - extension = <<>>, - payload = <<>>, - realtime - }). - - -main(Args) -> - DefaultOpts = [{format, state}, - {ssrc, 16#11223344}, - {rate, 8000}, - {pt, 98}], - {PosArgs, Opts} = getopts_checked(Args, DefaultOpts), - log(debug, fun (Dev) -> - io:format(Dev, "Initial options:~n", []), - dump_opts(Dev, Opts), - io:format(Dev, "~s: ~p~n", ["Args", PosArgs]) - end, [], Opts), - main(PosArgs, Opts). - -main([First | RemArgs], Opts) -> - try - F = list_to_integer(First), - Format = proplists:get_value(format, Opts, state), - PayloadData = proplists:get_value(payload, Opts, undef), - InFile = proplists:get_value(file, Opts, undef), - - Payload = case {PayloadData, InFile} of - {undef, undef} -> - % use default value - #rtp_packet{}#rtp_packet.payload; - {P, undef} -> P; - {_, File} -> - log(info, "Loading file '~s'~n", [File], Opts), - {ok, InDev} = file:open(File, [read]), - DS = [ Pl#rtp_packet.payload || {_T, Pl} <- read_packets(InDev, Opts)], - file:close(InDev), - log(debug, "File '~s' closed, ~w packets read.~n", [File, length(DS)], Opts), - DS - end, - Dev = standard_io, - write_packet_pre(Dev, Format), - do_groups(Dev, Payload, F, RemArgs, Opts), - write_packet_post(Dev, Format), - 0 - catch - _:_ -> - log(debug, "~p~n", [hd(erlang:get_stacktrace())], Opts), - usage(), - halt(1) - end - ; - -main(_, _Opts) -> - usage(), - halt(1). - -%%% group (count + offset) handling %%% - -do_groups(_Dev, _Pl, _F, [], _Opts) -> - ok; - -do_groups(Dev, Pl, F, [L], Opts) -> - do_groups(Dev, Pl, F, [L, 0], Opts); - -do_groups(Dev, Pl, First, [L, O | Args], Opts) -> - Ssrc = proplists:get_value(ssrc, Opts, #rtp_packet.ssrc), - PT = proplists:get_value(pt, Opts, #rtp_packet.payload_type), - Len = list_to_num(L), - Offs = list_to_num(O), - log(info, "Starting group: Ssrc=~.16B, PT=~B, First=~B, Len=~B, Offs=~B~n", - [Ssrc, PT, First, Len, Offs], Opts), - Pkg = #rtp_packet{ssrc = Ssrc, payload_type = PT}, - Pl2 = write_packets(Dev, Pl, Pkg, First, Len, Offs, Opts), - {Args2, Opts2} = getopts_checked(Args, Opts), - log(debug, fun (Io) -> - io:format(Io, "Changed options:~n", []), - dump_opts(Io, Opts2 -- Opts) - end, [], Opts), - do_groups(Dev, Pl2, First+Len, Args2, Opts2). - -%%% error handling helpers %%% - -getopts_checked(Args, Opts) -> - try - getopts(Args, Opts) - catch - C:R -> - log(error, "~s~n", - [explain_error(C, R, erlang:get_stacktrace(), Opts)], Opts), - usage(), - halt(1) - end. - -explain_error(error, badarg, [{erlang,list_to_integer,[S,B]} | _ ], _Opts) -> - io_lib:format("Invalid number '~s' (base ~B)", [S, B]); -explain_error(error, badarg, [{erlang,list_to_integer,[S]} | _ ], _Opts) -> - io_lib:format("Invalid decimal number '~s'", [S]); -explain_error(C, R, [Hd | _ ], _Opts) -> - io_lib:format("~p, ~p:~p", [Hd, C, R]); -explain_error(_, _, [], _Opts) -> - "". - -%%% usage and options %%% - -myname() -> - filename:basename(escript:script_name()). - -usage(Text) -> - io:format(standard_error, "~s: ~s~n", [myname(), Text]), - usage(). - -usage() -> - io:format(standard_error, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n", - [myname()]). - -show_version() -> - io:format(standard_io, - "~s ~s~n", [myname(), ?VERSION]). - -show_help() -> - io:format(standard_io, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n~n" ++ - "Options:~n" ++ - " -h, --help this text~n" ++ - " --version show version info~n" ++ - " -i, --file=FILE reads payload from file (state format by default)~n" ++ - " -f, --frame-size=N read payload as binary frames of size N instead~n" ++ - " -p, --payload=HEX set constant payload~n" ++ - " --verbose=N set verbosity~n" ++ - " -v increase verbosity~n" ++ - " --format=state use state format for output (default)~n" ++ - " -C, --format=c use simple C lines for output~n" ++ - " --format=carray use a C array for output~n" ++ - " -s, --ssrc=SSRC set the SSRC~n" ++ - " -t, --type=N set the payload type~n" ++ - " -r, --rate=N set the RTP rate [8000]~n" ++ - " -D, --duration=N set the packet duration in RTP time units [160]~n" ++ - " -d, --delay=FLOAT add offset to playout timestamp~n" ++ - "~n" ++ - "Arguments:~n" ++ - " Start initial packet (sequence) number~n" ++ - " Count number of packets~n" ++ - " Offs timestamp offset (in RTP units)~n" ++ - "", [myname()]). - -getopts([ "--file=" ++ File | R], Opts) -> - getopts(R, [{file, File} | Opts]); -getopts([ "-i" ++ T | R], Opts) -> - getopts_alias_arg("--file", T, R, Opts); -getopts([ "--frame-size=" ++ N | R], Opts) -> - Size = list_to_integer(N), - getopts(R, [{frame_size, Size}, {in_format, bin} | Opts]); -getopts([ "-f" ++ T | R], Opts) -> - getopts_alias_arg("--frame-size", T, R, Opts); -getopts([ "--duration=" ++ N | R], Opts) -> - Duration = list_to_integer(N), - getopts(R, [{duration, Duration} | Opts]); -getopts([ "-D" ++ T | R], Opts) -> - getopts_alias_arg("--duration", T, R, Opts); -getopts([ "--rate=" ++ N | R], Opts) -> - Rate = list_to_integer(N), - getopts(R, [{rate, Rate} | Opts]); -getopts([ "-r" ++ T | R], Opts) -> - getopts_alias_arg("--rate", T, R, Opts); -getopts([ "--version" | _], _Opts) -> - show_version(), - halt(0); -getopts([ "--help" | _], _Opts) -> - show_help(), - halt(0); -getopts([ "-h" ++ T | R], Opts) -> - getopts_alias_no_arg("--help", T, R, Opts); -getopts([ "--verbose=" ++ V | R], Opts) -> - Verbose = list_to_integer(V), - getopts(R, [{verbose, Verbose} | Opts]); -getopts([ "-v" ++ T | R], Opts) -> - Verbose = proplists:get_value(verbose, Opts, 0), - getopts_short_no_arg(T, R, [ {verbose, Verbose+1} | Opts]); -getopts([ "--format=state" | R], Opts) -> - getopts(R, [{format, state} | Opts]); -getopts([ "--format=c" | R], Opts) -> - getopts(R, [{format, c} | Opts]); -getopts([ "-C" ++ T | R], Opts) -> - getopts_alias_no_arg("--format=c", T, R, Opts); -getopts([ "--format=carray" | R], Opts) -> - getopts(R, [{format, carray} | Opts]); -getopts([ "--payload=" ++ Hex | R], Opts) -> - getopts(R, [{payload, hex_to_bin(Hex)} | Opts]); -getopts([ "--ssrc=" ++ Num | R], Opts) -> - getopts(R, [{ssrc, list_to_num(Num)} | Opts]); -getopts([ "-s" ++ T | R], Opts) -> - getopts_alias_arg("--ssrc", T, R, Opts); -getopts([ "--type=" ++ Num | R], Opts) -> - getopts(R, [{pt, list_to_num(Num)} | Opts]); -getopts([ "-t" ++ T | R], Opts) -> - getopts_alias_arg("--type", T, R, Opts); -getopts([ "--delay=" ++ Num | R], Opts) -> - getopts(R, [{delay, list_to_float(Num)} | Opts]); -getopts([ "-d" ++ T | R], Opts) -> - getopts_alias_arg("--delay", T, R, Opts); - -% parsing helpers -getopts([ "--" | R], Opts) -> - {R, normalize_opts(Opts)}; -getopts([ O = "--" ++ _ | _], _Opts) -> - usage("Invalid option: " ++ O), - halt(1); -getopts([ [ $-, C | _] | _], _Opts) when C < $0; C > $9 -> - usage("Invalid option: -" ++ [C]), - halt(1); - -getopts(R, Opts) -> - {R, normalize_opts(Opts)}. - -getopts_short_no_arg([], R, Opts) -> getopts(R, Opts); -getopts_short_no_arg(T, R, Opts) -> getopts([ "-" ++ T | R], Opts). - -getopts_alias_no_arg(A, [], R, Opts) -> getopts([A | R], Opts); -getopts_alias_no_arg(A, T, R, Opts) -> getopts([A, "-" ++ T | R], Opts). - -getopts_alias_arg(A, [], [T | R], Opts) -> getopts([A ++ "=" ++ T | R], Opts); -getopts_alias_arg(A, T, R, Opts) -> getopts([A ++ "=" ++ T | R], Opts). - -normalize_opts(Opts) -> - [ proplists:lookup(E, Opts) || E <- proplists:get_keys(Opts) ]. - -%%% conversions %%% - -bin_to_hex(Bin) -> [hd(integer_to_list(N,16)) || <> <= Bin]. -hex_to_bin(Hex) -> << <<(list_to_integer([Nib],16)):4>> || Nib <- Hex>>. - -list_to_num("-" ++ Str) -> -list_to_num(Str); -list_to_num("0x" ++ Str) -> list_to_integer(Str, 16); -list_to_num("0b" ++ Str) -> list_to_integer(Str, 2); -list_to_num(Str = [ $0 | _ ]) -> list_to_integer(Str, 8); -list_to_num(Str) -> list_to_integer(Str, 10). - -%%% dumping data %%% - -dump_opts(Dev, Opts) -> - dump_opts2(Dev, Opts, proplists:get_keys(Opts)). - -dump_opts2(Dev, Opts, [OptName | R]) -> - io:format(Dev, " ~-10s: ~p~n", - [OptName, proplists:get_value(OptName, Opts)]), - dump_opts2(Dev, Opts, R); -dump_opts2(_Dev, _Opts, []) -> ok. - -%%% logging %%% - -log(L, Fmt, Args, Opts) when is_list(Opts) -> - log(L, Fmt, Args, proplists:get_value(verbose, Opts, 0), Opts). - -log(debug, Fmt, Args, V, Opts) when V > 2 -> log2("DEBUG", Fmt, Args, Opts); -log(info, Fmt, Args, V, Opts) when V > 1 -> log2("INFO", Fmt, Args, Opts); -log(notice, Fmt, Args, V, Opts) when V > 0 -> log2("NOTICE", Fmt, Args, Opts); -log(warn, Fmt, Args, _V, Opts) -> log2("WARNING", Fmt, Args, Opts); -log(error, Fmt, Args, _V, Opts) -> log2("ERROR", Fmt, Args, Opts); - -log(Lvl, Fmt, Args, V, Opts) when V >= Lvl -> log2("", Fmt, Args, Opts); - -log(_, _, _, _i, _) -> ok. - -log2(Type, Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, "~s: " ++ Fmt, [Type | Args]); -log2("", Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, Fmt, Args); -log2(_Type, Fun, _Args, _Opts) when is_function(Fun, 1) -> - Fun(standard_error). - -%%% RTP packets %%% - -make_rtp_packet(P = #rtp_packet{version = 2}) -> - << (P#rtp_packet.version):2, - 0:1, % P - 0:1, % X - 0:4, % CC - (P#rtp_packet.marker):1, - (P#rtp_packet.payload_type):7, - (P#rtp_packet.seqno):16, - (P#rtp_packet.timestamp):32, - (P#rtp_packet.ssrc):32, - (P#rtp_packet.payload)/bytes - >>. - -parse_rtp_packet( - << 2:2, % Version 2 - 0:1, % P (not supported yet) - 0:1, % X (not supported yet) - 0:4, % CC (not supported yet) - M:1, - PT:7, - SeqNo: 16, - TS:32, - Ssrc:32, - Payload/bytes >>) -> - #rtp_packet{ - version = 0, - marker = M, - payload_type = PT, - seqno = SeqNo, - timestamp = TS, - ssrc = Ssrc, - payload = Payload}. - -%%% payload generation %%% - -next_payload(F) when is_function(F) -> - {F(), F}; -next_payload({F, D}) when is_function(F) -> - {P, D2} = F(D), - {P, {F, D2}}; -next_payload([P | R]) -> - {P, R}; -next_payload([]) -> - undef; -next_payload(Bin = <<_/bytes>>) -> - {Bin, Bin}. - -%%% real writing work %%% - -write_packets(_Dev, DS, _P, _F, 0, _O, _Opts) -> - DS; -write_packets(Dev, DataSource, P = #rtp_packet{}, F, L, O, Opts) -> - Format = proplists:get_value(format, Opts, state), - Ptime = proplists:get_value(duration, Opts, 160), - Delay = proplists:get_value(delay, Opts, 0), - Rate = proplists:get_value(rate, Opts, 8000), - case next_payload(DataSource) of - {Payload, DataSource2} -> - write_packet(Dev, Ptime * F / Rate + Delay, - P#rtp_packet{seqno = F, timestamp = F*Ptime+O, - payload = Payload}, - Format), - write_packets(Dev, DataSource2, P, F+1, L-1, O, Opts); - Other -> Other - end. - -write_packet(Dev, Time, P = #rtp_packet{}, Format) -> - Bin = make_rtp_packet(P), - - write_packet_line(Dev, Time, P, Bin, Format). - -write_packet_pre(Dev, carray) -> - io:format(Dev, - "struct {float t; int len; char *data;} packets[] = {~n", []); - -write_packet_pre(_Dev, _) -> ok. - -write_packet_post(Dev, carray) -> - io:format(Dev, "};~n", []); - -write_packet_post(_Dev, _) -> ok. - -write_packet_line(Dev, Time, _P, Bin, state) -> - io:format(Dev, "~f ~s~n", [Time, bin_to_hex(Bin)]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, c) -> - ByteList = [ [ $0, $x | integer_to_list(Byte, 16) ] || <> <= Bin ], - ByteStr = string:join(ByteList, ", "), - io:format(Dev, "/* time=~f, SeqNo=~B, TS=~B */ {~s}~n", [Time, N, TS, ByteStr]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, carray) -> - io:format(Dev, " /* RTP: SeqNo=~B, TS=~B */~n", [N, TS]), - io:format(Dev, " {~f, ~B, \"", [Time, size(Bin)]), - [ io:format(Dev, "\\x~2.16.0B", [Byte]) || <> <= Bin ], - io:format(Dev, "\"},~n", []). - -%%% real reading work %%% - -read_packets(Dev, Opts) -> - Format = proplists:get_value(in_format, Opts, state), - - read_packets(Dev, Opts, Format). - -read_packets(Dev, Opts, Format) -> - case read_packet(Dev, Opts, Format) of - eof -> []; - Tuple -> [Tuple | read_packets(Dev, Opts, Format)] - end. - -read_packet(Dev, Opts, bin) -> - Size = proplists:get_value(frame_size, Opts), - case file:read(Dev, Size) of - {ok, Data} -> {0, #rtp_packet{payload = iolist_to_binary(Data)}}; - eof -> eof - end; -read_packet(Dev, _Opts, Format) -> - case read_packet_line(Dev, Format) of - {Time, Bin} -> {Time, parse_rtp_packet(Bin)}; - eof -> eof - end. - -read_packet_line(Dev, state) -> - case io:fread(Dev, "", "~f ~s") of - {ok, [Time, Hex]} -> {Time, hex_to_bin(Hex)}; - eof -> eof - end. diff --git a/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st deleted file mode 100644 index e26d073..0000000 --- a/contrib/rtp/rtp_replay.st +++ /dev/null @@ -1,21 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. -FileStream fileIn: 'rtp_replay_shared.st'. - - -Eval [ - | replay file host dport | - - file := Smalltalk arguments at: 1 ifAbsent: [ 'rtpstream.state' ]. - host := Smalltalk arguments at: 2 ifAbsent: [ '127.0.0.1' ]. - dport := (Smalltalk arguments at: 3 ifAbsent: [ '4000' ]) asInteger. - sport := (Smalltalk arguments at: 4 ifAbsent: [ '0' ]) asInteger. - - replay := RTPReplay on: file fromPort: sport. - - Transcript nextPutAll: 'Going to stream now'; nl. - replay streamAudio: host port: dport. -] diff --git a/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st deleted file mode 100644 index 7b68c0f..0000000 --- a/contrib/rtp/rtp_replay_shared.st +++ /dev/null @@ -1,118 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. - -Object subclass: SDPUtils [ - "Look into using PetitParser." - SDPUtils class >> findPort: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'm=audio ') ifTrue: [ - | stream | - stream := line readStream - skip: 'm=audio ' size; - yourself. - ^ Number readFrom: stream. - ] - ]. - - ^ self error: 'Not found'. - ] - - SDPUtils class >> findHost: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'c=IN IP4 ') ifTrue: [ - | stream | - ^ stream := line readStream - skip: 'c=IN IP4 ' size; - upToEnd. - ] - ]. - - ^ self error: 'Not found'. - ] -] - -Object subclass: RTPReplay [ - | filename socket | - RTPReplay class >> on: aFile [ - ^ self new - initialize; - file: aFile; yourself - ] - - RTPReplay class >> on: aFile fromPort: aPort [ - ^ self new - initialize: aPort; - file: aFile; yourself - ] - - initialize [ - self initialize: 0. - ] - - initialize: aPort [ - socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort. - ] - - file: aFile [ - filename := aFile - ] - - localPort [ - ^ socket port - ] - - streamAudio: aHost port: aPort [ - | file last_time last_image udp_send dest | - - last_time := nil. - last_image := nil. - file := FileStream open: filename mode: #read. - - "Send the payload" - dest := Sockets.SocketAddress byName: aHost. - udp_send := [:payload | | datagram | - datagram := Sockets.Datagram data: payload contents address: dest port: aPort. - socket nextPut: datagram - ]. - - [file atEnd] whileFalse: [ - | lineStream time data now_image | - lineStream := file nextLine readStream. - - "Read the time, skip the blank, parse the data" - time := Number readFrom: lineStream. - lineStream skip: 1. - - data := WriteStream on: (ByteArray new: 30). - [lineStream atEnd] whileFalse: [ - | hex | - hex := lineStream next: 2. - data nextPut: (Number readFrom: hex readStream radix: 16). - ]. - - last_time isNil - ifTrue: [ - "First time, send it right now" - last_time := time. - last_image := Time millisecondClockValue. - udp_send value: data. - ] - ifFalse: [ - | wait_image new_image_time | - - "How long to wait?" - wait_image := last_image + ((time - last_time) * 1000). - [ wait_image > Time millisecondClockValue ] - whileTrue: [Processor yield]. - - udp_send value: data. - last_time := time. - last_image := wait_image. - ] - ] - ] -] - diff --git a/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st deleted file mode 100644 index 5f844df..0000000 --- a/contrib/rtp/rtp_replay_sip.st +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create a SIP connection and then stream... -""" - -PackageLoader - fileInPackage: #OsmoSIP. - -"Load for the replay code" -FileStream fileIn: 'rtp_replay_shared.st'. - - -Osmo.SIPCall subclass: StreamCall [ - | sem stream | - - createCall: aSDP [ - | sdp | - stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'. - sdp := aSDP % {stream localPort}. - ^ super createCall: sdp. - ] - - sem: aSemaphore [ - sem := aSemaphore - ] - - sessionNew [ - | host port | - Transcript nextPutAll: 'The call has started'; nl. - Transcript nextPutAll: sdp_result; nl. - - host := SDPUtils findHost: sdp_result. - port := SDPUtils findPort: sdp_result. - - [ - stream streamAudio: host port: port. - Transcript nextPutAll: 'Streaming has finished.'; nl. - ] fork. - ] - - sessionFailed [ - sem signal - ] - - sessionEnd [ - sem signal - ] -] - -Eval [ - | transport agent call sem sdp_fr sdp_amr | - - - sdp_fr := (WriteStream on: String new) - nextPutAll: 'v=0'; cr; nl; - nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 's=-'; cr; nl; - nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 't=0 0'; cr; nl; - nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl; - nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl; - nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl; - nextPutAll: 'a=fmtp:101 0-15'; cr; nl; - nextPutAll: 'a=ptime:20'; cr; nl; - contents. - - sem := Semaphore new. - transport := Osmo.SIPUdpTransport - startOn: '0.0.0.0' port: 5066. - agent := Osmo.SIPUserAgent createOn: transport. - transport start. - - call := (StreamCall - fromUser: 'sip:1000 at sip.zecke.osmocom.org' - host: '127.0.0.1' - port: 5060 - to: 'sip:123456 at 127.0.0.1' - on: agent) - sem: sem; yourself. - - call createCall: sdp_fr. - - - "Wait for the stream to have ended" - sem wait. - - (Delay forSeconds: 4) wait. -] diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua deleted file mode 100644 index c18a06b..0000000 --- a/contrib/rtp/timestamp_rtp.lua +++ /dev/null @@ -1,28 +0,0 @@ -print("Ni hao") - - -do - local tap = Listener.new("ip", "rtp") - local rtp_ssrc = Field.new("rtp.ssrc") - local frame_time = Field.new("frame.time_relative") - local rtp = Field.new("rtp") - - function tap.packet(pinfo, tvb, ip) - local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) - local rtp_data = rtp() - local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" - local f = io.open(filename, "a") - - f:write(tostring(frame_time()) .. " ") - f:write(tostring(rtp_data.value)) - f:write("\n") - f:close() - end - - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end -end diff --git a/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st deleted file mode 100644 index da0643e..0000000 --- a/contrib/sms/fill-hlr.st +++ /dev/null @@ -1,66 +0,0 @@ -"I create output for some simple SQL statements for the HLR db" - - -Eval [ - -"Create tables if they don't exist" -Transcript show: 'CREATE TABLE SMS ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - sent TIMESTAMP, - sender_id INTEGER NOT NULL, - receiver_id INTEGER NOT NULL, - deliver_attempts INTEGER NOT NULL DEFAULT 0, - valid_until TIMESTAMP, - reply_path_req INTEGER NOT NULL, - status_rep_req INTEGER NOT NULL, - protocol_id INTEGER NOT NULL, - data_coding_scheme INTEGER NOT NULL, - ud_hdr_ind INTEGER NOT NULL, - dest_addr TEXT, - user_data BLOB, - header BLOB, - text TEXT);'; nl; - show: 'CREATE TABLE Subscriber ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - updated TIMESTAMP NOT NULL, - imsi NUMERIC UNIQUE NOT NULL, - name TEXT, - extension TEXT UNIQUE, - authorized INTEGER NOT NULL DEFAULT 0, - tmsi TEXT UNIQUE, - lac INTEGER NOT NULL DEFAULT 0);'; nl. - -"Create some dummy subscribers" -num_sub := 1000. -num_sms := 30. -lac := 1. - -Transcript show: 'BEGIN;'; nl. - -1 to: num_sub do: [:each | - Transcript show: 'INSERT INTO Subscriber - (imsi, created, updated, authorized, lac, extension) - VALUES - (%1, datetime(''now''), datetime(''now''), 1, %2, %3);' % - {(274090000000000 + each). lac. each}; nl. -]. - -1 to: num_sms do: [:sms | - 1 to: num_sub do: [:sub | - Transcript show: 'INSERT INTO SMS - (created, sender_id, receiver_id, valid_until, - reply_path_req, status_rep_req, protocol_id, - data_coding_scheme, ud_hdr_ind, dest_addr, - text) VALUES - (datetime(''now''), 1, %1, ''2222-2-2'', - 0, 0, 0, - 0, 0, ''123456'', - ''abc'');' % {sub}; nl. - ] -]. - -Transcript show: 'COMMIT;'; nl. - -] diff --git a/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st deleted file mode 100644 index bd3f97a..0000000 --- a/contrib/sms/hlr-query.st +++ /dev/null @@ -1,10 +0,0 @@ -"Query for one SMS" - -Eval [ -1 to: 100 do: [:each | - Transcript show: 'SELECT SMS.* FROM SMS - JOIN Subscriber ON SMS.receiver_id = Subscriber.id - WHERE SMS.id >= 1 AND SMS.sent IS NULL AND Subscriber.lac > 0 - ORDER BY SMS.id LIMIT 1;'; nl. -]. -] diff --git a/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d deleted file mode 100644 index e75cdfc..0000000 --- a/contrib/sms/sqlite-probe.tap.d +++ /dev/null @@ -1,5 +0,0 @@ -probe process("/usr/lib/libsqlite3.so.0.8.6").function("sqlite3_get_table") -{ - a = user_string($zSql); - printf("sqlite3_get_table called '%s'\n", a); -} diff --git a/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service deleted file mode 100644 index c040e60..0000000 --- a/contrib/systemd/osmo-bsc-mgcp.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC MGCP - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service deleted file mode 100644 index 4047fef..0000000 --- a/contrib/systemd/osmo-bsc.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=OpenBSC BSC -Wants=osmo-bsc-mgcp.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service deleted file mode 100644 index a0b7829..0000000 --- a/contrib/systemd/osmo-gbproxy.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Osmocom Gb proxy - -[Service] -Type=simple -ExecStart=/usr/bin/osmo-gbproxy -c /etc/osmocom/osmo-gbproxy.cfg -Restart=always -RestartSec=2 -RestartPreventExitStatus=1 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service deleted file mode 100644 index 377497e..0000000 --- a/contrib/systemd/osmo-nitb.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC Network In the Box (NITB) - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3 -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service deleted file mode 100644 index bf6a8e0..0000000 --- a/contrib/systemd/osmo-sgsn.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=OpenBSC SGSN -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-sgsn -c /etc/osmocom/osmo-sgsn.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/testconv/Makefile b/contrib/testconv/Makefile deleted file mode 100644 index bb856f7..0000000 --- a/contrib/testconv/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -OBJS = testconv_main.o - -CC = gcc -CFLAGS = -O0 -ggdb -Wall -LDFLAGS = -CPPFLAGS = -I../.. -I../../include $(shell pkg-config --cflags libosmocore) $(shell pkg-config --cflags libbcg729) -LIBS = ../../src/libmgcp/libmgcp.a ../../src/libcommon/libcommon.a $(shell pkg-config --libs libosmocore) $(shell pkg-config --libs libbcg729) -lgsm -lrt - -testconv: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) - -testconv_main.o: testconv_main.c - -$(OBJS): - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c deleted file mode 100644 index 6c95c55..0000000 --- a/contrib/testconv/testconv_main.c +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "bscconfig.h" -#ifndef BUILD_MGCP_TRANSCODING -#error "Requires MGCP transcoding enabled (see --enable-mgcp-transcoding)" -#endif - -#include "openbsc/mgcp_transcode.h" - -static int audio_name_to_type(const char *name) -{ - if (!strcasecmp(name, "gsm")) - return 3; -#ifdef HAVE_BCG729 - else if (!strcasecmp(name, "g729")) - return 18; -#endif - else if (!strcasecmp(name, "pcma")) - return 8; - else if (!strcasecmp(name, "l16")) - return 11; - return -1; -} - -int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst); - -int main(int argc, char **argv) -{ - char buf[4096] = {0x80, 0}; - int cc, rc; - struct mgcp_rtp_end *dst_end; - struct mgcp_rtp_end *src_end; - struct mgcp_trunk_config tcfg = {{0}}; - struct mgcp_endpoint endp = {0}; - struct mgcp_process_rtp_state *state; - int in_size; - int in_samples = 160; - int out_samples = 0; - uint32_t ts = 0; - uint16_t seq = 0; - - osmo_init_logging(&log_info); - - tcfg.endpoints = &endp; - tcfg.number_endpoints = 1; - endp.tcfg = &tcfg; - mgcp_initialize_endp(&endp); - - dst_end = &endp.bts_end; - src_end = &endp.net_end; - - if (argc <= 2) - errx(1, "Usage: {gsm|g729|pcma|l16} {gsm|g729|pcma|l16} [SPP]"); - - if ((src_end->codec.payload_type = audio_name_to_type(argv[1])) == -1) - errx(1, "invalid input format '%s'", argv[1]); - if ((dst_end->codec.payload_type = audio_name_to_type(argv[2])) == -1) - errx(1, "invalid output format '%s'", argv[2]); - if (argc > 3) - out_samples = atoi(argv[3]); - - if (out_samples) { - dst_end->codec.frame_duration_den = dst_end->codec.rate; - dst_end->codec.frame_duration_num = out_samples; - dst_end->frames_per_packet = 1; - } - - rc = mgcp_transcoding_setup(&endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); - - state = dst_end->rtp_process_data; - OSMO_ASSERT(state != NULL); - - in_size = mgcp_transcoding_get_frame_size(state, in_samples, 0); - OSMO_ASSERT(sizeof(buf) >= in_size + 12); - - buf[1] = src_end->codec.payload_type; - *(uint16_t*)(buf+2) = htons(1); - *(uint32_t*)(buf+4) = htonl(0); - *(uint32_t*)(buf+8) = htonl(0xaabbccdd); - - while ((cc = read(0, buf + 12, in_size))) { - int cont; - int len; - - if (cc != in_size) - err(1, "read"); - - *(uint16_t*)(buf+2) = htonl(seq); - *(uint32_t*)(buf+4) = htonl(ts); - - seq += 1; - ts += in_samples; - - cc += 12; /* include RTP header */ - - len = cc; - - do { - cont = mgcp_transcoding_process_rtp(&endp, dst_end, - buf, &len, sizeof(buf)); - if (cont == -EAGAIN) { - fprintf(stderr, "Got EAGAIN\n"); - break; - } - - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); - - len -= 12; /* ignore RTP header */ - - if (write(1, buf + 12, len) != len) - err(1, "write"); - - len = cont; - } while (len > 0); - } - return 0; -} - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/e1-data-model.txt b/doc/e1-data-model.txt deleted file mode 100644 index 509004f..0000000 --- a/doc/e1-data-model.txt +++ /dev/null @@ -1,172 +0,0 @@ -E1 related data model - -This data model describes the physical relationship of the individual -parts in the network, it is not the logical/protocol side of the GSM -network. - -A BTS is connected to the BSC by some physical link. It could be an actual -E1 link, but it could also be abis-over-IP with a mixture of TCP and RTP/UDP. - -To further complicate the fact, multiple BTS can share one such pysical -link. On a single E1 line, we can easily accomodate up to three BTS with -two TRX each. - -Thus, it is best for OpenBSC to have some kind of abstraction layer. The BSC's -view of a BTS connected to it. We call this 'bts_link'. A bts_link can be -* all the TCP and UDP streams of a Abis-over-IP BTS -* a set of E1 timeslots for OML, RSL and TRAU connections on a E1 link -* a serial line exclusively used for OML messages (T-Link) - -A bts_link can be registered with the OpenBSC core at runtime. - -struct trx_link { - struct gsm_bts_trx *trx; -}; - -struct bts_link { - struct gsm_bts *bts; - struct trx_link trx_links[NUM_TRX]; -}; - -Interface from stack to input core: -====================================================================== -int abis_rsl_sendmsg(struct msgb *msg); - send a message through a RSL link to the TRX specified by the caller in - msg->trx. - -int abis_rsl_rcvmsg(struct msgb *msg); - receive a message from a RSL link from the TRX specified by the - caller in msg->trx. - -int abis_nm_sendmsg(struct msgb *msg); - send a message through a OML link to the BTS specified by the caller in - msg->trx->bts. The caller can just use bts->c0 to get the first TRX - in a BTS. (OML messages are not really sent to a TRX but to the BTS) - -int abis_nm_rcvmsg(struct msgb *msg); - receive a message from a OML link from the BTS specified by the caller - in msg->trx->bts. The caller can just use bts->c0 to get the first - TRX in a BTS. - -int abis_link_event(int event, void *data); - signal some event (such as layer 1 connect/disconnect) from the - input core to the stack. - -int subch_demux_in(mx, const uint8_t *data, int len); - receive 'len' bytes from a given E1 timeslot (TRAU frames) - -int subchan_mux_out(mx, uint8_t *data, int len); - obtain 'len' bytes of output data to be sent on E1 timeslot - -Intrface by Input Core for Input Plugins -====================================================================== - -int btslink_register_plugin(); - - -Configuration for the E1 input module -====================================================================== - -BTS - BTS number - number of TRX - OML link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TRX - RSL link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TS - E1 line number - timeslot number - subslot number - - -E1 input module data model -====================================================================== - - -enum e1inp_sign_type { - E1INP_SIGN_NONE, - E1INP_SIGN_OML, - E1INP_SIGN_RSL, -}; - -struct e1inp_sign_link { - /* list of signalling links */ - struct llist_head list; - - enum e1inp_sign_type type; - - /* trx for msg->trx of received msgs */ - struct gsm_bts_trx *trx; - - /* msgb queue of to-be-transmitted msgs */ - struct llist_head tx_list; - - /* SAPI and TEI on the E1 TS */ - uint8_t sapi; - uint8_t tei; -} - -enum e1inp_ts_type { - E1INP_TS_TYPE_NONE, - E1INP_TS_TYPE_SIGN, - E1INP_TS_TYPE_TRAU, -}; - -/* A timeslot in the E1 interface */ -struct e1inp_ts { - enum e1inp_ts_type type; - struct e1inp_line *line; - union { - struct { - struct llist_head sign_links; - } sign; - struct { - /* subchannel demuxer for frames from E1 */ - struct subch_demux demux; - /* subchannel muxer for frames to E1 */ - struct subch_mux mux; - } trau; - }; - union { - struct { - /* mISDN driver has one fd for each ts */ - struct osmo_fd; - } misdn; - } driver; -}; - -struct e1inp_line { - unsigned int num; - char *name; - - struct e1inp_ts ts[NR_E1_TS]; - - char *e1inp_driver; - void *driver_data; -}; - -/* Call from the Stack: configuration of this TS has changed */ -int e1inp_update_ts(struct e1inp_ts *ts); - -/* Receive a packet from the E1 driver */ -int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, - uint8_t tei, uint8_t sapi); - -/* Send a packet, callback function in the driver */ -int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg) - - -struct e1inp_driver { - const char *name; - int (*want_write)(struct e1inp_ts *ts); -}; diff --git a/doc/examples/osmo-bsc_nat/bscs.cfg b/doc/examples/osmo-bsc_nat/bscs.cfg deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.cfg +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg deleted file mode 100644 index 5e64342..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ /dev/null @@ -1,27 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy accept-all -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/handover.txt b/doc/handover.txt deleted file mode 100644 index ac19e87..0000000 --- a/doc/handover.txt +++ /dev/null @@ -1,89 +0,0 @@ -Ideas about a handover algorithm -====================================================================== - -This is mostly based on the results presented in Chapter 8 of "Performance -Enhancements in a Frequency Hopping GSM Network" by Thomas Toftegaard Nielsen -and Joeroen Wigard. - - -=== Reasons for performing handover === - -Section 2.1.1: Handover used in their CAPACITY simulation: - -1) Interference Handover - -Average RXLEV is satisfactory high, but average RXQUAL too low indicates -interference to the channel. Handover should be made. - -2) Bad Quality - -Averaged RXQUAL is lower than a threshold - -3) Low Level / Signal Strength - -Average RXLEV is lower than a threshold - -4) Distance Handover - -MS is too far away from a cell (measured by TA) - -5) Power budget / Better Cell - -RX Level of neighbor cell is at least "HO Margin dB" dB better than the -current serving cell. - -=== Ideal parameters for HO algorithm === - -Chapter 8, Section 2.2, Table 24: - -Window RXLEV averaging: 10 SACCH frames (no weighting) -Window RXQUAL averaging: 1 SACCH frame (no averaging) -Level Threashold: 1 of the last 1 AV-RXLEV values < -110dBm -Quality Threshold: 3 of the last 4 AV-RXQUAL values >= 5 -Interference Threshold: 1 of the last AV-RXLEV > -85 dBm & - 3 of the last 4 AV-RXQUAL values >= 5 -Power Budget: Level of neighbor cell > 3 dB better -Power Budget Interval: Every 6 SACCH frames (6 seconds ?!?) -Distance Handover: Disabled -Evaluation rule 1: RXLEV of the candidate cell a tleast -104 dBm -Evaluation rule 2: Level of candidate cell > 3dB better own cell -Timer Successful HO: 5 SACCH frames -Timer Unsuccessful HO: 1 SACCH frame - -In a non-frequency hopping case, RXQUAL threshold can be decreased to -RXLEV >= 4 - -When frequency hopping is enabled, the following additional parameters -should be introduced: - -* No intra-cell handover -* Use a HO Margin of 2dB - -=== Handover Channel Reservation === - -In loaded network, each cell should reserve some channels for handovers, -rather than using all of them for new call establishment. This reduces the -need to drop calls due to failing handovers, at the expense of failing new call -attempts. - -=== Dynamic HO Margin === - -The handover margin (hysteresis) should depend on the RXQUAL. Optimal results -were achieved with the following settings: -* RXQUAL <= 4: 9 dB -* RXQUAL == 5: 6 dB -* RXQUAL >= 6: 1 dB - - - -== Actual Handover on a protocol level == - -After the BSC has decided a handover shall be done, it has to - -# allocate a channel at the new BTS -# allocate a handover reference -# activate the channel on the BTS side using RSL CHANNEL ACTIVATION, - indicating the HO reference -# BTS responds with CHAN ACT ACK, including GSM frame number -# BSC sends 04.08 HO CMD to MS using old BTS - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/osmoappdesc.py b/osmoappdesc.py index b72c93e..be97a71 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -14,23 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see - -# Most systems won't be able to use these, so they're separated out -nitb_e1_configs = [ - "doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc.cfg", - "doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg", - "doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", - "doc/examples/osmo-nitb/rbs2308/openbsc.cfg" -] - - app_configs = { "msc": ["doc/examples/osmo-msc/osmo-msc.cfg"], } - apps = [(4254, "src/osmo-msc/osmo-msc", "OsmoMSC", "msc"), ] -- To view, visit https://gerrit.osmocom.org/3801 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49957769e09eed6d723bf7c3777024b62b3480fd Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:45:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:45:43 +0000 Subject: [PATCH] osmo-dev[master]: move iu.opts to no-iu.opts, change to --disable-iu Message-ID: Review at https://gerrit.osmocom.org/3802 move iu.opts to no-iu.opts, change to --disable-iu osmo-msc and osmo-sgsn have moved to --enable-iu by default. Depends: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f (osmo-msc) I04b07ffead5d5394651d80711d2de06162eeed14 (osmo-sgsn) Change-Id: I9a590b9cb9d9318c822e33e8432f3f8e5eb6779f --- M README D iu.opts A no-iu.opts 3 files changed, 13 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/02/3802/1 diff --git a/README b/README index 9d3990d..a3ab68f 100644 --- a/README +++ b/README @@ -8,15 +8,23 @@ more separate build trees in ./make-*. Run ./gen_makefile.py with a choice of projects (2G only or also 3G?) -and a choice of configure options, for example: +and a choice of configure options. - ./gen_makefile.py 3G+2G.deps default.opts iu.opts +Examples: + +Full 2G and 3G support: + + ./gen_makefile.py 3G+2G.deps default.opts + +2G only (requires to pass no-iu.opts), and a custom dir name of 'make-2G': + + ./gen_makefile.py 2G.deps default.opts no-iu.opts -m make-2G This generates a new dir containing a Makefile. When you run make in it, this will clone the source trees (if not present yet) and build all of them in the right order: - cd make-3G+2G-default+iu + cd make-3G+2G-default make If you make modifications in one of the source trees, this Makefile will pick diff --git a/iu.opts b/iu.opts deleted file mode 100644 index a96a1bc..0000000 --- a/iu.opts +++ /dev/null @@ -1,2 +0,0 @@ -osmo-msc --enable-iu -osmo-sgsn --enable-iu diff --git a/no-iu.opts b/no-iu.opts new file mode 100644 index 0000000..63de34a --- /dev/null +++ b/no-iu.opts @@ -0,0 +1,2 @@ +osmo-msc --disable-iu +osmo-sgsn --disable-iu -- To view, visit https://gerrit.osmocom.org/3802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a590b9cb9d9318c822e33e8432f3f8e5eb6779f Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:45:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:45:43 +0000 Subject: [PATCH] osmo-dev[master]: add fetch-gerrit-patch.sh, tweak READMEs Message-ID: Review at https://gerrit.osmocom.org/3803 add fetch-gerrit-patch.sh, tweak READMEs Change-Id: I6df4f3226af9087ef346de72cbcaa86a4d4d5e13 --- M README M src/README A src/fetch-gerrit-patch.sh 3 files changed, 87 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/03/3803/1 diff --git a/README b/README index a3ab68f..65dbf2e 100644 --- a/README +++ b/README @@ -52,3 +52,8 @@ Remove osmocom built binaries and headers from given prefix, default is /usr/local. + + +=== src/* + +Find other useful scripts in src/, see src/README. diff --git a/src/README b/src/README index 4444824..a2fbe81 100644 --- a/src/README +++ b/src/README @@ -2,6 +2,15 @@ There are some handy scripts I use for my daily Osmocom development: + osmo-add-gerrit-hooks.sh + Look for git repositories in and below the current dir and install the + gerrit commit-msg hook in each one. This requires an ~/.ssh/config + entry, see top comment in the script. + + fetch-gerrit-patch.sh + Pass a patch number seen on gerrit to fetch the latest patch set into + your git clone. See top comment in the script. + ./g run a git command in each source tree ./e run an arbitrary shell command in each source tree ./st show a brief branch and local mods status for each source tree @@ -11,6 +20,38 @@ Examples: + +----------------------------------------------------------------------------- + +git clone ssh://go/osmo-msc + +./osmo-add-gerrit-hooks.sh ++ cd /n/s/osmo/src/./osmo-msc/.git ++ [ ! -f hooks/commit-msg ] ++ scp go:hooks/commit-msg hooks/ +commit-msg 100% 4688 4.6KB/s 00:00 + + +----------------------------------------------------------------------------- + + +cd osmo-msc +../fetch-gerrit-patch.sh 3787 ++ git fetch origin refs/changes/87/3787/2 +From ssh://go/osmo-msc + * branch refs/changes/87/3787/2 -> FETCH_HEAD ++ git checkout -b 3787_2 FETCH_HEAD +Switched to a new branch '3787_2' + + +# or if you want an earlier patch set +../fetch-gerrit-patch.sh 3787/1 +From ssh://go/osmo-msc + * branch refs/changes/87/3787/1 -> FETCH_HEAD ++ git checkout -b 3787_1 FETCH_HEAD +Switched to a new branch '3787_1' + + ----------------------------------------------------------------------------- ./g fetch # run 'git fetch' in each clone = fetch all from upstream diff --git a/src/fetch-gerrit-patch.sh b/src/fetch-gerrit-patch.sh new file mode 100755 index 0000000..0353461 --- /dev/null +++ b/src/fetch-gerrit-patch.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# fetch gerrit patch into new branch named like the patch number. +# +# Usage: go to a git clone and pass a patch number: +# +# cd osmo-msc +# P 973 +# or +# P 973/2 +# +# Will create new local branches '973_4' (if 4 is the latest patch set) +# or '973_2', respectively. + +patch="$1" + +if [ -z "$patch" ]; then + echo "Usage: $0 1234[/5]" + exit 1 +fi + +if [ -z "$(echo "$patch" | grep '/')" ]; then + patch="/$patch/" +fi + +if [ -z "$(echo "$patch" | grep '^/')" ]; then + patch="/$patch" +fi + +last_set="$(git ls-remote origin "changes/*" | grep "$patch" | sed 's#.*/\([^/]*\)$#\1 &#' | sort -n | tail -n 1)" +if [ -z "$last_set" ]; then + echo "Not found: $patch" + exit 1 +fi + +change_name="$(echo "$last_set" | sed 's/.*\(refs.*\)/\1/')" +branch_name="$(echo "$change_name" | sed 's#refs/changes/../\([0-9]*\)/\([0-9]*\)#\1_\2#')" + +set -x +git fetch origin "$change_name" +git checkout -b "$branch_name" FETCH_HEAD + -- To view, visit https://gerrit.osmocom.org/3803 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6df4f3226af9087ef346de72cbcaa86a4d4d5e13 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:51:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:51:34 +0000 Subject: [PATCH] osmo-sgsn[master]: rewrite README Message-ID: Review at https://gerrit.osmocom.org/3804 rewrite README Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 --- M README 1 file changed, 14 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/04/3804/1 diff --git a/README b/README index d01b2cf..f399707 100644 --- a/README +++ b/README @@ -1,39 +1,17 @@ -About OpenBSC -============= +About OsmoSGSN +============== -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoSGSN originated from the OpenBSC project, as a separate program within +openbsc.git. In 2017, OpenBSC was split in separate repositories, and hence +OsmoSGSN was given its own separate git repository. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoSGSN exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- GTP towards a GGSN (e.g. OsmoGGSN); +- Gb towards a PCU (e.g. OsmoPCU); +- IuPS towards a HNB-GW (e.g. OsmoHNBGW) for 3G data; +- The Osmocom typical telnet VTY and CTRL interfaces. -Various interfaces towards the BTS are supported, among which are: - - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoSGSN issue tracker and wiki online at +https://osmocom.org/projects/osmosgsn +https://osmocom.org/projects/osmosgsn/wiki -- To view, visit https://gerrit.osmocom.org/3804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 02:53:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 02:53:13 +0000 Subject: [PATCH] osmo-sgsn[master]: rewrite README In-Reply-To: References: Message-ID: rewrite README Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 --- M README 1 file changed, 14 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/04/3804/2 diff --git a/README b/README index d01b2cf..b968211 100644 --- a/README +++ b/README @@ -1,39 +1,17 @@ -About OpenBSC -============= +About OsmoSGSN +============== -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoSGSN originated from the OpenBSC project, as a separate program within +openbsc.git. In 2017, OpenBSC was split in separate repositories, and hence +OsmoSGSN was given its own separate git repository. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoSGSN exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- GTP towards a GGSN (e.g. OsmoGGSN); +- Gb towards a BSS (e.g. OsmoPCU); +- IuPS towards a HNB-GW (e.g. OsmoHNBGW) for 3G data; +- The Osmocom typical telnet VTY and CTRL interfaces. -Various interfaces towards the BTS are supported, among which are: - - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoSGSN issue tracker and wiki online at +https://osmocom.org/projects/osmosgsn +https://osmocom.org/projects/osmosgsn/wiki -- To view, visit https://gerrit.osmocom.org/3804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 07:03:36 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 4 Sep 2017 07:03:36 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 11: > > don't worry. Let me edit as example. Ah right.. the caller frees it. of course. -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 11 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 08:26:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 08:26:05 +0000 Subject: openggsn[master]: ggsn: Fix DNS not sent in PDP context response In-Reply-To: References: Message-ID: Patch Set 1: I'll merge it as it is, I think 3 from uint16_t and uint8_t is clear enough and no need to clutter with a comment. -- To view, visit https://gerrit.osmocom.org/3748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 08:26:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 08:26:20 +0000 Subject: [MERGED] openggsn[master]: ggsn: Fix DNS not sent in PDP context response In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: ggsn: Fix DNS not sent in PDP context response ...................................................................... ggsn: Fix DNS not sent in PDP context response During IPv6 support implementation, helper function pco_contains_proto was added which contains an error: It is only capable of finding first protocol correctly, and as a consequence, in my setup DNS servers where not sent back to the SGSN/MS, resulting in phone being able to connect to IPs but not to domain names which required DNS resolution. The condition in the while loop is also changed to match the increment of the variable inside the loop to make it easier to understand at first glance. Fixes: 1ae98777d9b1ee62e6900caf4bb580d1a42bb416 Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c6a6dac..1e92956 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -215,14 +215,14 @@ uint8_t *cur = pco->v + 1; /* iterate over PCO and check if protocol contained */ - while (cur + 2 < pco->v + pco->l) { + while (cur + 3 <= pco->v + pco->l) { uint16_t cur_prot = osmo_load16be(cur); uint8_t cur_len = cur[2]; if (cur_prot == prot) return true; if (cur_len == 0) break; - cur += cur_len; + cur += cur_len + 3; } return false; } -- To view, visit https://gerrit.osmocom.org/3748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 08:30:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 08:30:39 +0000 Subject: osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3724/3/selftest/conf/resources.conf File selftest/conf/resources.conf: Line 67: auth_algo: 'xor' > xor is somewhat untypical, comp128 would be more common. Hmm, which one was ? That modem SIM is using a xor algo right now, so it needs this algo unless its changed. I don't know how easy it is to change it though. The KI needs to change too in that case? -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 09:28:19 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 4 Sep 2017 09:28:19 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: clarify language in vty read error Message-ID: Review at https://gerrit.osmocom.org/3805 cosmetic: clarify language in vty read error This is very minor but it annoys every time I see it. The text: "Error occurred during reading below line:" is not a complete sentence. The default understanding in english having left out the article implies that the error occured reading below [the] specified line, not that the error occured reading [the] specified line. That is to say, The message implied that the printed line was the last successfully parsed line. Change-Id: Ib4dd135feb9609b14983db5dac321a70267d8f30 --- M src/vty/vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/3805/1 diff --git a/src/vty/vty.c b/src/vty/vty.c index 644d4ed..113a781 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1481,7 +1481,7 @@ fprintf(stderr, "There is no such command.\n"); break; } - fprintf(stderr, "Error occurred during reading below " + fprintf(stderr, "Error occurred during reading the below " "line:\n%s\n", vty->buf); vty_close(vty); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3805 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4dd135feb9609b14983db5dac321a70267d8f30 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Mon Sep 4 09:44:46 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 4 Sep 2017 09:44:46 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 11: > Could you test my version? Tested. Works. -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 11 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 09:48:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 09:48:45 +0000 Subject: osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3721/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 449: return False > It is potentially dangerous to change this logic and I want to be sure I un I'll provide a test for this. I think I stumbled onto it when trying to use more than one scenario together, ie: -s encryption:cipher_a51+cipher_a52. AFAIR there were several things not correct in this code before my change: - It is expected that item and wanted_item to be the of the same type (because they follow same syntax). Thus in this case of are type list. AFAIR I checked and using this syntax doesn't work correctly to check if a list is a sublist/subset of another list. - I think here you want to check the opposite, that is: if all wanted items are a subset of the item capabilitites. For instance if a modem supports 3 ciphers, and you want a scenario which supports 2, then len(wanted_item)==2 and len(item)==3, and you want to check that wnated_item is a subset of item. -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 09:58:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 09:58:27 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3722/1/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 253: dest.append(src[i]) > It is potentially dangerous to change this logic and I want to be sure I un I'll provide a a test for this, but AFAIR it fails with the same scenario of the other patch: -s encryption:cipher_a50+cipher_a51, for instance: cipher_a50.conf: bts: - ciphers: - 'a5 0' cipher_a51.conf bts: - ciphers: - 'a5 1' Combining both scenarios means you want to restrict more, ie adding more requirements for the resources. This means you should end up with the following dict, because you require to have a BTS with both ciphers: bts : { ciphers : ['a5 0', 'a5 1' } So, if I understand correctly, in essence we are doing the union for scenarios dictionaries in order to have a bigger set which will then provide a smaller intersection against resources (only BTs having both ciphers are selected). Before this patch, the code basically fails to combine the two scenarios. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 10:03:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 10:03:42 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3723/3/example/resources.conf File example/resources.conf: Line 16: ciphers: ['a5 0', 'a5 1', 'a5 3'] > re-reading this, I get two thoughts: TBH, I don't care that much. I think it's still nice to use the quoting because as far as I remember you told you have issues without quoting. Because a50 can be understood as a hex number right? In any case, quoting also helps me understand that this value is being used a string in the code. So, in summary, I can indeed move those to a5_0 or a50, but I'll keep the quoting are it's still string keywords being used, like "xor" or "foobar". -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 10:11:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 10:11:14 +0000 Subject: osmo-gsm-manuals[master]: OsmoGsmTester: Move coredump section and add reference to ke... In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/3711/1//COMMIT_MSG Commit Message: Line 7: OsmoGsmTester: Move coredump section and add reference to kernel.core_pattern sysctl > Sneaky! Editing while moving. Makes it hard to spot the edits. So do you want me to split this into 2 commits? Is it really needed? The amount of text moved is quite small. https://gerrit.osmocom.org/#/c/3711/1/OsmoGSMTester/chapters/install.adoc File OsmoGSMTester/chapters/install.adoc: Line 449: osmo-gsm-tester source tree to the main unit: > (oops, it says "copy file" yet I have replaced the copy with an echo of the I'll fix that too. Line 464: value of that sysctl parameter: > "Please excuse the length of my letter, I didn't have the time to make it s I'll take yours as it's shorter. -- To view, visit https://gerrit.osmocom.org/3711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 10:30:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 10:30:40 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 1: (4 comments) https://gerrit.osmocom.org/#/c/3731/2/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 117: self.band_arfcn = band_arfcn > self.band_arfcn should have a default value up in __init__() or above that. Good point. I didn't do it probably because it is always set when requesting the object in suite.py:bts_obj(), but it still may make sense to have a default None there. Line 120: return self.band_arfcn.get('band') > can self.band_arfcn be unset? Then this would raise a NoneType exception. It should always be set by suite.py just after creating it in suite.py:bts_obj, so I don't expect it to be used without it being set. So no problem here. Line 123: return int(self.band_arfcn.get('arfcn')) > same same too. https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 484: arfcn = suite_run._try_reserve_arfcn(supported_bands) > I am fairly strongly against reserving more resources after the test starte If the suite cannot reserve a resource, it can wait for it. The only issue I see here is actually about possible deadlocks as I explained above. On the other hand, during last days I though about the current proposal in this patchset, and I think it still fails to resolve the issue because it only provides automatic matching between free ARFCNs and BTS, but not with modems. Which means if we have modems not supporting all bands, we could end up in an scenario in which a BTS supporting 1800 is configured for that one, but obtain a modem which only supports 900, unless we really specify a scenario for all to use the same band. And I'd definitely like to avoid this. So, I think the only safe bet here, would be to add specific parser logic while holding the resource lock and resolving resources, to check that ARFCN we select is in a band which is supported by both modem and bts (which can be checked by looking at modem and bts "bands" resource properties.) What do you think? Let's talk about this in the office, I agree it's going to be more useful. -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 10:42:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 10:42:37 +0000 Subject: [ABANDON] osmo-bsc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Use release helper from libosmocore ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I05bf42d638167c779328fa61b01c917da91a88de Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 10:43:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 10:43:17 +0000 Subject: [ABANDON] osmo-mgw[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Use release helper from libosmocore ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0905eeb177185da1e2818a01fdb7265694d9903d Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 10:43:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 10:43:45 +0000 Subject: [ABANDON] osmo-sgsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Use release helper from libosmocore ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 11:28:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 11:28:47 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3761/1/src/gprs_bssgp_pcu.cpp File src/gprs_bssgp_pcu.cpp: Line 969: talloc_free(the_pcu.bctx); > what? do we have a missing free here? Why can we just omit it, because we n Yes to both questions. -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 11:42:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 11:42:56 +0000 Subject: [PATCH] osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3761 to look at the new patch set (#2). cosmetic: convert explicit warnings to fixme/todo We do not use this style (#warning as an issue tracker replacement) in any other Osmocom project. Also those warnings clutter compiler output making it harder to spot warnings for the actual code. Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f --- M src/bts.cpp M src/gprs_rlcmac_meas.cpp M src/gprs_rlcmac_sched.cpp M src/osmobts_sock.cpp M src/tbf.cpp M src/tbf_dl.cpp 6 files changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/61/3761/2 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..b768569 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -649,7 +649,7 @@ } } else { // Create new TBF - #warning "Copy and paste with other routines.." + /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp index d6bbc19..41a7531 100644 --- a/src/gprs_rlcmac_meas.cpp +++ b/src/gprs_rlcmac_meas.cpp @@ -28,7 +28,7 @@ /* * downlink measurement */ -#warning "TODO: trigger the measurement report from the pollcontroller and use it for flow control" +/* TODO: trigger the measurement report from the pollcontroller and use it for flow control */ /* received Measurement Report */ int gprs_rlcmac_meas_rep(Packet_Measurement_Report_t *pmr) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 42f0308..4309909 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -60,7 +60,8 @@ || ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = ul_tbf; -#warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" +/* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all +states? */ } llist_for_each(pos, &bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index e9b85ab..31715d5 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -108,7 +108,8 @@ #endif for (ts = 0; ts < 8; ts++) bts->trx[trx].pdch[ts].disable(); -#warning "NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c for the reset." +/* FIXME: NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c +for the reset. */ gprs_rlcmac_tbf::free_all(&bts->trx[trx]); } diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..8e54157 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -382,7 +382,7 @@ { struct gprs_rlcmac_ul_tbf *tbf; -#warning "Copy and paste with tbf_new_dl_assignment" +/* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); @@ -465,7 +465,7 @@ get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, tbf->dl_ass_state)); tbf->stop_timer(); - #warning "TODO: Could/Should generate bssgp_tx_llc_discarded" + /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); llist_del(&tbf->list()); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b350720..1dd7dd8 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -145,7 +145,7 @@ } // Create new TBF (any TRX) -#warning "Copy and paste with alloc_ul_tbf" +/* FIXME: Copy and paste with alloc_ul_tbf */ /* set number of downlink slots according to multislot class */ dl_tbf = tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, ss); -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:06:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 12:06:41 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (6 comments) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 849: #define SNPRINTF_BUFFER_SIZE(ret, buffer_offset, size) \ > phew, can we document the arguments? my head is spinning... At least now there's one parameter left storing state, so easier than before IMHO ;) Line 851: return ret; \ > wait, you are having a function return in this macro? I think that's bad st Why? this macro is intended to be used only in this set of functions, not to be used by other non-related code. It's just put here together because it's used in lots of places in a few lines. No need to clutter more parts of the functions with extra returns. return only happens if ret < 0 which means snprintf failed and in that case we just want to return that error to the caller, no need to do more work. Furthermore, it then simplifies the code (early return, no need to check specific code branches, as we can take some assumptions granted). Line 866: osmuxh->amr_ft, osmuxh->amr_cmr); > If I get this right, before this patch this function always returned 0 (off It could return other values depending on what was returned by ret. It's the same now, but also returning values <0 on error and checking overflows correctly, etc. Line 903: if (msg->len - msg_offset < sizeof(struct osmux_hdr)) { > This change alone is complex enough. With the rest also being changed I'm u As I said, I mostly rewrite the functions because there was bad logic + difficult to catch cases all around. Take it as a new implementation. Otherwise I'd need to spend hours and provide lots of commits to end up doing the same as you see here) or maybe worse. Not that worth spending more hours for this I think. Line 911: if (osmuxh->ft == OSMUX_FT_VOICE_AMR && !osmo_amr_ft_valid(osmuxh->amr_ft)) { > oof, is this change really related? It's related in the sense of improving the function. This check was missing because there are other types of osmux frames which can then end up in this error code patch and they should. I can split it into a new patch if you ask for it, but as I was already rewriting the function I decided to put it here too. Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > (to illustrate above point, this macro call might return the function and b If there was an error in snprintf or if the buffer is full, why do I want to continue looping and wasting CPU time if anyway I cannot write into the buffer? I just want to return the error or return that we wrote the entire buffer. Why continuing? -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:29:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 12:29:03 +0000 Subject: osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3721/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 449: return False > I'll provide a test for this. I think I stumbled onto it when trying to use After doing some tests, it fixes the following scenario: You have a BTS which supports a50 and a51. Then you use only 1 of the ciphers in the scenario, for instance a50. Without this patch, this setup will fail. I'll push a new version of the commit with better git commit description. A test in test_resources.py is already provided with later commits when cipher attribute is added, which checks for this case. So, in later commits, if this commit is not present then "make check" fails, I just tried it: --- /home/pespin/dev/sysmocom/git/osmo-gsm-tester-sysmocom/osmo-gsm-tester/selftest/resource_test.err +++ got @@ -0,0 +1,8 @@ +Traceback (most recent call last): + File "/home/pespin/dev/sysmocom/git/osmo-gsm-tester-sysmocom/osmo-gsm-tester/selftest/resource_test.py", line 83, in + resources = pool.reserve(origin, want) + File "/home/pespin/dev/sysmocom/git/osmo-gsm-tester-sysmocom/osmo-gsm-tester/selftest/../src/osmo_gsm_tester/resource.py", line 155, in reserve + to_be_reserved = self.all_resources.without(reserved).find(origin, want) + File "/home/pespin/dev/sysmocom/git/osmo-gsm-tester-sysmocom/osmo-gsm-tester/selftest/../src/osmo_gsm_tester/resource.py", line 332, in find + % (key, want_item)) +osmo_gsm_tester.resource.NoResourceExn: No matching resource available for bts = {'type': 'osmo-bts-sysmo', 'ciphers': ['a5 1']} output mismatch: 'resource_test.err' Test failed: 'resource_test.py' -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:35:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 12:35:54 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (5 comments) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 849: #define SNPRINTF_BUFFER_SIZE(ret, buffer_offset, size) \ > At least now there's one parameter left storing state, so easier than befor agreed; yet when first reading it, it helps to have doc for these non-obvious parameters. Line 851: return ret; \ > Why? this macro is intended to be used only in this set of functions, not t I strongly object this coding style. Please no hidden return statements in macros, it makes the code cryptic; the flow should be obvious to the uninformed, and that's worth a few more lines. IIUC I have even identified one instance below where it breaks the current code flow. Line 903: if (msg->len - msg_offset < sizeof(struct osmux_hdr)) { > As I said, I mostly rewrite the functions because there was bad logic + dif ok, but let's have a unit test Line 911: if (osmuxh->ft == OSMUX_FT_VOICE_AMR && !osmo_amr_ft_valid(osmuxh->amr_ft)) { > It's related in the sense of improving the function. This check was missing it is unrelated to range checking of snprintf calls. Should be separate IMHO. Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > If there was an error in snprintf or if the buffer is full, why do I want t There was an error log statement ("No room for OSMUX payload") that you're now dropping. You shouldn't be failing silently. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:38:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 12:38:00 +0000 Subject: osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:40:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 12:40:23 +0000 Subject: osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 ok I understand now, thanks! (only +1 because you mentioned you wanted to push another commit...?) -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:43:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 12:43:28 +0000 Subject: osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Patch Set 1: Yes, I'll go through all comments in all commits and push the entire branch again. -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:44:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 12:44:18 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/3731/2/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 120: return self.band_arfcn.get('band') > It should always be set by suite.py just after creating it in suite.py:bts_ hmm, should be set by suite.py, but we're in bts_sysmo.py here. I'd prefer a 'if not self.band_arfcn: return None' Line 123: return int(self.band_arfcn.get('arfcn')) > same too. same again :) -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:45:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 12:45:20 +0000 Subject: osmo-gsm-manuals[master]: OsmoGsmTester: Move coredump section and add reference to ke... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3711/1//COMMIT_MSG Commit Message: Line 7: OsmoGsmTester: Move coredump section and add reference to kernel.core_pattern sysctl > So do you want me to split this into 2 commits? Is it really needed? The am maybe next time. -- To view, visit https://gerrit.osmocom.org/3711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:47:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 12:47:31 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3723/3/example/resources.conf File example/resources.conf: Line 16: ciphers: ['a5 0', 'a5 1', 'a5 3'] > TBH, I don't care that much. I think it's only about numbers starting with 0 being interpreted as octal. my choice would be a5_0. quote if you have to, but I wouldn't :) -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:50:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 12:50:48 +0000 Subject: osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) In-Reply-To: References: Message-ID: Patch Set 3: > (1 comment) I am still puzzled how we ended up with xor sim cards, I've never encountered one before. Using the sysmo-usim-tool and a card reader it should be easy to change this, pmaier knows all about it. -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 12:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 12:58:48 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (4 comments) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 849: #define SNPRINTF_BUFFER_SIZE(ret, buffer_offset, size) \ > agreed; yet when first reading it, it helps to have doc for these non-obvio Agree, I'll add a short description of each parameter. Line 903: if (msg->len - msg_offset < sizeof(struct osmux_hdr)) { > ok, but let's have a unit test Agree Line 911: if (osmuxh->ft == OSMUX_FT_VOICE_AMR && !osmo_amr_ft_valid(osmuxh->amr_ft)) { > it is unrelated to range checking of snprintf calls. Should be separate IMH OK I'll split it Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > There was an error log statement ("No room for OSMUX payload") that you're That's not checking the string output buffer, but the packet input buffer, it's different stuff. That check is there to prevent osmux_snprintf_payload() reading from put of bytes input buffer, and as our output buffer is full, there's no point in doing that check / print that error because anyway we are not interested in continuing and calling osmux_snprintf_payload(). So the early return imho is correct. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:02:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 13:02:53 +0000 Subject: [PATCH] osmo-dev[master]: git_branch_summary.py: add usage, make py3 compatible Message-ID: Review at https://gerrit.osmocom.org/3806 git_branch_summary.py: add usage, make py3 compatible Change-Id: Ia8cc461fd0f1fb43e19ee8846cc48a828d153b2f --- M src/git_branch_summary.py 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/06/3806/1 diff --git a/src/git_branch_summary.py b/src/git_branch_summary.py index 6bd4378..cc86112 100755 --- a/src/git_branch_summary.py +++ b/src/git_branch_summary.py @@ -2,6 +2,10 @@ import sys, subprocess, re +if len(sys.argv) < 2: + print("Usage: %s [...]\nThis is mostly here for helping the 'st' script." % sys.argv[0]) + exit(1) + interesting_branch_names = [ 'master', 'sysmocom/iu', 'sysmocom/sccp', 'aper-prefix-onto-upstream' ] re_branch_name = re.compile('^..([^ ]+) .*') @@ -15,7 +19,7 @@ def do_one_git(git_dir): global interesting - branch_strs = subprocess.check_output(('git', '-C', git_dir, 'branch', '-vv')).splitlines() + branch_strs = subprocess.check_output(('git', '-C', git_dir, 'branch', '-vv')).decode().splitlines() interesting_branches = [] for line in branch_strs: @@ -35,7 +39,7 @@ else: interesting_branches.append(br) - status = subprocess.check_output(('git', '-C', git_dir, 'status')) + status = subprocess.check_output(('git', '-C', git_dir, 'status')).decode() has_mods = 'modified:' in status interesting.append((git_dir, has_mods, interesting_branches)) @@ -59,6 +63,6 @@ br.append('[%s]' % '|'.join(ahead)) strs.append(''.join(br)) - print ' '.join(strs) + print(' '.join(strs)) # vim: shiftwidth=2 expandtab tabstop=2 -- To view, visit https://gerrit.osmocom.org/3806 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8cc461fd0f1fb43e19ee8846cc48a828d153b2f Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:03:07 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 13:03:07 +0000 Subject: osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) In-Reply-To: References: Message-ID: Patch Set 3: > > (1 comment) > > I am still puzzled how we ended up with xor sim cards, I've never > encountered one before. Using the sysmo-usim-tool and a card reader > it should be easy to change this, pmaier knows all about it. > > (1 comment) > > I am still puzzled how we ended up with xor sim cards, I've never > encountered one before. Using the sysmo-usim-tool and a card reader > it should be easy to change this, pmaier knows all about it. No idea I didn't set up the modems in the rack, but my tests showed that using the comp one the challenge responses didn't match, but they did when I used xor, so let's leave xor there for now. We can create a task to deploy some simcard with the other algo in order to check both, but I think it's out of the scope for this patch. -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:05:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 13:05:12 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split into digestible pieces In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#3). Simplify TS alloc: split into digestible pieces Algorithm B implementation is way too big and complex to maintain or even to follow the code. Split it into set of smaller functions with documented interfaces to make it easier to read and modify. This opens up the road for reusing those functions in implementation of additional allocation algorithms. The test results are intentionally left unchanged to avoid potential regressions. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2400 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 224 insertions(+), 135 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/3 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index ed4a79e..5cf12dc 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -374,18 +374,27 @@ /*! Return free TFI * * \param[in,out] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses * \param[out] trx_no_ TRX number on which TFI was found * \returns negative error code or 0 on success */ -static int tfi_find_free(BTS *bts, const GprsMs *ms, +static int tfi_find_free(BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -394,8 +403,7 @@ if (tfi < 0) return -EBUSY; - if (trx_no_) - *trx_no_ = trx_no; + *trx_no_ = trx_no; return tfi; } @@ -811,6 +819,204 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return single TS from a given UL/DL set according to TBF's direction + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return pcu_lsb(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of UL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] usf USF array + * \param[in,out] ul_slots set of UL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_ul_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t dl_slots, + uint8_t reserved_ul_slots, int8_t first_common_ts, + int *usf, uint8_t *ul_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + int free_usf = -1; + + if (single) + (*ul_slots) = get_single_ts(trx, tbf, dl_slots, *ul_slots, &ts); + + if ((*ul_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No uplink slots available\n"); + return -EINVAL; + } + + if (first_common_ts >= 0) + (*ul_slots) = 1 << first_common_ts; + else + (*ul_slots) = (*ul_slots) & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, *ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + OSMO_ASSERT(ts >= 0 && ts <= 8); + + (*ul_slots) = 1 << ts; + usf[ts] = free_usf; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_ul_slots, 'u', '.'), *ul_slots, 'U'), + single ? ", single" : ""); + + update_slot_counters(*ul_slots, reserved_ul_slots, slotcount, avail_count); + + return ts; +} + +/*! Find set of DL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] dl_slots set of DL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_dl_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t ul_slots, + uint8_t reserved_dl_slots, int8_t first_common_ts, + uint8_t *dl_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + + if (single) + (*dl_slots) = get_single_ts(trx, tbf, *dl_slots, ul_slots, &ts); + + if ((*dl_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots available\n"); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, 'd', '.'), (*dl_slots), 'D'), + single ? ", single" : ""); + + update_slot_counters(*dl_slots, reserved_dl_slots, slotcount, avail_count); + + return ffs(*dl_slots) - 1; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -833,8 +1039,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; - int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; @@ -855,18 +1059,8 @@ first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } - /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -886,95 +1080,25 @@ } /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + first_ts = get_dl_slot_set(trx, tbf, single, ul_slots, reserved_dl_slots, first_common_ts, + &dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - OSMO_ASSERT(ts >= 0 && ts <= 8); - - ul_slots = 1 << ts; - usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; + first_ts = get_ul_slot_set(trx, tbf, single, dl_slots, reserved_ul_slots, first_common_ts, usf, + &ul_slots, &slotcount, &avail_count); /* We will stick to that single UL slot, unreserve the others */ + slotcount = 1; reserved_ul_slots = ul_slots; - - avail_count = pcu_bitcount(reserved_ul_slots); } + + if (first_ts < 0) + return -EINVAL; first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); - return -EINVAL; - } - if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); return -EINVAL; } @@ -993,51 +1117,16 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:05:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 13:05:15 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures Message-ID: Review at https://gerrit.osmocom.org/3807 Simplify TS alloc: adjust function signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2400 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 109 insertions(+), 106 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/1 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..51d1c31 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -652,12 +652,11 @@ #warning "Copy and paste with other routines.." if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index b1fb8cc..1493f6e 100644 --- a/src/bts.h +++ b/src/bts.h @@ -203,11 +203,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..ed4a79e 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -300,26 +300,20 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(BTS *bts, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; @@ -377,8 +371,18 @@ return NULL; } +/*! Return free TFI + * + * \param[in,out] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -396,14 +400,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -488,9 +497,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in,out] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -796,15 +811,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -812,14 +832,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -858,7 +877,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -1025,7 +1044,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,10 +1052,15 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; @@ -1048,7 +1072,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,7 +1081,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); return rc; } diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..0e617ab 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ #warning "Copy and paste with tbf_new_dl_assignment" /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, 0, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b350720..7fd1131 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index e26c432..271f966 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -813,7 +811,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -823,7 +821,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:06:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 13:06:02 +0000 Subject: [MERGED] osmo-pcu[master]: cosmetic: convert explicit warnings to fixme/todo In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: cosmetic: convert explicit warnings to fixme/todo ...................................................................... cosmetic: convert explicit warnings to fixme/todo We do not use this style (#warning as an issue tracker replacement) in any other Osmocom project. Also those warnings clutter compiler output making it harder to spot warnings for the actual code. Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f --- M src/bts.cpp M src/gprs_rlcmac_meas.cpp M src/gprs_rlcmac_sched.cpp M src/osmobts_sock.cpp M src/tbf.cpp M src/tbf_dl.cpp 6 files changed, 9 insertions(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..b768569 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -649,7 +649,7 @@ } } else { // Create new TBF - #warning "Copy and paste with other routines.." + /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp index d6bbc19..41a7531 100644 --- a/src/gprs_rlcmac_meas.cpp +++ b/src/gprs_rlcmac_meas.cpp @@ -28,7 +28,7 @@ /* * downlink measurement */ -#warning "TODO: trigger the measurement report from the pollcontroller and use it for flow control" +/* TODO: trigger the measurement report from the pollcontroller and use it for flow control */ /* received Measurement Report */ int gprs_rlcmac_meas_rep(Packet_Measurement_Report_t *pmr) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index e059ae1..2350808 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -60,7 +60,8 @@ || ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = ul_tbf; -#warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" +/* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all +states? */ } llist_for_each(pos, &bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index e9b85ab..31715d5 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -108,7 +108,8 @@ #endif for (ts = 0; ts < 8; ts++) bts->trx[trx].pdch[ts].disable(); -#warning "NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c for the reset." +/* FIXME: NOT ALL RESOURCES are freed in this case... inconsistent with the other code. Share the code with pcu_l1if.c +for the reset. */ gprs_rlcmac_tbf::free_all(&bts->trx[trx]); } diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..8e54157 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -382,7 +382,7 @@ { struct gprs_rlcmac_ul_tbf *tbf; -#warning "Copy and paste with tbf_new_dl_assignment" +/* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); @@ -465,7 +465,7 @@ get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, tbf->dl_ass_state)); tbf->stop_timer(); - #warning "TODO: Could/Should generate bssgp_tx_llc_discarded" + /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); llist_del(&tbf->list()); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b350720..1dd7dd8 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -145,7 +145,7 @@ } // Create new TBF (any TRX) -#warning "Copy and paste with alloc_ul_tbf" +/* FIXME: Copy and paste with alloc_ul_tbf */ /* set number of downlink slots according to multislot class */ dl_tbf = tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, ss); -- To view, visit https://gerrit.osmocom.org/3761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72070e2a027e60e8b80c12ccfa23ff075434689f Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:33:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 13:33:08 +0000 Subject: [PATCH] osmo-sgsn[master]: configure.ac: set name to osmo-sgsn, fix ML addr Message-ID: Review at https://gerrit.osmocom.org/3808 configure.ac: set name to osmo-sgsn, fix ML addr Change-Id: I47e9f2307b42d171f2ceeda1e129e2311f611883 --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/08/3808/1 diff --git a/configure.ac b/configure.ac index 359c5c1..85a921f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT([openbsc], +AC_INIT([osmo-sgsn], m4_esyscmd([./git-version-gen .tarball-version]), - [openbsc at lists.osmocom.org]) + [osmocom-net-gprs at lists.osmocom.org]) dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ AC_CONFIG_AUX_DIR([.]) -- To view, visit https://gerrit.osmocom.org/3808 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47e9f2307b42d171f2ceeda1e129e2311f611883 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:33:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 13:33:09 +0000 Subject: [PATCH] osmo-sgsn[master]: move openbsc.pc to osmo-sgsn.pc Message-ID: Review at https://gerrit.osmocom.org/3809 move openbsc.pc to osmo-sgsn.pc Change-Id: Iad28d85b2a6d175cbe5d506aa82e7e4d94111eff --- M Makefile.am M configure.ac D openbsc.pc.in A osmo-sgsn.pc.in 4 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/09/3809/1 diff --git a/Makefile.am b/Makefile.am index 536b3f4..d57b66d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = openbsc.pc +pkgconfig_DATA = osmo-sgsn.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 85a921f..f1167d6 100644 --- a/configure.ac +++ b/configure.ac @@ -178,7 +178,7 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - openbsc.pc + osmo-sgsn.pc include/openbsc/Makefile include/Makefile src/Makefile diff --git a/openbsc.pc.in b/openbsc.pc.in deleted file mode 100644 index 17e265d..0000000 --- a/openbsc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OpenBSC -Description: OpenBSC base station controller -Requires: -Version: @VERSION@ -Cflags: -I${includedir} diff --git a/osmo-sgsn.pc.in b/osmo-sgsn.pc.in new file mode 100644 index 0000000..45aef57 --- /dev/null +++ b/osmo-sgsn.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/ + +Name: OsmoSGSN +Description: Osmocom's Serving GPRS Support Node for 2G and 3G packet-switched mobile networks +Requires: +Version: @VERSION@ +Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/3809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad28d85b2a6d175cbe5d506aa82e7e4d94111eff Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:33:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 13:33:09 +0000 Subject: [PATCH] osmo-sgsn[master]: move include/openbsc to include/osmocom/sgsn Message-ID: Review at https://gerrit.osmocom.org/3810 move include/openbsc to include/osmocom/sgsn Change-Id: I281ef585fffc2644682c8282224fb1c2da5ca795 --- M configure.ac M debian/copyright M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/sgsn/Makefile.am R include/osmocom/sgsn/common.h R include/osmocom/sgsn/crc24.h R include/osmocom/sgsn/debug.h R include/osmocom/sgsn/gb_proxy.h R include/osmocom/sgsn/gprs_gb_parse.h R include/osmocom/sgsn/gprs_gmm.h R include/osmocom/sgsn/gprs_llc.h R include/osmocom/sgsn/gprs_llc_xid.h R include/osmocom/sgsn/gprs_sgsn.h R include/osmocom/sgsn/gprs_sndcp.h R include/osmocom/sgsn/gprs_sndcp_comp.h R include/osmocom/sgsn/gprs_sndcp_dcomp.h R include/osmocom/sgsn/gprs_sndcp_pcomp.h R include/osmocom/sgsn/gprs_sndcp_xid.h R include/osmocom/sgsn/gprs_subscriber.h R include/osmocom/sgsn/gprs_utils.h R include/osmocom/sgsn/gsup_client.h R include/osmocom/sgsn/gtphub.h R include/osmocom/sgsn/oap_client.h R include/osmocom/sgsn/rest_octets.h R include/osmocom/sgsn/sgsn.h R include/osmocom/sgsn/signal.h R include/osmocom/sgsn/slhc.h R include/osmocom/sgsn/v42bis.h R include/osmocom/sgsn/v42bis_private.h R include/osmocom/sgsn/vty.h M src/gprs/crc24.c M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_tlli.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gb_parse.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_llc_xid.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_comp.c M src/gprs/gprs_sndcp_dcomp.c M src/gprs/gprs_sndcp_pcomp.c M src/gprs/gprs_sndcp_vty.c M src/gprs/gprs_sndcp_xid.c M src/gprs/gprs_subscriber.c M src/gprs/gprs_utils.c M src/gprs/gsup_client.c M src/gprs/gtphub.c M src/gprs/gtphub_ares.c M src/gprs/gtphub_main.c M src/gprs/gtphub_sock.c M src/gprs/gtphub_vty.c M src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_auth.c M src/gprs/sgsn_cdr.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/gprs/slhc.c M src/gprs/v42bis.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libcommon/oap_client.c M src/libcommon/socket.c M tests/gbproxy/gbproxy_test.c M tests/gprs/gprs_test.c M tests/gtphub/gtphub_test.c M tests/oap/oap_client_test.c M tests/sgsn/sgsn_test.c M tests/slhc/slhc_test.c M tests/sndcp_xid/sndcp_xid_test.c M tests/v42bis/v42bis_test.c M tests/xid/xid_test.c 87 files changed, 268 insertions(+), 264 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/10/3810/1 diff --git a/configure.ac b/configure.ac index f1167d6..5ded61f 100644 --- a/configure.ac +++ b/configure.ac @@ -179,8 +179,9 @@ AC_OUTPUT( osmo-sgsn.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/sgsn/Makefile src/Makefile src/gprs/Makefile tests/Makefile diff --git a/debian/copyright b/debian/copyright index b58117e..1f7f6fd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -78,22 +78,22 @@ doc/osmo-nitb-data_structures.dot doc/paging.txt include/Makefile.am - include/openbsc/Makefile.am - include/openbsc/common.h - include/openbsc/crc24.h - include/openbsc/debug.h - include/openbsc/gb_proxy.h - include/openbsc/gprs_gb_parse.h - include/openbsc/gprs_gmm.h - include/openbsc/gprs_llc.h - include/openbsc/gprs_sgsn.h - include/openbsc/gprs_sndcp.h - include/openbsc/gprs_subscriber.h - include/openbsc/rest_octets.h - include/openbsc/sgsn.h - include/openbsc/vty.h + include/osmocom/sgsn/Makefile.am + include/osmocom/sgsn/common.h + include/osmocom/sgsn/crc24.h + include/osmocom/sgsn/debug.h + include/osmocom/sgsn/gb_proxy.h + include/osmocom/sgsn/gprs_gb_parse.h + include/osmocom/sgsn/gprs_gmm.h + include/osmocom/sgsn/gprs_llc.h + include/osmocom/sgsn/gprs_sgsn.h + include/osmocom/sgsn/gprs_sndcp.h + include/osmocom/sgsn/gprs_subscriber.h + include/osmocom/sgsn/rest_octets.h + include/osmocom/sgsn/sgsn.h + include/osmocom/sgsn/vty.h m4/README - openbsc.pc.in + osmo-sgsn.pc.in src/Makefile.am src/gprs/.gitignore src/gprs/Makefile.am @@ -130,17 +130,17 @@ Copyright: __NO_COPYRIGHT_NOR_LICENSE__ License: __NO_COPYRIGHT_NOR_LICENSE__ -Files: include/openbsc/a_reset.h - include/openbsc/gprs_llc_xid.h - include/openbsc/gprs_sndcp_comp.h - include/openbsc/gprs_sndcp_dcomp.h - include/openbsc/gprs_sndcp_pcomp.h - include/openbsc/gprs_sndcp_xid.h - include/openbsc/gprs_utils.h - include/openbsc/gsup_client.h - include/openbsc/gtphub.h - include/openbsc/oap_client.h - include/openbsc/signal.h +Files: include/osmocom/sgsn/a_reset.h + include/osmocom/sgsn/gprs_llc_xid.h + include/osmocom/sgsn/gprs_sndcp_comp.h + include/osmocom/sgsn/gprs_sndcp_dcomp.h + include/osmocom/sgsn/gprs_sndcp_pcomp.h + include/osmocom/sgsn/gprs_sndcp_xid.h + include/osmocom/sgsn/gprs_utils.h + include/osmocom/sgsn/gsup_client.h + include/osmocom/sgsn/gtphub.h + include/osmocom/sgsn/oap_client.h + include/osmocom/sgsn/signal.h src/gprs/crc24.c src/gprs/gb_proxy.c src/gprs/gb_proxy_main.c @@ -223,8 +223,8 @@ 2015 sysmocom s.f.m.c. GmbH License: __NO_LICENSE__ -Files: include/openbsc/v42bis.h - include/openbsc/v42bis_private.h +Files: include/osmocom/sgsn/v42bis.h + include/osmocom/sgsn/v42bis_private.h Copyright: 2005-2011 Steve Underwood License: LGPL-2.1 This program is free software; you can redistribute it and/or modify @@ -367,7 +367,7 @@ On Debian systems, the complete text of the GNU Lesser General Public License Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. -Files: include/openbsc/slhc.h +Files: include/osmocom/sgsn/slhc.h Copyright: 1989 Regents of the University of California. License: __UNKNOWN__ Redistribution and use in source and binary forms are permitted diff --git a/include/Makefile.am b/include/Makefile.am index 677eec3..9d963a0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,3 +1,3 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..09db97a --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + sgsn \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/sgsn/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/sgsn/Makefile.am diff --git a/include/openbsc/common.h b/include/osmocom/sgsn/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/sgsn/common.h diff --git a/include/openbsc/crc24.h b/include/osmocom/sgsn/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/sgsn/crc24.h diff --git a/include/openbsc/debug.h b/include/osmocom/sgsn/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/sgsn/debug.h diff --git a/include/openbsc/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h similarity index 100% rename from include/openbsc/gb_proxy.h rename to include/osmocom/sgsn/gb_proxy.h diff --git a/include/openbsc/gprs_gb_parse.h b/include/osmocom/sgsn/gprs_gb_parse.h similarity index 97% rename from include/openbsc/gprs_gb_parse.h rename to include/osmocom/sgsn/gprs_gb_parse.h index 2468392..9f43fae 100644 --- a/include/openbsc/gprs_gb_parse.h +++ b/include/osmocom/sgsn/gprs_gb_parse.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include diff --git a/include/openbsc/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h similarity index 96% rename from include/openbsc/gprs_gmm.h rename to include/osmocom/sgsn/gprs_gmm.h index c38e49f..6324c5d 100644 --- a/include/openbsc/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -2,7 +2,7 @@ #define _GPRS_GMM_H #include -#include +#include #include diff --git a/include/openbsc/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h similarity index 98% rename from include/openbsc/gprs_llc.h rename to include/osmocom/sgsn/gprs_llc.h index 8bc2267..376ae9a 100644 --- a/include/openbsc/gprs_llc.h +++ b/include/osmocom/sgsn/gprs_llc.h @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include /* Section 4.7 LLC Layer Structure */ enum gprs_llc_sapi { diff --git a/include/openbsc/gprs_llc_xid.h b/include/osmocom/sgsn/gprs_llc_xid.h similarity index 100% rename from include/openbsc/gprs_llc_xid.h rename to include/osmocom/sgsn/gprs_llc_xid.h diff --git a/include/openbsc/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h similarity index 100% rename from include/openbsc/gprs_sgsn.h rename to include/osmocom/sgsn/gprs_sgsn.h diff --git a/include/openbsc/gprs_sndcp.h b/include/osmocom/sgsn/gprs_sndcp.h similarity index 100% rename from include/openbsc/gprs_sndcp.h rename to include/osmocom/sgsn/gprs_sndcp.h diff --git a/include/openbsc/gprs_sndcp_comp.h b/include/osmocom/sgsn/gprs_sndcp_comp.h similarity index 98% rename from include/openbsc/gprs_sndcp_comp.h rename to include/osmocom/sgsn/gprs_sndcp_comp.h index 87ab638..c04f7d4 100644 --- a/include/openbsc/gprs_sndcp_comp.h +++ b/include/osmocom/sgsn/gprs_sndcp_comp.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* Header / Data compression entity */ struct gprs_sndcp_comp { diff --git a/include/openbsc/gprs_sndcp_dcomp.h b/include/osmocom/sgsn/gprs_sndcp_dcomp.h similarity index 97% rename from include/openbsc/gprs_sndcp_dcomp.h rename to include/osmocom/sgsn/gprs_sndcp_dcomp.h index a76b4a4..3e85142 100644 --- a/include/openbsc/gprs_sndcp_dcomp.h +++ b/include/osmocom/sgsn/gprs_sndcp_dcomp.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* Note: The decompressed packet may have a maximum size of: * Return value * MAX_DATADECOMPR_FAC */ diff --git a/include/openbsc/gprs_sndcp_pcomp.h b/include/osmocom/sgsn/gprs_sndcp_pcomp.h similarity index 97% rename from include/openbsc/gprs_sndcp_pcomp.h rename to include/osmocom/sgsn/gprs_sndcp_pcomp.h index 4e15b9b..3e3131b 100644 --- a/include/openbsc/gprs_sndcp_pcomp.h +++ b/include/osmocom/sgsn/gprs_sndcp_pcomp.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* Note: The decompressed packet may have a maximum size of: * Return value + MAX_DECOMPR_INCR */ diff --git a/include/openbsc/gprs_sndcp_xid.h b/include/osmocom/sgsn/gprs_sndcp_xid.h similarity index 100% rename from include/openbsc/gprs_sndcp_xid.h rename to include/osmocom/sgsn/gprs_sndcp_xid.h diff --git a/include/openbsc/gprs_subscriber.h b/include/osmocom/sgsn/gprs_subscriber.h similarity index 100% rename from include/openbsc/gprs_subscriber.h rename to include/osmocom/sgsn/gprs_subscriber.h diff --git a/include/openbsc/gprs_utils.h b/include/osmocom/sgsn/gprs_utils.h similarity index 100% rename from include/openbsc/gprs_utils.h rename to include/osmocom/sgsn/gprs_utils.h diff --git a/include/openbsc/gsup_client.h b/include/osmocom/sgsn/gsup_client.h similarity index 97% rename from include/openbsc/gsup_client.h rename to include/osmocom/sgsn/gsup_client.h index 4a25490..29092ad 100644 --- a/include/openbsc/gsup_client.h +++ b/include/osmocom/sgsn/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 diff --git a/include/openbsc/gtphub.h b/include/osmocom/sgsn/gtphub.h similarity index 99% rename from include/openbsc/gtphub.h rename to include/osmocom/sgsn/gtphub.h index 9cb7605..8fd9f38 100644 --- a/include/openbsc/gtphub.h +++ b/include/osmocom/sgsn/gtphub.h @@ -28,7 +28,7 @@ #include #include -#include +#include /* support */ diff --git a/include/openbsc/oap_client.h b/include/osmocom/sgsn/oap_client.h similarity index 100% rename from include/openbsc/oap_client.h rename to include/osmocom/sgsn/oap_client.h diff --git a/include/openbsc/rest_octets.h b/include/osmocom/sgsn/rest_octets.h similarity index 98% rename from include/openbsc/rest_octets.h rename to include/osmocom/sgsn/rest_octets.h index 49a2312..0dbe7ae 100644 --- a/include/openbsc/rest_octets.h +++ b/include/osmocom/sgsn/rest_octets.h @@ -2,7 +2,7 @@ #define _REST_OCTETS_H #include -#include +#include #include /* generate SI1 rest octets */ diff --git a/include/openbsc/sgsn.h b/include/osmocom/sgsn/sgsn.h similarity index 97% rename from include/openbsc/sgsn.h rename to include/osmocom/sgsn/sgsn.h index f371dc6..e4eda17 100644 --- a/include/openbsc/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -5,9 +5,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/signal.h b/include/osmocom/sgsn/signal.h similarity index 100% rename from include/openbsc/signal.h rename to include/osmocom/sgsn/signal.h diff --git a/include/openbsc/slhc.h b/include/osmocom/sgsn/slhc.h similarity index 100% rename from include/openbsc/slhc.h rename to include/osmocom/sgsn/slhc.h diff --git a/include/openbsc/v42bis.h b/include/osmocom/sgsn/v42bis.h similarity index 100% rename from include/openbsc/v42bis.h rename to include/osmocom/sgsn/v42bis.h diff --git a/include/openbsc/v42bis_private.h b/include/osmocom/sgsn/v42bis_private.h similarity index 100% rename from include/openbsc/v42bis_private.h rename to include/osmocom/sgsn/v42bis_private.h diff --git a/include/openbsc/vty.h b/include/osmocom/sgsn/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/sgsn/vty.h diff --git a/src/gprs/crc24.c b/src/gprs/crc24.c index 1a420ed..da269b3 100644 --- a/src/gprs/crc24.c +++ b/src/gprs/crc24.c @@ -19,7 +19,7 @@ * */ -#include +#include /* CRC24 table - FCS */ static const uint32_t tbl_crc24[256] = { diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index d288cb3..eb2bbcc 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -41,14 +41,14 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include -#include +#include #include diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c index 853a763..9f9c605 100644 --- a/src/gprs/gb_proxy_main.c +++ b/src/gprs/gb_proxy_main.c @@ -41,10 +41,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index bee3150..4862755 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -18,12 +18,12 @@ * */ -#include +#include -#include -#include +#include +#include -#include +#include #include #include diff --git a/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c index a83630b..69cce3a 100644 --- a/src/gprs/gb_proxy_peer.c +++ b/src/gprs/gb_proxy_peer.c @@ -20,9 +20,9 @@ * */ -#include +#include -#include +#include #include #include diff --git a/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c index 3b3b976..1832122 100644 --- a/src/gprs/gb_proxy_tlli.c +++ b/src/gprs/gb_proxy_tlli.c @@ -20,12 +20,12 @@ #include -#include +#include -#include -#include +#include +#include -#include +#include #include diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c index bd5bb1b..156f337 100644 --- a/src/gprs/gb_proxy_vty.c +++ b/src/gprs/gb_proxy_vty.c @@ -31,10 +31,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c index d5a122b..ba78e89 100644 --- a/src/gprs/gprs_gb_parse.c +++ b/src/gprs/gprs_gb_parse.c @@ -21,11 +21,11 @@ #include #include -#include +#include -#include +#include -#include +#include #include diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7301bf1..7e109b4 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -54,15 +54,15 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 904ec7e..22743fe 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -33,15 +33,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static struct gprs_llc_llme *llme_alloc(uint32_t tlli); static int gprs_llc_tx_xid(struct gprs_llc_lle *lle, struct msgb *msg, diff --git a/src/gprs/gprs_llc_parse.c b/src/gprs/gprs_llc_parse.c index be63497..1d97004 100644 --- a/src/gprs/gprs_llc_parse.c +++ b/src/gprs/gprs_llc_parse.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static const struct value_string llc_cmd_strs[] = { { GPRS_LLC_NULL, "NULL" }, diff --git a/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c index 626d6ef..1433efe 100644 --- a/src/gprs/gprs_llc_vty.c +++ b/src/gprs/gprs_llc_vty.c @@ -32,9 +32,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c index fe63171..de60e49 100644 --- a/src/gprs/gprs_llc_xid.c +++ b/src/gprs/gprs_llc_xid.c @@ -30,10 +30,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include const struct value_string gprs_llc_xid_type_names[] = { { GPRS_LLC_XID_T_VERSION, "VERSION"}, diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 560485d..4cd3df1 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -33,14 +33,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include "openbsc/gprs_llc.h" +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c index 05dad66..77f8ca6 100644 --- a/src/gprs/gprs_sndcp.c +++ b/src/gprs/gprs_sndcp.c @@ -30,15 +30,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define DEBUG_IP_PACKETS 0 /* 0=Disabled, 1=Enabled */ diff --git a/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c index a12c39a..60b15b9 100644 --- a/src/gprs/gprs_sndcp_comp.c +++ b/src/gprs/gprs_sndcp_comp.c @@ -30,11 +30,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Create a new compression entity from a XID-Field */ static struct gprs_sndcp_comp *gprs_sndcp_comp_create(const void *ctx, diff --git a/src/gprs/gprs_sndcp_dcomp.c b/src/gprs/gprs_sndcp_dcomp.c index b0f95b4..04ff491 100644 --- a/src/gprs/gprs_sndcp_dcomp.c +++ b/src/gprs/gprs_sndcp_dcomp.c @@ -33,14 +33,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /* A struct to capture the output data of compressor and decompressor */ struct v42bis_output_buffer { diff --git a/src/gprs/gprs_sndcp_pcomp.c b/src/gprs/gprs_sndcp_pcomp.c index a2236c3..2911b5e 100644 --- a/src/gprs/gprs_sndcp_pcomp.c +++ b/src/gprs/gprs_sndcp_pcomp.c @@ -33,13 +33,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* Initalize header compression */ int gprs_sndcp_pcomp_init(const void *ctx, struct gprs_sndcp_comp *comp_entity, diff --git a/src/gprs/gprs_sndcp_vty.c b/src/gprs/gprs_sndcp_vty.c index 4bad8b0..0994a4c 100644 --- a/src/gprs/gprs_sndcp_vty.c +++ b/src/gprs/gprs_sndcp_vty.c @@ -31,10 +31,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/gprs_sndcp_xid.c b/src/gprs/gprs_sndcp_xid.c index dfea5fe..8f844b5 100644 --- a/src/gprs/gprs_sndcp_xid.c +++ b/src/gprs/gprs_sndcp_xid.c @@ -31,10 +31,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include /* When the propose bit in an SNDCP-XID compression field is set to zero, * the algorithm identifier is stripped. The algoritm parameters are specific diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 94297d0..bebdb1e 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -25,15 +25,15 @@ #include #include #include -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include #include diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c index 91a09d2..307699b 100644 --- a/src/gprs/gprs_utils.c +++ b/src/gprs/gprs_utils.c @@ -19,7 +19,7 @@ * along with this program. If not, see . * */ -#include +#include #include #include diff --git a/src/gprs/gsup_client.c b/src/gprs/gsup_client.c index 258f230..48357b4 100644 --- a/src/gprs/gsup_client.c +++ b/src/gprs/gsup_client.c @@ -21,14 +21,14 @@ * */ -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 0a8e375..7e3e663 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -32,9 +32,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/gprs/gtphub_ares.c b/src/gprs/gtphub_ares.c index afeeda6..87dc860 100644 --- a/src/gprs/gtphub_ares.c +++ b/src/gprs/gtphub_ares.c @@ -28,15 +28,15 @@ #include #include -#include -#include +#include +#include #include #include /* TODO split GRX ares from sgsn into a separate struct and allow use without * globals. */ -#include +#include extern struct sgsn_instance *sgsn; struct sgsn_instance sgsn_inst = { 0 }; diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index d7b3ba7..782afb3 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -41,9 +41,9 @@ #include -#include -#include -#include +#include +#include +#include #include "../../bscconfig.h" diff --git a/src/gprs/gtphub_sock.c b/src/gprs/gtphub_sock.c index 60bebaa..1acd5a6 100644 --- a/src/gprs/gtphub_sock.c +++ b/src/gprs/gtphub_sock.c @@ -25,8 +25,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include /* Convenience makro, note: only within this C file. */ #define LOG(level, fmt, args...) \ diff --git a/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c index d611b1f..3a46e81 100644 --- a/src/gprs/gtphub_vty.c +++ b/src/gprs/gtphub_vty.c @@ -30,12 +30,12 @@ #include #include -#include -#include +#include +#include /* TODO split GRX ares from sgsn into a separate struct and allow use without * globals. */ -#include +#include extern struct sgsn_instance *sgsn; extern void *tall_bsc_ctx; diff --git a/src/gprs/oap_client.c b/src/gprs/oap_client.c index 5128ac1..9ff84a6 100644 --- a/src/gprs/oap_client.c +++ b/src/gprs/oap_client.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include int oap_client_init(struct oap_client_config *config, struct oap_client_state *state) diff --git a/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c index 6238099..17567c4 100644 --- a/src/gprs/sgsn_ares.c +++ b/src/gprs/sgsn_ares.c @@ -19,8 +19,8 @@ * */ -#include -#include +#include +#include #include diff --git a/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c index a64339c..92712ef 100644 --- a/src/gprs/sgsn_auth.c +++ b/src/gprs/sgsn_auth.c @@ -21,11 +21,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include const struct value_string auth_state_names[] = { { SGSN_AUTH_ACCEPTED, "accepted"}, diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c index 16ea9d4..474d41a 100644 --- a/src/gprs/sgsn_cdr.c +++ b/src/gprs/sgsn_cdr.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include diff --git a/src/gprs/sgsn_ctrl.c b/src/gprs/sgsn_ctrl.c index f7b1180..dc5ae79 100644 --- a/src/gprs/sgsn_ctrl.c +++ b/src/gprs/sgsn_ctrl.c @@ -21,9 +21,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 90b4d16..9a00266 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -42,14 +42,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef BUILD_IU #include diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 8ffc6c8..d79beb3 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -52,12 +52,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index fce2518..1882852 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -30,12 +30,12 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include @@ -657,7 +657,7 @@ } /* Subscriber */ -#include +#include static void subscr_dump_full_vty(struct vty *vty, struct gprs_subscr *gsub, int pending) { diff --git a/src/gprs/slhc.c b/src/gprs/slhc.c index cbdf8db..20e571d 100644 --- a/src/gprs/slhc.c +++ b/src/gprs/slhc.c @@ -57,8 +57,8 @@ #include #include #include -#include -#include +#include +#include #define ERR_PTR(x) x diff --git a/src/gprs/v42bis.c b/src/gprs/v42bis.c index a04b0af..3bb9afc 100644 --- a/src/gprs/v42bis.c +++ b/src/gprs/v42bis.c @@ -38,9 +38,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 856583e..ac3c7fc 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,11 +23,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..6076409 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7be2240..a2837f3 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..8d5f990 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index 018ed21..2a8a59f 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index fd65e7b..89a9f70 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -21,14 +21,14 @@ * */ -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index b6a8d6b..cc0f58b 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include static struct gsup_client *g_gc; diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c index 5128ac1..9ff84a6 100644 --- a/src/libcommon/oap_client.c +++ b/src/libcommon/oap_client.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include int oap_client_init(struct oap_client_config *config, struct oap_client_state *state) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..dfcb393 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index 9672dcb..e8a4ef9 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -31,11 +31,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index aac9bb8..2dcbafa 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -2,10 +2,10 @@ #include #include -#include -#include +#include +#include -#include +#include #include #include diff --git a/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c index e7c27d2..ac0223b 100644 --- a/tests/gtphub/gtphub_test.c +++ b/tests/gtphub/gtphub_test.c @@ -28,9 +28,9 @@ #include #include -#include +#include -#include +#include #include #include diff --git a/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c index e6501cb..7adae83 100644 --- a/tests/oap/oap_client_test.c +++ b/tests/oap/oap_client_test.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index d66c5dd..a486794 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -19,15 +19,15 @@ * */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include diff --git a/tests/slhc/slhc_test.c b/tests/slhc/slhc_test.c index d2e1cd9..bb0e26c 100644 --- a/tests/slhc/slhc_test.c +++ b/tests/slhc/slhc_test.c @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include #include diff --git a/tests/sndcp_xid/sndcp_xid_test.c b/tests/sndcp_xid/sndcp_xid_test.c index 151dd2b..dc6da82 100644 --- a/tests/sndcp_xid/sndcp_xid_test.c +++ b/tests/sndcp_xid/sndcp_xid_test.c @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include #include diff --git a/tests/v42bis/v42bis_test.c b/tests/v42bis/v42bis_test.c index 7e90785..41d23b0 100644 --- a/tests/v42bis/v42bis_test.c +++ b/tests/v42bis/v42bis_test.c @@ -19,9 +19,9 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/xid/xid_test.c b/tests/xid/xid_test.c index b77a4ae..e30a14f 100644 --- a/tests/xid/xid_test.c +++ b/tests/xid/xid_test.c @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/3810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I281ef585fffc2644682c8282224fb1c2da5ca795 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:33:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 13:33:53 +0000 Subject: [PATCH] osmo-msc[master]: rename include/openbsc to include/osmocom/msc Message-ID: Review at https://gerrit.osmocom.org/3811 rename include/openbsc to include/osmocom/msc Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 --- M configure.ac M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/msc/Makefile.am R include/osmocom/msc/a_iface.h R include/osmocom/msc/a_iface_bssap.h R include/osmocom/msc/a_reset.h R include/osmocom/msc/abis_nm.h R include/osmocom/msc/abis_om2000.h R include/osmocom/msc/abis_rsl.h R include/osmocom/msc/arfcn_range_encode.h R include/osmocom/msc/auth.h R include/osmocom/msc/bsc_api.h R include/osmocom/msc/bsc_msc.h R include/osmocom/msc/bsc_msc_data.h R include/osmocom/msc/bsc_msg_filter.h R include/osmocom/msc/bsc_rll.h R include/osmocom/msc/bss.h R include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h R include/osmocom/msc/chan_alloc.h R include/osmocom/msc/common.h R include/osmocom/msc/common_bsc.h R include/osmocom/msc/common_cs.h R include/osmocom/msc/crc24.h R include/osmocom/msc/ctrl.h R include/osmocom/msc/db.h R include/osmocom/msc/debug.h R include/osmocom/msc/e1_config.h R include/osmocom/msc/gsm_04_08.h R include/osmocom/msc/gsm_04_11.h R include/osmocom/msc/gsm_04_14.h R include/osmocom/msc/gsm_04_80.h R include/osmocom/msc/gsm_data.h R include/osmocom/msc/gsm_data_shared.h R include/osmocom/msc/gsm_subscriber.h R include/osmocom/msc/gsup_client.h R include/osmocom/msc/gtphub.h R include/osmocom/msc/handover.h R include/osmocom/msc/handover_decision.h R include/osmocom/msc/ipaccess.h R include/osmocom/msc/iu_dummy.h R include/osmocom/msc/iucs.h R include/osmocom/msc/iucs_ranap.h R include/osmocom/msc/meas_feed.h R include/osmocom/msc/meas_rep.h R include/osmocom/msc/misdn.h R include/osmocom/msc/mncc.h R include/osmocom/msc/mncc_int.h R include/osmocom/msc/msc_ifaces.h R include/osmocom/msc/network_listen.h R include/osmocom/msc/oap_client.h R include/osmocom/msc/openbscdefines.h R include/osmocom/msc/osmo_bsc.h R include/osmocom/msc/osmo_bsc_grace.h R include/osmocom/msc/osmo_bsc_reset.h R include/osmocom/msc/osmo_bsc_rf.h R include/osmocom/msc/osmo_bsc_sigtran.h R include/osmocom/msc/osmo_msc.h R include/osmocom/msc/osmux.h R include/osmocom/msc/paging.h R include/osmocom/msc/rest_octets.h R include/osmocom/msc/rrlp.h R include/osmocom/msc/rs232.h R include/osmocom/msc/rtp_proxy.h R include/osmocom/msc/signal.h R include/osmocom/msc/silent_call.h R include/osmocom/msc/slhc.h R include/osmocom/msc/smpp.h R include/osmocom/msc/sms_queue.h R include/osmocom/msc/socket.h R include/osmocom/msc/system_information.h R include/osmocom/msc/transaction.h R include/osmocom/msc/trau_mux.h R include/osmocom/msc/trau_upqueue.h R include/osmocom/msc/ussd.h R include/osmocom/msc/vlr.h R include/osmocom/msc/vty.h M src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libcommon/oap_client.c M src/libcommon/socket.c M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/meas_feed.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c M src/libmsc/mncc_sock.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.c M src/libmsc/smpp_utils.c M src/libmsc/smpp_vty.c M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_auth_fsm.c M src/libvlr/vlr_core.h M src/libvlr/vlr_lu_fsm.c M src/osmo-msc/msc_main.c M src/utils/meas_db.c M src/utils/meas_json.c M src/utils/meas_pcap2db.c M src/utils/meas_udp2db.c M src/utils/meas_vis.c M src/utils/smpp_mirror.c M tests/db/db_test.c M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp/smpp_test.c M tests/sms_queue/sms_queue_test.c 137 files changed, 349 insertions(+), 345 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/3811/1 diff --git a/configure.ac b/configure.ac index 0549ed3..4e27a14 100644 --- a/configure.ac +++ b/configure.ac @@ -177,8 +177,9 @@ AC_OUTPUT( osmo-msc.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/msc/Makefile src/Makefile src/libmsc/Makefile src/libvlr/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 677eec3..9d963a0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,3 +1,3 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..4d80637 --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + msc \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/msc/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/msc/Makefile.am diff --git a/include/openbsc/a_iface.h b/include/osmocom/msc/a_iface.h similarity index 98% rename from include/openbsc/a_iface.h rename to include/osmocom/msc/a_iface.h index 149f1c7..a49ede2 100644 --- a/include/openbsc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -20,7 +20,7 @@ #pragma once -#include +#include /* A struct to keep a context information about the BSCs we are associated with */ struct bsc_context { diff --git a/include/openbsc/a_iface_bssap.h b/include/osmocom/msc/a_iface_bssap.h similarity index 100% rename from include/openbsc/a_iface_bssap.h rename to include/osmocom/msc/a_iface_bssap.h diff --git a/include/openbsc/a_reset.h b/include/osmocom/msc/a_reset.h similarity index 100% rename from include/openbsc/a_reset.h rename to include/osmocom/msc/a_reset.h diff --git a/include/openbsc/abis_nm.h b/include/osmocom/msc/abis_nm.h similarity index 99% rename from include/openbsc/abis_nm.h rename to include/osmocom/msc/abis_nm.h index db2a659..2581962 100644 --- a/include/openbsc/abis_nm.h +++ b/include/osmocom/msc/abis_nm.h @@ -26,7 +26,7 @@ #include #include -#include +#include /* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ #define MAX_BTS_ATTR 5 diff --git a/include/openbsc/abis_om2000.h b/include/osmocom/msc/abis_om2000.h similarity index 100% rename from include/openbsc/abis_om2000.h rename to include/osmocom/msc/abis_om2000.h diff --git a/include/openbsc/abis_rsl.h b/include/osmocom/msc/abis_rsl.h similarity index 100% rename from include/openbsc/abis_rsl.h rename to include/osmocom/msc/abis_rsl.h diff --git a/include/openbsc/arfcn_range_encode.h b/include/osmocom/msc/arfcn_range_encode.h similarity index 100% rename from include/openbsc/arfcn_range_encode.h rename to include/osmocom/msc/arfcn_range_encode.h diff --git a/include/openbsc/auth.h b/include/osmocom/msc/auth.h similarity index 100% rename from include/openbsc/auth.h rename to include/osmocom/msc/auth.h diff --git a/include/openbsc/bsc_api.h b/include/osmocom/msc/bsc_api.h similarity index 100% rename from include/openbsc/bsc_api.h rename to include/osmocom/msc/bsc_api.h diff --git a/include/openbsc/bsc_msc.h b/include/osmocom/msc/bsc_msc.h similarity index 98% rename from include/openbsc/bsc_msc.h rename to include/osmocom/msc/bsc_msc.h index 380eb17..d649f76 100644 --- a/include/openbsc/bsc_msc.h +++ b/include/osmocom/msc/bsc_msc.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/include/openbsc/bsc_msc_data.h b/include/osmocom/msc/bsc_msc_data.h similarity index 100% rename from include/openbsc/bsc_msc_data.h rename to include/osmocom/msc/bsc_msc_data.h diff --git a/include/openbsc/bsc_msg_filter.h b/include/osmocom/msc/bsc_msg_filter.h similarity index 100% rename from include/openbsc/bsc_msg_filter.h rename to include/osmocom/msc/bsc_msg_filter.h diff --git a/include/openbsc/bsc_rll.h b/include/osmocom/msc/bsc_rll.h similarity index 92% rename from include/openbsc/bsc_rll.h rename to include/osmocom/msc/bsc_rll.h index 729ba60..93c80e7 100644 --- a/include/openbsc/bsc_rll.h +++ b/include/osmocom/msc/bsc_rll.h @@ -1,7 +1,7 @@ #ifndef _BSC_RLL_H #define _BSC_RLL_H -#include +#include enum bsc_rllr_ind { BSC_RLLR_IND_EST_CONF, diff --git a/include/openbsc/bss.h b/include/osmocom/msc/bss.h similarity index 93% rename from include/openbsc/bss.h rename to include/osmocom/msc/bss.h index 9f16bf7..0904334 100644 --- a/include/openbsc/bss.h +++ b/include/osmocom/msc/bss.h @@ -1,7 +1,7 @@ #ifndef _BSS_H_ #define _BSS_H_ -#include +#include struct msgb; diff --git a/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h diff --git a/include/openbsc/chan_alloc.h b/include/osmocom/msc/chan_alloc.h similarity index 100% rename from include/openbsc/chan_alloc.h rename to include/osmocom/msc/chan_alloc.h diff --git a/include/openbsc/common.h b/include/osmocom/msc/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/msc/common.h diff --git a/include/openbsc/common_bsc.h b/include/osmocom/msc/common_bsc.h similarity index 83% rename from include/openbsc/common_bsc.h rename to include/osmocom/msc/common_bsc.h index 7960383..821298c 100644 --- a/include/openbsc/common_bsc.h +++ b/include/osmocom/msc/common_bsc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/include/openbsc/common_cs.h b/include/osmocom/msc/common_cs.h similarity index 100% rename from include/openbsc/common_cs.h rename to include/osmocom/msc/common_cs.h diff --git a/include/openbsc/crc24.h b/include/osmocom/msc/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/msc/crc24.h diff --git a/include/openbsc/ctrl.h b/include/osmocom/msc/ctrl.h similarity index 100% rename from include/openbsc/ctrl.h rename to include/osmocom/msc/ctrl.h diff --git a/include/openbsc/db.h b/include/osmocom/msc/db.h similarity index 100% rename from include/openbsc/db.h rename to include/osmocom/msc/db.h diff --git a/include/openbsc/debug.h b/include/osmocom/msc/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/msc/debug.h diff --git a/include/openbsc/e1_config.h b/include/osmocom/msc/e1_config.h similarity index 83% rename from include/openbsc/e1_config.h rename to include/osmocom/msc/e1_config.h index 538c0b0..ac5fbb1 100644 --- a/include/openbsc/e1_config.h +++ b/include/osmocom/msc/e1_config.h @@ -1,7 +1,7 @@ #ifndef _E1_CONFIG_H #define _E1_CONFIG_H -#include +#include int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); int e1_reconfig_trx(struct gsm_bts_trx *trx); diff --git a/include/openbsc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h similarity index 98% rename from include/openbsc/gsm_04_08.h rename to include/osmocom/msc/gsm_04_08.h index ca251b0..c99fc86 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -5,7 +5,7 @@ #include #include -#include +#include struct msgb; struct gsm_bts; diff --git a/include/openbsc/gsm_04_11.h b/include/osmocom/msc/gsm_04_11.h similarity index 100% rename from include/openbsc/gsm_04_11.h rename to include/osmocom/msc/gsm_04_11.h diff --git a/include/openbsc/gsm_04_14.h b/include/osmocom/msc/gsm_04_14.h similarity index 100% rename from include/openbsc/gsm_04_14.h rename to include/osmocom/msc/gsm_04_14.h diff --git a/include/openbsc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h similarity index 100% rename from include/openbsc/gsm_04_80.h rename to include/osmocom/msc/gsm_04_80.h diff --git a/include/openbsc/gsm_data.h b/include/osmocom/msc/gsm_data.h similarity index 99% rename from include/openbsc/gsm_data.h rename to include/osmocom/msc/gsm_data.h index 205ab6c..5d3d5ca 100644 --- a/include/openbsc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -14,9 +14,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h similarity index 99% rename from include/openbsc/gsm_data_shared.h rename to include/osmocom/msc/gsm_data_shared.h index bed46d2..5028a26 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -24,7 +24,7 @@ #include #endif -#include +#include /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ diff --git a/include/openbsc/gsm_subscriber.h b/include/osmocom/msc/gsm_subscriber.h similarity index 97% rename from include/openbsc/gsm_subscriber.h rename to include/osmocom/msc/gsm_subscriber.h index d88e32a..6b0e3da 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/osmocom/msc/gsm_subscriber.h @@ -6,7 +6,7 @@ #include #include -#include +#include #define GSM_NAME_LENGTH 160 diff --git a/include/openbsc/gsup_client.h b/include/osmocom/msc/gsup_client.h similarity index 97% rename from include/openbsc/gsup_client.h rename to include/osmocom/msc/gsup_client.h index 4a25490..3d1dce0 100644 --- a/include/openbsc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 diff --git a/include/openbsc/gtphub.h b/include/osmocom/msc/gtphub.h similarity index 99% rename from include/openbsc/gtphub.h rename to include/osmocom/msc/gtphub.h index 9cb7605..d7b6f1b 100644 --- a/include/openbsc/gtphub.h +++ b/include/osmocom/msc/gtphub.h @@ -28,7 +28,7 @@ #include #include -#include +#include /* support */ diff --git a/include/openbsc/handover.h b/include/osmocom/msc/handover.h similarity index 100% rename from include/openbsc/handover.h rename to include/osmocom/msc/handover.h diff --git a/include/openbsc/handover_decision.h b/include/osmocom/msc/handover_decision.h similarity index 100% rename from include/openbsc/handover_decision.h rename to include/osmocom/msc/handover_decision.h diff --git a/include/openbsc/ipaccess.h b/include/osmocom/msc/ipaccess.h similarity index 100% rename from include/openbsc/ipaccess.h rename to include/osmocom/msc/ipaccess.h diff --git a/include/openbsc/iu_dummy.h b/include/osmocom/msc/iu_dummy.h similarity index 100% rename from include/openbsc/iu_dummy.h rename to include/osmocom/msc/iu_dummy.h diff --git a/include/openbsc/iucs.h b/include/osmocom/msc/iucs.h similarity index 100% rename from include/openbsc/iucs.h rename to include/osmocom/msc/iucs.h diff --git a/include/openbsc/iucs_ranap.h b/include/osmocom/msc/iucs_ranap.h similarity index 100% rename from include/openbsc/iucs_ranap.h rename to include/osmocom/msc/iucs_ranap.h diff --git a/include/openbsc/meas_feed.h b/include/osmocom/msc/meas_feed.h similarity index 95% rename from include/openbsc/meas_feed.h rename to include/osmocom/msc/meas_feed.h index f77ee07..02b7d95 100644 --- a/include/openbsc/meas_feed.h +++ b/include/osmocom/msc/meas_feed.h @@ -3,7 +3,7 @@ #include -#include +#include struct meas_feed_hdr { uint8_t msg_type; diff --git a/include/openbsc/meas_rep.h b/include/osmocom/msc/meas_rep.h similarity index 100% rename from include/openbsc/meas_rep.h rename to include/osmocom/msc/meas_rep.h diff --git a/include/openbsc/misdn.h b/include/osmocom/msc/misdn.h similarity index 100% rename from include/openbsc/misdn.h rename to include/osmocom/msc/misdn.h diff --git a/include/openbsc/mncc.h b/include/osmocom/msc/mncc.h similarity index 100% rename from include/openbsc/mncc.h rename to include/osmocom/msc/mncc.h diff --git a/include/openbsc/mncc_int.h b/include/osmocom/msc/mncc_int.h similarity index 100% rename from include/openbsc/mncc_int.h rename to include/osmocom/msc/mncc_int.h diff --git a/include/openbsc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h similarity index 97% rename from include/openbsc/msc_ifaces.h rename to include/osmocom/msc/msc_ifaces.h index a1071ae..d46dfe9 100644 --- a/include/openbsc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/openbsc/network_listen.h b/include/osmocom/msc/network_listen.h similarity index 92% rename from include/openbsc/network_listen.h rename to include/osmocom/msc/network_listen.h index 67d1f4e..05fbb2f 100644 --- a/include/openbsc/network_listen.h +++ b/include/osmocom/msc/network_listen.h @@ -2,7 +2,7 @@ #define _OPENBSC_NWL_H #include -#include +#include void ipac_nwl_init(void); diff --git a/include/openbsc/oap_client.h b/include/osmocom/msc/oap_client.h similarity index 100% rename from include/openbsc/oap_client.h rename to include/osmocom/msc/oap_client.h diff --git a/include/openbsc/openbscdefines.h b/include/osmocom/msc/openbscdefines.h similarity index 100% rename from include/openbsc/openbscdefines.h rename to include/osmocom/msc/openbscdefines.h diff --git a/include/openbsc/osmo_bsc.h b/include/osmocom/msc/osmo_bsc.h similarity index 100% rename from include/openbsc/osmo_bsc.h rename to include/osmocom/msc/osmo_bsc.h diff --git a/include/openbsc/osmo_bsc_grace.h b/include/osmocom/msc/osmo_bsc_grace.h similarity index 94% rename from include/openbsc/osmo_bsc_grace.h rename to include/osmocom/msc/osmo_bsc_grace.h index 5a81cd1..6232ffd 100644 --- a/include/openbsc/osmo_bsc_grace.h +++ b/include/osmocom/msc/osmo_bsc_grace.h @@ -21,8 +21,8 @@ #ifndef OSMO_BSC_GRACE_H #define OSMO_BSC_GRACE_H -#include -#include +#include +#include struct bsc_msc_data; diff --git a/include/openbsc/osmo_bsc_reset.h b/include/osmocom/msc/osmo_bsc_reset.h similarity index 100% rename from include/openbsc/osmo_bsc_reset.h rename to include/osmocom/msc/osmo_bsc_reset.h diff --git a/include/openbsc/osmo_bsc_rf.h b/include/osmocom/msc/osmo_bsc_rf.h similarity index 97% rename from include/openbsc/osmo_bsc_rf.h rename to include/osmocom/msc/osmo_bsc_rf.h index 19ccd08..a81ebd7 100644 --- a/include/openbsc/osmo_bsc_rf.h +++ b/include/osmocom/msc/osmo_bsc_rf.h @@ -1,7 +1,7 @@ #ifndef OSMO_BSC_RF #define OSMO_BSC_RF -#include +#include #include #include diff --git a/include/openbsc/osmo_bsc_sigtran.h b/include/osmocom/msc/osmo_bsc_sigtran.h similarity index 95% rename from include/openbsc/osmo_bsc_sigtran.h rename to include/osmocom/msc/osmo_bsc_sigtran.h index fbcfcb3..7015edb 100644 --- a/include/openbsc/osmo_bsc_sigtran.h +++ b/include/osmocom/msc/osmo_bsc_sigtran.h @@ -20,8 +20,8 @@ #pragma once -#include -#include +#include +#include /* Allocate resources to make a new connection oriented sigtran connection * (not the connection ittself!) */ diff --git a/include/openbsc/osmo_msc.h b/include/osmocom/msc/osmo_msc.h similarity index 98% rename from include/openbsc/osmo_msc.h rename to include/osmocom/msc/osmo_msc.h index cdfd27f..5f4713e 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/osmocom/msc/osmo_msc.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "bsc_api.h" diff --git a/include/openbsc/osmux.h b/include/osmocom/msc/osmux.h similarity index 100% rename from include/openbsc/osmux.h rename to include/osmocom/msc/osmux.h diff --git a/include/openbsc/paging.h b/include/osmocom/msc/paging.h similarity index 98% rename from include/openbsc/paging.h rename to include/osmocom/msc/paging.h index 049da14..b856dcd 100644 --- a/include/openbsc/paging.h +++ b/include/osmocom/msc/paging.h @@ -26,7 +26,7 @@ #include #include -#include +#include /** * A pending paging request diff --git a/include/openbsc/rest_octets.h b/include/osmocom/msc/rest_octets.h similarity index 98% rename from include/openbsc/rest_octets.h rename to include/osmocom/msc/rest_octets.h index 49a2312..49857b7 100644 --- a/include/openbsc/rest_octets.h +++ b/include/osmocom/msc/rest_octets.h @@ -2,7 +2,7 @@ #define _REST_OCTETS_H #include -#include +#include #include /* generate SI1 rest octets */ diff --git a/include/openbsc/rrlp.h b/include/osmocom/msc/rrlp.h similarity index 100% rename from include/openbsc/rrlp.h rename to include/osmocom/msc/rrlp.h diff --git a/include/openbsc/rs232.h b/include/osmocom/msc/rs232.h similarity index 100% rename from include/openbsc/rs232.h rename to include/osmocom/msc/rs232.h diff --git a/include/openbsc/rtp_proxy.h b/include/osmocom/msc/rtp_proxy.h similarity index 98% rename from include/openbsc/rtp_proxy.h rename to include/osmocom/msc/rtp_proxy.h index 52ffefd..3cd8cac 100644 --- a/include/openbsc/rtp_proxy.h +++ b/include/osmocom/msc/rtp_proxy.h @@ -27,7 +27,7 @@ #include #include -#include +#include #define RTP_PT_GSM_FULL 3 #define RTP_PT_GSM_HALF 96 diff --git a/include/openbsc/signal.h b/include/osmocom/msc/signal.h similarity index 99% rename from include/openbsc/signal.h rename to include/osmocom/msc/signal.h index 49f86d6..14c76f8 100644 --- a/include/openbsc/signal.h +++ b/include/osmocom/msc/signal.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include diff --git a/include/openbsc/silent_call.h b/include/osmocom/msc/silent_call.h similarity index 100% rename from include/openbsc/silent_call.h rename to include/osmocom/msc/silent_call.h diff --git a/include/openbsc/slhc.h b/include/osmocom/msc/slhc.h similarity index 100% rename from include/openbsc/slhc.h rename to include/osmocom/msc/slhc.h diff --git a/include/openbsc/smpp.h b/include/osmocom/msc/smpp.h similarity index 100% rename from include/openbsc/smpp.h rename to include/osmocom/msc/smpp.h diff --git a/include/openbsc/sms_queue.h b/include/osmocom/msc/sms_queue.h similarity index 100% rename from include/openbsc/sms_queue.h rename to include/osmocom/msc/sms_queue.h diff --git a/include/openbsc/socket.h b/include/osmocom/msc/socket.h similarity index 100% rename from include/openbsc/socket.h rename to include/osmocom/msc/socket.h diff --git a/include/openbsc/system_information.h b/include/osmocom/msc/system_information.h similarity index 94% rename from include/openbsc/system_information.h rename to include/osmocom/msc/system_information.h index 71bea26..854b7e3 100644 --- a/include/openbsc/system_information.h +++ b/include/osmocom/msc/system_information.h @@ -3,7 +3,7 @@ #include -#include +#include struct gsm_bts; diff --git a/include/openbsc/transaction.h b/include/osmocom/msc/transaction.h similarity index 94% rename from include/openbsc/transaction.h rename to include/osmocom/msc/transaction.h index 4930fbd..272fb3b 100644 --- a/include/openbsc/transaction.h +++ b/include/osmocom/msc/transaction.h @@ -1,11 +1,11 @@ #ifndef _TRANSACT_H #define _TRANSACT_H -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include diff --git a/include/openbsc/trau_mux.h b/include/osmocom/msc/trau_mux.h similarity index 97% rename from include/openbsc/trau_mux.h rename to include/osmocom/msc/trau_mux.h index 75c359b..08863bf 100644 --- a/include/openbsc/trau_mux.h +++ b/include/osmocom/msc/trau_mux.h @@ -29,8 +29,8 @@ */ #include -#include -#include +#include +#include struct decoded_trau_frame; diff --git a/include/openbsc/trau_upqueue.h b/include/osmocom/msc/trau_upqueue.h similarity index 100% rename from include/openbsc/trau_upqueue.h rename to include/osmocom/msc/trau_upqueue.h diff --git a/include/openbsc/ussd.h b/include/osmocom/msc/ussd.h similarity index 100% rename from include/openbsc/ussd.h rename to include/osmocom/msc/ussd.h diff --git a/include/openbsc/vlr.h b/include/osmocom/msc/vlr.h similarity index 99% rename from include/openbsc/vlr.h rename to include/osmocom/msc/vlr.h index 619971a..e9afde3 100644 --- a/include/openbsc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -7,9 +7,9 @@ #include #include #include -#include +#include // for GSM_NAME_LENGTH -#include +#include struct log_target; diff --git a/include/openbsc/vty.h b/include/osmocom/msc/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/msc/vty.h diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c0294c7..9a226ac 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index d6dff95..8a28b72 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -24,11 +24,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 1791687..cdefa09 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -25,10 +25,10 @@ #include #include -#include +#include -#include -#include +#include +#include struct cmd_node net_node = { GSMNET_NODE, diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 7157e00..6037dda 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,10 +23,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..612e215 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7be2240..f4f6e5d 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..9382889 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index 018ed21..58a6ff0 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index fd65e7b..b5f2e68 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -21,14 +21,14 @@ * */ -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index b6a8d6b..5576292 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include static struct gsup_client *g_gc; diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c index 5128ac1..39055ab 100644 --- a/src/libcommon/oap_client.c +++ b/src/libcommon/oap_client.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include int oap_client_init(struct oap_client_config *config, struct oap_client_state *state) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..2793bcf 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 3f9f231..3d2013e 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -29,16 +29,16 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include /* A pointer to the GSM network we work with. By the current paradigm, * there can only be one gsm_network per MSC. The pointer is set once diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 45d2040..34d03e3 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -25,13 +25,13 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #define IP_V4_ADDR_LEN 4 diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c index 9064ce6..7b5367b 100644 --- a/src/libmsc/auth.c +++ b/src/libmsc/auth.c @@ -20,10 +20,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index 9d1f0d4..7e445aa 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -21,11 +21,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/src/libmsc/db.c b/src/libmsc/db.c index ae7e287..4e4477b 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -29,12 +29,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index cad9d9b..84f52c6 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -35,33 +35,33 @@ #include "bscconfig.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #include #include @@ -76,8 +76,8 @@ #include #endif -#include -#include +#include +#include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 574fe28..99adbf7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -43,21 +43,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef BUILD_SMPP #include "smpp_smsc.h" diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c index b529f4c..5f49574 100644 --- a/src/libmsc/gsm_04_14.c +++ b/src/libmsc/gsm_04_14.c @@ -26,12 +26,12 @@ #include "bscconfig.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index bec1d26..37e058c 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 09540c1..8bc060f 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -37,20 +37,20 @@ #ifdef BUILD_IU #include #else -#include +#include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param) diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index e9d335e..4191c5a 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,7 +26,7 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include +#include #include #include diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index 04b9ece..c89e412 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -26,12 +26,12 @@ #include #include -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index 45de1ca..abf1812 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -29,13 +29,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* To continue authorization after a Security Mode Complete */ int gsm0408_authorize(struct gsm_subscriber_connection *conn); diff --git a/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c index 1e7b4cd..3daebee 100644 --- a/src/libmsc/meas_feed.c +++ b/src/libmsc/meas_feed.c @@ -13,12 +13,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "meas_feed.h" diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 8110ead..4e88bc6 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -29,12 +29,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static const struct value_string mncc_names[] = { diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index ac6e734..84623df 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -27,14 +27,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include void *tall_call_ctx; diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 0c696f2..05c9439 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -35,9 +35,9 @@ #include #include -#include -#include -#include +#include +#include +#include struct mncc_sock_state { struct gsm_network *net; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index c461139..7a04153 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -20,15 +20,15 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #include "../../bscconfig.h" @@ -39,7 +39,7 @@ uint16_t rtp_port, bool use_x213_nsap); #else -#include +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 198b1dd..5c9539d 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -32,10 +32,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include static struct cmd_node msc_node = { MSC_NODE, diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 4d24f22..db24757 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -21,22 +21,22 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include #include "../../bscconfig.h" #ifdef BUILD_IU #include #else -#include +#include #endif /* Receive a SAPI-N-REJECT from BSC */ diff --git a/src/libmsc/rrlp.c b/src/libmsc/rrlp.c index cd3da06..7428893 100644 --- a/src/libmsc/rrlp.c +++ b/src/libmsc/rrlp.c @@ -21,10 +21,10 @@ -#include -#include -#include -#include +#include +#include +#include +#include /* RRLP msPositionReq, nsBased, * Accuracy=60, Method=gps, ResponseTime=2, oneSet */ diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index 7af7a80..5b19700 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -25,14 +25,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /* paging of the requested subscriber has completed */ static int paging_cb_silent(unsigned int hooknum, unsigned int event, diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 431cb4d..3ea5ddd 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -36,16 +36,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "smpp_smsc.h" diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 04afc49..88cecfc 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -41,8 +41,8 @@ #include "smpp_smsc.h" -#include -#include +#include +#include /*! \brief Ugly wrapper. libsmpp34 should do this itself! */ #define SMPP34_UNPACK(rc, type, str, data, len) \ diff --git a/src/libmsc/smpp_utils.c b/src/libmsc/smpp_utils.c index d0850d8..7208e25 100644 --- a/src/libmsc/smpp_utils.c +++ b/src/libmsc/smpp_utils.c @@ -19,7 +19,7 @@ #include "smpp_smsc.h" -#include +#include int smpp_determine_scheme(uint8_t dcs, uint8_t *data_coding, int *mode) diff --git a/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c index 13467f1..c0309d6 100644 --- a/src/libmsc/smpp_vty.c +++ b/src/libmsc/smpp_vty.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include "smpp_smsc.h" diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index fe7a608..609a0db 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -30,15 +30,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index bcab8e4..336637c 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -25,12 +25,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 28e0914..bac31a1 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -18,16 +18,16 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include void *tall_trans_ctx; diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index 81a3566..e3263d2 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -29,11 +29,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index b4c9450..484e9d5 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -31,30 +31,30 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include "meas_feed.h" diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a5ea0f6..a9aacbd 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -25,10 +25,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index f9ed0b5..9d9e4c1 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c index 0eb86e7..1c9e191 100644 --- a/src/libvlr/vlr_auth_fsm.c +++ b/src/libvlr/vlr_auth_fsm.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h index 0e63c7e..6ca54e8 100644 --- a/src/libvlr/vlr_core.h +++ b/src/libvlr/vlr_core.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #define LOGGSUPP(level, gsup, fmt, args...) \ LOGP(DVLR, level, "GSUP(%s) " fmt, \ diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index 94bea56..c9223f8 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 3dfc806..75ba19c 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -37,32 +37,32 @@ /* build switches from the configure script */ #include "../../bscconfig.h" -#include +#include #include #include #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -70,10 +70,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include static const char * const osmomsc_copyright = "OsmoMSC - Osmocom Circuit-Switched Core Network implementation\r\n" diff --git a/src/utils/meas_db.c b/src/utils/meas_db.c index d81efca..8cf27df 100644 --- a/src/utils/meas_db.c +++ b/src/utils/meas_db.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_json.c b/src/utils/meas_json.c index 51eb6c7..8db7791 100644 --- a/src/utils/meas_json.c +++ b/src/utils/meas_json.c @@ -37,9 +37,9 @@ #include -#include -#include -#include +#include +#include +#include static void print_meas_rep_uni_json(struct gsm_meas_rep_unidir *mru) { diff --git a/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c index b874ac4..0644521 100644 --- a/src/utils/meas_pcap2db.c +++ b/src/utils/meas_pcap2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include diff --git a/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c index 5032d0c..c2b5ace 100644 --- a/src/utils/meas_udp2db.c +++ b/src/utils/meas_udp2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 77194de..5efb300 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -16,7 +16,7 @@ #include -#include +#include struct ms_state_uni { CDKSLIDER *cdk; diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index c570505..248396a 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -18,7 +18,7 @@ #include #include -#include +#include /* FIXME: merge with smpp_smsc.c */ #define SMPP_SYS_ID_LEN 16 diff --git a/tests/db/db_test.c b/tests/db/db_test.c index a0c1e79..63099f6 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -18,11 +18,11 @@ * */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 4b10e49..d05aa29 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -30,15 +30,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include #if BUILD_IU -#include +#include #include #else -#include +#include #endif #include "msc_vlr_tests.h" diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h index c2c5a58..1cd3914 100644 --- a/tests/msc_vlr/msc_vlr_tests.h +++ b/tests/msc_vlr/msc_vlr_tests.h @@ -26,9 +26,9 @@ #include #include -#include -#include -#include +#include +#include +#include extern bool _log_lines; #define _log(fmt, args...) do { \ diff --git a/tests/smpp/smpp_test.c b/tests/smpp/smpp_test.c index 62fa9d2..5f5f2d6 100644 --- a/tests/smpp/smpp_test.c +++ b/tests/smpp/smpp_test.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c index af25b06..0d073db 100644 --- a/tests/sms_queue/sms_queue_test.c +++ b/tests/sms_queue/sms_queue_test.c @@ -23,8 +23,8 @@ #include -#include -#include +#include +#include static void *talloc_ctx = NULL; -- To view, visit https://gerrit.osmocom.org/3811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:33:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 13:33:53 +0000 Subject: [PATCH] osmo-msc[master]: remove contrib/soap.py, seems to apply to osmo-bsc only Message-ID: Review at https://gerrit.osmocom.org/3812 remove contrib/soap.py, seems to apply to osmo-bsc only Change-Id: I647be0a646bbc3cfee226c55061e0e57fa1211fa --- D contrib/soap.py 1 file changed, 0 insertions(+), 188 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/12/3812/1 diff --git a/contrib/soap.py b/contrib/soap.py deleted file mode 100755 index 4d0a023..0000000 --- a/contrib/soap.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/python3 -# -*- mode: python-mode; py-indent-tabs-mode: nil -*- -""" -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -""" - -__version__ = "v0.7" # bump this on every non-trivial change - -from twisted.internet import defer, reactor -from twisted_ipa import CTRL, IPAFactory, __version__ as twisted_ipa_version -from ipa import Ctrl -from treq import post, collect -from suds.client import Client -from functools import partial -from distutils.version import StrictVersion as V # FIXME: use NormalizedVersion from PEP-386 when available -import argparse, datetime, signal, sys, os, logging, logging.handlers - -# we don't support older versions of TwistedIPA module -assert V(twisted_ipa_version) > V('0.4') - -# keys from OpenBSC openbsc/src/libbsc/bsc_rf_ctrl.c, values SOAP-specific -oper = { 'inoperational' : 0, 'operational' : 1 } -admin = { 'locked' : 0, 'unlocked' : 1 } -policy = { 'off' : 0, 'on' : 1, 'grace' : 2, 'unknown' : 3 } - -# keys from OpenBSC openbsc/src/libbsc/bsc_vty.c -fix = { 'invalid' : 0, 'fix2d' : 1, 'fix3d' : 1 } # SOAP server treats it as boolean but expects int - - -def handle_reply(p, f, log, r): - """ - Reply handler: takes function p to process raw SOAP server reply r, function f to run for each command and verbosity flag v - """ - repl = p(r) # result is expected to have both commands[] array and error string (could be None) - bsc_id = repl.commands[0].split()[0].split('.')[3] # we expect 1st command to have net.0.bsc.666.bts.2.trx.1 location prefix format - log.info("Received SOAP response for BSC %s with %d commands, error status: %s" % (bsc_id, len(repl.commands), repl.error)) - log.debug("BSC %s commands: %s" % (bsc_id, repl.commands)) - for t in repl.commands: # Process OpenBscCommands format from .wsdl - (_, m) = Ctrl().cmd(*t.split()) - f(m) - - -class Trap(CTRL): - """ - TRAP handler (agnostic to factory's client object) - """ - def ctrl_TRAP(self, data, op_id, v): - """ - Parse CTRL TRAP and dispatch to appropriate handler after normalization - """ - (l, r) = v.split() - loc = l.split('.') - t_type = loc[-1] - p = partial(lambda a, i: a[i] if len(a) > i else None, loc) # parse helper - method = getattr(self, 'handle_' + t_type.replace('-', ''), lambda: "Unhandled %s trap" % t_type) - method(p(1), p(3), p(5), p(7), r) # we expect net.0.bsc.666.bts.2.trx.1 format for trap prefix - - def ctrl_SET_REPLY(self, data, _, v): - """ - Debug log for replies to our commands - """ - self.factory.log.debug('SET REPLY %s' % v) - - def ctrl_ERROR(self, data, op_id, v): - """ - We want to know if smth went wrong - """ - self.factory.log.debug('CTRL ERROR [%s] %s' % (op_id, v)) - - def connectionMade(self): - """ - Logging wrapper, calling super() is necessary not to break reconnection logic - """ - self.factory.log.info("Connected to CTRL@%s:%d" % (self.factory.host, self.factory.port)) - super(CTRL, self).connectionMade() - - @defer.inlineCallbacks - def handle_locationstate(self, net, bsc, bts, trx, data): - """ - Handle location-state TRAP: parse trap content, build SOAP context and use treq's routines to post it while setting up async handlers - """ - (ts, fx, lat, lon, height, opr, adm, pol, mcc, mnc) = data.split(',') - tstamp = datetime.datetime.fromtimestamp(float(ts)).isoformat() - self.factory.log.debug('location-state@%s.%s.%s.%s (%s) [%s/%s] => %s' % (net, bsc, bts, trx, tstamp, mcc, mnc, data)) - ctx = self.factory.client.registerSiteLocation(bsc, float(lon), float(lat), fix.get(fx, 0), tstamp, oper.get(opr, 2), admin.get(adm, 2), policy.get(pol, 3)) - d = post(self.factory.location, ctx.envelope) - d.addCallback(collect, partial(handle_reply, ctx.process_reply, self.transport.write, self.factory.log)) # treq's collect helper is handy to get all reply content at once using closure on ctx - d.addErrback(lambda e, bsc: self.factory.log.critical("HTTP POST error %s while trying to register BSC %s" % (e, bsc)), bsc) # handle HTTP errors - # Ensure that we run only limited number of requests in parallel: - yield self.factory.semaphore.acquire() - yield d # we end up here only if semaphore is available which means it's ok to fire the request without exceeding the limit - self.factory.semaphore.release() - - def handle_notificationrejectionv1(self, net, bsc, bts, trx, data): - """ - Handle notification-rejection-v1 TRAP: just an example to show how more message types can be handled - """ - self.factory.log.debug('notification-rejection-v1 at bsc-id %s => %s' % (bsc, data)) - - -class TrapFactory(IPAFactory): - """ - Store SOAP client object so TRAP handler can use it for requests - """ - location = None - log = None - semaphore = None - client = None - host = None - port = None - def __init__(self, host, port, proto, semaphore, log, wsdl=None, location=None): - self.host = host # for logging only, - self.port = port # seems to be no way to get it from ReconnectingClientFactory - self.log = log - self.semaphore = semaphore - soap = Client(wsdl, location=location, nosend=True) # make async SOAP client - self.location = location.encode() if location else soap.wsdl.services[0].ports[0].location # necessary for dispatching HTTP POST via treq - self.client = soap.service - level = self.log.getEffectiveLevel() - self.log.setLevel(logging.WARNING) # we do not need excessive debug from lower levels - super(TrapFactory, self).__init__(proto, self.log) - self.log.setLevel(level) - self.log.debug("Using IPA %s, SUDS client: %s" % (Ctrl.version, soap)) - - -def reloader(path, script, log, dbg1, dbg2, signum, _): - """ - Signal handler: we have to use execl() because twisted's reactor is not restartable due to some bug in twisted implementation - """ - log.info("Received Signal %d - restarting..." % signum) - if signum == signal.SIGUSR1 and dbg1 not in sys.argv and dbg2 not in sys.argv: - sys.argv.append(dbg1) # enforce debug - if signum == signal.SIGUSR2 and (dbg1 in sys.argv or dbg2 in sys.argv): # disable debug - if dbg1 in sys.argv: - sys.argv.remove(dbg1) - if dbg2 in sys.argv: - sys.argv.remove(dbg2) - os.execl(path, script, *sys.argv[1:]) - - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Proxy between given SOAP service and Osmocom CTRL protocol.') - p.add_argument('-v', '--version', action='version', version=("%(prog)s " + __version__)) - p.add_argument('-p', '--port', type=int, default=4250, help="Port to use for CTRL interface, defaults to 4250") - p.add_argument('-c', '--ctrl', default='localhost', help="Adress to use for CTRL interface, defaults to localhost") - p.add_argument('-w', '--wsdl', required=True, help="WSDL URL for SOAP") - p.add_argument('-n', '--num', type=int, default=5, help="Max number of concurrent HTTP requests to SOAP server") - p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") - p.add_argument('-o', '--output', action='store_true', help="Log to STDOUT in addition to SYSLOG") - p.add_argument('-l', '--location', help="Override location found in WSDL file (don't use unless you know what you're doing)") - args = p.parse_args() - - log = logging.getLogger('CTRL2SOAP') - if args.debug: - log.setLevel(logging.DEBUG) - else: - log.setLevel(logging.INFO) - log.addHandler(logging.handlers.SysLogHandler('/dev/log')) - if args.output: - log.addHandler(logging.StreamHandler(sys.stdout)) - - reboot = partial(reloader, os.path.abspath(__file__), os.path.basename(__file__), log, '-d', '--debug') # keep in sync with add_argument() call above - signal.signal(signal.SIGHUP, reboot) - signal.signal(signal.SIGQUIT, reboot) - signal.signal(signal.SIGUSR1, reboot) # restart and enabled debug output - signal.signal(signal.SIGUSR2, reboot) # restart and disable debug output - - log.info("SOAP proxy %s starting with PID %d ..." % (__version__, os.getpid())) - reactor.connectTCP(args.ctrl, args.port, TrapFactory(args.ctrl, args.port, Trap, defer.DeferredSemaphore(args.num), log, args.wsdl, args.location)) - reactor.run() -- To view, visit https://gerrit.osmocom.org/3812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I647be0a646bbc3cfee226c55061e0e57fa1211fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 13:34:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 13:34:31 +0000 Subject: [PATCH] osmo-bsc[master]: move include/openbsc to include/osmocom/bsc Message-ID: Review at https://gerrit.osmocom.org/3813 move include/openbsc to include/osmocom/bsc Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 --- M configure.ac M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/bsc/Makefile.am R include/osmocom/bsc/a_reset.h R include/osmocom/bsc/abis_nm.h R include/osmocom/bsc/abis_om2000.h R include/osmocom/bsc/abis_rsl.h R include/osmocom/bsc/arfcn_range_encode.h R include/osmocom/bsc/auth.h R include/osmocom/bsc/bsc_api.h R include/osmocom/bsc/bsc_msc.h R include/osmocom/bsc/bsc_msc_data.h R include/osmocom/bsc/bsc_msg_filter.h R include/osmocom/bsc/bsc_nat.h R include/osmocom/bsc/bsc_nat_callstats.h R include/osmocom/bsc/bsc_nat_sccp.h R include/osmocom/bsc/bsc_rll.h R include/osmocom/bsc/bsc_subscriber.h R include/osmocom/bsc/bss.h R include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h R include/osmocom/bsc/chan_alloc.h R include/osmocom/bsc/common.h R include/osmocom/bsc/common_bsc.h R include/osmocom/bsc/common_cs.h R include/osmocom/bsc/crc24.h R include/osmocom/bsc/ctrl.h R include/osmocom/bsc/debug.h R include/osmocom/bsc/e1_config.h R include/osmocom/bsc/gsm_04_08_utils.h R include/osmocom/bsc/gsm_04_80.h R include/osmocom/bsc/gsm_data.h R include/osmocom/bsc/gsm_data_shared.h R include/osmocom/bsc/gsm_subscriber.h R include/osmocom/bsc/handover.h R include/osmocom/bsc/handover_decision.h R include/osmocom/bsc/ipaccess.h R include/osmocom/bsc/iu_dummy.h R include/osmocom/bsc/meas_feed.h R include/osmocom/bsc/meas_rep.h R include/osmocom/bsc/misdn.h R include/osmocom/bsc/mncc.h R include/osmocom/bsc/mncc_int.h R include/osmocom/bsc/msc_ifaces.h R include/osmocom/bsc/nat_rewrite_trie.h R include/osmocom/bsc/network_listen.h R include/osmocom/bsc/openbscdefines.h R include/osmocom/bsc/osmo_bsc.h R include/osmocom/bsc/osmo_bsc_grace.h R include/osmocom/bsc/osmo_bsc_reset.h R include/osmocom/bsc/osmo_bsc_rf.h R include/osmocom/bsc/osmo_bsc_sigtran.h R include/osmocom/bsc/osmo_msc.h R include/osmocom/bsc/osmux.h R include/osmocom/bsc/paging.h R include/osmocom/bsc/pcu_if.h R include/osmocom/bsc/pcuif_proto.h R include/osmocom/bsc/rest_octets.h R include/osmocom/bsc/rrlp.h R include/osmocom/bsc/rs232.h R include/osmocom/bsc/rtp_proxy.h R include/osmocom/bsc/sgsn.h R include/osmocom/bsc/signal.h R include/osmocom/bsc/silent_call.h R include/osmocom/bsc/smpp.h R include/osmocom/bsc/sms_queue.h R include/osmocom/bsc/socket.h R include/osmocom/bsc/system_information.h R include/osmocom/bsc/transaction.h R include/osmocom/bsc/trau_mux.h R include/osmocom/bsc/trau_upqueue.h R include/osmocom/bsc/ussd.h R include/osmocom/bsc/vty.h M src/ipaccess/abisip-find.c M src/ipaccess/ipaccess-config.c M src/ipaccess/ipaccess-firmware.c M src/ipaccess/ipaccess-proxy.c M src/ipaccess/network_listen.c M src/libbsc/abis_nm.c M src/libbsc/abis_nm_vty.c M src/libbsc/abis_om2000.c M src/libbsc/abis_om2000_vty.c M src/libbsc/abis_rsl.c M src/libbsc/arfcn_range_encode.c M src/libbsc/bsc_api.c M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_ctrl_lookup.c M src/libbsc/bsc_dyn_ts.c M src/libbsc/bsc_init.c M src/libbsc/bsc_msc.c M src/libbsc/bsc_rf_ctrl.c M src/libbsc/bsc_rll.c M src/libbsc/bsc_subscriber.c M src/libbsc/bsc_vty.c M src/libbsc/bts_ericsson_rbs2000.c M src/libbsc/bts_init.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/bts_ipaccess_nanobts_omlattr.c M src/libbsc/bts_nokia_site.c M src/libbsc/bts_siemens_bs11.c M src/libbsc/bts_sysmobts.c M src/libbsc/bts_unknown.c M src/libbsc/chan_alloc.c M src/libbsc/e1_config.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/gsm_04_80_utils.c M src/libbsc/handover_decision.c M src/libbsc/handover_logic.c M src/libbsc/meas_proc.c M src/libbsc/meas_rep.c M src/libbsc/net_init.c M src/libbsc/paging.c M src/libbsc/pcu_sock.c M src/libbsc/rest_octets.c M src/libbsc/system_information.c M src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/socket.c M src/libfilter/bsc_msg_acc.c M src/libfilter/bsc_msg_filter.c M src/libfilter/bsc_msg_vty.c M src/libtrau/rtp_proxy.c M src/libtrau/trau_mux.c M src/libtrau/trau_upqueue.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c M src/osmo-bsc/osmo_bsc_reset.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_nat/bsc_filter.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_filter.c M src/osmo-bsc_nat/bsc_nat_rewrite.c M src/osmo-bsc_nat/bsc_nat_rewrite_trie.c M src/osmo-bsc_nat/bsc_nat_utils.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_sccp.c M src/osmo-bsc_nat/bsc_ussd.c M src/utils/bs11_config.c M src/utils/meas_db.c M src/utils/meas_json.c M src/utils/meas_pcap2db.c M src/utils/meas_udp2db.c M src/utils/meas_vis.c M tests/abis/abis_test.c M tests/bsc-nat-trie/bsc_nat_trie_test.c M tests/bsc-nat/bsc_nat_test.c M tests/bsc/bsc_test.c M tests/channel/channel_test.c M tests/gsm0408/gsm0408_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c M tests/subscr/bsc_subscr_test.c M tests/trau/trau_test.c 167 files changed, 515 insertions(+), 511 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/13/3813/1 diff --git a/configure.ac b/configure.ac index 8107047..930d1d3 100644 --- a/configure.ac +++ b/configure.ac @@ -126,8 +126,9 @@ AC_OUTPUT( osmo-bsc.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/bsc/Makefile src/Makefile src/libtrau/Makefile src/libbsc/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 3234e62..740e088 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) noinst_HEADERS = \ diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..cf24c62 --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + bsc \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/bsc/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/bsc/Makefile.am diff --git a/include/openbsc/a_reset.h b/include/osmocom/bsc/a_reset.h similarity index 100% rename from include/openbsc/a_reset.h rename to include/osmocom/bsc/a_reset.h diff --git a/include/openbsc/abis_nm.h b/include/osmocom/bsc/abis_nm.h similarity index 99% rename from include/openbsc/abis_nm.h rename to include/osmocom/bsc/abis_nm.h index db2a659..34f16a9 100644 --- a/include/openbsc/abis_nm.h +++ b/include/osmocom/bsc/abis_nm.h @@ -26,7 +26,7 @@ #include #include -#include +#include /* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ #define MAX_BTS_ATTR 5 diff --git a/include/openbsc/abis_om2000.h b/include/osmocom/bsc/abis_om2000.h similarity index 100% rename from include/openbsc/abis_om2000.h rename to include/osmocom/bsc/abis_om2000.h diff --git a/include/openbsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h similarity index 100% rename from include/openbsc/abis_rsl.h rename to include/osmocom/bsc/abis_rsl.h diff --git a/include/openbsc/arfcn_range_encode.h b/include/osmocom/bsc/arfcn_range_encode.h similarity index 100% rename from include/openbsc/arfcn_range_encode.h rename to include/osmocom/bsc/arfcn_range_encode.h diff --git a/include/openbsc/auth.h b/include/osmocom/bsc/auth.h similarity index 100% rename from include/openbsc/auth.h rename to include/osmocom/bsc/auth.h diff --git a/include/openbsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h similarity index 100% rename from include/openbsc/bsc_api.h rename to include/osmocom/bsc/bsc_api.h diff --git a/include/openbsc/bsc_msc.h b/include/osmocom/bsc/bsc_msc.h similarity index 98% rename from include/openbsc/bsc_msc.h rename to include/osmocom/bsc/bsc_msc.h index 380eb17..ceaea53 100644 --- a/include/openbsc/bsc_msc.h +++ b/include/osmocom/bsc/bsc_msc.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/include/openbsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h similarity index 100% rename from include/openbsc/bsc_msc_data.h rename to include/osmocom/bsc/bsc_msc_data.h diff --git a/include/openbsc/bsc_msg_filter.h b/include/osmocom/bsc/bsc_msg_filter.h similarity index 100% rename from include/openbsc/bsc_msg_filter.h rename to include/osmocom/bsc/bsc_msg_filter.h diff --git a/include/openbsc/bsc_nat.h b/include/osmocom/bsc/bsc_nat.h similarity index 100% rename from include/openbsc/bsc_nat.h rename to include/osmocom/bsc/bsc_nat.h diff --git a/include/openbsc/bsc_nat_callstats.h b/include/osmocom/bsc/bsc_nat_callstats.h similarity index 100% rename from include/openbsc/bsc_nat_callstats.h rename to include/osmocom/bsc/bsc_nat_callstats.h diff --git a/include/openbsc/bsc_nat_sccp.h b/include/osmocom/bsc/bsc_nat_sccp.h similarity index 100% rename from include/openbsc/bsc_nat_sccp.h rename to include/osmocom/bsc/bsc_nat_sccp.h diff --git a/include/openbsc/bsc_rll.h b/include/osmocom/bsc/bsc_rll.h similarity index 92% rename from include/openbsc/bsc_rll.h rename to include/osmocom/bsc/bsc_rll.h index 729ba60..3afe4a8 100644 --- a/include/openbsc/bsc_rll.h +++ b/include/osmocom/bsc/bsc_rll.h @@ -1,7 +1,7 @@ #ifndef _BSC_RLL_H #define _BSC_RLL_H -#include +#include enum bsc_rllr_ind { BSC_RLLR_IND_EST_CONF, diff --git a/include/openbsc/bsc_subscriber.h b/include/osmocom/bsc/bsc_subscriber.h similarity index 100% rename from include/openbsc/bsc_subscriber.h rename to include/osmocom/bsc/bsc_subscriber.h diff --git a/include/openbsc/bss.h b/include/osmocom/bsc/bss.h similarity index 93% rename from include/openbsc/bss.h rename to include/osmocom/bsc/bss.h index 9f16bf7..b12487d 100644 --- a/include/openbsc/bss.h +++ b/include/osmocom/bsc/bss.h @@ -1,7 +1,7 @@ #ifndef _BSS_H_ #define _BSS_H_ -#include +#include struct msgb; diff --git a/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h diff --git a/include/openbsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h similarity index 100% rename from include/openbsc/chan_alloc.h rename to include/osmocom/bsc/chan_alloc.h diff --git a/include/openbsc/common.h b/include/osmocom/bsc/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/bsc/common.h diff --git a/include/openbsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h similarity index 83% rename from include/openbsc/common_bsc.h rename to include/osmocom/bsc/common_bsc.h index 7960383..08394e9 100644 --- a/include/openbsc/common_bsc.h +++ b/include/osmocom/bsc/common_bsc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/include/openbsc/common_cs.h b/include/osmocom/bsc/common_cs.h similarity index 100% rename from include/openbsc/common_cs.h rename to include/osmocom/bsc/common_cs.h diff --git a/include/openbsc/crc24.h b/include/osmocom/bsc/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/bsc/crc24.h diff --git a/include/openbsc/ctrl.h b/include/osmocom/bsc/ctrl.h similarity index 100% rename from include/openbsc/ctrl.h rename to include/osmocom/bsc/ctrl.h diff --git a/include/openbsc/debug.h b/include/osmocom/bsc/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/bsc/debug.h diff --git a/include/openbsc/e1_config.h b/include/osmocom/bsc/e1_config.h similarity index 83% rename from include/openbsc/e1_config.h rename to include/osmocom/bsc/e1_config.h index 538c0b0..909e3cc 100644 --- a/include/openbsc/e1_config.h +++ b/include/osmocom/bsc/e1_config.h @@ -1,7 +1,7 @@ #ifndef _E1_CONFIG_H #define _E1_CONFIG_H -#include +#include int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); int e1_reconfig_trx(struct gsm_bts_trx *trx); diff --git a/include/openbsc/gsm_04_08_utils.h b/include/osmocom/bsc/gsm_04_08_utils.h similarity index 100% rename from include/openbsc/gsm_04_08_utils.h rename to include/osmocom/bsc/gsm_04_08_utils.h diff --git a/include/openbsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h similarity index 100% rename from include/openbsc/gsm_04_80.h rename to include/osmocom/bsc/gsm_04_80.h diff --git a/include/openbsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h similarity index 99% rename from include/openbsc/gsm_data.h rename to include/osmocom/bsc/gsm_data.h index b21b79c..0aeb535 100644 --- a/include/openbsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -14,9 +14,9 @@ #include #include -#include -#include -#include +#include +#include +#include /** annotations for msgb ownership */ diff --git a/include/openbsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h similarity index 99% rename from include/openbsc/gsm_data_shared.h rename to include/osmocom/bsc/gsm_data_shared.h index bef4504..6ce571e 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -24,8 +24,8 @@ #include #endif -#include -#include +#include +#include /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ diff --git a/include/openbsc/gsm_subscriber.h b/include/osmocom/bsc/gsm_subscriber.h similarity index 97% rename from include/openbsc/gsm_subscriber.h rename to include/osmocom/bsc/gsm_subscriber.h index d88e32a..ca66d47 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/osmocom/bsc/gsm_subscriber.h @@ -6,7 +6,7 @@ #include #include -#include +#include #define GSM_NAME_LENGTH 160 diff --git a/include/openbsc/handover.h b/include/osmocom/bsc/handover.h similarity index 100% rename from include/openbsc/handover.h rename to include/osmocom/bsc/handover.h diff --git a/include/openbsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h similarity index 100% rename from include/openbsc/handover_decision.h rename to include/osmocom/bsc/handover_decision.h diff --git a/include/openbsc/ipaccess.h b/include/osmocom/bsc/ipaccess.h similarity index 100% rename from include/openbsc/ipaccess.h rename to include/osmocom/bsc/ipaccess.h diff --git a/include/openbsc/iu_dummy.h b/include/osmocom/bsc/iu_dummy.h similarity index 100% rename from include/openbsc/iu_dummy.h rename to include/osmocom/bsc/iu_dummy.h diff --git a/include/openbsc/meas_feed.h b/include/osmocom/bsc/meas_feed.h similarity index 95% rename from include/openbsc/meas_feed.h rename to include/osmocom/bsc/meas_feed.h index f77ee07..55bce09 100644 --- a/include/openbsc/meas_feed.h +++ b/include/osmocom/bsc/meas_feed.h @@ -3,7 +3,7 @@ #include -#include +#include struct meas_feed_hdr { uint8_t msg_type; diff --git a/include/openbsc/meas_rep.h b/include/osmocom/bsc/meas_rep.h similarity index 100% rename from include/openbsc/meas_rep.h rename to include/osmocom/bsc/meas_rep.h diff --git a/include/openbsc/misdn.h b/include/osmocom/bsc/misdn.h similarity index 100% rename from include/openbsc/misdn.h rename to include/osmocom/bsc/misdn.h diff --git a/include/openbsc/mncc.h b/include/osmocom/bsc/mncc.h similarity index 100% rename from include/openbsc/mncc.h rename to include/osmocom/bsc/mncc.h diff --git a/include/openbsc/mncc_int.h b/include/osmocom/bsc/mncc_int.h similarity index 100% rename from include/openbsc/mncc_int.h rename to include/osmocom/bsc/mncc_int.h diff --git a/include/openbsc/msc_ifaces.h b/include/osmocom/bsc/msc_ifaces.h similarity index 97% rename from include/openbsc/msc_ifaces.h rename to include/osmocom/bsc/msc_ifaces.h index a1071ae..dadb828 100644 --- a/include/openbsc/msc_ifaces.h +++ b/include/osmocom/bsc/msc_ifaces.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/openbsc/nat_rewrite_trie.h b/include/osmocom/bsc/nat_rewrite_trie.h similarity index 100% rename from include/openbsc/nat_rewrite_trie.h rename to include/osmocom/bsc/nat_rewrite_trie.h diff --git a/include/openbsc/network_listen.h b/include/osmocom/bsc/network_listen.h similarity index 92% rename from include/openbsc/network_listen.h rename to include/osmocom/bsc/network_listen.h index 67d1f4e..68d0709 100644 --- a/include/openbsc/network_listen.h +++ b/include/osmocom/bsc/network_listen.h @@ -2,7 +2,7 @@ #define _OPENBSC_NWL_H #include -#include +#include void ipac_nwl_init(void); diff --git a/include/openbsc/openbscdefines.h b/include/osmocom/bsc/openbscdefines.h similarity index 100% rename from include/openbsc/openbscdefines.h rename to include/osmocom/bsc/openbscdefines.h diff --git a/include/openbsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h similarity index 100% rename from include/openbsc/osmo_bsc.h rename to include/osmocom/bsc/osmo_bsc.h diff --git a/include/openbsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h similarity index 94% rename from include/openbsc/osmo_bsc_grace.h rename to include/osmocom/bsc/osmo_bsc_grace.h index 5a81cd1..b7950ce 100644 --- a/include/openbsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -21,8 +21,8 @@ #ifndef OSMO_BSC_GRACE_H #define OSMO_BSC_GRACE_H -#include -#include +#include +#include struct bsc_msc_data; diff --git a/include/openbsc/osmo_bsc_reset.h b/include/osmocom/bsc/osmo_bsc_reset.h similarity index 100% rename from include/openbsc/osmo_bsc_reset.h rename to include/osmocom/bsc/osmo_bsc_reset.h diff --git a/include/openbsc/osmo_bsc_rf.h b/include/osmocom/bsc/osmo_bsc_rf.h similarity index 97% rename from include/openbsc/osmo_bsc_rf.h rename to include/osmocom/bsc/osmo_bsc_rf.h index 19ccd08..56ac980 100644 --- a/include/openbsc/osmo_bsc_rf.h +++ b/include/osmocom/bsc/osmo_bsc_rf.h @@ -1,7 +1,7 @@ #ifndef OSMO_BSC_RF #define OSMO_BSC_RF -#include +#include #include #include diff --git a/include/openbsc/osmo_bsc_sigtran.h b/include/osmocom/bsc/osmo_bsc_sigtran.h similarity index 95% rename from include/openbsc/osmo_bsc_sigtran.h rename to include/osmocom/bsc/osmo_bsc_sigtran.h index fbcfcb3..8964903 100644 --- a/include/openbsc/osmo_bsc_sigtran.h +++ b/include/osmocom/bsc/osmo_bsc_sigtran.h @@ -20,8 +20,8 @@ #pragma once -#include -#include +#include +#include /* Allocate resources to make a new connection oriented sigtran connection * (not the connection ittself!) */ diff --git a/include/openbsc/osmo_msc.h b/include/osmocom/bsc/osmo_msc.h similarity index 98% rename from include/openbsc/osmo_msc.h rename to include/osmocom/bsc/osmo_msc.h index cdfd27f..c08cb26 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/osmocom/bsc/osmo_msc.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "bsc_api.h" diff --git a/include/openbsc/osmux.h b/include/osmocom/bsc/osmux.h similarity index 100% rename from include/openbsc/osmux.h rename to include/osmocom/bsc/osmux.h diff --git a/include/openbsc/paging.h b/include/osmocom/bsc/paging.h similarity index 96% rename from include/openbsc/paging.h rename to include/osmocom/bsc/paging.h index 7dd8500..e917772 100644 --- a/include/openbsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include /** * A pending paging request diff --git a/include/openbsc/pcu_if.h b/include/osmocom/bsc/pcu_if.h similarity index 100% rename from include/openbsc/pcu_if.h rename to include/osmocom/bsc/pcu_if.h diff --git a/include/openbsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h similarity index 100% rename from include/openbsc/pcuif_proto.h rename to include/osmocom/bsc/pcuif_proto.h diff --git a/include/openbsc/rest_octets.h b/include/osmocom/bsc/rest_octets.h similarity index 100% rename from include/openbsc/rest_octets.h rename to include/osmocom/bsc/rest_octets.h diff --git a/include/openbsc/rrlp.h b/include/osmocom/bsc/rrlp.h similarity index 100% rename from include/openbsc/rrlp.h rename to include/osmocom/bsc/rrlp.h diff --git a/include/openbsc/rs232.h b/include/osmocom/bsc/rs232.h similarity index 100% rename from include/openbsc/rs232.h rename to include/osmocom/bsc/rs232.h diff --git a/include/openbsc/rtp_proxy.h b/include/osmocom/bsc/rtp_proxy.h similarity index 98% rename from include/openbsc/rtp_proxy.h rename to include/osmocom/bsc/rtp_proxy.h index 52ffefd..918420c 100644 --- a/include/openbsc/rtp_proxy.h +++ b/include/osmocom/bsc/rtp_proxy.h @@ -27,7 +27,7 @@ #include #include -#include +#include #define RTP_PT_GSM_FULL 3 #define RTP_PT_GSM_HALF 96 diff --git a/include/openbsc/sgsn.h b/include/osmocom/bsc/sgsn.h similarity index 97% rename from include/openbsc/sgsn.h rename to include/osmocom/bsc/sgsn.h index f371dc6..f71b649 100644 --- a/include/openbsc/sgsn.h +++ b/include/osmocom/bsc/sgsn.h @@ -5,9 +5,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/signal.h b/include/osmocom/bsc/signal.h similarity index 99% rename from include/openbsc/signal.h rename to include/osmocom/bsc/signal.h index 49f86d6..feab246 100644 --- a/include/openbsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include diff --git a/include/openbsc/silent_call.h b/include/osmocom/bsc/silent_call.h similarity index 100% rename from include/openbsc/silent_call.h rename to include/osmocom/bsc/silent_call.h diff --git a/include/openbsc/smpp.h b/include/osmocom/bsc/smpp.h similarity index 100% rename from include/openbsc/smpp.h rename to include/osmocom/bsc/smpp.h diff --git a/include/openbsc/sms_queue.h b/include/osmocom/bsc/sms_queue.h similarity index 100% rename from include/openbsc/sms_queue.h rename to include/osmocom/bsc/sms_queue.h diff --git a/include/openbsc/socket.h b/include/osmocom/bsc/socket.h similarity index 100% rename from include/openbsc/socket.h rename to include/osmocom/bsc/socket.h diff --git a/include/openbsc/system_information.h b/include/osmocom/bsc/system_information.h similarity index 94% rename from include/openbsc/system_information.h rename to include/osmocom/bsc/system_information.h index 71bea26..29f639d 100644 --- a/include/openbsc/system_information.h +++ b/include/osmocom/bsc/system_information.h @@ -3,7 +3,7 @@ #include -#include +#include struct gsm_bts; diff --git a/include/openbsc/transaction.h b/include/osmocom/bsc/transaction.h similarity index 95% rename from include/openbsc/transaction.h rename to include/osmocom/bsc/transaction.h index 1e93fff..5465548 100644 --- a/include/openbsc/transaction.h +++ b/include/osmocom/bsc/transaction.h @@ -1,10 +1,10 @@ #ifndef _TRANSACT_H #define _TRANSACT_H -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/include/openbsc/trau_mux.h b/include/osmocom/bsc/trau_mux.h similarity index 97% rename from include/openbsc/trau_mux.h rename to include/osmocom/bsc/trau_mux.h index 75c359b..eeceff5 100644 --- a/include/openbsc/trau_mux.h +++ b/include/osmocom/bsc/trau_mux.h @@ -29,8 +29,8 @@ */ #include -#include -#include +#include +#include struct decoded_trau_frame; diff --git a/include/openbsc/trau_upqueue.h b/include/osmocom/bsc/trau_upqueue.h similarity index 100% rename from include/openbsc/trau_upqueue.h rename to include/osmocom/bsc/trau_upqueue.h diff --git a/include/openbsc/ussd.h b/include/osmocom/bsc/ussd.h similarity index 100% rename from include/openbsc/ussd.h rename to include/osmocom/bsc/ussd.h diff --git a/include/openbsc/vty.h b/include/osmocom/bsc/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/bsc/vty.h diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c index 21d9f22..c459161 100644 --- a/src/ipaccess/abisip-find.c +++ b/src/ipaccess/abisip-find.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include static int udp_sock(const char *ifname) { diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index 6822c06..c68e3ea 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -37,19 +37,19 @@ #include #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/ipaccess/ipaccess-firmware.c b/src/ipaccess/ipaccess-firmware.c index 5f55bb5..515cc75 100644 --- a/src/ipaccess/ipaccess-firmware.c +++ b/src/ipaccess/ipaccess-firmware.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c index d367442..b45b543 100644 --- a/src/ipaccess/ipaccess-proxy.c +++ b/src/ipaccess/ipaccess-proxy.c @@ -37,7 +37,7 @@ #define _GNU_SOURCE #include -#include +#include #include #include #include @@ -45,9 +45,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include /* one instance of an ip.access protocol proxy */ diff --git a/src/ipaccess/network_listen.c b/src/ipaccess/network_listen.c index 3b44ceb..dd6cb4b 100644 --- a/src/ipaccess/network_listen.c +++ b/src/ipaccess/network_listen.c @@ -33,10 +33,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #define WHITELIST_MAX_SIZE ((NUM_ARFCNS*2)+2+1) diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index cf20d7c..3a48dee 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -34,17 +34,17 @@ #include #include -#include -#include +#include +#include #include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include #define OM_ALLOC_SIZE 1024 diff --git a/src/libbsc/abis_nm_vty.c b/src/libbsc/abis_nm_vty.c index 6ec0a4a..a0d72c2 100644 --- a/src/libbsc/abis_nm_vty.c +++ b/src/libbsc/abis_nm_vty.c @@ -28,14 +28,14 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/abis_om2000.c b/src/libbsc/abis_om2000.c index 82a14b2..756cc89 100644 --- a/src/libbsc/abis_om2000.c +++ b/src/libbsc/abis_om2000.c @@ -36,12 +36,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include /* FIXME: move to libosmocore */ diff --git a/src/libbsc/abis_om2000_vty.c b/src/libbsc/abis_om2000_vty.c index a6bc4c7..b75d420 100644 --- a/src/libbsc/abis_om2000_vty.c +++ b/src/libbsc/abis_om2000_vty.c @@ -26,14 +26,14 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 75229a5..09fb14b 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -27,26 +27,26 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include #define RSL_ALLOC_SIZE 1024 #define RSL_ALLOC_HEADROOM 128 diff --git a/src/libbsc/arfcn_range_encode.c b/src/libbsc/arfcn_range_encode.c index 9ca4840..ae99fd9 100644 --- a/src/libbsc/arfcn_range_encode.c +++ b/src/libbsc/arfcn_range_encode.c @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a0ba69a..b42c382 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -21,17 +21,17 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index 641fe2b..7c2bfb5 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -22,13 +22,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define CTRL_CMD_VTY_STRING(cmdname, cmdstr, dtype, element) \ CTRL_HELPER_GET_STRING(cmdname, dtype, element) \ diff --git a/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c index a8a8cf5..d1d9b0a 100644 --- a/src/libbsc/bsc_ctrl_lookup.c +++ b/src/libbsc/bsc_ctrl_lookup.c @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include extern vector ctrl_node_vec; diff --git a/src/libbsc/bsc_dyn_ts.c b/src/libbsc/bsc_dyn_ts.c index e5422fc..aa3c252 100644 --- a/src/libbsc/bsc_dyn_ts.c +++ b/src/libbsc/bsc_dyn_ts.c @@ -19,9 +19,9 @@ */ #include -#include -#include -#include +#include +#include +#include void tchf_pdch_ts_init(struct gsm_bts_trx_ts *ts) { diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index a99eea2..5b6530d 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -19,25 +19,25 @@ * */ -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include /* global pointer to the gsm network data structure */ diff --git a/src/libbsc/bsc_msc.c b/src/libbsc/bsc_msc.c index 82a572d..648b3e6 100644 --- a/src/libbsc/bsc_msc.c +++ b/src/libbsc/bsc_msc.c @@ -19,8 +19,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c index b7b6fc8..20115e1 100644 --- a/src/libbsc/bsc_rf_ctrl.c +++ b/src/libbsc/bsc_rf_ctrl.c @@ -20,12 +20,12 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/bsc_rll.c b/src/libbsc/bsc_rll.c index bb488da..ebf9b88 100644 --- a/src/libbsc/bsc_rll.c +++ b/src/libbsc/bsc_rll.c @@ -22,15 +22,15 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include struct bsc_rll_req { struct llist_head list; diff --git a/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c index 73e61e8..d9d90ba 100644 --- a/src/libbsc/bsc_subscriber.c +++ b/src/libbsc/bsc_subscriber.c @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include static struct bsc_subscr *bsc_subscr_alloc(struct llist_head *list) { diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index abfff0c..42c16e8 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -36,28 +36,28 @@ #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libbsc/bts_ericsson_rbs2000.c b/src/libbsc/bts_ericsson_rbs2000.c index 99da4e7..5ee2760 100644 --- a/src/libbsc/bts_ericsson_rbs2000.c +++ b/src/libbsc/bts_ericsson_rbs2000.c @@ -22,12 +22,12 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include diff --git a/src/libbsc/bts_init.c b/src/libbsc/bts_init.c index d6b152a..18f1ed4 100644 --- a/src/libbsc/bts_init.c +++ b/src/libbsc/bts_init.c @@ -16,7 +16,7 @@ * along with this program. If not, see . * */ -#include +#include int bts_init(void) { diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..1f203f5 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -23,23 +23,23 @@ #include -#include -#include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include -#include +#include +#include extern struct gsm_network *bsc_gsmnet; diff --git a/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 473e1ca..22ae484 100644 --- a/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include static void patch_16(uint8_t *data, const uint16_t val) { diff --git a/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c index 3ca76c0..392cd17 100644 --- a/src/libbsc/bts_nokia_site.c +++ b/src/libbsc/bts_nokia_site.c @@ -30,11 +30,11 @@ #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include diff --git a/src/libbsc/bts_siemens_bs11.c b/src/libbsc/bts_siemens_bs11.c index c083b1e..e01c258 100644 --- a/src/libbsc/bts_siemens_bs11.c +++ b/src/libbsc/bts_siemens_bs11.c @@ -22,11 +22,11 @@ #include -#include -#include -#include +#include +#include +#include #include -#include +#include static int bts_model_bs11_start(struct gsm_network *net); diff --git a/src/libbsc/bts_sysmobts.c b/src/libbsc/bts_sysmobts.c index e4b6cdc..2982074 100644 --- a/src/libbsc/bts_sysmobts.c +++ b/src/libbsc/bts_sysmobts.c @@ -23,17 +23,17 @@ #include -#include -#include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/src/libbsc/bts_unknown.c b/src/libbsc/bts_unknown.c index f113529..5ecf875 100644 --- a/src/libbsc/bts_unknown.c +++ b/src/libbsc/bts_unknown.c @@ -20,9 +20,9 @@ */ -#include +#include #include -#include +#include static struct gsm_bts_model model_unknown = { .type = GSM_BTS_TYPE_UNKNOWN, diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 4192d65..679ad42 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -25,14 +25,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index d57dec5..1923efd 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -23,15 +23,15 @@ #include -#include +#include #include #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include #define SAPI_L2ML 0 #define SAPI_OML 62 diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 109beda..7fc696f 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -30,13 +30,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ diff --git a/src/libbsc/gsm_04_80_utils.c b/src/libbsc/gsm_04_80_utils.c index e0db81e..d67f3c5 100644 --- a/src/libbsc/gsm_04_80_utils.c +++ b/src/libbsc/gsm_04_80_utils.c @@ -20,7 +20,7 @@ */ #include -#include +#include int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text) diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 8d7e047..09c7eaa 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -25,12 +25,12 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include /* Get reference to a neighbor cell on a given BCCH ARFCN */ diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 8ced74f..ace8ac3 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -29,18 +29,18 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include struct bsc_handover { struct llist_head list; diff --git a/src/libbsc/meas_proc.c b/src/libbsc/meas_proc.c index 5b97e74..efc3fd0 100644 --- a/src/libbsc/meas_proc.c +++ b/src/libbsc/meas_proc.c @@ -24,10 +24,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include /* process an already parsed measurement report */ static int process_meas_rep(struct gsm_meas_rep *mr) diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c index 808103d..cb8379e 100644 --- a/src/libbsc/meas_rep.c +++ b/src/libbsc/meas_rep.c @@ -20,8 +20,8 @@ */ -#include -#include +#include +#include static int get_field(const struct gsm_meas_rep *rep, enum meas_rep_field field) diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 0dd3753..a71662c 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -17,10 +17,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index 02212a3..b8f9043 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -42,14 +42,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include void *tall_paging_ctx; diff --git a/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c index 98e12fa..40dd68d 100644 --- a/src/libbsc/pcu_sock.c +++ b/src/libbsc/pcu_sock.c @@ -37,12 +37,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg); uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index fdab70a..ae04225 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -26,13 +26,13 @@ #include #include -#include -#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include /* generate SI1 rest octets */ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net) diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index fe0b23d..c0df8bb 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -33,12 +33,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* * DCS1800 and PCS1900 have overlapping ARFCNs. We would need to set the diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c0294c7..c40bc41 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index fbcfa1d..16d51a1 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -25,11 +25,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 1791687..fd10836 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -25,10 +25,10 @@ #include #include -#include +#include -#include -#include +#include +#include struct cmd_node net_node = { GSMNET_NODE, diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 1443791..d4d5fb5 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,12 +23,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..68fc597 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 077029a..e085aa6 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -34,9 +34,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..84a71cb 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index a2f6b2d..a746c24 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..78aacdb 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c index a42206d..d7b737b 100644 --- a/src/libfilter/bsc_msg_acc.c +++ b/src/libfilter/bsc_msg_acc.c @@ -18,9 +18,9 @@ * */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c index 338db72..fc87e88 100644 --- a/src/libfilter/bsc_msg_filter.c +++ b/src/libfilter/bsc_msg_filter.c @@ -21,14 +21,14 @@ * */ -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c index c342fdc..52e0da5 100644 --- a/src/libfilter/bsc_msg_vty.c +++ b/src/libfilter/bsc_msg_vty.c @@ -17,9 +17,9 @@ * */ -#include -#include -#include +#include +#include +#include #include diff --git a/src/libtrau/rtp_proxy.c b/src/libtrau/rtp_proxy.c index 6b38ee5..5b1ca79 100644 --- a/src/libtrau/rtp_proxy.c +++ b/src/libtrau/rtp_proxy.c @@ -30,13 +30,13 @@ #include #include -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/libtrau/trau_mux.c b/src/libtrau/trau_mux.c index b37c765..e570b93 100644 --- a/src/libtrau/trau_mux.c +++ b/src/libtrau/trau_mux.c @@ -22,16 +22,16 @@ #include #include -#include +#include #include -#include +#include #include #include -#include +#include #include -#include +#include #include -#include +#include /* this corresponds to the bit-lengths of the individual codec * parameters as indicated in Table 1.1 of TS 06.10 */ diff --git a/src/libtrau/trau_upqueue.c b/src/libtrau/trau_upqueue.c index f8edaf0..c1c0003 100644 --- a/src/libtrau/trau_upqueue.c +++ b/src/libtrau/trau_upqueue.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include void trau_tx_to_mncc(struct gsm_network *net, struct msgb *msg) { diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index 8e47069..c388f5b 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -17,12 +17,12 @@ * */ -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include #include -#include +#include #define return_when_not_connected(conn) \ if (!conn->sccp_con) {\ diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index b4ffa88..94aa350 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -20,15 +20,15 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 3417783..4311250 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -18,22 +18,22 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include #include #include #include -#include -#include +#include +#include #include #define IP_V4_ADDR_LEN 4 diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index c23ed21..2446312 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -19,13 +19,13 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c index 2a9820d..7f9671a 100644 --- a/src/osmo-bsc/osmo_bsc_filter.c +++ b/src/osmo-bsc/osmo_bsc_filter.c @@ -19,13 +19,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 63afa20..a310079 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts *bts) { diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 61ef33c..5e8f45e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -18,17 +18,17 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c index 351fd2c..0e5777e 100644 --- a/src/osmo-bsc/osmo_bsc_msc.c +++ b/src/osmo-bsc/osmo_bsc_msc.c @@ -20,15 +20,15 @@ * */ -#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c index 0baf080..d28f548 100644 --- a/src/osmo-bsc/osmo_bsc_reset.c +++ b/src/osmo-bsc/osmo_bsc_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 0f6ca33..48796c1 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -26,13 +26,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 8edcbf3..0e7003f 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_filter.c b/src/osmo-bsc_nat/bsc_filter.c index 6a9e99f..8d4a680 100644 --- a/src/osmo-bsc_nat/bsc_filter.c +++ b/src/osmo-bsc_nat/bsc_filter.c @@ -20,10 +20,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c index 49050fc..bf6d0ad 100644 --- a/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -42,15 +42,15 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index 401288d..1548ea3 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -39,15 +39,15 @@ #define _GNU_SOURCE #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c index ff6a739..93cdff3 100644 --- a/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -27,12 +27,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_filter.c b/src/osmo-bsc_nat/bsc_nat_filter.c index e735290..cd7ca25 100644 --- a/src/osmo-bsc_nat/bsc_nat_filter.c +++ b/src/osmo-bsc_nat/bsc_nat_filter.c @@ -18,10 +18,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_nat_rewrite.c b/src/osmo-bsc_nat/bsc_nat_rewrite.c index 943e1fa..75ed4ec 100644 --- a/src/osmo-bsc_nat/bsc_nat_rewrite.c +++ b/src/osmo-bsc_nat/bsc_nat_rewrite.c @@ -21,13 +21,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c index 633fa87..af346ef 100644 --- a/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c +++ b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c @@ -19,9 +19,9 @@ * */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c index c12b29f..a9906b9 100644 --- a/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/src/osmo-bsc_nat/bsc_nat_utils.c @@ -21,14 +21,14 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_vty.c b/src/osmo-bsc_nat/bsc_nat_vty.c index 875cefb..5f7cbc8 100644 --- a/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/src/osmo-bsc_nat/bsc_nat_vty.c @@ -18,23 +18,23 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include #include #include -#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_sccp.c b/src/osmo-bsc_nat/bsc_sccp.c index c6c265f..bb882a6 100644 --- a/src/osmo-bsc_nat/bsc_sccp.c +++ b/src/osmo-bsc_nat/bsc_sccp.c @@ -19,9 +19,9 @@ * */ -#include -#include -#include +#include +#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c index 29b4fee..20df8d1 100644 --- a/src/osmo-bsc_nat/bsc_ussd.c +++ b/src/osmo-bsc_nat/bsc_ussd.c @@ -20,12 +20,12 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/utils/bs11_config.c b/src/utils/bs11_config.c index a0f3cb7..6487df2 100644 --- a/src/utils/bs11_config.c +++ b/src/utils/bs11_config.c @@ -32,14 +32,14 @@ #include -#include -#include +#include +#include #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/src/utils/meas_db.c b/src/utils/meas_db.c index d81efca..7233dcd 100644 --- a/src/utils/meas_db.c +++ b/src/utils/meas_db.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_json.c b/src/utils/meas_json.c index 51eb6c7..4623ee0 100644 --- a/src/utils/meas_json.c +++ b/src/utils/meas_json.c @@ -37,9 +37,9 @@ #include -#include -#include -#include +#include +#include +#include static void print_meas_rep_uni_json(struct gsm_meas_rep_unidir *mru) { diff --git a/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c index b874ac4..db00fae 100644 --- a/src/utils/meas_pcap2db.c +++ b/src/utils/meas_pcap2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include diff --git a/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c index 5032d0c..34f8385 100644 --- a/src/utils/meas_udp2db.c +++ b/src/utils/meas_udp2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 77194de..851aa03 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -16,7 +16,7 @@ #include -#include +#include struct ms_state_uni { CDKSLIDER *cdk; diff --git a/tests/abis/abis_test.c b/tests/abis/abis_test.c index 591f835..461f24e 100644 --- a/tests/abis/abis_test.c +++ b/tests/abis/abis_test.c @@ -24,9 +24,9 @@ #include #include -#include -#include -#include +#include +#include +#include static const uint8_t load_config[] = { 0x42, 0x12, 0x00, 0x08, 0x31, 0x36, 0x38, 0x64, diff --git a/tests/bsc-nat-trie/bsc_nat_trie_test.c b/tests/bsc-nat-trie/bsc_nat_trie_test.c index 4b4df2f..3c04a9f 100644 --- a/tests/bsc-nat-trie/bsc_nat_trie_test.c +++ b/tests/bsc-nat-trie/bsc_nat_trie_test.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/tests/bsc-nat/bsc_nat_test.c b/tests/bsc-nat/bsc_nat_test.c index 2914a01..a61da00 100644 --- a/tests/bsc-nat/bsc_nat_test.c +++ b/tests/bsc-nat/bsc_nat_test.c @@ -22,12 +22,12 @@ */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 20ed5b4..aedc018 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -24,13 +24,13 @@ */ -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index e66bed3..ec2927e 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -25,10 +25,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include void test_bts_debug_print(void) { diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index d9ff305..974ebe5 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -24,13 +24,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 96d56ef..3b5429c 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -19,9 +19,9 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c index 60d687d..934684f 100644 --- a/tests/subscr/bsc_subscr_test.c +++ b/tests/subscr/bsc_subscr_test.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/tests/trau/trau_test.c b/tests/trau/trau_test.c index c74e6db..c8c9a5e 100644 --- a/tests/trau/trau_test.c +++ b/tests/trau/trau_test.c @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/3813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:25:49 2017 From: gerrit-no-reply at lists.osmocom.org (Ivan Kluchnikov) Date: Mon, 4 Sep 2017 14:25:49 +0000 Subject: [PATCH] openbsc[master]: handover_decision: Fix condition for power budget handover a... Message-ID: Review at https://gerrit.osmocom.org/3814 handover_decision: Fix condition for power budget handover attempt Handover attempt for power budget case should be performed every N SACCH frames, where N = Power Budget Interval. First measurement report with mr->nr = 0 was used for the first handover attempt in this case, which is not correct, because first usable report should have mr->nr = net->handover.pwr_interval-1. Moreover using the first measurement report with mr->nr = 0 for handover attempt could lead to unnecessary handover, because usually av_rxlev for first measurement report from MS is worse than for following reports. Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e --- M openbsc/src/libbsc/handover_decision.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/14/3814/1 diff --git a/openbsc/src/libbsc/handover_decision.c b/openbsc/src/libbsc/handover_decision.c index 0f07bca..f81f1dd 100644 --- a/openbsc/src/libbsc/handover_decision.c +++ b/openbsc/src/libbsc/handover_decision.c @@ -273,7 +273,7 @@ return attempt_handover(mr); /* Power Budget AKA Better Cell */ - if ((mr->nr % net->handover.pwr_interval) == 0) + if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) return attempt_handover(mr); return 0; -- To view, visit https://gerrit.osmocom.org/3814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:45:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 14:45:03 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split into digestible pieces In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#4). Simplify TS alloc: split into digestible pieces Algorithm B implementation is way too big and complex to maintain or even to follow the code. Split it into set of smaller functions with documented interfaces to make it easier to read and modify. This opens up the road for reusing those functions in implementation of additional allocation algorithms. The test results are intentionally left unchanged to avoid potential regressions. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2400 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 235 insertions(+), 135 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/4 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index ed4a79e..52d5edd 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -217,6 +217,16 @@ } +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in,out] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, @@ -374,18 +384,27 @@ /*! Return free TFI * * \param[in,out] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses * \param[out] trx_no_ TRX number on which TFI was found * \returns negative error code or 0 on success */ -static int tfi_find_free(BTS *bts, const GprsMs *ms, +static int tfi_find_free(BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -394,8 +413,7 @@ if (tfi < 0) return -EBUSY; - if (trx_no_) - *trx_no_ = trx_no; + *trx_no_ = trx_no; return tfi; } @@ -811,6 +829,205 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return pcu_lsb(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of UL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] usf USF array + * \param[in,out] ul_slots set of UL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_ul_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t dl_slots, + uint8_t reserved_ul_slots, int8_t first_common_ts, + int *usf, uint8_t *ul_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + int free_usf = -1; + + if (single) + (*ul_slots) = get_single_ts(trx, tbf, dl_slots, *ul_slots, &ts); + + if ((*ul_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No uplink slots available\n"); + return -EINVAL; + } + + if (first_common_ts >= 0) + (*ul_slots) = 1 << first_common_ts; + else + (*ul_slots) = (*ul_slots) & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, *ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + OSMO_ASSERT(ts >= 0 && ts <= 8); + + (*ul_slots) = 1 << ts; + usf[ts] = free_usf; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_ul_slots, 'u', '.'), *ul_slots, 'U'), + single ? ", single" : ""); + + update_slot_counters(*ul_slots, reserved_ul_slots, slotcount, avail_count); + + return ts; +} + +/*! Find set of DL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] dl_slots set of DL timeslots + * \param[out] slotcount Number of selected UL timeslots + * \param[out] avail_count Number of available UL timeslots + * \returns negative error code or first selected TS on success + */ +static int get_dl_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t ul_slots, + uint8_t reserved_dl_slots, int8_t first_common_ts, + uint8_t *dl_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + + if (single) + (*dl_slots) = get_single_ts(trx, tbf, *dl_slots, ul_slots, &ts); + + if ((*dl_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots available\n"); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, 'd', '.'), (*dl_slots), 'D'), + single ? ", single" : ""); + + update_slot_counters(*dl_slots, reserved_dl_slots, slotcount, avail_count); + + return ffs(*dl_slots) - 1; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -833,8 +1050,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; - int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; @@ -855,18 +1070,8 @@ first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } - /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -886,95 +1091,25 @@ } /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + first_ts = get_dl_slot_set(trx, tbf, single, ul_slots, reserved_dl_slots, first_common_ts, + &dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - OSMO_ASSERT(ts >= 0 && ts <= 8); - - ul_slots = 1 << ts; - usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; + first_ts = get_ul_slot_set(trx, tbf, single, dl_slots, reserved_ul_slots, first_common_ts, usf, + &ul_slots, &slotcount, &avail_count); /* We will stick to that single UL slot, unreserve the others */ + slotcount = 1; reserved_ul_slots = ul_slots; - - avail_count = pcu_bitcount(reserved_ul_slots); } + + if (first_ts < 0) + return -EINVAL; first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); - return -EINVAL; - } - if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); return -EINVAL; } @@ -993,51 +1128,16 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:48:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:48:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3731 to look at the new patch set (#3). Reserve ARFCN dynamically based on BTS band support Instead of statically specifying a band for a BTS to use, declare a list of supported bands for each BTS. At the time of BTS object creation, ask the BTS for band support and try to dynamically reserve an ARFCN resource which is compatible with any of the bands supported by the BTS. All this happens transparently to the test. Still, the test may want to use a specific band / arfcn. In this case, a test can use suite.reserve_arfcn(band, arfcn) to reserve a specific band/arfcn and pass that to the BTS at creation time, which will then use that one instead of trying to find a suitable one. It is left as future work to support BTs with multiple TRX, in which case several arfcn must be reserved. It should not be that difficult, mostly using "times: X" where X is the amount of trx, changing the API to use a list of arfcns and the configure() methods of the BTS. Related: OS#2230 Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 --- M example/default-suites.conf M example/defaults.conf M example/resources.conf A example/scenarios/band-1900.conf M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/suite_test.ok M selftest/suite_test/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py A suites/register/register_band_1900.py A suites/register/suite.conf 15 files changed, 152 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/31/3731/3 diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..7fc97d3 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -7,3 +7,4 @@ - smpp - aoip_smpp - aoip_encryption:cipher-a50+cipher-a51 +- register:band-1900 diff --git a/example/defaults.conf b/example/defaults.conf index 969fac6..e9e7846 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -34,7 +34,6 @@ osmobsc_bts_type: sysmobts trx_list: - max_power_red: 0 - arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 - phys_chan_config: SDCCH8 diff --git a/example/resources.conf b/example/resources.conf index 95cb8cf..3ebd57f 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -12,14 +12,14 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: [a5_0, a5_1, a5_3] - label: Ettus B200 type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800', 'GSM-1900'] launch_trx: true ciphers: [a5_0, a5_1] @@ -27,7 +27,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: [a5_0, a5_1] diff --git a/example/scenarios/band-1900.conf b/example/scenarios/band-1900.conf new file mode 100644 index 0000000..956c8db --- /dev/null +++ b/example/scenarios/band-1900.conf @@ -0,0 +1,4 @@ +resources: + bts: + - bands: + - GSM-1900 diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index b186737..e5fe6e6 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -12,7 +12,7 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: - 'a5_0' - 'a5_1' @@ -21,7 +21,7 @@ type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800'] launch_trx: true ciphers: - 'a5_0' @@ -31,7 +31,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: - 'a5_0' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index c946d3d..207cfb0 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,16 +46,16 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': '377ac78d5404b826d40c84efd04b4a9fd4e62b7e', + 'bts': [{'_hash': '2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3', 'addr': '10.42.42.114', - 'band': 'GSM-1800', + 'bands': ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', 'type': 'osmo-bts-sysmo'}, {'_hash': '6a9c9fbd364e1563a5b9f0826030a7888fd19575', 'addr': '10.42.42.50', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '6', 'label': 'Ettus B200', @@ -63,7 +63,7 @@ 'type': 'osmo-bts-trx'}, {'_hash': 'e50fd38e3bfe8039ac13bc315bc84f46110b7443', 'addr': '10.42.42.51', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '7', 'label': 'sysmoCell 5000', @@ -118,9 +118,13 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e +--- testowner: DBG: Picked - _hash: 2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5_0 - a5_1 @@ -129,7 +133,8 @@ type: osmo-bts-sysmo - _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5_0 - a5_1 @@ -170,10 +175,14 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e +- _hash: 2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3 _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5_0 - a5_1 @@ -183,7 +192,8 @@ - _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 _reserved_by: testowner-123-1490837279 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5_0 - a5_1 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..8fbf8b8 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -32,9 +32,13 @@ tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 1 x bts (candidates: 3) -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: c8a01d42f3977e49ceff0734a1475857913dfb13 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..6e40798 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -10,13 +10,13 @@ type: sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] - label: octBTS 3000 type: oct ipa_unit_id: 5 addr: 10.42.42.115 - band: GSM-1800 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:0c:90:32:b5:8a @@ -24,7 +24,7 @@ type: nanobts ipa_unit_id: 1902 addr: 10.42.42.190 - band: GSM-1900 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:02:95:00:41:b3 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index b5262a2..a53874f 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -43,6 +43,18 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + return self.band_arfcn.get('band') + + def arfcn(self): + return int(self.band_arfcn.get('arfcn')) + def trx_remote_ip(self): conf_ip = self.conf.get('trx_remote_ip', None) if conf_ip is not None: @@ -105,7 +117,8 @@ 'oml_remote_ip': self.bsc.addr(), 'trx_local_ip': self.remote_addr(), 'trx_remote_ip': self.trx_remote_ip(), - 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_trx': self.conf }) @@ -121,6 +134,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_trx')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index f37f88b..cae2828 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -29,6 +29,7 @@ remote_inst = None remote_env = None remote_dir = None + band_arfcn = None REMOTE_DIR = '/osmo-gsm-tester' BTS_SYSMO_BIN = 'osmo-bts-sysmo' @@ -110,6 +111,22 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + if not self.band_arfcn: + return None + return self.band_arfcn.get('band') + + def arfcn(self): + if not self.band_arfcn: + return None + return int(self.band_arfcn.get('arfcn')) + def configure(self): if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be configured') @@ -122,7 +139,8 @@ config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr(), - 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) @@ -138,6 +156,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_sysmo')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 4f43bfc..b7ca7d8 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -53,7 +53,7 @@ 'bts[].type': schema.STR, 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, - 'bts[].band': schema.BAND, + 'bts[].bands[]': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, 'bts[].ciphers[]': schema.CIPHER, @@ -522,6 +522,11 @@ for item in item_list: item.pop(USED_KEY, None) + def add(self, more): + if more is self or more is self.reserved: + raise RuntimeError('adding a list of reserved resources to itself') + config.add(self.reserved, copy.deepcopy(more.reserved)) + def free(self): if self.reserved: self.resources_pool.free(self.origin, self.reserved) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index cdf0a04..92d7b73 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -39,7 +39,7 @@ raise ValueError('Invalid %s: %r' % (name, val)) def band(val): - if val in ('GSM-1800', 'GSM-1900'): + if val in ('GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'): return raise ValueError('Unknown GSM band: %r' % val) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 2ac2062..f92e533 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -246,6 +246,11 @@ self.log('reserving resources in', self.resources_pool.state_dir, '...') self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + def reserve_resources_append(self, requirements): + new_reserved = self.resources_pool.reserve(self, requirements) + self.dbg('reserving new resources %r' % new_reserved) + self.reserved_resources.add(new_reserved) + def run_tests(self, names=None): try: log.large_separator(self.trial.name(), self.name(), sublevel=2) @@ -317,6 +322,14 @@ return self.reserved_resources.free() + def reserve_arfcn(self, band, arfcn=None): + '''To be used by tests. Returned resource can be passed when requested a bts object''' + + if arfcn is None: + return self._try_reserve_arfcn((band,)) + else: + return self.reserve_resources_append({ 'arfcn': [{'band': band, 'arfcn': arfcn, 'times': '1'}] }) + def ip_address(self, specifics=None): return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics) @@ -350,8 +363,18 @@ ip_address = self.ip_address() return osmo_stp.OsmoStp(self, ip_address) - def bts(self, specifics=None): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + def bts(self, arfcn=None, specifics=None): + return bts_obj(self, arfcn, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + + def _try_reserve_arfcn(self, supported_bands): + for band in supported_bands: + try: + self.reserve_resources_append({ 'arfcn': [{'band': band, 'times': '1'}] }) + except resource.NoResourceExn as e: + self.dbg('Band %s has no available arfcns' % band) + continue + return self.reserved_resources.get(resource.R_ARFCN) + raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) @@ -448,12 +471,17 @@ scenarios = [config.get_scenario(scenario_name) for scenario_name in scenario_names] return (suite_scenario_str, suite, scenarios) -def bts_obj(suite_run, conf): +def bts_obj(suite_run, arfcn, conf): bts_type = conf.get('type') log.dbg('create BTS object', type=bts_type) bts_class = resource.KNOWN_BTS_TYPES.get(bts_type) if bts_class is None: raise RuntimeError('No such BTS type is defined: %r' % bts_type) - return bts_class(suite_run, conf) + bts_inst = bts_class(suite_run, conf) + if arfcn is None: + supported_bands = bts_inst.supported_bands() + arfcn = suite_run._try_reserve_arfcn(supported_bands) + bts_inst.set_arfcn_resource(arfcn) + return bts_inst # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/register/register_band_1900.py b/suites/register/register_band_1900.py new file mode 100755 index 0000000..3e0f6c3 --- /dev/null +++ b/suites/register/register_band_1900.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +arfcn = suite.reserve_arfcn(band='GSM-1900') +bts = suite.bts(arfcn) +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +ms.log_info() + +print('waiting for modems to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/register/suite.conf b/suites/register/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/register/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:48:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:48:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3721 to look at the new patch set (#2). resource: Fix list comparison in item_matches In following commits, cipher attribute containing a list of supported ciphers is introdued in osmo-gsm-tester. While developing the feature, it was found that resources containing lists are not being handled correctly. Previous implementation regarding lists in several ways: - In the list coe path, both item and wanted_item are expected to be lists. Python doesn't support to check for sublists using the "in" operand. - want_item basically contains the scenario dic, and item is each of the items available as resource of a given type. Thus, we want to check that item supports the subset of features requested by the scenario, ie. that the list in the scenario is a subset of the ones in the3 item and not the opposite. The following failing scenario is going to be checked during "make check" when the cipher attribute is added: BTS supporting cipher a50 and a51, and scenario requesting a50 succeeds. If this commit is remove, the test no longer passes, and it fails with: osmo_gsm_tester.resource.NoResourceExn: No matching resource available for bts = {'type': 'osmo-bts-sysmo', 'ciphers': ['a5 1']} Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d --- M src/osmo_gsm_tester/resource.py 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/21/3721/2 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index c55140a..da543f7 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -441,9 +441,12 @@ return True if is_list(wanted_item): - # multiple possible values - if item not in wanted_item: + if not is_list(item): return False + # multiple possible values + for val in wanted_item: + if val not in item: + return False return True return item == wanted_item -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:48:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:48:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3722 to look at the new patch set (#2). config: Fix combination of lists It can make sense to recursively call combine() for a list containing complex structures like dictionaries or lists. However, for a list of simple types (eg. integers or strings), we just want to merge both lists and we only need to check if the value is already there. This case won't work if we call combine for each element of the list because for a simple case it will just end up checking if a[i] == b[i]. A sample unit test is provided with this commit which shows the kind of issue it fixes. This kind of operation is needed in later commits where cipher attribute is introduced. Without this patch, having following 2 scenarios and trying them to use together "-s foosuite:cipher-a50+ciphera51" will fail: cipher_a50.conf: bts: - ciphers: - 'a5 0' cipher_a51.conf bts: - ciphers: - 'a5 1' ValueError: cannot combine dicts, conflicting items (values 'a5 0' and 'a5 1') Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 --- M selftest/config_test.ok M selftest/config_test.py M src/osmo_gsm_tester/config.py 3 files changed, 16 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3722/2 diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 80b5a06..11bb833 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -93,3 +93,5 @@ Validation: Error --- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error +- Combine lists: +{'a_list': ['x', 'z', 'y']} diff --git a/selftest/config_test.py b/selftest/config_test.py index 61ec73a..bf4a2e1 100755 --- a/selftest/config_test.py +++ b/selftest/config_test.py @@ -8,7 +8,7 @@ import pprint import copy -from osmo_gsm_tester import config, log, schema +from osmo_gsm_tester import config, log, schema, util example_config_file = 'test.cfg' example_config = os.path.join(_prep.script_dir, 'config_test', example_config_file) @@ -27,6 +27,7 @@ 'bts[].trx[].timeslots[]' : schema.STR, 'bts[].trx[].band' : schema.BAND, 'a_dict.foo' : schema.INT, + 'a_list[]': util.is_list, 'addr[]' : schema.IPV4, 'hwaddr[]' : schema.HWADDR, 'imsi[]' : schema.IMSI, @@ -112,4 +113,11 @@ c['imsi'][2] = None val(c) +print('- Combine lists:') +a = {} +b = {} +a['a_list'] = ['x', 'z'] +b['a_list'] = [ 'y' ] +config.combine(a, b) +print(a) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index f6e81ac..392cd04 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -246,7 +246,11 @@ raise ValueError('cannot combine list with a value of type: %r' % type(src)) for i in range(len(src)): log.ctx(idx=i) - combine(dest[i], src[i]) + assert type(dest[i]) == type(src[i]) + if is_dict(dest[i]) or is_list(dest[i]): + combine(dest[i], src[i]) + elif src[i] not in dest: + dest.append(src[i]) return if dest == src: return -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:48:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:48:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3723 to look at the new patch set (#4). Add cipher cfg param for modem and bts This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e --- M example/default-suites.conf M example/resources.conf A example/scenarios/cipher-a50.conf A example/scenarios/cipher-a51.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 31 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/3723/4 diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..1e8d47a 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption +- aoip_encryption:cipher-a50+cipher-a51 diff --git a/example/resources.conf b/example/resources.conf index f190c2f..95cb8cf 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -13,6 +13,7 @@ ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: [a5_0, a5_1, a5_3] - label: Ettus B200 type: osmo-bts-trx @@ -20,6 +21,7 @@ addr: 10.42.42.50 band: GSM-1800 launch_trx: true + ciphers: [a5_0, a5_1] - label: sysmoCell 5000 type: osmo-bts-trx @@ -27,6 +29,7 @@ addr: 10.42.42.51 band: GSM-1800 trx_remote_ip: 10.42.42.112 + ciphers: [a5_0, a5_1] arfcn: - arfcn: 512 @@ -56,21 +59,25 @@ imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' + ciphers: [a5_0, a5_1] diff --git a/example/scenarios/cipher-a50.conf b/example/scenarios/cipher-a50.conf new file mode 100644 index 0000000..107172b --- /dev/null +++ b/example/scenarios/cipher-a50.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - a5_0 + modem: + - ciphers: + - a5_0 diff --git a/example/scenarios/cipher-a51.conf b/example/scenarios/cipher-a51.conf new file mode 100644 index 0000000..8539867 --- /dev/null +++ b/example/scenarios/cipher-a51.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - a5_1 + modem: + - ciphers: + - a5_1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index da543f7..4f43bfc 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -56,6 +56,7 @@ 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, + 'bts[].ciphers[]': schema.CIPHER, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, @@ -65,6 +66,7 @@ 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, + 'modem[].ciphers[]': schema.CIPHER, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 2da80cd..cdf0a04 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -66,6 +66,11 @@ return raise ValueError('Unknown Authentication Algorithm: %r' % val) +def cipher(val): + if val in ('a5_0', 'a5_1', 'a5_2', 'a5_3', 'a5_4', 'a5_5', 'a5_6', 'a5_7'): + return + raise ValueError('Unknown Cipher value: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -76,6 +81,7 @@ KI = 'ki' MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' +CIPHER = 'cipher' SCHEMA_TYPES = { INT: int, STR: str, @@ -87,6 +93,7 @@ KI: ki, MSISDN: msisdn, AUTH_ALGO: auth_algo, + CIPHER: cipher, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:48:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:48:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3724 to look at the new patch set (#4). resource_test: update to check list features (ciphers) Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c --- M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/resource_test.py 3 files changed, 182 insertions(+), 237 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/24/3724/4 diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index 2005590..b186737 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -1,32 +1,41 @@ # all hardware and interfaces available to this osmo-gsm-tester ip_address: -- addr: 10.42.42.1 - addr: 10.42.42.2 - addr: 10.42.42.3 +- addr: 10.42.42.4 +- addr: 10.42.42.5 +- addr: 10.42.42.6 bts: - label: sysmoBTS 1002 - type: sysmo + type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - 'a5_0' + - 'a5_1' -- label: octBTS 3000 - type: oct - ipa_unit_id: 5 - addr: 10.42.42.115 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.50 band: GSM-1800 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a + launch_trx: true + ciphers: + - 'a5_0' + - 'a5_1' -- label: nanoBTS 1900 - type: nanobts - ipa_unit_id: 1902 - addr: 10.42.42.190 - band: GSM-1900 - trx_list: - - hw_addr: 00:02:95:00:41:b3 +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.51 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + ciphers: + - 'a5_0' + - 'a5_1' arfcn: - arfcn: 512 @@ -39,7 +48,6 @@ band: GSM-1800 - arfcn: 520 band: GSM-1800 - - arfcn: 540 band: GSM-1900 - arfcn: 542 @@ -52,82 +60,38 @@ band: GSM-1900 modem: -- label: m7801 - path: '/wavecom_0' - imsi: 901700000007801 - ki: D620F48487B1B782DA55DF6717F08FF9 +- label: sierra_1 + path: '/sierra_1' + imsi: '901700000009031' + ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' -- label: m7802 - path: '/wavecom_1' - imsi: 901700000007802 - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 +- label: sierra_2 + path: '/sierra_2' + imsi: '901700000009029' + ki: '00969E283349D354A8239E877F2E0866' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' -- label: m7803 - path: '/wavecom_2' - imsi: 901700000007803 - ki: ABBED4C91417DF710F60675B6EE2C8D2 +- label: gobi_0 + path: '/gobi_0' + imsi: '901700000009030' + ki: 'BB70807226393CDBAC8DD3439FF54252' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' -- label: m7804 - path: '/wavecom_3' - imsi: 901700000007804 - ki: 8BA541179156F2BF0918CA3CFF9351B0 - -- label: m7805 - path: '/wavecom_4' - imsi: 901700000007805 - ki: 82BEC24B5B50C9FAA69D17DEC0883A23 - -- label: m7806 - path: '/wavecom_5' - imsi: 901700000007806 - ki: DAF6BD6A188F7A4F09866030BF0F723D - -- label: m7807 - path: '/wavecom_6' - imsi: 901700000007807 - ki: AEB411CFE39681A6352A1EAE4DDC9DBA - -- label: m7808 - path: '/wavecom_7' - imsi: 901700000007808 - ki: F5DEF8692B305D7A65C677CA9EEE09C4 - -- label: m7809 - path: '/wavecom_8' - imsi: 901700000007809 - ki: A644F4503E812FD75329B1C8D625DA44 - -- label: m7810 - path: '/wavecom_9' - imsi: 901700000007810 - ki: EF663BDF3477DCD18D3D2293A2BAED67 - -- label: m7811 - path: '/wavecom_10' - imsi: 901700000007811 - ki: E88F37F048A86A9BC4D652539228C039 - -- label: m7812 - path: '/wavecom_11' - imsi: 901700000007812 - ki: E8D940DD66FCF6F1CD2C0F8F8C45633D - -- label: m7813 - path: '/wavecom_12' - imsi: 901700000007813 - ki: DBF534700C10141C49F699B0419107E3 - -- label: m7814 - path: '/wavecom_13' - imsi: 901700000007814 - ki: B36021DEB90C4EA607E408A92F3B024D - -- label: m7815 - path: '/wavecom_14' - imsi: 901700000007815 - ki: 1E209F6F839F9195778C4F96BE281A24 - -- label: m7816 - path: '/wavecom_15' - imsi: 901700000007816 - ki: BF827D219E739DD189F6F59E60D6455C +- label: gobi_3 + path: '/gobi_3' + imsi: '901700000009032' + ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index d366cf9..c946d3d 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,112 +46,67 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': '07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9', + 'bts': [{'_hash': '377ac78d5404b826d40c84efd04b4a9fd4e62b7e', 'addr': '10.42.42.114', 'band': 'GSM-1800', + 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', - 'type': 'sysmo'}, - {'_hash': '76c8d2f459113cd6c99ed62d1a94bbe9a291ba94', - 'addr': '10.42.42.115', + 'type': 'osmo-bts-sysmo'}, + {'_hash': '6a9c9fbd364e1563a5b9f0826030a7888fd19575', + 'addr': '10.42.42.50', 'band': 'GSM-1800', - 'ipa_unit_id': '5', - 'label': 'octBTS 3000', - 'trx_list': [{'hw_addr': '00:0c:90:32:b5:8a'}], - 'type': 'oct'}, - {'_hash': '0b7fabd512b36aec43d7d496abd00af4e193b0f8', - 'addr': '10.42.42.190', - 'band': 'GSM-1900', - 'ipa_unit_id': '1902', - 'label': 'nanoBTS 1900', - 'trx_list': [{'hw_addr': '00:02:95:00:41:b3'}], - 'type': 'nanobts'}], - 'ip_address': [{'_hash': 'cde1debf28f07f94f92c761b4b7c6bf35785ced4', - 'addr': '10.42.42.1'}, - {'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c', + 'ciphers': ['a5_0', 'a5_1'], + 'ipa_unit_id': '6', + 'label': 'Ettus B200', + 'launch_trx': 'True', + 'type': 'osmo-bts-trx'}, + {'_hash': 'e50fd38e3bfe8039ac13bc315bc84f46110b7443', + 'addr': '10.42.42.51', + 'band': 'GSM-1800', + 'ciphers': ['a5_0', 'a5_1'], + 'ipa_unit_id': '7', + 'label': 'sysmoCell 5000', + 'trx_remote_ip': '10.42.42.112', + 'type': 'osmo-bts-trx'}], + 'ip_address': [{'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c', 'addr': '10.42.42.2'}, {'_hash': '1c614d6210c551d142aadca8f25e1534ebb2a70f', - 'addr': '10.42.42.3'}], - 'modem': [{'_hash': '19c69e45aa090fb511446bd00797690aa82ff52f', - 'imsi': '901700000007801', - 'ki': 'D620F48487B1B782DA55DF6717F08FF9', - 'label': 'm7801', - 'path': '/wavecom_0'}, - {'_hash': 'e1a46516a1fb493b2617ab14fc1693a9a45ec254', - 'imsi': '901700000007802', - 'ki': '47FDB2D55CE6A10A85ABDAD034A5B7B3', - 'label': 'm7802', - 'path': '/wavecom_1'}, - {'_hash': '4fe91500a309782bb0fd8ac6fc827834089f8b00', - 'imsi': '901700000007803', - 'ki': 'ABBED4C91417DF710F60675B6EE2C8D2', - 'label': 'm7803', - 'path': '/wavecom_2'}, - {'_hash': 'c895badf0c2faaa4a997cd9f2313b5ebda7486e4', - 'imsi': '901700000007804', - 'ki': '8BA541179156F2BF0918CA3CFF9351B0', - 'label': 'm7804', - 'path': '/wavecom_3'}, - {'_hash': '60f182abed05adb530e3d06d88cc47703b65d7d8', - 'imsi': '901700000007805', - 'ki': '82BEC24B5B50C9FAA69D17DEC0883A23', - 'label': 'm7805', - 'path': '/wavecom_4'}, - {'_hash': 'd1f0fbf089a4bf32dd566af956d23b89e3d60821', - 'imsi': '901700000007806', - 'ki': 'DAF6BD6A188F7A4F09866030BF0F723D', - 'label': 'm7806', - 'path': '/wavecom_5'}, - {'_hash': '2445e3b5949d15f4351c0db1d3f3f593f9d73aa5', - 'imsi': '901700000007807', - 'ki': 'AEB411CFE39681A6352A1EAE4DDC9DBA', - 'label': 'm7807', - 'path': '/wavecom_6'}, - {'_hash': '80247388b2ca382382c4aec678102355b7922965', - 'imsi': '901700000007808', - 'ki': 'F5DEF8692B305D7A65C677CA9EEE09C4', - 'label': 'm7808', - 'path': '/wavecom_7'}, - {'_hash': '5b9e4e117a8889430542d22a9693e7b999362856', - 'imsi': '901700000007809', - 'ki': 'A644F4503E812FD75329B1C8D625DA44', - 'label': 'm7809', - 'path': '/wavecom_8'}, - {'_hash': '219a7abb057050eef3ce4b99c487f32bbaae9a41', - 'imsi': '901700000007810', - 'ki': 'EF663BDF3477DCD18D3D2293A2BAED67', - 'label': 'm7810', - 'path': '/wavecom_9'}, - {'_hash': '75d45c2d975b893da34c7cae827c25a2039cecd2', - 'imsi': '901700000007811', - 'ki': 'E88F37F048A86A9BC4D652539228C039', - 'label': 'm7811', - 'path': '/wavecom_10'}, - {'_hash': '1777362f556b249a5c1d6a83110704dbd037bc20', - 'imsi': '901700000007812', - 'ki': 'E8D940DD66FCF6F1CD2C0F8F8C45633D', - 'label': 'm7812', - 'path': '/wavecom_11'}, - {'_hash': '21d7eb4b0c782e004821a9f7f778891c93956924', - 'imsi': '901700000007813', - 'ki': 'DBF534700C10141C49F699B0419107E3', - 'label': 'm7813', - 'path': '/wavecom_12'}, - {'_hash': 'f53e4e79bdbc63eb2845de671007d4f733f28409', - 'imsi': '901700000007814', - 'ki': 'B36021DEB90C4EA607E408A92F3B024D', - 'label': 'm7814', - 'path': '/wavecom_13'}, - {'_hash': 'df1abec7704ebc89b2c062a69bd299cf3663ed9e', - 'imsi': '901700000007815', - 'ki': '1E209F6F839F9195778C4F96BE281A24', - 'label': 'm7815', - 'path': '/wavecom_14'}, - {'_hash': '11df1e4c7708157e5b89020c757763f58d6e610b', - 'imsi': '901700000007816', - 'ki': 'BF827D219E739DD189F6F59E60D6455C', - 'label': 'm7816', - 'path': '/wavecom_15'}]} + 'addr': '10.42.42.3'}, + {'_hash': '862b529c701adf302477bc126a8032cfc2ec4753', + 'addr': '10.42.42.4'}, + {'_hash': '05feb6e1e24ca4235889eb28d0a8d5cedac6e5d1', + 'addr': '10.42.42.5'}, + {'_hash': 'e780ac7581ad29f8f46e637b61d0c38898c4c52c', + 'addr': '10.42.42.6'}], + 'modem': [{'_hash': 'f392ed391f9d39abb6ae01431b26b4f44079a447', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009031', + 'ki': '80A37E6FDEA931EAC92FFA5F671EFEAD', + 'label': 'sierra_1', + 'path': '/sierra_1'}, + {'_hash': '1b3cf2a04bde791a84fcc462c29f73391b1f7313', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009029', + 'ki': '00969E283349D354A8239E877F2E0866', + 'label': 'sierra_2', + 'path': '/sierra_2'}, + {'_hash': '83f7b4a07c355487d31db6f068146e48bb1ed118', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009030', + 'ki': 'BB70807226393CDBAC8DD3439FF54252', + 'label': 'gobi_0', + 'path': '/gobi_0'}, + {'_hash': 'a5f8f08a24df0eca067c5b51d55c3c4fd8721908', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009032', + 'ki': '2F70DCA43C45ACB97E947FDD0C7CA30A', + 'label': 'gobi_3', + 'path': '/gobi_3'}]} *** end: all resources - request some resources @@ -163,34 +118,47 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +--- testowner: DBG: Picked - _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e addr: 10.42.42.114 band: GSM-1800 + ciphers: + - a5_0 + - a5_1 ipa_unit_id: '1' label: sysmoBTS 1002 - type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 - addr: 10.42.42.115 + type: osmo-bts-sysmo +- _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 + addr: 10.42.42.50 band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct ---- testowner: Reserving 1 x ip_address (candidates: 3) ---- testowner: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 - addr: 10.42.42.1 ---- testowner: Reserving 2 x modem (candidates: 16) ---- testowner: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f - imsi: '901700000007801' - ki: D620F48487B1B782DA55DF6717F08FF9 - label: m7801 - path: /wavecom_0 -- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 - imsi: '901700000007802' - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 - label: m7802 - path: /wavecom_1 + ciphers: + - a5_0 + - a5_1 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + type: osmo-bts-trx +--- testowner: Reserving 1 x ip_address (candidates: 5) +--- testowner: DBG: Picked - _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c + addr: 10.42.42.2 +--- testowner: Reserving 2 x modem (candidates: 4) +--- testowner: DBG: Picked - _hash: f392ed391f9d39abb6ae01431b26b4f44079a447 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009031' + ki: 80A37E6FDEA931EAC92FFA5F671EFEAD + label: sierra_1 + path: /sierra_1 +- _hash: 1b3cf2a04bde791a84fcc462c29f73391b1f7313 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009029' + ki: 00969E283349D354A8239E877F2E0866 + label: sierra_2 + path: /sierra_2 ~~~ currently reserved: arfcn: - _hash: e620569450f8259b3f0212ec19c285dd07df063c @@ -202,39 +170,52 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +- _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - a5_0 + - a5_1 ipa_unit_id: '1' label: sysmoBTS 1002 - type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + type: osmo-bts-sysmo +- _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 _reserved_by: testowner-123-1490837279 - addr: 10.42.42.115 + addr: 10.42.42.50 band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct + ciphers: + - a5_0 + - a5_1 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + type: osmo-bts-trx ip_address: -- _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 +- _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c _reserved_by: testowner-123-1490837279 - addr: 10.42.42.1 + addr: 10.42.42.2 modem: -- _hash: 19c69e45aa090fb511446bd00797690aa82ff52f +- _hash: f392ed391f9d39abb6ae01431b26b4f44079a447 _reserved_by: testowner-123-1490837279 - imsi: '901700000007801' - ki: D620F48487B1B782DA55DF6717F08FF9 - label: m7801 - path: /wavecom_0 -- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009031' + ki: 80A37E6FDEA931EAC92FFA5F671EFEAD + label: sierra_1 + path: /sierra_1 +- _hash: 1b3cf2a04bde791a84fcc462c29f73391b1f7313 _reserved_by: testowner-123-1490837279 - imsi: '901700000007802' - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 - label: m7802 - path: /wavecom_1 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009029' + ki: 00969E283349D354A8239E877F2E0866 + label: sierra_2 + path: /sierra_2 ~~~ end: currently reserved diff --git a/selftest/resource_test.py b/selftest/resource_test.py index a0ec490..8b60be6 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -73,9 +73,9 @@ print('- request some resources') want = { 'ip_address': [ { 'times': 1 } ], - 'bts': [ { 'type': 'sysmo', 'times': 1 }, { 'type': 'oct', 'times': 1 } ], + 'bts': [ { 'type': 'osmo-bts-sysmo', 'times': 1 , 'ciphers': ['a5_1']}, { 'type': 'osmo-bts-trx', 'times': 1 } ], 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], - 'modem': [ { 'times': 2 } ], + 'modem': [ { 'times': 2 , 'ciphers': ['a5_0', 'a5_1']} ], } origin = log.Origin(None, 'testowner') -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:48:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:48:18 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Use own format to specify encryption algorithm Message-ID: Review at https://gerrit.osmocom.org/3815 Use own format to specify encryption algorithm ... instead of using the one from from osmo vty directly. This way we avoid having multiple word attribute value and we can skip using quotes in the conf files. Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d --- M example/defaults.conf M selftest/template_test/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/util.py M suites/aoip_encryption/register_a5_0_authopt.py M suites/aoip_encryption/register_a5_0_authreq.py M suites/aoip_encryption/register_a5_1_authreq.py 9 files changed, 26 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/15/3815/1 diff --git a/example/defaults.conf b/example/defaults.conf index 082f159..969fac6 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -5,7 +5,7 @@ short_name: osmo-gsm-tester-nitb long_name: osmo-gsm-tester-nitb auth_policy: closed - encryption: a5 0 + encryption: a5_0 bsc: net: @@ -14,7 +14,7 @@ short_name: osmo-gsm-tester-msc long_name: osmo-gsm-tester-msc auth_policy: closed - encryption: a5 0 + encryption: a5_0 authentication: optional msc: @@ -24,7 +24,7 @@ short_name: osmo-gsm-tester-msc long_name: osmo-gsm-tester-msc auth_policy: closed - encryption: a5 0 + encryption: a5_0 authentication: optional bsc_bts: diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 200dfdc..2559b14 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -24,7 +24,7 @@ long name ${net_name_long} auth policy ${net_auth_policy} location updating reject cause 13 - encryption a5 ${encryption} + encryption ${encryption} neci 1 rrlp mode none mm info 1 diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 2eb23fb..6b5c2bc 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -84,7 +84,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(bsc=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['bsc']['net']['encryption']) + config.overlay(values, dict(bsc=dict(net=dict(encryption=encryption_vty)))) self.dbg('BSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index f023b29..67234e3 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -81,7 +81,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['msc']['net']['encryption']) + config.overlay(values, dict(msc=dict(net=dict(encryption=encryption_vty)))) if self.authentication is not None: config.overlay(values, dict(msc=dict(net=dict(authentication=self.authentication)))) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 8f91bbd..b0a706d 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -82,7 +82,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(nitb=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['nitb']['net']['encryption']) + config.overlay(values, dict(nitb=dict(net=dict(encryption=encryption_vty)))) self.config = values diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..4e12776 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -314,4 +314,8 @@ return True raise ValueError('Invalid BOOL field: %r' % val) +def encryption2osmovty(val): + assert val[:3] == 'a5_' + return 'a5 ' + val[3:] + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py index ff93cb8..0224ee0 100755 --- a/suites/aoip_encryption/register_a5_0_authopt.py +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(False) -msc.set_encryption('a5 0') -bsc.set_encryption('a5 0') +msc.set_encryption('a5_0') +bsc.set_encryption('a5_0') hlr.start() stp.start() msc.start() diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index be8f8a1..a191008 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(True) -msc.set_encryption('a5 0') -bsc.set_encryption('a5 0') +msc.set_encryption('a5_0') +bsc.set_encryption('a5_0') hlr.start() stp.start() msc.start() diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index dd41348..bbcc3e5 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(True) -msc.set_encryption('a5 1') -bsc.set_encryption('a5 1') +msc.set_encryption('a5_1') +bsc.set_encryption('a5_1') hlr.start() stp.start() msc.start() -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:48:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:48:18 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource_test: Fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/3816 resource_test: Fix trailing whitespace Change-Id: I654484b21ca2e950ff3019ee20133e9cb50296bb --- M selftest/resource_test.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/16/3816/1 diff --git a/selftest/resource_test.py b/selftest/resource_test.py index 8b60be6..9a78674 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -37,7 +37,7 @@ try: resource.solve([ [0, 2], [2], - [0, 2] ]) + [0, 2] ]) assert False except resource.NotSolvable as e: print(e) -- To view, visit https://gerrit.osmocom.org/3816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I654484b21ca2e950ff3019ee20133e9cb50296bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 14:51:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 14:51:27 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 As discussed, let's not merge this for now. I still fixed some comments you had in case we can re-use some of the work done in here. -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:02:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 15:02:28 +0000 Subject: osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) >From my point of view, we can merge this one. https://gerrit.osmocom.org/#/c/3763/1/example/resources.conf File example/resources.conf: Line 63: features: ['sms'] > again the '- item' list format consideration, if you agree I'd like to keep this format, it's more compact and handy when I'm looking through the resources.conf. It also took me a while to understand how arrays are formatted with the other format, I find this one a lot more natural. In case we move to a new parsing engine (ie. never), then we can easily move a few configuration to use a different format. Meanwhile (eternity), let's enjoy it. Line 79: features: [] > (let's just omit the property if it is empty) If you don't mind I'll keep this one like this because of course it has some features but I didn't get to test them yet, so I need to fill them at some point, hopefully soon. This way to I can remember more easily to do it. -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:03:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 15:03:05 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3150 to look at the new patch set (#9). Move DL scheduling and RTS handler to trx level Use TRX object directly instead of BTS singleton and trx_no. This is necessary to facilitate the move of UL/DL TBF lists to TRX level. Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Related: OS#1541 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_sched.cpp M src/pcu_l1_if.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp 8 files changed, 66 insertions(+), 76 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/50/3150/9 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..5cf3d7c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1375,8 +1375,7 @@ egprs_ms_class, tlli, ta, ms); if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); + handle_tbf_reject(get_trx(), ms, tlli, ts_no); return; } diff --git a/src/bts.h b/src/bts.h index d65cd2f..37e065e 100644 --- a/src/bts.h +++ b/src/bts.h @@ -92,7 +92,7 @@ gprs_rlcmac_bts *bts_data() const; BTS *bts() const; uint8_t trx_no() const; - + gprs_rlcmac_trx *get_trx(); struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); @@ -695,6 +695,11 @@ return trx->bts->bts_data(); } +inline gprs_rlcmac_trx *gprs_rlcmac_pdch::get_trx() +{ + return trx; +} + inline uint8_t gprs_rlcmac_pdch::trx_no() const { return trx->trx_no; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..3d825a8 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -89,9 +89,7 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, const char *imsi); -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr); +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr); int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class = 0); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 2350808..4585622 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,12 +25,10 @@ #include "pcu_utils.h" -static uint32_t sched_poll(BTS *bts, - uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, - struct gprs_rlcmac_tbf **poll_tbf, - struct gprs_rlcmac_tbf **ul_ass_tbf, - struct gprs_rlcmac_tbf **dl_ass_tbf, - struct gprs_rlcmac_ul_tbf **ul_ack_tbf) +static uint32_t sched_poll(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_tbf **poll_tbf, + struct gprs_rlcmac_tbf **ul_ass_tbf, struct gprs_rlcmac_tbf **dl_ass_tbf, + struct gprs_rlcmac_ul_tbf **ul_ack_tbf) { struct gprs_rlcmac_ul_tbf *ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf; @@ -42,11 +40,11 @@ if ((block_nr % 3) == 2) poll_fn ++; poll_fn = poll_fn % GSM_MAX_FN; - llist_for_each(pos, &bts->ul_tbfs()) { + llist_for_each(pos, &trx->bts->ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); OSMO_ASSERT(ul_tbf); /* this trx, this ts */ - if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) + if (ul_tbf->trx->trx_no != trx->trx_no || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -63,11 +61,11 @@ /* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states? */ } - llist_for_each(pos, &bts->dl_tbfs()) { + llist_for_each(pos, &trx->bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); OSMO_ASSERT(dl_tbf); /* this trx, this ts */ - if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) + if (dl_tbf->trx->trx_no != trx->trx_no || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -207,9 +205,8 @@ return NULL; } -static struct msgb *sched_select_downlink(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, uint32_t fn, - uint8_t block_nr, struct gprs_rlcmac_pdch *pdch) +static struct msgb *sched_select_downlink(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_pdch *pdch) { struct msgb *msg = NULL; struct gprs_rlcmac_dl_tbf *tbf, *prio_tbf = NULL; @@ -226,7 +223,7 @@ int age; const int age_thresh1 = msecs_to_frames(200); const int high_prio_msecs = - OSMO_MIN(BTS::TIMER_T3190_MSEC/2, bts->dl_tbf_idle_msec); + OSMO_MIN(BTS::TIMER_T3190_MSEC/2, trx->bts->bts_data()->dl_tbf_idle_msec); const int age_thresh2 = msecs_to_frames(high_prio_msecs); /* select downlink resource */ @@ -278,7 +275,7 @@ if (prio_tbf) { LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling data message at " "RTS for DL TFI=%d (TRX=%d, TS=%d) prio=%d\n", - prio_tfi, trx, ts, max_prio); + prio_tfi, trx->trx_no, ts, max_prio); /* next TBF to handle resource is the next one */ pdch->next_dl_tfi = (prio_tfi + 1) & 31; /* generate DL data block */ @@ -308,37 +305,35 @@ return msg; } -static inline void tap_n_acc(const struct msgb *msg, const struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, - uint32_t fn, enum pcu_gsmtap_category cat) +static inline void tap_n_acc(const struct msgb *msg, struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, + enum pcu_gsmtap_category cat) { if (!msg) return; switch(cat) { case PCU_GSMTAP_C_DL_CTRL: - bts->bts->rlc_sent_control(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, - msg->len); + trx->bts->rlc_sent_control(); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx->trx_no, ts, GSMTAP_CHANNEL_PACCH, fn, + msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DATA_GPRS: - bts->bts->rlc_sent(); + trx->bts->rlc_sent(); /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, - msg->len); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx->trx_no, ts, GSMTAP_CHANNEL_PDTCH, fn, + msg->data, msg->len); break; case PCU_GSMTAP_C_DL_DUMMY: - bts->bts->rlc_sent_dummy(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, - msg->len); + trx->bts->rlc_sent_dummy(); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx->trx_no, ts, GSMTAP_CHANNEL_PACCH, fn, + msg->data, msg->len); break; default: break; } } -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr) +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr) { struct gprs_rlcmac_pdch *pdch; struct gprs_rlcmac_tbf *poll_tbf = NULL, *dl_ass_tbf = NULL, @@ -348,62 +343,60 @@ struct msgb *msg = NULL; uint32_t poll_fn, sba_fn; - if (trx >= 8 || ts >= 8) + if (trx->trx_no >= 8 || ts >= 8) return -EINVAL; - pdch = &bts->trx[trx].pdch[ts]; + pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { LOGP(DRLCMACSCHED, LOGL_ERROR, "Received RTS on disabled PDCH: " - "TRX=%d TS=%d\n", trx, ts); + "TRX=%d TS=%d\n", trx->trx_no, ts); return -EIO; } /* store last frame number of RTS */ pdch->last_rts_fn = fn; - poll_fn = sched_poll(bts->bts, trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, - &dl_ass_tbf, &ul_ack_tbf); + poll_fn = sched_poll(trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, &dl_ass_tbf, &ul_ack_tbf); /* check uplink resource for polling */ if (poll_tbf) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "polling at FN=%d of %s\n", trx, ts, fn, + "polling at FN=%d of %s\n", trx->trx_no, ts, fn, block_nr, poll_fn, tbf_name(poll_tbf)); /* use free USF */ /* else. check for sba */ - else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr) != 0xffffffff)) + else if ((sba_fn = trx->bts->sba()->sched(trx->trx_no, ts, fn, block_nr) != 0xffffffff)) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "single block allocation at FN=%d\n", trx, ts, fn, + "single block allocation at FN=%d\n", trx->trx_no, ts, fn, block_nr, sba_fn); /* use free USF */ /* else, we search for uplink resource */ else - usf = sched_select_uplink(trx, ts, fn, block_nr, pdch); + usf = sched_select_uplink(trx->trx_no, ts, fn, block_nr, pdch); /* Prio 1: select control message */ - msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, - dl_ass_tbf, ul_ack_tbf); - tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_CTRL); + msg = sched_select_ctrl_msg(trx->trx_no, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); + tap_n_acc(msg, trx, ts, fn, PCU_GSMTAP_C_DL_CTRL); /* Prio 2: select data message for downlink */ if (!msg) { - msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); - tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_DATA_GPRS); + msg = sched_select_downlink(trx, ts, fn, block_nr, pdch); + tap_n_acc(msg, trx, ts, fn, PCU_GSMTAP_C_DL_DATA_GPRS); } /* Prio 3: send dummy contol message */ if (!msg) { /* increase counter */ msg = sched_dummy(); - tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_DUMMY); + tap_n_acc(msg, trx, ts, fn, PCU_GSMTAP_C_DL_DUMMY); } if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + trx->bts->rlc_dl_bytes(msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); @@ -413,7 +406,7 @@ gprs_bssgp_update_frames_sent(); /* send PDTCH/PACCH to L1 */ - pcu_l1if_tx_pdtch(msg, trx, ts, bts->trx[trx].arfcn, fn, block_nr); + pcu_l1if_tx_pdtch(msg, trx->trx_no, ts, trx->arfcn, fn, block_nr); return 0; } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 7112b04..40c47f0 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -331,11 +331,13 @@ } // FIXME: remove this, when changed from c++ to c. -extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx, uint8_t ts, +extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx_no, uint8_t ts, uint32_t fn, uint8_t block_nr) { - return gprs_rlcmac_rcv_rts_block(bts_main_data(), - trx, ts, fn, block_nr); + struct gprs_rlcmac_bts *bts = bts_main_data(); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + return gprs_rlcmac_rcv_rts_block(trx, ts, fn, block_nr); } static int pcu_rx_rts_req(struct gsm_pcu_if_rts_req *rts_req) diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..503a9ff 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1450,24 +1450,22 @@ return ts == control_ts; } -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts) +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts) { struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); if (!ul_tbf) return ul_tbf; talloc_set_destructor(ul_tbf, ul_tbf_dtor); - new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + new (ul_tbf) gprs_rlcmac_ul_tbf(trx->bts); if (!ms) - ms = bts->bts->ms_alloc(0, 0); + ms = trx->bts->ms_alloc(0, 0); ms->set_tlli(tlli); - llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + llist_add(&ul_tbf->list(), &trx->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..c13e61f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -324,8 +324,7 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf); -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts_no); +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..886856a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -203,7 +203,8 @@ uint32_t *fn, uint8_t *block_nr = NULL) { uint8_t bn = fn2bn(*fn); - gprs_rlcmac_rcv_rts_block(bts, trx_no, ts_no, *fn, bn); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); *fn = fn_add_blocks(*fn, 1); bn += 1; if (block_nr) @@ -1651,9 +1652,8 @@ for (ts_no = 0 ; ts_no < 8; ts_no += 1) { if (!(slots & (1 << ts_no))) continue; - gprs_rlcmac_rcv_rts_block(the_bts->bts_data(), - dl_tbf->trx->trx_no, ts_no, - *fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts->bts_data()->trx[dl_tbf->trx->trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); } *fn = fn_add_blocks(*fn, 1); } @@ -3222,17 +3222,14 @@ setup_bts(&the_bts, ts_no, 4); int rc = 0; - - ul_tbf = handle_tbf_reject(the_bts.bts_data(), NULL, tlli, - trx_no, ts_no); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + ul_tbf = handle_tbf_reject(trx, NULL, tlli, ts_no); OSMO_ASSERT(ul_tbf != 0); /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); @@ -3307,9 +3304,8 @@ /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:04:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 15:04:04 +0000 Subject: osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Patch Set 1: I'll probably need to locally rebase it as it's based on top of other commits (some of which contain fixes with arrays which may be needed for it). -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:07:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 15:07:34 +0000 Subject: openbsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Patch Set 1: Cool. Could you please add spec reference to put this into proper context? -- To view, visit https://gerrit.osmocom.org/3814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:16:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 15:16:50 +0000 Subject: [PATCH] libosmocore[master]: Make release helper more robust Message-ID: Review at https://gerrit.osmocom.org/3817 Make release helper more robust * check for bumpversion and error out if missing * drop bumpversion dependency from .deb Change-Id: Ide04d4c1ba20426bdf9531e25b462eda9418858a Related: OS#1861 --- M debian/control M osmo-release.mk 2 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/3817/1 diff --git a/debian/control b/debian/control index e266173..b19448e 100644 --- a/debian/control +++ b/debian/control @@ -281,7 +281,6 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, - bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk index 03eb3cb..40eb121 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,6 +2,7 @@ REL := patch endif +BUMPVER := $(shell bumpversion) NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) @@ -9,6 +10,10 @@ release: +ifeq ($(BUMPVER),) + @$(error Unable to find 'bumpversion' command.) +endif + ifeq ($(NEW_VER),) @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) endif -- To view, visit https://gerrit.osmocom.org/3817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide04d4c1ba20426bdf9531e25b462eda9418858a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:17:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 15:17:26 +0000 Subject: [ABANDON] openbsc[master]: bsc_control.py: convert to python3 In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: bsc_control.py: convert to python3 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/1358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I669be3e8731460d5d9229fd0459ef7dd60e8bd73 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:21:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 15:21:50 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGsmTester: Move coredump section and add reference to ke... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3711 to look at the new patch set (#2). OsmoGsmTester: Move coredump section and add reference to kernel.core_pattern sysctl This section is moved further below in order to have it after section which explains how to create user jenkins and osmo-gsm-tester group, as we need this group already created anyway for the config to work correctly. Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 32 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/11/3711/2 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index f58c611..4d2b677 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -330,31 +330,6 @@ This assumes you have already created the jenkins user (see <>). -==== Allow Core Files - -In case a binary run for the test crashes, a core file of the crash should be -written. This requires a limit rule. Copy the following config file from the -osmo-gsm-tester source tree to the main unit: - ----- -sudo -s -echo "@osmo-gsm-tester - core unlimited" > /etc/security/limits.d/osmo-gsm-tester_allow-core.conf ----- - -Re-login the user to make these changes take effect. - -==== Allow Realtime Priority - -Certain binaries should be run with real-time priority, like 'osmo-bts-trx'. -Add this permission on the main unit: - ----- -sudo -s -echo "@osmo-gsm-tester - rtprio 99" > /etc/security/limits.d/osmo-gsm-tester_allow-rtprio.conf ----- - -Re-login the user to make these changes take effect. - ==== User Permissions On the main unit, create a group for all users that should be allowed to use @@ -467,6 +442,38 @@ TODO: allow skipping pcaps by configuration if access to tcpdump is not wanted +==== Allow Core Files + +In case a binary run for the test crashes, a core file of the crash should be +written. This requires a limit rule. Create a file with the required rule: + +---- +sudo -s +echo "@osmo-gsm-tester - core unlimited" > /etc/security/limits.d/osmo-gsm-tester_allow-core.conf +---- + +Re-login the user to make these changes take effect. + +Set the *kernel.core_pattern* sysctl to *core* (usually the default). For each +binary run by osmo-gsm-tester, a core file will then appear in the same dir that +contains stdout and stderr for that process (because this dir is set as CWD). + +---- +sysctl -w kernel.core_pattern=core +---- + +==== Allow Realtime Priority + +Certain binaries should be run with real-time priority, like 'osmo-bts-trx'. +Add this permission on the main unit: + +---- +sudo -s +echo "@osmo-gsm-tester - rtprio 99" > /etc/security/limits.d/osmo-gsm-tester_allow-rtprio.conf +---- + +Re-login the user to make these changes take effect. + [[user_config_uhd]] ==== UHD -- To view, visit https://gerrit.osmocom.org/3711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:40:46 2017 From: gerrit-no-reply at lists.osmocom.org (Ivan Kluchnikov) Date: Mon, 4 Sep 2017 15:40:46 +0000 Subject: openbsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Patch Set 1: > Cool. Could you please add spec reference to put this into proper > context? Hi, I am not sure that I can find exact spec reference. But I used openbsc/doc/handover.txt and it has link to Chapter 8 of "Performance Enhancements in a Frequency Hopping GSM Network". It's useful for understanding of current handover implementation. -- To view, visit https://gerrit.osmocom.org/3814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 15:59:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 4 Sep 2017 15:59:48 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > That's not checking the string output buffer, but the packet input buffer, How come is the buffer getting full? AMR payload is very very small and we're using a buffer of 4096 bytes? -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:03:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 4 Sep 2017 16:03:29 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 851: return ret; \ > I strongly object this coding style. Please no hidden return statements in Return hidden is macros is not good. I'm with Neels in this one. Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > How come is the buffer getting full? AMR payload is very very small and we' I'm telling this because I suspect this is papering a problem somewhere else... -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:05:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 16:05:26 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: per build, drop programs built "unintentionally" Message-ID: Review at https://gerrit.osmocom.org/3818 jenkins: per build, drop programs built "unintentionally" Each of the jenkins-build-* scripts intends to build a specific set of programs. While compiling dependencies, other programs may end up in $prefix/bin. Drop those other binaries to reduce potential confusion. Add arguments to the create_bin_tgz function: callers need to list exactly the $prefix/bin/* binaries that should be tar'd. All others are first removed from the prefix. Adjust existing scripts to provide such binary names. Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 --- M contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh M contrib/jenkins-build-osmo-pcu-sysmo.sh M contrib/jenkins-build-osmo-pcu.sh M contrib/jenkins-build-osmo-trx.sh 9 files changed, 24 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/18/3818/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 3e30873..3d9932d 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -140,6 +140,22 @@ create_bin_tgz() { # build the archive that is going to be copied to the tester + + wanted_binaries="$@" + + if [ -z "$wanted_binaries" ]; then + set +x; echo "ERROR: create_bin_tgz needs a list of permitted binaries"; set -x + exit 1 + fi + + # remove binaries not intended to originate from this build + cd "$prefix_real"/bin + for f in * ; do + if [ -z "$(echo "_ $wanted_binaries _" | grep " $f ")" ]; then + rm "$f" + fi + done + cd "$prefix_real" this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" tar="${this}.tgz" diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index f286368..e636893 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -20,4 +20,4 @@ build_repo libosmo-abis build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include -create_bin_tgz +create_bin_tgz osmo-bts-sysmo diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 8664a08..6188be1 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -11,4 +11,4 @@ build_repo libosmo-abis build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -create_bin_tgz +create_bin_tgz osmo-bts-trx diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 67e135f..460e9d6 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -8,4 +8,4 @@ build_repo libosmo-abis build_repo osmo-hlr -create_bin_tgz +create_bin_tgz osmo-hlr diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index dddacc7..8025ca2 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -14,4 +14,4 @@ build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -create_bin_tgz +create_bin_tgz osmo-msc diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 2f26a20..ef55259 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -12,4 +12,4 @@ build_repo libosmo-sccp build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -create_bin_tgz +create_bin_tgz osmo-nitb diff --git a/contrib/jenkins-build-osmo-pcu-sysmo.sh b/contrib/jenkins-build-osmo-pcu-sysmo.sh index b912252..0277303 100755 --- a/contrib/jenkins-build-osmo-pcu-sysmo.sh +++ b/contrib/jenkins-build-osmo-pcu-sysmo.sh @@ -16,4 +16,4 @@ build_repo libosmocore --disable-pcsc --disable-doxygen build_repo osmo-pcu --enable-sysmocom-dsp -create_bin_tgz +create_bin_tgz osmo-pcu-sysmo diff --git a/contrib/jenkins-build-osmo-pcu.sh b/contrib/jenkins-build-osmo-pcu.sh index 7953875..4d4277f 100755 --- a/contrib/jenkins-build-osmo-pcu.sh +++ b/contrib/jenkins-build-osmo-pcu.sh @@ -7,4 +7,4 @@ build_repo libosmocore --disable-pcsc --disable-doxygen build_repo osmo-pcu -create_bin_tgz +create_bin_tgz osmo-pcu diff --git a/contrib/jenkins-build-osmo-trx.sh b/contrib/jenkins-build-osmo-trx.sh index 7d2a5b6..b996cfe 100755 --- a/contrib/jenkins-build-osmo-trx.sh +++ b/contrib/jenkins-build-osmo-trx.sh @@ -6,4 +6,4 @@ build_repo osmo-trx --without-sse -create_bin_tgz +create_bin_tgz osmo-trx -- To view, visit https://gerrit.osmocom.org/3818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:06:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 16:06:15 +0000 Subject: openbsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Patch Set 1: Ok, than add ref. to it so people can follow your train of thought. -- To view, visit https://gerrit.osmocom.org/3814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:11:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 16:11:26 +0000 Subject: osmo-gsm-manuals[master]: OsmoGsmTester: Move coredump section and add reference to ke... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:11:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 16:11:30 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGsmTester: Move coredump section and add reference to ke... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGsmTester: Move coredump section and add reference to kernel.core_pattern sysctl ...................................................................... OsmoGsmTester: Move coredump section and add reference to kernel.core_pattern sysctl This section is moved further below in order to have it after section which explains how to create user jenkins and osmo-gsm-tester group, as we need this group already created anyway for the config to work correctly. Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 32 insertions(+), 25 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index f58c611..4d2b677 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -330,31 +330,6 @@ This assumes you have already created the jenkins user (see <>). -==== Allow Core Files - -In case a binary run for the test crashes, a core file of the crash should be -written. This requires a limit rule. Copy the following config file from the -osmo-gsm-tester source tree to the main unit: - ----- -sudo -s -echo "@osmo-gsm-tester - core unlimited" > /etc/security/limits.d/osmo-gsm-tester_allow-core.conf ----- - -Re-login the user to make these changes take effect. - -==== Allow Realtime Priority - -Certain binaries should be run with real-time priority, like 'osmo-bts-trx'. -Add this permission on the main unit: - ----- -sudo -s -echo "@osmo-gsm-tester - rtprio 99" > /etc/security/limits.d/osmo-gsm-tester_allow-rtprio.conf ----- - -Re-login the user to make these changes take effect. - ==== User Permissions On the main unit, create a group for all users that should be allowed to use @@ -467,6 +442,38 @@ TODO: allow skipping pcaps by configuration if access to tcpdump is not wanted +==== Allow Core Files + +In case a binary run for the test crashes, a core file of the crash should be +written. This requires a limit rule. Create a file with the required rule: + +---- +sudo -s +echo "@osmo-gsm-tester - core unlimited" > /etc/security/limits.d/osmo-gsm-tester_allow-core.conf +---- + +Re-login the user to make these changes take effect. + +Set the *kernel.core_pattern* sysctl to *core* (usually the default). For each +binary run by osmo-gsm-tester, a core file will then appear in the same dir that +contains stdout and stderr for that process (because this dir is set as CWD). + +---- +sysctl -w kernel.core_pattern=core +---- + +==== Allow Realtime Priority + +Certain binaries should be run with real-time priority, like 'osmo-bts-trx'. +Add this permission on the main unit: + +---- +sudo -s +echo "@osmo-gsm-tester - rtprio 99" > /etc/security/limits.d/osmo-gsm-tester_allow-rtprio.conf +---- + +Re-login the user to make these changes take effect. + [[user_config_uhd]] ==== UHD -- To view, visit https://gerrit.osmocom.org/3711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:12:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 16:12:51 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > I'm telling this because I suspect this is papering a problem somewhere els Are you asking about this exact "No room for OSMUX payload" error case? It's not about a buffer being full, it's about extra validation to assert we don't read out of bounds by checking contents of the packet were not truncated, ie. osmux_get_payload_len says there should be 35 bytes, but packet only contains 30 bytes more. Thus, we read 4 bytes out of the buffer. In case you referer to why we may return in the SNPRINTF_BUFFER_SIZE() above: - In a general case, if the buffer is too small. - In this specific case (osmux_test calling osmux_snprintf): Initially the buffer was 2048, and I changed it to 4096 because I was seeing the buffer overflows (initial crash). Then, AMR payload may be a few bytes, but its representation using ASCII + spacing + other stuff can grow bigger. Then in one osmux frame, you can have 8 of those. And again multiply that by the amount of osmux frames in one UDP packet. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:17:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 4 Sep 2017 16:17:13 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: guys, please put this in prespective. If I look at the amount of time all of you are spending on an osmux-private version of printing strings to a buffer, this is not worth our time. In case of doubt, consider creating an inefficient dynamic-allocating version or the like, which is easy to validate. This is called very infrequently. Our aim here is to be as productive as possible without introducing code that is hard to understand or prone to (even exploitable) errors. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 4 16:22:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 4 Sep 2017 16:22:46 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > Are you asking about this exact "No room for OSMUX payload" error case? OK, if the problem are truncated packet, then fix _snprintf() function to use msg->len instead of fetching the field from the RTP header. We shouldn't trust what the header announces. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 17:01:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 17:01:54 +0000 Subject: [PATCH] osmo-bsc[master]: Migrate from OpenSSL to osmo_get_rand_id() Message-ID: Review at https://gerrit.osmocom.org/3819 Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2 Related: OS#1694 --- M configure.ac M debian/control M src/osmo-bsc_nat/Makefile.am M src/osmo-bsc_nat/bsc_nat.c M tests/channel/Makefile.am 5 files changed, 1 insertion(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/19/3819/1 diff --git a/configure.ac b/configure.ac index 5d684ef..ee74dbd 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,6 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) diff --git a/debian/control b/debian/control index e6e5724..2c0b601 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ pkg-config, python-minimal, libdbi-dev, - libssl-dev, libsctp-dev, libtalloc-dev, libasn1c-dev, diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am index 1eec7aa..a095a4f 100644 --- a/src/osmo-bsc_nat/Makefile.am +++ b/src/osmo-bsc_nat/Makefile.am @@ -14,7 +14,6 @@ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMONETIF_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -55,7 +54,6 @@ $(LIBOSMONETIF_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBRARY_GSM) \ -lrt \ $(NULL) diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index 401288d..6f0e846 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -74,8 +74,6 @@ #include -#include - #include "../../bscconfig.h" #define SCCP_CLOSE_TIME 20 @@ -221,7 +219,7 @@ buf = v_put(buf, 0x23); mrand = bsc->last_rand; - if (RAND_bytes(mrand, 16) != 1) + if (osmo_get_rand_id(mrand, 16) < 0) goto failed_random; memcpy(buf, mrand, 16); diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index d190cba..23c2870 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -29,6 +29,5 @@ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) -- To view, visit https://gerrit.osmocom.org/3819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia57bf1300525cf3c247284fe966b1c415c2d53e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 4 17:04:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 17:04:49 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > OK, if the problem are truncated packet, then fix _snprintf() function to u I have no idea if the code initially fetching the AMR size from RTP is doing that correctly or not, I'm just pointing out what I see in the code, which was already there before this commit. I'm just keeping the validation checks from before because again I didn't want to spend lots of time in checking if this specific check is good or not. In the worse case, it's harmless, so no big issue. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 17:22:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 17:22:41 +0000 Subject: [PATCH] osmo-msc[master]: Migrate from OpenSSL to osmo_get_rand_id() Message-ID: Review at https://gerrit.osmocom.org/3820 Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336 --- M configure.ac M debian/control M src/libmsc/Makefile.am M src/libmsc/auth.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libvlr/Makefile.am M src/libvlr/vlr.c M src/osmo-msc/Makefile.am M tests/db/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sms_queue/Makefile.am 13 files changed, 8 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/3820/1 diff --git a/configure.ac b/configure.ac index 1942614..1ad2187 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,6 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) # Enable/disable smpp support in the msc? diff --git a/debian/control b/debian/control index 907ec38..d265ea9 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ pkg-config, libdbi-dev, libtalloc-dev, - libssl-dev, libc-ares-dev, libgtp-dev, libasn1c-dev, diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index c9b8bb4..3b388dc 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -10,7 +10,6 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c index 9064ce6..fcf694e 100644 --- a/src/libmsc/auth.c +++ b/src/libmsc/auth.c @@ -28,8 +28,6 @@ #include #include -#include - #include const struct value_string auth_action_names[] = { diff --git a/src/libmsc/db.c b/src/libmsc/db.c index ae7e287..26da69f 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -42,8 +42,6 @@ #include #include -#include - static char *db_basename = NULL; static char *db_dirname = NULL; static dbi_conn conn; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 90a0431..b986640 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "bscconfig.h" diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am index 17ad411..c5ab4a6 100644 --- a/src/libvlr/Makefile.am +++ b/src/libvlr/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ - $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) + $(COVERAGE_CFLAGS) noinst_HEADERS = \ vlr_access_req_fsm.h \ diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a5ea0f6..70b0704 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -30,8 +30,6 @@ #include #include -#include - #include #include #include @@ -276,8 +274,8 @@ int tried; for (tried = 0; tried < 100; tried++) { - if (RAND_bytes((uint8_t *) &tmsi, sizeof(tmsi)) != 1) { - LOGP(DVLR, LOGL_ERROR, "RAND_bytes failed\n"); + if (osmo_get_rand_id((uint8_t *) &tmsi, sizeof(tmsi)) < 0) { + LOGP(DDB, LOGL_ERROR, "osmo_get_rand_id() failed\n"); return -1; } /* throw the dice again, if the TSMI doesn't fit */ diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index a26b4bd..639002a 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -13,7 +13,6 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -43,7 +42,6 @@ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBSMPP34_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOLEGACYMGCP_LIBS) \ $(LIBRARY_GSM) \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index bcb66ec..720e005 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -42,6 +42,5 @@ $(LIBOSMOGSM_LIBS) \ $(LIBSMPP34_LIBS) \ $(LIBOSMOVTY_LIBS) \ - $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index fb4857f..fd32e81 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -9,7 +9,6 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -30,7 +29,7 @@ -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libvlr/libvlr.a \ @@ -38,7 +37,6 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 4b10e49..0a605e1 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -249,11 +249,11 @@ } unsigned char next_rand_byte = 0; -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int __wrap_RAND_bytes(unsigned char *buf, int num) +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *buf, size_t num); +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - int i; + size_t i; for (i = 0; i < num; i++) buf[i] = next_rand_byte++; return 1; diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1d3b9da..abb6b92 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -8,7 +8,6 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ @@ -38,7 +37,6 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 4 17:30:30 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 4 Sep 2017 17:30:30 +0000 Subject: osmo-gsm-tester[master]: jenkins: per build, drop programs built "unintentionally" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/3818/1/contrib/jenkins-build-common.sh File contrib/jenkins-build-common.sh: Line 154: if [ -z "$(echo "_ $wanted_binaries _" | grep " $f ")" ]; then what are those underscores in there used for? I guess they can be removed. Or otherwise the first and last spaces are removed? https://gerrit.osmocom.org/#/c/3818/1/contrib/jenkins-build-osmo-nitb.sh File contrib/jenkins-build-osmo-nitb.sh: Line 15: create_bin_tgz osmo-nitb If merging this commit before already adding the build job with osmo-sgsn, please keep it in here too. Otherwise if merging all support at the same time or during same day, it's fine to directly remove it. https://gerrit.osmocom.org/#/c/3818/1/contrib/jenkins-build-osmo-pcu-sysmo.sh File contrib/jenkins-build-osmo-pcu-sysmo.sh: Line 19: create_bin_tgz osmo-pcu-sysmo I think that's the wrong binary: # du -la osmo-pcu-sysmo/ | grep bin/osmo-pcu 2088 osmo-pcu-sysmo/bin/osmo-pcu -- To view, visit https://gerrit.osmocom.org/3818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 17:44:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 17:44:35 +0000 Subject: [PATCH] osmo-sgsn[master]: Migrate from OpenSSL to osmo_get_rand_id() Message-ID: Review at https://gerrit.osmocom.org/3821 Migrate from OpenSSL to osmo_get_rand_id() This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 --- M configure.ac M debian/control M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_sgsn.c M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c M tests/sgsn/Makefile.am M tests/sgsn/sgsn_test.c M tests/sndcp_xid/Makefile.am M tests/xid/Makefile.am 13 files changed, 32 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/21/3821/1 diff --git a/configure.ac b/configure.ac index a90a6ca..ff32d91 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,6 @@ PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? -PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], diff --git a/debian/control b/debian/control index 16fd244..2e50a79 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ automake, libtool, pkg-config, - libssl-dev, libtalloc-dev, libc-ares-dev, libgtp-dev, diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 654604b..0a88c01 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -15,7 +15,6 @@ $(LIBOSMOGB_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBCARES_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) if BUILD_IU @@ -63,7 +62,6 @@ $(NULL) osmo_gbproxy_LDADD = \ $(OSMO_LIBS) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) @@ -99,7 +97,6 @@ $(OSMO_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index d288cb3..10a6f1d 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -50,8 +50,6 @@ #include #include -#include - extern void *tall_bsc_ctx; static const struct rate_ctr_desc global_ctr_description[] = { @@ -237,7 +235,7 @@ bss_ptmsi = sgsn_ptmsi; } else { do { - if (RAND_bytes((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)) != 1) { + if (osmo_get_rand_id((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)) < 0) { bss_ptmsi = GSM_RESERVED_TMSI; break; } @@ -274,7 +272,7 @@ } else { do { /* create random TLLI, 0b01111xxx... */ - if (RAND_bytes((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)) != 1) { + if (osmo_get_rand_id((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)) < 0) { sgsn_tlli = 0; break; } diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7301bf1..4b46125 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -31,8 +31,6 @@ #include #include -#include - #include "bscconfig.h" #include @@ -608,12 +606,10 @@ /* ? 10.5.5.7: */ acreq->force_stby = force_standby; /* 3GPP TS 24.008 ? 10.5.5.19: */ - if (RAND_bytes(&rbyte, 1) != 1) { - LOGP(DMM, LOGL_NOTICE, "RAND_bytes failed for A&C ref, falling " - "back to rand()\n"); - acreq->ac_ref_nr = rand(); - } else - acreq->ac_ref_nr = rbyte; + if (osmo_get_rand_id(&rbyte, 1) < 0) + LOGP(DMM, LOGL_ERROR, "osmo_get_rand_id() failed for A&C ref, falling back to insecure random\n"); + + acreq->ac_ref_nr = rbyte; mm->ac_ref_nr_used = acreq->ac_ref_nr; /* Only if authentication is requested we need to set RAND + CKSN */ diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 904ec7e..932f223 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include @@ -1069,11 +1067,8 @@ uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); - } + if (osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4) < 0) + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset, falling back to insecure random\n"); /* Generate XID message */ xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, @@ -1102,11 +1097,9 @@ uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - if (RAND_bytes((uint8_t *) &llme->iov_ui, 4) != 1) { - LOGP(DLLC, LOGL_NOTICE, "RAND_bytes failed for LLC XID reset, " - "falling back to rand()\n"); - llme->iov_ui = rand(); - } + + if (osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4) < 0) + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset, falling back to insecure random\n"); /* Generate XID message */ xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 560485d..98fb3b0 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -46,8 +46,6 @@ #include -#include - #include "../../bscconfig.h" #if BUILD_IU @@ -644,7 +642,7 @@ int max_retries = 100; restart: - if (RAND_bytes((uint8_t *) &ptmsi, sizeof(ptmsi)) != 1) + if (osmo_get_rand_id((uint8_t *) &ptmsi, sizeof(ptmsi)) < 0) goto failed; /* Enforce that the 2 MSB are set without loosing the distance between diff --git a/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am index 3291839..ef38fb6 100644 --- a/tests/gbproxy/Makefile.am +++ b/tests/gbproxy/Makefile.am @@ -28,7 +28,7 @@ $(NULL) gbproxy_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ $(NULL) gbproxy_test_LDADD = \ @@ -46,6 +46,5 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBRARY_DL) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index 9672dcb..ebf04e6 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -37,8 +37,6 @@ #include #include -#include - #define REMOTE_BSS_ADDR 0x01020304 #define REMOTE_SGSN_ADDR 0x05060708 @@ -55,24 +53,24 @@ struct llist_head *received_messages = NULL; -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } static int rand_seq_num = 0; -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { uint32_t val; OSMO_ASSERT(num == sizeof(val)); - OSMO_ASSERT(__real_RAND_bytes(buf, num) == 1); + OSMO_ASSERT(__real_osmo_get_rand_id(buf, num) == 1); val = 0x00dead00 + rand_seq_num; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 36026dd..802811d 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -32,7 +32,7 @@ $(NULL) sgsn_test_LDFLAGS = \ - -Wl,--wrap=RAND_bytes \ + -Wl,--wrap=osmo_get_rand_id \ -Wl,--wrap=sgsn_update_subscriber_data \ -Wl,--wrap=gprs_subscr_request_update_location \ -Wl,--wrap=gprs_subscr_request_auth_info \ @@ -67,7 +67,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index d66c5dd..5bf82ff 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -100,21 +100,21 @@ return 0; } -/* override, requires '-Wl,--wrap=RAND_bytes' */ -int __real_RAND_bytes(unsigned char *buf, int num); -int mock_RAND_bytes(unsigned char *buf, int num); -int (*RAND_bytes_cb)(unsigned char *, int) = - &mock_RAND_bytes; +/* override, requires '-Wl,--wrap=osmo_get_rand_id' */ +int __real_osmo_get_rand_id(uint8_t *data, size_t len); +int mock_osmo_get_rand_id(uint8_t *data, size_t len); +int (*osmo_get_rand_id_cb)(uint8_t *, size_t) = + &mock_osmo_get_rand_id; -int __wrap_RAND_bytes(unsigned char *buf, int num) +int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(buf, num); } /* make results of A&C ref predictable */ -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *buf, size_t num) { if (num > 1) - return __real_RAND_bytes(buf, num); + return __real_osmo_get_rand_id(buf, num); buf[0] = 0; return 1; } diff --git a/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am index d09c41b..fbcb36c 100644 --- a/tests/sndcp_xid/Makefile.am +++ b/tests/sndcp_xid/Makefile.am @@ -14,7 +14,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt -lm diff --git a/tests/xid/Makefile.am b/tests/xid/Makefile.am index 6c3689f..92876ec 100644 --- a/tests/xid/Makefile.am +++ b/tests/xid/Makefile.am @@ -30,7 +30,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ -- To view, visit https://gerrit.osmocom.org/3821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 4 17:44:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 4 Sep 2017 17:44:55 +0000 Subject: [ABANDON] openbsc[master]: Migrate from OpenSSL to osmo_get_rand_id() In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Migrate from OpenSSL to osmo_get_rand_id() ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/1464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I270c33912bf107b3c7c217d199262cc74d56ffdb Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Mon Sep 4 17:47:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 4 Sep 2017 17:47:50 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > I have no idea if the code initially fetching the AMR size from RTP is doin OK, I'm reviewing this function. It seems this check is not working. if (msg_len < sizeof(struct osmux_hdr)) msg_len is int, while sizeof is unsigned. C takes the left hand side of the relational as unsigned, so this branch never evaluates true. Then, we start accessing out of bound memory area. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 18:15:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 4 Sep 2017 18:15:43 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c File src/osmux.c: Line 918: SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); > OK, I'm reviewing this function. Hm, forget this: while (msg_len > 0) { is already always positive, so this can't be the reason for what you're observing there, hm. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 4 18:26:52 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Mon, 4 Sep 2017 18:26:52 +0000 Subject: [PATCH] osmo-ci[master]: Change used protocoll for 'git ls-remote' call from https to... Message-ID: Review at https://gerrit.osmocom.org/3822 Change used protocoll for 'git ls-remote' call from https to git. Otherwise script depends on availability of https://git.osmocom.org, which is currently down. Change-Id: Icf2a6b425177ef24aef1dba6e270d36fdc05d214 --- M scripts/osmo-build.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/22/3822/1 diff --git a/scripts/osmo-build.sh b/scripts/osmo-build.sh index 8ca8e47..39cbae6 100644 --- a/scripts/osmo-build.sh +++ b/scripts/osmo-build.sh @@ -172,7 +172,7 @@ branch_and_rev_of_remote_repo() { if [ -z "${2+x}" ]; then branch="master"; else branch="$2"; fi branch="$( echo "$branch" | tr '/' '_')" - rev="$(git ls-remote "https://git.osmocom.org/$1" "refs/heads/$branch")" + rev="$(git ls-remote "git://git.osmocom.org/$1" "refs/heads/$branch")" # check whether branch is a tag if [ "$rev" = "" ]; then -- To view, visit https://gerrit.osmocom.org/3822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf2a6b425177ef24aef1dba6e270d36fdc05d214 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg From gerrit-no-reply at lists.osmocom.org Mon Sep 4 18:49:37 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Mon, 4 Sep 2017 18:49:37 +0000 Subject: [PATCH] openbsc[master]: Make use of osmo-build.sh to use dependency artifacts for bu... Message-ID: Review at https://gerrit.osmocom.org/3823 Make use of osmo-build.sh to use dependency artifacts for builds. Change-Id: I8a2ff700bbe3806bb2c1d561c6f2249fae3d8dd8 Note: this patchset depends on https://gerrit.osmocom.org/#/c/3822/1 --- M contrib/jenkins.sh 1 file changed, 47 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/3823/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 892d721..a878855 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,59 +1,58 @@ -#!/usr/bin/env bash -# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org +#!/bin/sh -ex -if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then - echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" - exit 2 -fi +artifact_deps() { + x="$($1 libosmocore)" + x="${x}_$($1 libosmo-abis)" + x="${x}_$($1 libosmo-netif)" + x="${x}_$($1 libosmo-sccp "$sccp_branch")" + x="${x}_$($1 libsmpp34)" + x="${x}_$($1 openggsn)" -set -ex + if [ "x$IU" = "x--enable-iu" ]; then + x="${x}_$($1 libasn1c)" + x="${x}_$($1 osmo-iuh "$osmo_iuh_branch")" + fi -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst + echo "${x}.tar.gz" +} -mkdir "$deps" || true -rm -rf "$inst" +build_deps() { -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + osmo-build-dep.sh libosmocore master ac_cv_path_DOXYGEN=false + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + osmo-build-dep.sh libosmo-abis + osmo-build-dep.sh libosmo-netif + osmo-build-dep.sh libosmo-sccp "$sccp_branch" + PARALLEL_MAKE=-j1 osmo-build-dep.sh libsmpp34 + osmo-build-dep.sh openggsn -export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" -export LD_LIBRARY_PATH="$inst/lib" + if [ "x$IU" = "x--enable-iu" ]; then + osmo-build-dep.sh libasn1c + osmo-build-dep.sh osmo-iuh "$osmo_iuh_branch" + fi +} + +build_project() { + + cd "$base/openbsc" + + autoreconf --install --force + + ./configure "$SMPP" "$MGCP" "$IU" \ + --enable-osmo-bsc \ + --enable-nat \ + --enable-vty-tests \ + --enable-external-tests + + "$MAKE" "$PARALLEL_MAKE" + "$MAKE" check || cat-testlogs.sh + "$MAKE" distcheck || cat-testlogs.sh +} if [ "x$IU" = "x--enable-iu" ]; then - sccp_branch="old_sua" - osmo_iuh_branch="old_sua" + sccp_branch="old_sua" + osmo_iuh_branch="old_sua" fi -osmo-build-dep.sh libosmocore -osmo-build-dep.sh libosmo-abis -osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp $sccp_branch -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh openggsn - -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh $osmo_iuh_branch -fi - -set +x -echo -echo -echo -echo " =============================== openbsc ===============================" -echo -set -x - -cd "$base" -cd openbsc -autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests -$MAKE $PARALLEL_MAKE -LD_LIBRARY_PATH="$inst/lib" $MAKE check \ - || cat-testlogs.sh -LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \ - || cat-testlogs.sh +. osmo-build.sh -- To view, visit https://gerrit.osmocom.org/3823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a2ff700bbe3806bb2c1d561c6f2249fae3d8dd8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg From gerrit-no-reply at lists.osmocom.org Mon Sep 4 19:20:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 4 Sep 2017 19:20:38 +0000 Subject: [PATCH] libosmo-netif[master]: rtp: return offset in osmo_rtp_snprintf() Message-ID: Review at https://gerrit.osmocom.org/3824 rtp: return offset in osmo_rtp_snprintf() Instead of the result of the last snprintf() call. Change-Id: I10066d73387be96a4e1f3349d700405beb138076 --- M src/rtp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/24/3824/1 diff --git a/src/rtp.c b/src/rtp.c index 7ac5862..44fc217 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -222,5 +222,5 @@ ret = snprintf(buf+offset, len, "]"); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - return ret; + return offset; } -- To view, visit https://gerrit.osmocom.org/3824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10066d73387be96a4e1f3349d700405beb138076 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Mon Sep 4 19:20:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 4 Sep 2017 19:20:39 +0000 Subject: [PATCH] libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls Message-ID: Review at https://gerrit.osmocom.org/3825 osmux: fix buffer management mess in snprintf() calls SNPRINTF_BUFFER_SIZE() macro seems to be very buggy. Replace it by a working version: if (ret < 0) \ ret = 0; \ offset += ret; \ if (ret > remain) \ ret = remain; \ remain -= ret; That basically accounts for remaining space in the buffer and updates the offset to where we should print next. This macro also deals with two corner cases: 1) snprintf() fails, actually never happens in practise, but documentation indicates it may return -1, so catch this case to stick to specs. 2) There is not enough space in the buffer, in that case, keep increasing offset, so we know how much would have been printed, just like snprintf(). As in snprintf(), caller should not assume the buffer is nul-terminated. Thanks to Pau Espin for reporting, and Holger for clues on this. I also run osmux_test and, at quick glance, it looks good. Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 --- M src/osmux.c M src/rtp.c M tests/osmux/osmux_test.c 3 files changed, 49 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/25/3825/1 diff --git a/src/osmux.c b/src/osmux.c index 23a6440..232b29e 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -846,19 +846,20 @@ h->rtp_ssrc = rtp_ssrc; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size += ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; static int osmux_snprintf_header(char *buf, size_t size, struct osmux_hdr *osmuxh) { + unsigned int remain = size, offset = 0; int ret; - int len = size, offset = 0; - ret = snprintf(buf, len, "OSMUX seq=%03u ccid=%03u " + ret = snprintf(buf, remain, "OSMUX seq=%03u ccid=%03u " "ft=%01u ctr=%01u " "amr_f=%01u amr_q=%01u " "amr_ft=%02u amr_cmr=%02u ", @@ -866,7 +867,7 @@ osmuxh->ft, osmuxh->ctr, osmuxh->amr_f, osmuxh->amr_q, osmuxh->amr_ft, osmuxh->amr_cmr); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } @@ -874,16 +875,16 @@ static int osmux_snprintf_payload(char *buf, size_t size, const uint8_t *payload, int payload_len) { + unsigned int remain = size, offset = 0; int ret, i; - int len = size, offset = 0; for (i=0; ilen, len = size; - struct osmux_hdr *osmuxh; + unsigned int remain = size; int this_len, msg_off = 0; + struct osmux_hdr *osmuxh; + unsigned int offset = 0; + int msg_len = msg->len; + int ret; while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { @@ -912,10 +914,8 @@ return -1; } - ret = osmux_snprintf_header(buf+offset, size, osmuxh); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = osmux_snprintf_header(buf + offset, remain, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); this_len = sizeof(struct osmux_hdr) + osmux_get_payload_len(osmuxh); @@ -928,12 +928,10 @@ return -1; } - ret = osmux_snprintf_payload(buf+offset, size, + ret = osmux_snprintf_payload(buf + offset, remain, osmux_get_payload(osmuxh), osmux_get_payload_len(osmuxh)); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); msg_len -= this_len; } diff --git a/src/rtp.c b/src/rtp.c index 44fc217..56fc37c 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -185,19 +185,20 @@ return msg; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size += ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; int osmo_rtp_snprintf(char *buf, size_t size, struct msgb *msg) { + unsigned int remain = size, offset = 0; struct rtp_hdr *rtph; - int ret, i; uint8_t *payload; - unsigned int len = size, offset = 0; + int ret, i; rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) @@ -205,22 +206,22 @@ payload = (uint8_t *)rtph + sizeof(struct rtp_hdr); - ret = snprintf(buf, len, "RTP ver=%01u ssrc=%u type=%02u " + ret = snprintf(buf, remain, "RTP ver=%01u ssrc=%u type=%02u " "marker=%01u ext=%01u csrc_count=%01u " "sequence=%u timestamp=%u [", rtph->version, ntohl(rtph->ssrc), rtph->payload_type, rtph->marker, rtph->extension, rtph->csrc_count, ntohs(rtph->sequence), ntohl(rtph->timestamp)); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); for (i=0; ilen - sizeof(struct rtp_hdr); i++) { - ret = snprintf(buf+offset, len, "%02x ", payload[i]); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "%02x ", payload[i]); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); } - ret = snprintf(buf+offset, len, "]"); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c index 63f89f1..fe200fc 100644 --- a/tests/osmux/osmux_test.c +++ b/tests/osmux/osmux_test.c @@ -65,8 +65,9 @@ static void tx_cb(struct msgb *msg, void *data) { - char buf[4096]; struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data; + char buf[4096]; + int ret; #if OSMUX_TEST_USE_TIMING struct timeval now, diff; @@ -82,7 +83,8 @@ } #endif - osmo_rtp_snprintf(buf, sizeof(buf), msg); + ret = osmo_rtp_snprintf(buf, sizeof(buf), msg); + buf[ret - 1] = '\0'; fprintf(stderr, "extracted packet: %s\n", buf); if (memcmp(msg->data + sizeof(struct rtp_hdr), @@ -102,11 +104,13 @@ static void osmux_deliver(struct msgb *batch_msg, void *data) { - char buf[1024]; struct osmux_hdr *osmuxh; LLIST_HEAD(list); + char buf[1024]; + int ret; - osmux_snprintf(buf, sizeof(buf), batch_msg); + ret = osmux_snprintf(buf, sizeof(buf), batch_msg); + buf[ret - 1] = '\0'; fprintf(stderr, "OSMUX message (len=%d) %s\n", batch_msg->len, buf); /* For each OSMUX message, extract the RTP messages and put them @@ -182,11 +186,11 @@ static void osmux_test_loop(int ccid) { + struct rtp_hdr *rtph = (struct rtp_hdr *)rtp_pkt; + int i, j, k = 0, ret; struct msgb *msg; char buf[1024]; - struct rtp_hdr *rtph = (struct rtp_hdr *)rtp_pkt; uint16_t seq; - int i, j, k = 0; for (i = 1; i < 65; i++) { msg = msgb_alloc(1500, "test"); @@ -200,7 +204,8 @@ seq++; rtph->sequence = htons(seq); - osmo_rtp_snprintf(buf, sizeof(buf), msg); + ret = osmo_rtp_snprintf(buf, sizeof(buf), msg); + buf[ret - 1] = '\0'; fprintf(stderr, "adding to ccid=%u %s\n", (i % 2) + ccid, buf); rtp_pkts++; -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Mon Sep 4 23:22:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 23:22:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: per build, drop programs built "unintentionally" In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3818 to look at the new patch set (#2). jenkins: per build, drop programs built "unintentionally" Each of the jenkins-build-* scripts intends to build a specific set of programs. While compiling dependencies, other programs may end up in $prefix/bin. Drop those other binaries to reduce potential confusion. Add arguments to the create_bin_tgz function: callers need to list exactly the $prefix/bin/* binaries that should be tar'd. All others are first removed from the prefix. Adjust existing scripts to provide such binary names. Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 --- M contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh M contrib/jenkins-build-osmo-pcu-sysmo.sh M contrib/jenkins-build-osmo-pcu.sh M contrib/jenkins-build-osmo-trx.sh 9 files changed, 24 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/18/3818/2 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 3e30873..3d9932d 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -140,6 +140,22 @@ create_bin_tgz() { # build the archive that is going to be copied to the tester + + wanted_binaries="$@" + + if [ -z "$wanted_binaries" ]; then + set +x; echo "ERROR: create_bin_tgz needs a list of permitted binaries"; set -x + exit 1 + fi + + # remove binaries not intended to originate from this build + cd "$prefix_real"/bin + for f in * ; do + if [ -z "$(echo "_ $wanted_binaries _" | grep " $f ")" ]; then + rm "$f" + fi + done + cd "$prefix_real" this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" tar="${this}.tgz" diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index f286368..e636893 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -20,4 +20,4 @@ build_repo libosmo-abis build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include -create_bin_tgz +create_bin_tgz osmo-bts-sysmo diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 8664a08..6188be1 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -11,4 +11,4 @@ build_repo libosmo-abis build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -create_bin_tgz +create_bin_tgz osmo-bts-trx diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 67e135f..460e9d6 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -8,4 +8,4 @@ build_repo libosmo-abis build_repo osmo-hlr -create_bin_tgz +create_bin_tgz osmo-hlr diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index dddacc7..8025ca2 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -14,4 +14,4 @@ build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -create_bin_tgz +create_bin_tgz osmo-msc diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 2f26a20..ef55259 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -12,4 +12,4 @@ build_repo libosmo-sccp build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -create_bin_tgz +create_bin_tgz osmo-nitb diff --git a/contrib/jenkins-build-osmo-pcu-sysmo.sh b/contrib/jenkins-build-osmo-pcu-sysmo.sh index b912252..c38bc33 100755 --- a/contrib/jenkins-build-osmo-pcu-sysmo.sh +++ b/contrib/jenkins-build-osmo-pcu-sysmo.sh @@ -16,4 +16,4 @@ build_repo libosmocore --disable-pcsc --disable-doxygen build_repo osmo-pcu --enable-sysmocom-dsp -create_bin_tgz +create_bin_tgz osmo-pcu diff --git a/contrib/jenkins-build-osmo-pcu.sh b/contrib/jenkins-build-osmo-pcu.sh index 7953875..4d4277f 100755 --- a/contrib/jenkins-build-osmo-pcu.sh +++ b/contrib/jenkins-build-osmo-pcu.sh @@ -7,4 +7,4 @@ build_repo libosmocore --disable-pcsc --disable-doxygen build_repo osmo-pcu -create_bin_tgz +create_bin_tgz osmo-pcu diff --git a/contrib/jenkins-build-osmo-trx.sh b/contrib/jenkins-build-osmo-trx.sh index 7d2a5b6..b996cfe 100755 --- a/contrib/jenkins-build-osmo-trx.sh +++ b/contrib/jenkins-build-osmo-trx.sh @@ -6,4 +6,4 @@ build_repo osmo-trx --without-sse -create_bin_tgz +create_bin_tgz osmo-trx -- To view, visit https://gerrit.osmocom.org/3818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 4 23:22:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 4 Sep 2017 23:22:40 +0000 Subject: osmo-gsm-tester[master]: jenkins: per build, drop programs built "unintentionally" In-Reply-To: References: Message-ID: Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/3818/1/contrib/jenkins-build-common.sh File contrib/jenkins-build-common.sh: Line 154: if [ -z "$(echo "_ $wanted_binaries _" | grep " $f ")" ]; then > what are those underscores in there used for? I guess they can be removed. yes, it's to make sure each binary name is surrounded by two spaces ... I thought about regex '\<$f\>' but that might also hit at '-', so I decided to make space the delimiter and guarantee it on both ends. https://gerrit.osmocom.org/#/c/3818/1/contrib/jenkins-build-osmo-nitb.sh File contrib/jenkins-build-osmo-nitb.sh: Line 15: create_bin_tgz osmo-nitb > If merging this commit before already adding the build job with osmo-sgsn, osmo-sgsn is already added and going to be available; just need to adjust the patch that is in the queue to pick the osmo-sgsn binary from the osmo-sgsn installation https://gerrit.osmocom.org/#/c/3818/1/contrib/jenkins-build-osmo-pcu-sysmo.sh File contrib/jenkins-build-osmo-pcu-sysmo.sh: Line 19: create_bin_tgz osmo-pcu > I think that's the wrong binary: ah ok -- To view, visit https://gerrit.osmocom.org/3818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 09:26:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 09:26:24 +0000 Subject: osmo-ci[master]: Change used protocoll for 'git ls-remote' call from https to... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf2a6b425177ef24aef1dba6e270d36fdc05d214 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 09:26:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 09:26:25 +0000 Subject: [MERGED] osmo-ci[master]: Change used protocoll for 'git ls-remote' call from https to... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Change used protocoll for 'git ls-remote' call from https to git. ...................................................................... Change used protocoll for 'git ls-remote' call from https to git. Otherwise script depends on availability of https://git.osmocom.org, which is currently down. Change-Id: Icf2a6b425177ef24aef1dba6e270d36fdc05d214 --- M scripts/osmo-build.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/osmo-build.sh b/scripts/osmo-build.sh index 8ca8e47..39cbae6 100644 --- a/scripts/osmo-build.sh +++ b/scripts/osmo-build.sh @@ -172,7 +172,7 @@ branch_and_rev_of_remote_repo() { if [ -z "${2+x}" ]; then branch="master"; else branch="$2"; fi branch="$( echo "$branch" | tr '/' '_')" - rev="$(git ls-remote "https://git.osmocom.org/$1" "refs/heads/$branch")" + rev="$(git ls-remote "git://git.osmocom.org/$1" "refs/heads/$branch")" # check whether branch is a tag if [ "$rev" = "" ]; then -- To view, visit https://gerrit.osmocom.org/3822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf2a6b425177ef24aef1dba6e270d36fdc05d214 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:28:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 10:28:59 +0000 Subject: osmo-dev[master]: move iu.opts to no-iu.opts, change to --disable-iu In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9a590b9cb9d9318c822e33e8432f3f8e5eb6779f Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:29:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 10:29:01 +0000 Subject: [MERGED] osmo-dev[master]: move iu.opts to no-iu.opts, change to --disable-iu In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move iu.opts to no-iu.opts, change to --disable-iu ...................................................................... move iu.opts to no-iu.opts, change to --disable-iu osmo-msc and osmo-sgsn have moved to --enable-iu by default. Depends: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f (osmo-msc) I04b07ffead5d5394651d80711d2de06162eeed14 (osmo-sgsn) Change-Id: I9a590b9cb9d9318c822e33e8432f3f8e5eb6779f --- M README D iu.opts A no-iu.opts 3 files changed, 13 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/README b/README index 9d3990d..a3ab68f 100644 --- a/README +++ b/README @@ -8,15 +8,23 @@ more separate build trees in ./make-*. Run ./gen_makefile.py with a choice of projects (2G only or also 3G?) -and a choice of configure options, for example: +and a choice of configure options. - ./gen_makefile.py 3G+2G.deps default.opts iu.opts +Examples: + +Full 2G and 3G support: + + ./gen_makefile.py 3G+2G.deps default.opts + +2G only (requires to pass no-iu.opts), and a custom dir name of 'make-2G': + + ./gen_makefile.py 2G.deps default.opts no-iu.opts -m make-2G This generates a new dir containing a Makefile. When you run make in it, this will clone the source trees (if not present yet) and build all of them in the right order: - cd make-3G+2G-default+iu + cd make-3G+2G-default make If you make modifications in one of the source trees, this Makefile will pick diff --git a/iu.opts b/iu.opts deleted file mode 100644 index a96a1bc..0000000 --- a/iu.opts +++ /dev/null @@ -1,2 +0,0 @@ -osmo-msc --enable-iu -osmo-sgsn --enable-iu diff --git a/no-iu.opts b/no-iu.opts new file mode 100644 index 0000000..63de34a --- /dev/null +++ b/no-iu.opts @@ -0,0 +1,2 @@ +osmo-msc --disable-iu +osmo-sgsn --disable-iu -- To view, visit https://gerrit.osmocom.org/3802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9a590b9cb9d9318c822e33e8432f3f8e5eb6779f Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:29:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 10:29:05 +0000 Subject: osmo-dev[master]: add fetch-gerrit-patch.sh, tweak READMEs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3803 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6df4f3226af9087ef346de72cbcaa86a4d4d5e13 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:29:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 10:29:08 +0000 Subject: [MERGED] osmo-dev[master]: add fetch-gerrit-patch.sh, tweak READMEs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add fetch-gerrit-patch.sh, tweak READMEs ...................................................................... add fetch-gerrit-patch.sh, tweak READMEs Change-Id: I6df4f3226af9087ef346de72cbcaa86a4d4d5e13 --- M README M src/README A src/fetch-gerrit-patch.sh 3 files changed, 87 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/README b/README index a3ab68f..65dbf2e 100644 --- a/README +++ b/README @@ -52,3 +52,8 @@ Remove osmocom built binaries and headers from given prefix, default is /usr/local. + + +=== src/* + +Find other useful scripts in src/, see src/README. diff --git a/src/README b/src/README index 4444824..a2fbe81 100644 --- a/src/README +++ b/src/README @@ -2,6 +2,15 @@ There are some handy scripts I use for my daily Osmocom development: + osmo-add-gerrit-hooks.sh + Look for git repositories in and below the current dir and install the + gerrit commit-msg hook in each one. This requires an ~/.ssh/config + entry, see top comment in the script. + + fetch-gerrit-patch.sh + Pass a patch number seen on gerrit to fetch the latest patch set into + your git clone. See top comment in the script. + ./g run a git command in each source tree ./e run an arbitrary shell command in each source tree ./st show a brief branch and local mods status for each source tree @@ -11,6 +20,38 @@ Examples: + +----------------------------------------------------------------------------- + +git clone ssh://go/osmo-msc + +./osmo-add-gerrit-hooks.sh ++ cd /n/s/osmo/src/./osmo-msc/.git ++ [ ! -f hooks/commit-msg ] ++ scp go:hooks/commit-msg hooks/ +commit-msg 100% 4688 4.6KB/s 00:00 + + +----------------------------------------------------------------------------- + + +cd osmo-msc +../fetch-gerrit-patch.sh 3787 ++ git fetch origin refs/changes/87/3787/2 +From ssh://go/osmo-msc + * branch refs/changes/87/3787/2 -> FETCH_HEAD ++ git checkout -b 3787_2 FETCH_HEAD +Switched to a new branch '3787_2' + + +# or if you want an earlier patch set +../fetch-gerrit-patch.sh 3787/1 +From ssh://go/osmo-msc + * branch refs/changes/87/3787/1 -> FETCH_HEAD ++ git checkout -b 3787_1 FETCH_HEAD +Switched to a new branch '3787_1' + + ----------------------------------------------------------------------------- ./g fetch # run 'git fetch' in each clone = fetch all from upstream diff --git a/src/fetch-gerrit-patch.sh b/src/fetch-gerrit-patch.sh new file mode 100755 index 0000000..0353461 --- /dev/null +++ b/src/fetch-gerrit-patch.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# fetch gerrit patch into new branch named like the patch number. +# +# Usage: go to a git clone and pass a patch number: +# +# cd osmo-msc +# P 973 +# or +# P 973/2 +# +# Will create new local branches '973_4' (if 4 is the latest patch set) +# or '973_2', respectively. + +patch="$1" + +if [ -z "$patch" ]; then + echo "Usage: $0 1234[/5]" + exit 1 +fi + +if [ -z "$(echo "$patch" | grep '/')" ]; then + patch="/$patch/" +fi + +if [ -z "$(echo "$patch" | grep '^/')" ]; then + patch="/$patch" +fi + +last_set="$(git ls-remote origin "changes/*" | grep "$patch" | sed 's#.*/\([^/]*\)$#\1 &#' | sort -n | tail -n 1)" +if [ -z "$last_set" ]; then + echo "Not found: $patch" + exit 1 +fi + +change_name="$(echo "$last_set" | sed 's/.*\(refs.*\)/\1/')" +branch_name="$(echo "$change_name" | sed 's#refs/changes/../\([0-9]*\)/\([0-9]*\)#\1_\2#')" + +set -x +git fetch origin "$change_name" +git checkout -b "$branch_name" FETCH_HEAD + -- To view, visit https://gerrit.osmocom.org/3803 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6df4f3226af9087ef346de72cbcaa86a4d4d5e13 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:29:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 10:29:14 +0000 Subject: osmo-dev[master]: git_branch_summary.py: add usage, make py3 compatible In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3806 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8cc461fd0f1fb43e19ee8846cc48a828d153b2f Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:29:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 10:29:15 +0000 Subject: [MERGED] osmo-dev[master]: git_branch_summary.py: add usage, make py3 compatible In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: git_branch_summary.py: add usage, make py3 compatible ...................................................................... git_branch_summary.py: add usage, make py3 compatible Change-Id: Ia8cc461fd0f1fb43e19ee8846cc48a828d153b2f --- M src/git_branch_summary.py 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/src/git_branch_summary.py b/src/git_branch_summary.py index 6bd4378..cc86112 100755 --- a/src/git_branch_summary.py +++ b/src/git_branch_summary.py @@ -2,6 +2,10 @@ import sys, subprocess, re +if len(sys.argv) < 2: + print("Usage: %s [...]\nThis is mostly here for helping the 'st' script." % sys.argv[0]) + exit(1) + interesting_branch_names = [ 'master', 'sysmocom/iu', 'sysmocom/sccp', 'aper-prefix-onto-upstream' ] re_branch_name = re.compile('^..([^ ]+) .*') @@ -15,7 +19,7 @@ def do_one_git(git_dir): global interesting - branch_strs = subprocess.check_output(('git', '-C', git_dir, 'branch', '-vv')).splitlines() + branch_strs = subprocess.check_output(('git', '-C', git_dir, 'branch', '-vv')).decode().splitlines() interesting_branches = [] for line in branch_strs: @@ -35,7 +39,7 @@ else: interesting_branches.append(br) - status = subprocess.check_output(('git', '-C', git_dir, 'status')) + status = subprocess.check_output(('git', '-C', git_dir, 'status')).decode() has_mods = 'modified:' in status interesting.append((git_dir, has_mods, interesting_branches)) @@ -59,6 +63,6 @@ br.append('[%s]' % '|'.join(ahead)) strs.append(''.join(br)) - print ' '.join(strs) + print(' '.join(strs)) # vim: shiftwidth=2 expandtab tabstop=2 -- To view, visit https://gerrit.osmocom.org/3806 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8cc461fd0f1fb43e19ee8846cc48a828d153b2f Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:38:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:38:27 +0000 Subject: openbsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:38:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:38:33 +0000 Subject: openbsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Patch Set 1: nice catch! -- To view, visit https://gerrit.osmocom.org/3814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:38:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:38:35 +0000 Subject: [MERGED] openbsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: handover_decision: Fix condition for power budget handover attempt ...................................................................... handover_decision: Fix condition for power budget handover attempt Handover attempt for power budget case should be performed every N SACCH frames, where N = Power Budget Interval. First measurement report with mr->nr = 0 was used for the first handover attempt in this case, which is not correct, because first usable report should have mr->nr = net->handover.pwr_interval-1. Moreover using the first measurement report with mr->nr = 0 for handover attempt could lead to unnecessary handover, because usually av_rxlev for first measurement report from MS is worse than for following reports. Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e --- M openbsc/src/libbsc/handover_decision.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/handover_decision.c b/openbsc/src/libbsc/handover_decision.c index 0f07bca..f81f1dd 100644 --- a/openbsc/src/libbsc/handover_decision.c +++ b/openbsc/src/libbsc/handover_decision.c @@ -273,7 +273,7 @@ return attempt_handover(mr); /* Power Budget AKA Better Cell */ - if ((mr->nr % net->handover.pwr_interval) == 0) + if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) return attempt_handover(mr); return 0; -- To view, visit https://gerrit.osmocom.org/3814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:39:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:39:53 +0000 Subject: osmo-bsc[master]: move include/openbsc to include/osmocom/bsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:41:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:41:50 +0000 Subject: osmo-bsc[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3794/2/README File README: Line 18: - Abis interfaces towards various kinds of BTS; as you mention OsmoMSC above, one could mention OsmoBTS here Line 25: OsmoBSC-NAT is a specialized solution to navigating RTP streams through a NAT. It's not about RTP streams. It's about aggregating many (e.g. hundreds of) A interfaces from many (Osmo-)BSC into one A link to the MSC, so the MSC doesn't need to be configured with lots of A links/interfaces. This includes signaling and media handling, but it's not specifically related to RTP. -- To view, visit https://gerrit.osmocom.org/3794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:42:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:42:07 +0000 Subject: osmo-bsc[master]: rename openbsc.pc to osmo-bsc.pc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3792 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99ab9fea01c11841437b587dffd4e1fff17a291f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:42:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:42:43 +0000 Subject: osmo-bsc[master]: drop files unrelated to osmo-bsc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:43:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:43:11 +0000 Subject: osmo-bsc[master]: drop MGCP client from osmo-bsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:44:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:44:20 +0000 Subject: libosmocore[master]: cosmetic: clarify language in vty read error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3805 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib4dd135feb9609b14983db5dac321a70267d8f30 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:44:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:44:22 +0000 Subject: [MERGED] libosmocore[master]: cosmetic: clarify language in vty read error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: clarify language in vty read error ...................................................................... cosmetic: clarify language in vty read error This is very minor but it annoys every time I see it. The text: "Error occurred during reading below line:" is not a complete sentence. The default understanding in english having left out the article implies that the error occured reading below [the] specified line, not that the error occured reading [the] specified line. That is to say, The message implied that the printed line was the last successfully parsed line. Change-Id: Ib4dd135feb9609b14983db5dac321a70267d8f30 --- M src/vty/vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/vty.c b/src/vty/vty.c index 644d4ed..113a781 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1481,7 +1481,7 @@ fprintf(stderr, "There is no such command.\n"); break; } - fprintf(stderr, "Error occurred during reading below " + fprintf(stderr, "Error occurred during reading the below " "line:\n%s\n", vty->buf); vty_close(vty); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3805 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib4dd135feb9609b14983db5dac321a70267d8f30 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:45:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:45:18 +0000 Subject: osmo-msc[master]: remove contrib/soap.py, seems to apply to osmo-bsc only In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I thought this is a greneric control interface to SOAP proxy, not related to any of the specific programs? Please clarify with max. Maybe it should be in libosmocore? -- To view, visit https://gerrit.osmocom.org/3812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I647be0a646bbc3cfee226c55061e0e57fa1211fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:45:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:45:39 +0000 Subject: osmo-msc[master]: rename include/openbsc to include/osmocom/msc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:46:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:46:18 +0000 Subject: osmo-msc[master]: drop files unrelated to osmo-msc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3801 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I49957769e09eed6d723bf7c3777024b62b3480fd Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:47:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:47:51 +0000 Subject: osmo-msc[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/3800/2/README File README: Line 17: - IuCS towards a HNG-GW (e.g. OsmoHNBGW) for 3G voice; HNB-GW. Also, it's a RNC or HNB-GW. Line 18: - MNCC (Mobile Network Call Control derived from GSM TS 04.07) Line 19: - SMPP SMPP 3.4 (Short Message Peer-to-Peer) -- To view, visit https://gerrit.osmocom.org/3800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:48:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:48:07 +0000 Subject: osmo-msc[master]: debian: fix web and VCS links, tweak osmo-msc.install In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3fffa73722c5437c969d25294e0ff86de5385087 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:48:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:48:21 +0000 Subject: osmo-msc[master]: rename openbsc.pc to osmo-msc.pc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3798 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe73012cb2a27d886b5faf931a62d5efbddd8120 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:49:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:49:27 +0000 Subject: osmo-msc[master]: --enable-iu by default In-Reply-To: References: Message-ID: Patch Set 1: I'm not entirely convinced if this is the way to go. Compiling libosmo-ui takes quite long, and I think the number of users of the 3G Osmocom stack is still much lower than that of the 2G stack? -- To view, visit https://gerrit.osmocom.org/3786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:49:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:49:35 +0000 Subject: osmo-msc[master]: configure.ac: fix to "AC_INIT[osmo-msc]" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c0dea06e341ccd944448b133381a390fc500c32 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:50:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:50:30 +0000 Subject: osmo-sgsn[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3804/2/README File README: Line 12: - IuPS towards a HNB-GW (e.g. OsmoHNBGW) for 3G data; RNC or HNB-GW. The HNB-Gw is only a special case for femtocells. -- To view, visit https://gerrit.osmocom.org/3804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:50:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:50:52 +0000 Subject: osmo-sgsn[master]: move include/openbsc to include/osmocom/sgsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I281ef585fffc2644682c8282224fb1c2da5ca795 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:51:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:51:06 +0000 Subject: osmo-sgsn[master]: move openbsc.pc to osmo-sgsn.pc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iad28d85b2a6d175cbe5d506aa82e7e4d94111eff Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:51:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:51:14 +0000 Subject: osmo-sgsn[master]: configure.ac: set name to osmo-sgsn, fix ML addr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3808 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I47e9f2307b42d171f2ceeda1e129e2311f611883 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:51:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:51:23 +0000 Subject: osmo-sgsn[master]: drop files unrelated to osmo-sgsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9dc7514c3850010d0e9b3ab716b4f4e8d83594f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:51:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 10:51:31 +0000 Subject: osmo-sgsn[master]: debian: fix osmo-sgsn.install, tweak VCS link and descriptions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6493a7ca7d996fab00d99652a74a709c860a3de7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 10:53:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 10:53:24 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: add 'asp' / 'local-ip' command Message-ID: Review at https://gerrit.osmocom.org/3826 vty: add 'asp' / 'local-ip' command We can set the ASP's remote IP (i.e. where to reach osmo-stp), but so far the only way to specify the local IP address to bind to can only be set from C code (e.g. the simple client). Allow setting the local address via VTY. For example, this is desired for the osmo-gsm-tester, to not use arbitrary IP addresses. Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d --- M src/osmo_ss7_vty.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/26/3826/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 1fb35a1..2f2663d 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -566,6 +566,16 @@ return CMD_SUCCESS; } +DEFUN(asp_local_ip, asp_local_ip_cmd, + "local-ip A.B.C.D", + "Specify Local IP Address from which to contact ASP\n" + "Local IP Address from which to contact of ASP\n") +{ + struct osmo_ss7_asp *asp = vty->index; + osmo_talloc_replace_string(asp, &asp->cfg.local.host, argv[0]); + return CMD_SUCCESS; +} + DEFUN(asp_qos_clas, asp_qos_class_cmd, "qos-class <0-255>", "Specify QoS Class of ASP\n" @@ -1728,6 +1738,7 @@ install_element(L_CS7_NODE, &no_cs7_asp_cmd); install_element(L_CS7_ASP_NODE, &cfg_description_cmd); install_element(L_CS7_ASP_NODE, &asp_remote_ip_cmd); + install_element(L_CS7_ASP_NODE, &asp_local_ip_cmd); install_element(L_CS7_ASP_NODE, &asp_qos_class_cmd); install_element(L_CS7_ASP_NODE, &asp_block_cmd); install_element(L_CS7_ASP_NODE, &asp_shutdown_cmd); -- To view, visit https://gerrit.osmocom.org/3826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 11:05:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 11:05:57 +0000 Subject: [PATCH] osmo-msc[master]: doc/examples: add detailed cs7 config examples Message-ID: Review at https://gerrit.osmocom.org/3827 doc/examples: add detailed cs7 config examples Change-Id: I4da6724cd4348e92dfd06516f82af06c97277ef9 --- A doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg A doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg M osmoappdesc.py 3 files changed, 59 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/27/3827/1 diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg new file mode 100644 index 0000000..f632a4a --- /dev/null +++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg @@ -0,0 +1,26 @@ +! +! OsmoMSC configuration saved from vty +! +line vty + no login +! +network + network country code 1 + mobile network code 1 + short name OsmoMSC + long name OsmoMSC + auth policy closed + location updating reject cause 13 + encryption a5 0 + rrlp mode none + mm info 1 +cs7 instance 0 + point-code 0.23.1 + asp asp-clnt-OsmoMSC-A-Iu 2905 0 m3ua + remote-ip 10.23.24.1 ! where to reach the STP +! local-ip 10.23.24.1 +msc + cs7-instance-a 0 + cs7-instance-iu 0 + mgcpgw remote-ip 10.23.24.1 + assign-tmsi diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg new file mode 100644 index 0000000..3c38445 --- /dev/null +++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg @@ -0,0 +1,29 @@ +! +! OsmoMSC configuration saved from vty +! +line vty + no login +! +network + network country code 1 + mobile network code 1 + short name OsmoMSC + long name OsmoMSC + auth policy closed + location updating reject cause 13 + encryption a5 0 + rrlp mode none + mm info 1 +cs7 instance 0 + point-code 0.23.1 + asp asp-clnt-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.24.1 +cs7 instance 1 + point-code 0.23.2 + asp asp-clnt-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.24.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 + mgcpgw remote-ip 10.23.24.1 + assign-tmsi diff --git a/osmoappdesc.py b/osmoappdesc.py index b72c93e..93944cf 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -28,7 +28,10 @@ app_configs = { - "msc": ["doc/examples/osmo-msc/osmo-msc.cfg"], + "msc": ["doc/examples/osmo-msc/osmo-msc.cfg", + "doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg", + "doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg", + ], } -- To view, visit https://gerrit.osmocom.org/3827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4da6724cd4348e92dfd06516f82af06c97277ef9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 11:31:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 5 Sep 2017 11:31:04 +0000 Subject: libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (4 comments) Fix the small bits and it's fine for me. Once it's merged we can apply some other bits in my patch which are also useful (documentation., extra check for osmux frame type, etc.). Please before doing so, also rebase on top of latest master, otherwise there are gerrit verification issues due to some late changes when verifying some stuff during build time. https://gerrit.osmocom.org/#/c/3825/1//COMMIT_MSG Commit Message: Line 31: As in snprintf(), caller should not assume the buffer is nul-terminated. Why not? Reading at man snprintf my impression is the opposite: """ RETURN VALUE Upon successful return, these functions return the number of characters printed (excluding the null byte used to end output to strings). The functions snprintf() and vsnprintf() do not write more than size bytes (including the terminating null byte ('\0')). If the output was truncated due to this limit, then the return value is the number of characters (excluding the terminating null byte) which would have been written to the final string if enough space had been available. Thus, a return value of size or more means that the output was truncated. (See also below under NOTES.) If an output error is encountered, a negative value is returned. """ So, as long as siz>=1, it for sure should write the NULL character. Other possibilities I can think of is the case in which snprintf() returns -1, where I guess the output buffer should not be used anyway because it's unexpected what's in there. And in the case size==0, I'd bet it either: - Returns -1 (case above) - Returns number of bytes required for the input buffer (and you don't care if it wrote null byte because there's actually no input buffer and if it's not intended to have size=0 you already have bigger problems somewhere else. It's true though that as we are masking the error in snprintf, what comes out of osmux_snprintf may not be null terminated. https://gerrit.osmocom.org/#/c/3825/1/tests/osmux/osmux_test.c File tests/osmux/osmux_test.c: Line 87: buf[ret - 1] = '\0'; As stated in the comment I did in the commit description, I think we should always ensure a null terminated buf is returned (given than size>0 of course). I'd move this line inside osmo_rtp_snprintf. Line 113: buf[ret - 1] = '\0'; Same here for osmux_snprintf. Line 208: buf[ret - 1] = '\0'; same -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 11:32:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 5 Sep 2017 11:32:16 +0000 Subject: libosmo-netif[master]: rtp: return offset in osmo_rtp_snprintf() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10066d73387be96a4e1f3349d700405beb138076 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 11:33:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 5 Sep 2017 11:33:33 +0000 Subject: [PATCH] osmo-bsc[master]: Move channel state assignment to macro Message-ID: Review at https://gerrit.osmocom.org/3828 Move channel state assignment to macro Previously we've used function so debug print always pointed to the same place which is not very useful. Replace it with macro so proper file:line is printed. Also, make sure that we always change state only through this macro. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 --- M include/openbsc/abis_rsl.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/chan_alloc.c M src/libbsc/handover_logic.c 5 files changed, 20 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/28/3828/1 diff --git a/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h index f983fce..ecab0fe 100644 --- a/include/openbsc/abis_rsl.h +++ b/include/openbsc/abis_rsl.h @@ -34,6 +34,13 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) +#define LCHAN_SET_ST(lch_, st_) \ + do { \ + DEBUGP(DRSL, "%s state %s -> %s\n", \ + gsm_lchan_name(lch_), gsm_lchans_name((lch_)->state), gsm_lchans_name(st_)); \ + (lch_)->state = st_; \ + } while (0) + int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); @@ -74,7 +81,6 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, enum rsl_rel_mode release_mode); -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); /* to be provided by external code */ diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 75229a5..fabb47a 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -79,7 +79,7 @@ osmo_timer_schedule(&lchan->error_timer, lchan->ts->trx->bts->network->T3111 + 2, 0); } else { - rsl_lchan_set_state(lchan, LCHAN_S_NONE); + LCHAN_SET_ST(lchan, LCHAN_S_NONE); } lchan_free(lchan); } @@ -509,7 +509,7 @@ * the calling code passes the correct lchan. */ OSMO_ASSERT(lchan == lchan->ts->lchan); - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_ACT_REQ); msg = rsl_msgb_alloc(); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); @@ -622,7 +622,7 @@ return rc; } - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_ACT_REQ); ta = lchan->rqd_ta; @@ -825,7 +825,7 @@ /* go back to the none state */ LOGP(DRSL, LOGL_INFO, "%s is back in operation.\n", gsm_lchan_name(lchan)); - rsl_lchan_set_state(lchan, LCHAN_S_NONE); + LCHAN_SET_ST(lchan, LCHAN_S_NONE); /* Put PDCH channel back into PDCH mode, if GPRS is enabled */ if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH @@ -896,7 +896,7 @@ /* * TODO: start T3109 now. */ - rsl_lchan_set_state(lchan, LCHAN_S_REL_ERR); + LCHAN_SET_ST(lchan, LCHAN_S_REL_ERR); } /* Start another timer or assume the BTS sends a ACK/NACK? */ @@ -1220,17 +1220,8 @@ { LOGP(DRSL, LOGL_ERROR, "%s %s lchan broken: %s\n", gsm_lchan_name(lchan), gsm_lchant_name(lchan->type), reason); - rsl_lchan_set_state(lchan, LCHAN_S_BROKEN); + LCHAN_SET_ST(lchan, LCHAN_S_BROKEN); lchan->broken_reason = reason; - return 0; -} - -int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) -{ - DEBUGP(DRSL, "%s state %s -> %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), - gsm_lchans_name(state)); - lchan->state = state; return 0; } @@ -1257,7 +1248,7 @@ talloc_free(lchan->rqd_ref); lchan->rqd_ref = NULL; lchan->rqd_ta = 0; - rsl_lchan_set_state(msg->lchan, LCHAN_S_ACTIVE); + LCHAN_SET_ST(msg->lchan, LCHAN_S_ACTIVE); if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) { /* * lchan_act_tmr_cb() already called @@ -1282,7 +1273,7 @@ LOGP(DRSL, LOGL_NOTICE, "%s CHAN ACT ACK, but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); - rsl_lchan_set_state(lchan, LCHAN_S_ACTIVE); + LCHAN_SET_ST(lchan, LCHAN_S_ACTIVE); if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) dyn_ts_switchover_complete(lchan); @@ -2614,7 +2605,7 @@ * rsl_rx_rf_chan_rel_ack(). PDCH is always on lchan[0]. */ if (ts->dyn.pchan_is == GSM_PCHAN_PDCH) { - rsl_lchan_set_state(ts->lchan, LCHAN_S_REL_REQ); + LCHAN_SET_ST(ts->lchan, LCHAN_S_REL_REQ); rc = rsl_rf_chan_release(ts->lchan, 0, SACCH_NONE); if (rc) { LOGP(DRSL, LOGL_ERROR, diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a0ba69a..2c64dde 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -246,7 +246,7 @@ conn->secondary_lchan = new_lchan; new_lchan->conn = conn; - rsl_lchan_set_state(new_lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(new_lchan, LCHAN_S_ACT_REQ); return 0; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 4192d65..8d31dcf 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -448,7 +448,7 @@ osmo_timer_del(&lchan->error_timer); lchan->type = GSM_LCHAN_NONE; - lchan->state = LCHAN_S_NONE; + LCHAN_SET_ST(lchan, LCHAN_S_NONE); if (lchan->abis_ip.rtp_socket) { rtp_socket_free(lchan->abis_ip.rtp_socket); @@ -485,7 +485,7 @@ int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode mode) { DEBUGP(DRLL, "%s starting release sequence\n", gsm_lchan_name(lchan)); - rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_REL_REQ); lchan->conn = NULL; _lchan_handle_release(lchan, sacch_deact, mode); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 8ced74f..5202cc9 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -152,7 +152,7 @@ return rc; } - rsl_lchan_set_state(new_lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(new_lchan, LCHAN_S_ACT_REQ); llist_add(&ho->list, &bsc_handovers); /* we continue in the SS_LCHAN handler / ho_chan_activ_ack */ -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 5 11:34:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 5 Sep 2017 11:34:31 +0000 Subject: [PATCH] osmo-bts[master]: OML: print actual type of report sent to BSC Message-ID: Review at https://gerrit.osmocom.org/3829 OML: print actual type of report sent to BSC We re-use the same facility to send different data so it's better to print actual cause value to avoid confusion. Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/29/3829/1 diff --git a/src/common/oml.c b/src/common/oml.c index 20f45e5..69a2642 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -73,7 +73,7 @@ struct msgb *nmsg; va_list ap; - LOGP(DOML, LOGL_NOTICE, "Reporting FAILURE to BSC: "); + LOGP(DOML, LOGL_NOTICE, "Sending %s to BSC: ", get_value_string(abis_mm_event_cause_names, cause_value)); va_start(ap, fmt); osmo_vlogp(DOML, LOGL_NOTICE, __FILE__, __LINE__, 1, fmt, ap); nmsg = abis_nm_fail_evt_vrep(NM_EVT_PROC_FAIL, NM_SEVER_CRITICAL, -- To view, visit https://gerrit.osmocom.org/3829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 5 12:38:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 5 Sep 2017 12:38:07 +0000 Subject: [PATCH] osmo-bsc[master]: Move channel state assignment to macro In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3828 to look at the new patch set (#2). Move channel state assignment to macro Previously we've used function so debug print always pointed to the same place which is not very useful. Replace it with macro so proper file:line is printed. Also, make sure that we always change state only through this macro. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 --- M include/openbsc/abis_rsl.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/chan_alloc.c M src/libbsc/handover_logic.c 5 files changed, 21 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/28/3828/2 diff --git a/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h index f983fce..c419bb7 100644 --- a/include/openbsc/abis_rsl.h +++ b/include/openbsc/abis_rsl.h @@ -34,6 +34,14 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) +#define LCHAN_SET_ST(lch_, st_) \ + do { \ + if ((lch_)->state != st_) \ + DEBUGP(DRSL, "%s state %s -> %s\n", \ + gsm_lchan_name(lch_), gsm_lchans_name((lch_)->state), gsm_lchans_name(st_)); \ + (lch_)->state = st_; \ + } while (0) + int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); @@ -74,7 +82,6 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, enum rsl_rel_mode release_mode); -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); /* to be provided by external code */ diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 75229a5..fabb47a 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -79,7 +79,7 @@ osmo_timer_schedule(&lchan->error_timer, lchan->ts->trx->bts->network->T3111 + 2, 0); } else { - rsl_lchan_set_state(lchan, LCHAN_S_NONE); + LCHAN_SET_ST(lchan, LCHAN_S_NONE); } lchan_free(lchan); } @@ -509,7 +509,7 @@ * the calling code passes the correct lchan. */ OSMO_ASSERT(lchan == lchan->ts->lchan); - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_ACT_REQ); msg = rsl_msgb_alloc(); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); @@ -622,7 +622,7 @@ return rc; } - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_ACT_REQ); ta = lchan->rqd_ta; @@ -825,7 +825,7 @@ /* go back to the none state */ LOGP(DRSL, LOGL_INFO, "%s is back in operation.\n", gsm_lchan_name(lchan)); - rsl_lchan_set_state(lchan, LCHAN_S_NONE); + LCHAN_SET_ST(lchan, LCHAN_S_NONE); /* Put PDCH channel back into PDCH mode, if GPRS is enabled */ if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH @@ -896,7 +896,7 @@ /* * TODO: start T3109 now. */ - rsl_lchan_set_state(lchan, LCHAN_S_REL_ERR); + LCHAN_SET_ST(lchan, LCHAN_S_REL_ERR); } /* Start another timer or assume the BTS sends a ACK/NACK? */ @@ -1220,17 +1220,8 @@ { LOGP(DRSL, LOGL_ERROR, "%s %s lchan broken: %s\n", gsm_lchan_name(lchan), gsm_lchant_name(lchan->type), reason); - rsl_lchan_set_state(lchan, LCHAN_S_BROKEN); + LCHAN_SET_ST(lchan, LCHAN_S_BROKEN); lchan->broken_reason = reason; - return 0; -} - -int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) -{ - DEBUGP(DRSL, "%s state %s -> %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), - gsm_lchans_name(state)); - lchan->state = state; return 0; } @@ -1257,7 +1248,7 @@ talloc_free(lchan->rqd_ref); lchan->rqd_ref = NULL; lchan->rqd_ta = 0; - rsl_lchan_set_state(msg->lchan, LCHAN_S_ACTIVE); + LCHAN_SET_ST(msg->lchan, LCHAN_S_ACTIVE); if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) { /* * lchan_act_tmr_cb() already called @@ -1282,7 +1273,7 @@ LOGP(DRSL, LOGL_NOTICE, "%s CHAN ACT ACK, but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); - rsl_lchan_set_state(lchan, LCHAN_S_ACTIVE); + LCHAN_SET_ST(lchan, LCHAN_S_ACTIVE); if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) dyn_ts_switchover_complete(lchan); @@ -2614,7 +2605,7 @@ * rsl_rx_rf_chan_rel_ack(). PDCH is always on lchan[0]. */ if (ts->dyn.pchan_is == GSM_PCHAN_PDCH) { - rsl_lchan_set_state(ts->lchan, LCHAN_S_REL_REQ); + LCHAN_SET_ST(ts->lchan, LCHAN_S_REL_REQ); rc = rsl_rf_chan_release(ts->lchan, 0, SACCH_NONE); if (rc) { LOGP(DRSL, LOGL_ERROR, diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a0ba69a..2c64dde 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -246,7 +246,7 @@ conn->secondary_lchan = new_lchan; new_lchan->conn = conn; - rsl_lchan_set_state(new_lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(new_lchan, LCHAN_S_ACT_REQ); return 0; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 4192d65..8d31dcf 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -448,7 +448,7 @@ osmo_timer_del(&lchan->error_timer); lchan->type = GSM_LCHAN_NONE; - lchan->state = LCHAN_S_NONE; + LCHAN_SET_ST(lchan, LCHAN_S_NONE); if (lchan->abis_ip.rtp_socket) { rtp_socket_free(lchan->abis_ip.rtp_socket); @@ -485,7 +485,7 @@ int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode mode) { DEBUGP(DRLL, "%s starting release sequence\n", gsm_lchan_name(lchan)); - rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_REL_REQ); lchan->conn = NULL; _lchan_handle_release(lchan, sacch_deact, mode); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 8ced74f..5202cc9 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -152,7 +152,7 @@ return rc; } - rsl_lchan_set_state(new_lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(new_lchan, LCHAN_S_ACT_REQ); llist_add(&ho->list, &bsc_handovers); /* we continue in the SS_LCHAN handler / ho_chan_activ_ack */ -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 12:45:53 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 5 Sep 2017 12:45:53 +0000 Subject: [PATCH] openbsc[master]: Make use of osmo-build.sh to use dependency artifacts for bu... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3823 to look at the new patch set (#2). Make use of osmo-build.sh to use dependency artifacts for builds. Change-Id: I8a2ff700bbe3806bb2c1d561c6f2249fae3d8dd8 Note: this patchset depends on https://gerrit.osmocom.org/#/c/3822/1 --- M contrib/jenkins.sh 1 file changed, 47 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/3823/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 892d721..61b27be 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,59 +1,58 @@ -#!/usr/bin/env bash -# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org +#!/bin/sh -ex -if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then - echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" - exit 2 -fi +artifact_deps() { + x="$($1 libosmocore)" + x="${x}_$($1 libosmo-abis)" + x="${x}_$($1 libosmo-netif)" + x="${x}_$($1 libosmo-sccp "$sccp_branch")" + x="${x}_$($1 libsmpp34)" + x="${x}_$($1 openggsn)" -set -ex + if [ "x$IU" = "x--enable-iu" ]; then + x="${x}_$($1 libasn1c)" + x="${x}_$($1 osmo-iuh "$osmo_iuh_branch")" + fi -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst + echo "${x}.tar.gz" +} -mkdir "$deps" || true -rm -rf "$inst" +build_deps() { -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + osmo-build-dep.sh libosmocore master ac_cv_path_DOXYGEN=false + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + osmo-build-dep.sh libosmo-abis + osmo-build-dep.sh libosmo-netif + osmo-build-dep.sh libosmo-sccp "$sccp_branch" + PARALLEL_MAKE=-j1 osmo-build-dep.sh libsmpp34 + osmo-build-dep.sh openggsn -export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" -export LD_LIBRARY_PATH="$inst/lib" + if [ "x$IU" = "x--enable-iu" ]; then + osmo-build-dep.sh libasn1c + osmo-build-dep.sh osmo-iuh "$osmo_iuh_branch" + fi +} + +build_project() { + + cd "$base/openbsc" + + autoreconf --install --force + + ./configure "$SMPP" "$MGCP" "$IU" \ + --enable-osmo-bsc \ + --enable-nat \ + --enable-vty-tests \ + --enable-external-tests + + "$MAKE" $PARALLEL_MAKE + "$MAKE" check || cat-testlogs.sh + "$MAKE" distcheck || cat-testlogs.sh +} if [ "x$IU" = "x--enable-iu" ]; then - sccp_branch="old_sua" - osmo_iuh_branch="old_sua" + sccp_branch="old_sua" + osmo_iuh_branch="old_sua" fi -osmo-build-dep.sh libosmocore -osmo-build-dep.sh libosmo-abis -osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp $sccp_branch -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh openggsn - -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh $osmo_iuh_branch -fi - -set +x -echo -echo -echo -echo " =============================== openbsc ===============================" -echo -set -x - -cd "$base" -cd openbsc -autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests -$MAKE $PARALLEL_MAKE -LD_LIBRARY_PATH="$inst/lib" $MAKE check \ - || cat-testlogs.sh -LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \ - || cat-testlogs.sh +. osmo-build.sh -- To view, visit https://gerrit.osmocom.org/3823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8a2ff700bbe3806bb2c1d561c6f2249fae3d8dd8 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 12:49:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 5 Sep 2017 12:49:40 +0000 Subject: osmo-msc[master]: remove contrib/soap.py, seems to apply to osmo-bsc only In-Reply-To: References: Message-ID: Patch Set 1: Yes, it's generic in a sense it's not specific to any particular osmo-* program but it relies on ipa.py implementation, on which vty_test_runner.py depends as well. We can move soap.py to osmo-python-tests because vty_test_runner.py depends on it anyway. -- To view, visit https://gerrit.osmocom.org/3812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I647be0a646bbc3cfee226c55061e0e57fa1211fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 13:13:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 5 Sep 2017 13:13:58 +0000 Subject: [PATCH] libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3825 to look at the new patch set (#2). osmux: fix buffer management mess in snprintf() calls SNPRINTF_BUFFER_SIZE() macro seems to be very buggy. Replace it by a working version: if (ret < 0) \ ret = 0; \ offset += ret; \ if (ret > remain) \ ret = remain; \ remain -= ret; That basically accounts for remaining space in the buffer and updates the offset to where we should print next. This macro also deals with two corner cases: 1) snprintf() fails, actually never happens in practise, but documentation indicates it may return -1, so catch this case to stick to specs. 2) There is not enough space in the buffer, in that case, keep increasing offset, so we know how much would have been printed, just like snprintf(). As in snprintf(), caller should not assume the buffer is nul-terminated. Thanks to Pau Espin for reporting, and Holger for clues on this. I also run osmux_test and, at quick glance, it looks good. Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 --- M src/osmux.c M src/rtp.c M tests/osmux/osmux_test.c 3 files changed, 44 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/25/3825/2 diff --git a/src/osmux.c b/src/osmux.c index b3c43e2..b18246f 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -846,19 +846,20 @@ h->rtp_ssrc = rtp_ssrc; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size -= ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; static int osmux_snprintf_header(char *buf, size_t size, struct osmux_hdr *osmuxh) { + unsigned int remain = size, offset = 0; int ret; - int len = size, offset = 0; - ret = snprintf(buf, len, "OSMUX seq=%03u ccid=%03u " + ret = snprintf(buf, remain, "OSMUX seq=%03u ccid=%03u " "ft=%01u ctr=%01u " "amr_f=%01u amr_q=%01u " "amr_ft=%02u amr_cmr=%02u ", @@ -866,7 +867,7 @@ osmuxh->ft, osmuxh->ctr, osmuxh->amr_f, osmuxh->amr_q, osmuxh->amr_ft, osmuxh->amr_cmr); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } @@ -874,19 +875,19 @@ static int osmux_snprintf_payload(char *buf, size_t size, const uint8_t *payload, int payload_len) { + unsigned int remain = size, offset = 0; int ret, i; - int len = size, offset = 0; - ret = snprintf(buf+offset, len, "[ "); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "[ "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); for (i=0; ilen, len = size; - struct osmux_hdr *osmuxh; + unsigned int remain = size; int this_len, msg_off = 0; + struct osmux_hdr *osmuxh; + unsigned int offset = 0; + int msg_len = msg->len; + int ret; while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { @@ -915,10 +917,8 @@ return -1; } - ret = osmux_snprintf_header(buf+offset, size, osmuxh); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = osmux_snprintf_header(buf + offset, remain, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); this_len = sizeof(struct osmux_hdr) + osmux_get_payload_len(osmuxh); @@ -931,12 +931,10 @@ return -1; } - ret = osmux_snprintf_payload(buf+offset, size, + ret = osmux_snprintf_payload(buf + offset, remain, osmux_get_payload(osmuxh), osmux_get_payload_len(osmuxh)); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); msg_len -= this_len; } diff --git a/src/rtp.c b/src/rtp.c index 44fc217..56fc37c 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -185,19 +185,20 @@ return msg; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size += ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; int osmo_rtp_snprintf(char *buf, size_t size, struct msgb *msg) { + unsigned int remain = size, offset = 0; struct rtp_hdr *rtph; - int ret, i; uint8_t *payload; - unsigned int len = size, offset = 0; + int ret, i; rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) @@ -205,22 +206,22 @@ payload = (uint8_t *)rtph + sizeof(struct rtp_hdr); - ret = snprintf(buf, len, "RTP ver=%01u ssrc=%u type=%02u " + ret = snprintf(buf, remain, "RTP ver=%01u ssrc=%u type=%02u " "marker=%01u ext=%01u csrc_count=%01u " "sequence=%u timestamp=%u [", rtph->version, ntohl(rtph->ssrc), rtph->payload_type, rtph->marker, rtph->extension, rtph->csrc_count, ntohs(rtph->sequence), ntohl(rtph->timestamp)); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); for (i=0; ilen - sizeof(struct rtp_hdr); i++) { - ret = snprintf(buf+offset, len, "%02x ", payload[i]); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "%02x ", payload[i]); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); } - ret = snprintf(buf+offset, len, "]"); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c index bf6174b..09b7a9a 100644 --- a/tests/osmux/osmux_test.c +++ b/tests/osmux/osmux_test.c @@ -65,8 +65,8 @@ static void tx_cb(struct msgb *msg, void *data) { - char buf[4096]; struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data; + char buf[4096]; #if OSMUX_TEST_USE_TIMING struct timeval now, diff; @@ -102,9 +102,9 @@ static void osmux_deliver(struct msgb *batch_msg, void *data) { - char buf[2048]; struct osmux_hdr *osmuxh; LLIST_HEAD(list); + char buf[2048]; osmux_snprintf(buf, sizeof(buf), batch_msg); fprintf(stderr, "OSMUX message (len=%d) %s\n", batch_msg->len, buf); @@ -182,11 +182,11 @@ static void osmux_test_loop(int ccid) { - struct msgb *msg; - char buf[1024]; struct rtp_hdr *rtph = (struct rtp_hdr *)rtp_pkt; - uint16_t seq; + struct msgb *msg; int i, j, k = 0; + char buf[1024]; + uint16_t seq; for (i = 1; i < 65; i++) { msg = msgb_alloc(1500, "test"); -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 5 13:13:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 5 Sep 2017 13:13:59 +0000 Subject: [PATCH] libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers Message-ID: Review at https://gerrit.osmocom.org/3830 src: _snprintf() helper functions always nul-terminate buffers Add the \0 for every case, even if this does not match exactly the snprintf semantics. Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 --- M src/osmux.c M src/rtp.c 2 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/30/3830/1 diff --git a/src/osmux.c b/src/osmux.c index b18246f..683c6e9 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -938,6 +938,13 @@ msg_len -= this_len; } + /* This _snprintf() variant always nul-terminates the buffer. */ + if (!offset) + buf[0] = '\0'; + else if (offset + 1 >= size) + buf[offset] = '\0'; + else + buf[++offset] = '\0'; return offset; } diff --git a/src/rtp.c b/src/rtp.c index 56fc37c..f524f73 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -223,5 +223,13 @@ ret = snprintf(buf + offset, remain, "]"); SNPRINTF_BUFFER_SIZE(ret, remain, offset); + /* This _snprintf() variant always nul-terminates the buffer. */ + if (!offset) + buf[0] = '\0'; + else if (offset + 1 >= size) + buf[offset] = '\0'; + else + buf[++offset] = '\0'; + return offset; } -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Sep 5 13:35:10 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 5 Sep 2017 13:35:10 +0000 Subject: [PATCH] osmo-msc[master]: Make use of osmo-build.sh, which introduces dependency artif... Message-ID: Review at https://gerrit.osmocom.org/3831 Make use of osmo-build.sh, which introduces dependency artifacts. Change-Id: I6228536f6c6f79e5534361ea3653669d9bdd81e9 --- M contrib/jenkins.sh 1 file changed, 41 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/3831/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index a7313c5..cb59676 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,57 +1,50 @@ #!/usr/bin/env bash # jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org -if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then - echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" - exit 2 -fi +artifact_deps() { + x="$($1 libosmocore)" + x="${x}_$($1 libosmo-abis)" + x="${x}_$($1 libosmo-netif)" + x="${x}_$($1 libosmo-sccp)" + x="${x}_$($1 libsmpp34)" + x="${x}_$($1 openggsn)" + x="${x}_$($1 osmo-mgw)" + if [ "x$IU" = "x--enable-iu" ]; then + x="${x}_$($1 libasn1c)" + #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh + x="${x}_$($1 osmo-iuh)" + fi +} -set -ex +build_deps() { + osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + osmo-build-dep.sh libosmo-abis + osmo-build-dep.sh libosmo-netif + osmo-build-dep.sh libosmo-sccp + PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 + osmo-build-dep.sh openggsn + osmo-build-dep.sh osmo-mgw -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst + if [ "x$IU" = "x--enable-iu" ]; then + osmo-build-dep.sh libasn1c + #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh + osmo-build-dep.sh osmo-iuh + fi +} -mkdir "$deps" || true -rm -rf "$inst" - -osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false - -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - -export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" -export LD_LIBRARY_PATH="$inst/lib" - -osmo-build-dep.sh libosmo-abis -osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh openggsn -osmo-build-dep.sh osmo-mgw - -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh -fi - -set +x -echo -echo -echo -echo " =============================== osmo-msc ===============================" -echo -set -x - -cd "$base" -autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests -$MAKE $PARALLEL_MAKE -LD_LIBRARY_PATH="$inst/lib" $MAKE check \ - || cat-testlogs.sh -LD_LIBRARY_PATH="$inst/lib" \ +build_project() { + cd $base + autoreconf --install --force + ./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests + $MAKE $PARALLEL_MAKE + LD_LIBRARY_PATH="$inst/lib" $MAKE check \ + || cat-testlogs.sh + LD_LIBRARY_PATH="$inst/lib" \ DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ - || cat-testlogs.sh + || cat-testlogs.sh +} + +. osmo-build.sh -- To view, visit https://gerrit.osmocom.org/3831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6228536f6c6f79e5534361ea3653669d9bdd81e9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg From gerrit-no-reply at lists.osmocom.org Tue Sep 5 13:35:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 13:35:55 +0000 Subject: [PATCH] osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg Message-ID: Review at https://gerrit.osmocom.org/3832 doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg Now osmo-bsc.cfg's SCCP addresses work by internal defaults, while osmo-bsc_custom-sccp.cfg shows how to use custom STP IP address and SCCP point codes. Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd --- M doc/examples/osmo-bsc/osmo-bsc.cfg A doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg M osmoappdesc.py 3 files changed, 128 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/3832/1 diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index 7c10e9d..47123ec 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -1,11 +1,5 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login +! osmo-bsc default configuration +! (assumes STP to run on 127.0.0.1 and uses default point codes) ! e1_input e1_line 0 driver ipa @@ -15,12 +9,14 @@ short name OsmoBSC long name OsmoBSC auth policy closed + authorized-regexp .* location updating reject cause 13 encryption a5 0 - neci 1 + authentication optional + neci 0 paging any use tch 0 rrlp mode none - mm info 1 + mm info 0 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 @@ -28,21 +24,25 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 bts 0 - type nanobts + type sysmobts band DCS1800 cell_identity 0 location_area_code 1 - training_sequence_code 7 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 + radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 - dtx uplink force - dtx downlink + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden ip.access unit_id 0 0 oml ip.access stream_id 255 line 0 neighbor-list mode manual-si5 @@ -50,12 +50,14 @@ neighbor-list add arfcn 200 si5 neighbor-list add arfcn 10 si5 neighbor-list add arfcn 20 + codec-support fr gprs mode none + no force-combined-si trx 0 rf_locked 0 arfcn 871 nominal power 23 - max_power_red 20 + max_power_red 0 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 @@ -81,21 +83,24 @@ timeslot 7 phys_chan_config TCH/F hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote +msc 0 ip.access rtp-base 4000 timeout-ping 20 timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name + no timeout-ping advanced + no bsc-welcome-text + no bsc-msc-lost-text + no bsc-grace-text + type normal + allow-emergency allow + amr-config 12_2k forbidden + amr-config 10_2k forbidden + amr-config 7_95k forbidden + amr-config 7_40k forbidden + amr-config 6_70k forbidden + amr-config 5_90k allowed + amr-config 5_15k forbidden + amr-config 4_75k forbidden bsc - no access-list-name - access-list-name bsc-list + mid-call-timeout 0 + no missing-msc-text diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg b/doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg new file mode 100644 index 0000000..f9c0a3c --- /dev/null +++ b/doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg @@ -0,0 +1,92 @@ +! osmo-bsc configuration example for custom SCCP addresses +! +e1_input + e1_line 0 driver ipa +network + network country code 1 + mobile network code 1 + short name OsmoBSC + long name OsmoBSC + auth policy closed + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + authentication optional + neci 0 + paging any use tch 0 + rrlp mode none + mm info 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 + bts 0 + type sysmobts + band DCS1800 + cell_identity 0 + location_area_code 1 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 0 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +cs7 instance 0 + point-code 0.42.1 + !asp asp-clnt-OsmoBSC 2905 0 m3ua + ! remote-ip 10.23.24.1 ! where to reach the STP + sccp-address msc_remote + point-code 0.23.1 +msc 0 + msc-addr msc_remote diff --git a/osmoappdesc.py b/osmoappdesc.py index 36eb1a7..338239c 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -15,7 +15,8 @@ # along with this program. If not, see app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg", + "doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 13:50:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 5 Sep 2017 13:50:51 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/3830/1/src/osmux.c File src/osmux.c: Line 941: /* This _snprintf() variant always nul-terminates the buffer. */ I still don't get why you say at least some variants of snprintf don't contain nul-terminated buffers. Line 945: buf[offset] = '\0'; in a given case, size=50 and offset=60 (buffer too small to contain everything) ---> buffer overflow. You probably mean here: buf[size-1] = '\0'; (and still need to check size>0). You probably need something like: if (size) { if (offset >= size) { if(buf[size-1] != '\0') offset--; buf[size-1] = '\0'; } else { buf[offset] = '\0'; } } -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 13:51:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 5 Sep 2017 13:51:37 +0000 Subject: libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3825/2//COMMIT_MSG Commit Message: Line 31: As in snprintf(), caller should not assume the buffer is nul-terminated. I think this is still not true and should be removed. -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 15:45:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 15:45:02 +0000 Subject: openbsc[master]: Make use of osmo-build.sh to use dependency artifacts for bu... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a2ff700bbe3806bb2c1d561c6f2249fae3d8dd8 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 15:45:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 15:45:04 +0000 Subject: [MERGED] openbsc[master]: Make use of osmo-build.sh to use dependency artifacts for bu... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Make use of osmo-build.sh to use dependency artifacts for builds. ...................................................................... Make use of osmo-build.sh to use dependency artifacts for builds. Change-Id: I8a2ff700bbe3806bb2c1d561c6f2249fae3d8dd8 Note: this patchset depends on https://gerrit.osmocom.org/#/c/3822/1 --- M contrib/jenkins.sh 1 file changed, 47 insertions(+), 48 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 892d721..61b27be 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,59 +1,58 @@ -#!/usr/bin/env bash -# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org +#!/bin/sh -ex -if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then - echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" - exit 2 -fi +artifact_deps() { + x="$($1 libosmocore)" + x="${x}_$($1 libosmo-abis)" + x="${x}_$($1 libosmo-netif)" + x="${x}_$($1 libosmo-sccp "$sccp_branch")" + x="${x}_$($1 libsmpp34)" + x="${x}_$($1 openggsn)" -set -ex + if [ "x$IU" = "x--enable-iu" ]; then + x="${x}_$($1 libasn1c)" + x="${x}_$($1 osmo-iuh "$osmo_iuh_branch")" + fi -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst + echo "${x}.tar.gz" +} -mkdir "$deps" || true -rm -rf "$inst" +build_deps() { -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + osmo-build-dep.sh libosmocore master ac_cv_path_DOXYGEN=false + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + osmo-build-dep.sh libosmo-abis + osmo-build-dep.sh libosmo-netif + osmo-build-dep.sh libosmo-sccp "$sccp_branch" + PARALLEL_MAKE=-j1 osmo-build-dep.sh libsmpp34 + osmo-build-dep.sh openggsn -export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" -export LD_LIBRARY_PATH="$inst/lib" + if [ "x$IU" = "x--enable-iu" ]; then + osmo-build-dep.sh libasn1c + osmo-build-dep.sh osmo-iuh "$osmo_iuh_branch" + fi +} + +build_project() { + + cd "$base/openbsc" + + autoreconf --install --force + + ./configure "$SMPP" "$MGCP" "$IU" \ + --enable-osmo-bsc \ + --enable-nat \ + --enable-vty-tests \ + --enable-external-tests + + "$MAKE" $PARALLEL_MAKE + "$MAKE" check || cat-testlogs.sh + "$MAKE" distcheck || cat-testlogs.sh +} if [ "x$IU" = "x--enable-iu" ]; then - sccp_branch="old_sua" - osmo_iuh_branch="old_sua" + sccp_branch="old_sua" + osmo_iuh_branch="old_sua" fi -osmo-build-dep.sh libosmocore -osmo-build-dep.sh libosmo-abis -osmo-build-dep.sh libosmo-netif -osmo-build-dep.sh libosmo-sccp $sccp_branch -PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh openggsn - -if [ "x$IU" = "x--enable-iu" ]; then - osmo-build-dep.sh libasn1c - #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh - osmo-build-dep.sh osmo-iuh $osmo_iuh_branch -fi - -set +x -echo -echo -echo -echo " =============================== openbsc ===============================" -echo -set -x - -cd "$base" -cd openbsc -autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests -$MAKE $PARALLEL_MAKE -LD_LIBRARY_PATH="$inst/lib" $MAKE check \ - || cat-testlogs.sh -LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \ - || cat-testlogs.sh +. osmo-build.sh -- To view, visit https://gerrit.osmocom.org/3823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a2ff700bbe3806bb2c1d561c6f2249fae3d8dd8 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Sep 5 16:37:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 16:37:41 +0000 Subject: osmo-msc[master]: remove contrib/soap.py, seems to apply to osmo-bsc only In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Thanks for the feedback ... I didn't think much about it but this patch happened because... https://gerrit.osmocom.org/#/c/3812/1/contrib/soap.py File contrib/soap.py: Line 39 this reads like it is osmo-bsc specific? -- To view, visit https://gerrit.osmocom.org/3812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I647be0a646bbc3cfee226c55061e0e57fa1211fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 17:10:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 5 Sep 2017 17:10:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Include serial attribute in info() Message-ID: Review at https://gerrit.osmocom.org/3833 modem: Include serial attribute in info() Change-Id: Ifd490942ecc8ecfd0f799ed241a53d45f5870b30 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/33/3833/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 43aa091..3958b5e 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -549,7 +549,7 @@ return True return False - def info(self, keys=('Manufacturer', 'Model', 'Revision')): + def info(self, keys=('Manufacturer', 'Model', 'Revision', 'Serial')): props = self.properties() return ', '.join(['%s: %r'%(k,props.get(k)) for k in keys]) -- To view, visit https://gerrit.osmocom.org/3833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd490942ecc8ecfd0f799ed241a53d45f5870b30 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 5 17:10:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 5 Sep 2017 17:10:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: log property changes from Modem interface Message-ID: Review at https://gerrit.osmocom.org/3834 modem: log property changes from Modem interface The purpose of this patch is to make sure we output to the extended log some information regarding the firwmare version of the modem being used, even if the test being run doesn't call print(modem.info) explicitly. Printing self.info() just after waiting for Powered==true doesn't always work, because the properties are not populated after a while after. Calling Modem.GetProperties() immediately after receiving Powered==true, will provide with empty strings on properties such as Revision. 18:59:55.747412 bus /sierra_1: Setting Powered True 18:59:55.938889 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Powered=True 18:59:55.964694 bus /sierra_1: DBG: Powered == True 18:59:55.987777 bus /sierra_1: DBG: interface enabled: org.ofono.VoiceCallManager 18:59:56.006278 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=[] 18:59:56.027366 bus /sierra_1: Setting Online True 18:59:56.189991 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Manufacturer=Sierra Wireless, Incorporated 18:59:56.210935 bus /sierra_1: DBG: interface enabled: org.ofono.LocationReporting 18:59:56.233217 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['gps'] 18:59:56.255807 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Model=MC7304 18:59:56.279374 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Online=True 18:59:56.315008 bus /sierra_1: DBG: Online == True 18:59:56.338779 bus /sierra_1: DBG: interface enabled: org.ofono.SimManager 18:59:56.357744 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['sim', 'gps'] 18:59:56.379532 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Revision=SWI9X15C_06.03.32.04 r28324 CNSHZ-AR-BUILD 2015/05/25 01:09:15 18:59:56.401241 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Serial=356853054230919 Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/34/3834/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 3958b5e..e3858f9 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -224,6 +224,8 @@ def on_property_change(self, name, value): if name == 'Interfaces': self.on_interfaces_change(value) + else: + self.dbg('%r.PropertyChanged() -> %s=%s' % (I_MODEM, name, value)) def on_interfaces_change(self, interfaces_now): # First some logging. -- To view, visit https://gerrit.osmocom.org/3834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 5 17:11:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 5 Sep 2017 17:11:53 +0000 Subject: osmo-gsm-tester[master]: jenkins: per build, drop programs built "unintentionally" In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 17:34:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 17:34:52 +0000 Subject: [PATCH] osmo-bsc[master]: rewrite README In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3794 to look at the new patch set (#3). rewrite README Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d --- M README 1 file changed, 21 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/94/3794/3 diff --git a/README b/README index d01b2cf..86bf01f 100644 --- a/README +++ b/README @@ -1,39 +1,27 @@ -About OpenBSC +About OsmoBSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoBSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoBSC was one of the parts split off from the old openbsc.git. Before, it +worked as a standalone osmo-bsc binary as well as a combination of libbsc and +libmsc, i.e. the old OsmoNITB. Since the standalone OsmoMSC with a true A +interface (and IuCS for 3G support) is available, OsmoBSC exists only as a +separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoBSC exposes +- A over IP towards an MSC (e.g. OsmoMSC); +- Abis interfaces towards various kinds of BTS (e.g. OsmoBTS); +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. +OsmoBSC-NAT is a specialized solution to aggregate many (e.g. hundreds of) A +interfaces from many (Osmo-)BSC instances into one A link to the MSC. This +includes signaling and media handling. - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoBSC issue tracker and wiki online at +https://osmocom.org/projects/osmobsc +https://osmocom.org/projects/osmobsc/wiki -- To view, visit https://gerrit.osmocom.org/3794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 17:58:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 17:58:01 +0000 Subject: [PATCH] osmo-msc[master]: rewrite README In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3800 to look at the new patch set (#3). rewrite README Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 --- M README 1 file changed, 19 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/00/3800/3 diff --git a/README b/README index d01b2cf..da5f7b0 100644 --- a/README +++ b/README @@ -1,39 +1,24 @@ -About OpenBSC +About OsmoMSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoMSC was one of the parts split off from the old openbsc.git. Before, it was +the libmsc part of the old OsmoNITB. Since a true A interface and IuCS for 3G +support is available, OsmoMSC exists only as a separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoMSC exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07) +- SMPP 3.4 (Short Message Peer-to-Peer) +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoMSC issue tracker and wiki online at +https://osmocom.org/projects/osmomsc +https://osmocom.org/projects/osmomsc/wiki -- To view, visit https://gerrit.osmocom.org/3800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 17:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 17:59:18 +0000 Subject: [PATCH] osmo-sgsn[master]: rewrite README In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3804 to look at the new patch set (#3). rewrite README Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 --- M README 1 file changed, 14 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/04/3804/3 diff --git a/README b/README index d01b2cf..a14ba38 100644 --- a/README +++ b/README @@ -1,39 +1,17 @@ -About OpenBSC -============= +About OsmoSGSN +============== -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoSGSN originated from the OpenBSC project, as a separate program within +openbsc.git. In 2017, OpenBSC was split in separate repositories, and hence +OsmoSGSN was given its own separate git repository. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoSGSN exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- GTP towards a GGSN (e.g. OsmoGGSN); +- Gb towards a BSS (e.g. OsmoPCU); +- IuPS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G data; +- The Osmocom typical telnet VTY and CTRL interfaces. -Various interfaces towards the BTS are supported, among which are: - - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoSGSN issue tracker and wiki online at +https://osmocom.org/projects/osmosgsn +https://osmocom.org/projects/osmosgsn/wiki -- To view, visit https://gerrit.osmocom.org/3804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Tue Sep 5 19:54:43 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 05 Sep 2017 19:54:43 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59af0109e3f24_104b95cf7c59098@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 270s] - [ 270s] -[+] Testing: ??? (non-recursive, direct truncation, not punctured) [ 270s] -[.] Input length : ret = 224 exp = 224 -> OK [ 271s] -[.] Output length : ret = 448 exp = 448 -> OK [ 271s] -[.] Pre computed vector checks: [ 271s] -[..] Encoding: OK [ 271s] -[..] Decoding: OK [ 271s] -[.] Random vector checks: [ 271s] -[..] Encoding / Decoding cycle : OK [ 271s] -[..] Encoding / Decoding cycle : OK [ 271s] -[..] Encoding / Decoding cycle : OK [ 271s] - [ 271s] ./testsuite.at:51: exit code was 132, expected 0 [ 271s] 8. testsuite.at:48: 8. conv (testsuite.at:48): FAILED (testsuite.at:51) [ 271s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 271s] make[1]: *** [override_dh_auto_test] Error 1 [ 271s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 271s] debian/rules:15: recipe for target 'build' failed [ 271s] make: *** [build] Error 2 [ 271s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 271s] [ 271s] build33 failed "build libosmocore_0.9.6.20170905.dsc" at Tue Sep 5 19:54:31 UTC 2017. [ 271s] [ 271s] ### VM INTERACTION START ### [ 273s] [ 250.969793] reboot: Power down [ 274s] ### VM INTERACTION END ### [ 274s] [ 274s] build33 failed "build libosmocore_0.9.6.20170905.dsc" at Tue Sep 5 19:54:35 UTC 2017. [ 274s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:46 +0000 Subject: [PATCH] openggsn[master]: gtp-kernel: Remove dependency to cmdline.[ch] Message-ID: Review at https://gerrit.osmocom.org/3835 gtp-kernel: Remove dependency to cmdline.[ch] Change-Id: I760f25df609c309eba4d5716f3e23b49320449bf --- M ggsn/ggsn.c M ggsn/gtp-kernel.c M ggsn/gtp-kernel.h 3 files changed, 14 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/35/3835/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c6a6dac..1b7911c 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -710,8 +710,12 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) - goto err; + if (args_info.gtp_linux_given) { + if (gtp_kernel_init(gsn, &net.v4, prefixlen, args_info.net_arg) < 0) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to initialize kernel GTP\n"); + goto err; + } + } gtp_set_cb_data_ind(gsn, encaps_tun); gtp_set_cb_delete_context(gsn, delete_context); diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c index 458ac27..f98586d 100644 --- a/ggsn/gtp-kernel.c +++ b/ggsn/gtp-kernel.c @@ -27,7 +27,6 @@ #include "../lib/syserr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" -#include "cmdline.h" #include #include @@ -80,12 +79,8 @@ #define GTP_DEVNAME "gtp0" int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - size_t prefixlen, - struct gengetopt_args_info *args_info) + size_t prefixlen, const char *net_arg) { - if (!args_info->gtp_linux_given) - return 0; - if (gtp_dev_create(-1, GTP_DEVNAME, gsn->fd0, gsn->fd1u) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "cannot create GTP tunnel device: %s\n", @@ -113,12 +108,12 @@ } DEBUGP(DGGSN, "Setting route to reach %s via %s\n", - args_info->net_arg, GTP_DEVNAME); + net_arg, GTP_DEVNAME); if (gtp_dev_config(GTP_DEVNAME, net, prefixlen) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add route to reach network %s\n", - args_info->net_arg); + net_arg); } /* launch script if it is set to bring up the route to reach @@ -132,7 +127,7 @@ /* eg. /home/ggsn/ipup gtp0 10.0.0.0/8 */ snprintf(cmd, sizeof(cmd), "%s %s %s", - ipup, GTP_DEVNAME, args_info->net_arg); + ipup, GTP_DEVNAME, net_arg); cmd[sizeof(cmd)-1] = '\0'; err = system(cmd); diff --git a/ggsn/gtp-kernel.h b/ggsn/gtp-kernel.h index b3b29e3..34fd7bf 100644 --- a/ggsn/gtp-kernel.h +++ b/ggsn/gtp-kernel.h @@ -8,8 +8,7 @@ #ifdef GTP_KERNEL int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - size_t prefixlen, - struct gengetopt_args_info *args_info); + size_t prefixlen, const char *net_arg); void gtp_kernel_stop(void); int gtp_kernel_tunnel_add(struct pdp_t *pdp); @@ -19,15 +18,10 @@ #else static inline int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - size_t prefixlen, - struct gengetopt_args_info *args_info) + size_t prefixlen, const char *net_arg) { - if (args_info->gtp_linux_given) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "ggsn compiled without GTP kernel support!\n"); - return -1; - } - return 0; + SYS_ERR(DGGSN, LOGL_ERROR, 0, "ggsn compiled without GTP kernel support!\n"); + return -1; } static inline void gtp_kernel_stop(void) {} -- To view, visit https://gerrit.osmocom.org/3835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I760f25df609c309eba4d5716f3e23b49320449bf Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:46 +0000 Subject: [PATCH] openggsn[master]: lib/tun: Add missing #include to net/if.h for IFNAMSIZ Message-ID: Review at https://gerrit.osmocom.org/3836 lib/tun: Add missing #include to net/if.h for IFNAMSIZ Change-Id: I979867d643c9fa912884fe55105333dbad39ab97 --- M lib/tun.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/36/3836/1 diff --git a/lib/tun.h b/lib/tun.h index 1cd0767..8fa1c61 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -13,6 +13,8 @@ #ifndef _TUN_H #define _TUN_H +#include + #include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ -- To view, visit https://gerrit.osmocom.org/3836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I979867d643c9fa912884fe55105333dbad39ab97 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:47 +0000 Subject: [PATCH] openggsn[master]: lib/tun: Add 'void *priv' pointer to tun_t Message-ID: Review at https://gerrit.osmocom.org/3837 lib/tun: Add 'void *priv' pointer to tun_t This allows the application to attach some private state to the tun device, such as the context from which it was created/allocated Change-Id: Ief43b9b5fab5830fa8e28362c795f88f0b4d353b --- M lib/tun.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/37/3837/1 diff --git a/lib/tun.h b/lib/tun.h index 8fa1c61..67ef39d 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -61,6 +61,8 @@ int routes; /* One if we allocated an automatic route */ char devname[IFNAMSIZ]; /* Name of the tun device */ int (*cb_ind) (struct tun_t * tun, void *pack, unsigned len); + /* to be used by libgtp callers/users (to attach their own private state) */ + void *priv; }; extern int tun_new(struct tun_t **tun); -- To view, visit https://gerrit.osmocom.org/3837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief43b9b5fab5830fa8e28362c795f88f0b4d353b Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:47 +0000 Subject: [PATCH] openggsn[master]: lib/in46_addr: Add in46a_ntoa() function, similar to inet_nt... Message-ID: Review at https://gerrit.osmocom.org/3838 lib/in46_addr: Add in46a_ntoa() function, similar to inet_ntoa() Change-Id: I752b7033a106a74dc219047da5c3a7ad3cd3602e --- M lib/in46_addr.c M lib/in46_addr.h 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/38/3838/1 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 8f5cc09..4e7cbcd 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -69,6 +69,16 @@ return inet_ntop(af, (const void *) &in->v4, dst, dst_size); } +/* like inet_ntoa() */ +const char *in46a_ntoa(const struct in46_addr *in46) +{ + static char addrstr_buf[256]; + if (in46a_ntop(in46, addrstr_buf, sizeof(addrstr_buf)) < 0) + return "INVALID"; + else + return addrstr_buf; +} + /*! Determine if two in46_addr are equal or not * \returns 1 in case they are equal; 0 otherwise */ int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index 0afd2b4..1614c1d 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -17,6 +17,7 @@ extern int in46a_to_af(const struct in46_addr *in); extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); +extern const char *in46a_ntoa(const struct in46_addr *in46); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); -- To view, visit https://gerrit.osmocom.org/3838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I752b7033a106a74dc219047da5c3a7ad3cd3602e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:47 +0000 Subject: [PATCH] openggsn[master]: lib/in46_addr: Add 'struct in46_prefix' to represent addr + ... Message-ID: Review at https://gerrit.osmocom.org/3839 lib/in46_addr: Add 'struct in46_prefix' to represent addr + prefix Change-Id: I797d105117e81951732bcfc2cc26a8d00fd69443 --- M lib/in46_addr.c M lib/in46_addr.h 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/39/3839/1 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 4e7cbcd..6864c64 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -79,6 +79,13 @@ return addrstr_buf; } +const char *in46p_ntoa(const struct in46_prefix *in46p) +{ + static char addrstr_buf[256]; + snprintf(addrstr_buf, sizeof(addrstr_buf), "%s/%u", in46a_ntoa(&in46p->addr), in46p->prefixlen); + return addrstr_buf; +} + /*! Determine if two in46_addr are equal or not * \returns 1 in case they are equal; 0 otherwise */ int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index 1614c1d..ce2df14 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -14,10 +14,16 @@ }; }; +struct in46_prefix { + struct in46_addr addr; + uint8_t prefixlen; +}; + extern int in46a_to_af(const struct in46_addr *in); extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern const char *in46a_ntoa(const struct in46_addr *in46); +extern const char *in46p_ntoa(const struct in46_prefix *in46p); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); -- To view, visit https://gerrit.osmocom.org/3839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I797d105117e81951732bcfc2cc26a8d00fd69443 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:47 +0000 Subject: [PATCH] openggsn[master]: lib/in46_addr: Avoid ASSERT() when in46a_ntop() is called on... Message-ID: Review at https://gerrit.osmocom.org/3840 lib/in46_addr: Avoid ASSERT() when in46a_ntop() is called on uninitialized address Change-Id: I42d41ec1370b9cc15d372b649d8e1bc78e76af9b --- M lib/in46_addr.c 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/40/3840/1 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 6864c64..4b5fd64 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -62,7 +62,14 @@ /*! Convenience wrapper around inet_ntop() for \ref in46_addr */ const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) { - int af = in46a_to_af(in); + int af; + + if (!in || in->len == 0) { + strncpy(dst, "UNDEFINED", dst_size); + return dst; + } + + af = in46a_to_af(in); if (af < 0) return NULL; -- To view, visit https://gerrit.osmocom.org/3840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42d41ec1370b9cc15d372b649d8e1bc78e76af9b Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:48 +0000 Subject: [PATCH] openggsn[master]: lib/ippool: Add back-pointer from pool member to pool Message-ID: Review at https://gerrit.osmocom.org/3841 lib/ippool: Add back-pointer from pool member to pool This allows us to remove pool members without having to keep a pointer to the pool around. Change-Id: I9042eb85989c5451d7894678eca110dd19e78002 --- M lib/ippool.c M lib/ippool.h 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/41/3841/1 diff --git a/lib/ippool.c b/lib/ippool.c index 1729ec7..b1b242d 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -295,6 +295,7 @@ in46a_inc(&addr); (*this)->member[i].inuse = 0; + (*this)->member[i].pool = *this; /* Insert into list of unused */ (*this)->member[i].prev = (*this)->lastdyn; @@ -315,6 +316,7 @@ struct in46_addr *i6al = &(*this)->member[i].addr; memset(i6al, 0, sizeof(*i6al)); (*this)->member[i].inuse = 0; + (*this)->member[i].pool = *this; /* Insert into list of unused */ (*this)->member[i].prev = (*this)->laststat; diff --git a/lib/ippool.h b/lib/ippool.h index ba92a56..8249b7f 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -56,6 +56,7 @@ struct ippoolm_t { struct in46_addr addr; /* IP address of this member */ + struct ippool_t *pool; /* Pool to which we belong */ int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ -- To view, visit https://gerrit.osmocom.org/3841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9042eb85989c5451d7894678eca110dd19e78002 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:48 +0000 Subject: [PATCH] openggsn[master]: lib/ippool: Move ippool_aton() out of ippool_new() Message-ID: Review at https://gerrit.osmocom.org/3842 lib/ippool: Move ippool_aton() out of ippool_new() we rather pass the in46_prefix directly into ippool_new() Change-Id: Iadf6274e881a9bfc75eb41f9380f5ae2d8c92a0f --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h 3 files changed, 24 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/42/3842/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 1b7911c..2ab0e43 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -565,23 +565,24 @@ } /* dynip */ + struct in46_prefix i46p; + size_t prefixlen; if (!args_info.dynip_arg) { - if (ippool_new(&ippool, args_info.net_arg, NULL, 1, 0, - IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | - IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to allocate IP pool!"); + if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); exit(1); } } else { - if (ippool_new(&ippool, args_info.dynip_arg, NULL, 1, 0, - IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | - IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to allocate IP pool!"); + if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); exit(1); } } + i46p.prefixlen = prefixlen; + if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); + exit(1); + } /* DNS1 and DNS2 */ memset(&dns1, 0, sizeof(dns1)); diff --git a/lib/ippool.c b/lib/ippool.c index b1b242d..a236fe7 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -185,8 +185,8 @@ } /* Create new address pool */ -int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, - int allowdyn, int allowstat, int flags) +int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, + int flags) { /* Parse only first instance of pool for now */ @@ -200,14 +200,11 @@ int dynsize; unsigned int statsize; - if (!allowdyn) { + if (!dyn || dyn->addr.len == 0) { dynsize = 0; } else { - if (ippool_aton(&addr, &addrprefixlen, dyn, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Failed to parse dynamic pool"); - return -1; - } + addr = dyn->addr; + addrprefixlen = dyn->prefixlen; /* we want to work with /64 prefixes, i.e. allocate /64 prefixes rather * than /128 (single IPv6 addresses) */ if (addr.len == sizeof(struct in6_addr)) @@ -227,18 +224,15 @@ dynsize--; } - if (!allowstat) { + if (!stat || stat->addr.len == 0) { statsize = 0; stataddr.len = 0; stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &stataddrprefixlen, stat, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Failed to parse static range"); - return -1; - } + stataddr = stat->addr; + stataddrprefixlen = stat->prefixlen; - statsize = (1 << (addr.len - addrprefixlen + 1)) -1; + statsize = (1 << (addr.len - stataddrprefixlen + 1)) -1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -251,8 +245,8 @@ return -1; } - (*this)->allowdyn = allowdyn; - (*this)->allowstat = allowstat; + (*this)->allowdyn = dyn ? 1 : 0; + (*this)->allowstat = stat ? 1 : 0; if (stataddr.len > 0) (*this)->stataddr = stataddr; (*this)->stataddrprefixlen = stataddrprefixlen; diff --git a/lib/ippool.h b/lib/ippool.h index 8249b7f..fbac66d 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -71,8 +71,8 @@ extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ -extern int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, - int allowdyn, int allowstat, int flags); +extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, + const struct in46_prefix *stat, int flags); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); -- To view, visit https://gerrit.osmocom.org/3842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iadf6274e881a9bfc75eb41f9380f5ae2d8c92a0f Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:48 +0000 Subject: [PATCH] openggsn[master]: lib/tun.c: Proper cleanup during tun_new() error paths Message-ID: Review at https://gerrit.osmocom.org/3843 lib/tun.c: Proper cleanup during tun_new() error paths Change-Id: I285be20df76774ac7258b6edb3d4f2d28703757d --- M lib/tun.c 1 file changed, 32 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/43/3843/1 diff --git a/lib/tun.c b/lib/tun.c index c4b7d10..6ca9be7 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -748,7 +748,7 @@ /* Open the actual tun device */ if (((*tun)->fd = open("/dev/net/tun", O_RDWR)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "open() failed"); - return -1; + goto err_free; } /* Set device flags. For some weird reason this is also the method @@ -757,8 +757,7 @@ ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); - close((*tun)->fd); - return -1; + goto err_close; } strncpy((*tun)->devname, ifr.ifr_name, IFNAMSIZ); @@ -780,7 +779,7 @@ if ((*tun)->fd < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't find tunnel device"); - return -1; + goto err_free; } snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", devnum); @@ -798,7 +797,7 @@ /* Create a channel to the NET kernel. */ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "socket() failed"); - return -1; + goto err_close; } /* Delete any IP addresses until SIOCDIFADDR fails */ @@ -812,45 +811,53 @@ if ((ip_fd = open("/dev/udp", O_RDWR, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't open /dev/udp"); - return -1; + goto err_free; } if (((*tun)->fd = open("/dev/tun", O_RDWR, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't open /dev/tun"); - return -1; + close(ip_fd); + goto err_free; } /* Assign a new PPA and get its unit number. */ if ((ppa = ioctl((*tun)->fd, TUNNEWPPA, -1)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't assign new interface"); - return -1; + goto sun_close_ip; } if ((if_fd = open("/dev/tun", O_RDWR, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't open /dev/tun (2)"); - return -1; + goto sun_close_ip; } if (ioctl(if_fd, I_PUSH, "ip") < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't push IP module"); - return -1; + goto sun_close_if; } /* Assign ppa according to the unit number returned by tun device */ if (ioctl(if_fd, IF_UNITSEL, (char *)&ppa) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't set PPA %d", ppa); - return -1; + goto sun_close_if; } /* Link the two streams */ if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't link TUN device to IP"); - return -1; + goto sun_close_if; + } + + /* Link the two streams */ + if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, errno, + "Can't link TUN device to IP"); + goto sun_close_if; } close(if_fd); @@ -866,7 +873,7 @@ ioctl(ip_fd, I_PUNLINK, muxid); SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't set multiplexor id"); - return -1; + goto sun_close_ip; } /* if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) @@ -874,10 +881,22 @@ return 0; +sun_close_if: + close(if_fd); +sun_close_ip: + close(ip_fd); + goto err_close; + #else #error "Unknown platform!" #endif +err_close: + close((*tun)->fd); +err_free: + free(*tun); + *tun = NULL; + return -1; } int tun_free(struct tun_t *tun) -- To view, visit https://gerrit.osmocom.org/3843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I285be20df76774ac7258b6edb3d4f2d28703757d Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:48 +0000 Subject: [PATCH] openggsn[master]: libgtp: Remove ctrl_handle from gsn_t, replace with private ... Message-ID: Review at https://gerrit.osmocom.org/3844 libgtp: Remove ctrl_handle from gsn_t, replace with private context The control interface handle never belonged into libgtp in the first place. Commit 727417dd28813c697b4820aef9f54f249e30c4b8 should not have added this to the shared library (used by sgsnemu, osmo-sgsn, ...), but to some private state of the GGSN. Introducing a private context pointer at the same location will keep ABI compatibilty. Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5 --- M gtp/gtp.h 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/44/3844/1 diff --git a/gtp/gtp.h b/gtp/gtp.h index 8f13ed2..7fa9ae7 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -12,8 +12,6 @@ #ifndef _GTP_H #define _GTP_H -#include - #define GTP_MODE_GGSN 1 #define GTP_MODE_SGSN 2 @@ -247,7 +245,7 @@ unsigned char restart_counter; /* Increment on restart. Stored on disk */ char *statedir; /* Disk location for permanent storage */ - struct ctrl_handle *ctrl; /* Control Interface */ + void *priv; /* used by libgtp users to attach their own state) */ struct queue_t *queue_req; /* Request queue */ struct queue_t *queue_resp; /* Response queue */ -- To view, visit https://gerrit.osmocom.org/3844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:49 +0000 Subject: [PATCH] openggsn[master]: libgtp: Add back-reference to gsn from pdp context Message-ID: Review at https://gerrit.osmocom.org/3845 libgtp: Add back-reference to gsn from pdp context This is required once one wants to support multiple GSNs in a single application. WARNING: This breaks ABI compatibility, LIBVERSION must be adjusted Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2 --- M gtp/gtp.c M gtp/pdp.h 2 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/45/3845/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 012aa79..7ce41bb 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -90,7 +90,11 @@ int gtp_newpdp(struct gsn_t *gsn, struct pdp_t **pdp, uint64_t imsi, uint8_t nsapi) { - return pdp_newpdp(pdp, imsi, nsapi, NULL); + int rc; + rc = pdp_newpdp(pdp, imsi, nsapi, NULL); + if (!rc && *pdp) + (*pdp)->gsn = gsn; + return rc; } int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp) @@ -1571,6 +1575,8 @@ } pdp_newpdp(&pdp, pdp->imsi, pdp->nsapi, pdp); + if (pdp) + pdp->gsn = gsn; /* Callback function to validata login */ if (gsn->cb_create_context_ind != 0) diff --git a/gtp/pdp.h b/gtp/pdp.h index 432f1df..c51e9e2 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -12,6 +12,8 @@ #ifndef _PDP_H #define _PDP_H +struct gsn_t; + #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ @@ -221,6 +223,8 @@ /* to be used by libgtp callers/users (to attach their own private state) */ void *priv; + + struct gsn_t *gsn; }; /* functions related to pdp_t management */ -- To view, visit https://gerrit.osmocom.org/3845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:49 +0000 Subject: [PATCH] openggsn[master]: Remove __sun__ code that is unmaintained Message-ID: Review at https://gerrit.osmocom.org/3846 Remove __sun__ code that is unmaintained We haven nobody maintaining this platform, let's remove it. In fact, only Linux and FreeBSD are part of the jenkins build tests, so even Apple/MacOS is up for disposal. However, as it's more popular, let's keep the code. Change-Id: Id6b8179259bacade52c39f96e688f828eff164ac --- M lib/tun.c M sgsnemu/sgsnemu.c 2 files changed, 0 insertions(+), 264 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/46/3846/1 diff --git a/lib/tun.c b/lib/tun.c index 6ca9be7..32d4b27 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -53,13 +53,6 @@ #elif defined (__APPLE__) #include -#elif defined (__sun__) -#include -#include -#include -#include -/*#include "sun_if_tun.h"*/ - #else #error "Unknown platform!" #endif @@ -111,102 +104,6 @@ close(fd); return 0; } - -/* Currently unused -int tun_addroute2(struct tun_t *this, - struct in_addr *dst, - struct in_addr *gateway, - struct in_addr *mask) { - - struct { - struct nlmsghdr n; - struct rtmsg r; - char buf[TUN_NLBUFSIZE]; - } req; - - struct sockaddr_nl local; - int addr_len; - int fd; - int status; - struct sockaddr_nl nladdr; - struct iovec iov; - struct msghdr msg; - - memset(&req, 0, sizeof(req)); - req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); - req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE; - req.n.nlmsg_type = RTM_NEWROUTE; - req.r.rtm_family = AF_INET; - req.r.rtm_table = RT_TABLE_MAIN; - req.r.rtm_protocol = RTPROT_BOOT; - req.r.rtm_scope = RT_SCOPE_UNIVERSE; - req.r.rtm_type = RTN_UNICAST; - tun_nlattr(&req.n, sizeof(req), RTA_DST, dst, 4); - tun_nlattr(&req.n, sizeof(req), RTA_GATEWAY, gateway, 4); - - if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "socket() failed"); - return -1; - } - - memset(&local, 0, sizeof(local)); - local.nl_family = AF_NETLINK; - local.nl_groups = 0; - - if (bind(fd, (struct sockaddr*)&local, sizeof(local)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "bind() failed"); - close(fd); - return -1; - } - - addr_len = sizeof(local); - if (getsockname(fd, (struct sockaddr*)&local, &addr_len) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "getsockname() failed"); - close(fd); - return -1; - } - - if (addr_len != sizeof(local)) { - SYS_ERR(DTUN, LOGL_ERROR, 0, - "Wrong address length %d", addr_len); - close(fd); - return -1; - } - - if (local.nl_family != AF_NETLINK) { - SYS_ERR(DTUN, LOGL_ERROR, 0, - "Wrong address family %d", local.nl_family); - close(fd); - return -1; - } - - iov.iov_base = (void*)&req.n; - iov.iov_len = req.n.nlmsg_len; - - msg.msg_name = (void*)&nladdr; - msg.msg_namelen = sizeof(nladdr), - msg.msg_iov = &iov; - msg.msg_iovlen = 1; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - - memset(&nladdr, 0, sizeof(nladdr)); - nladdr.nl_family = AF_NETLINK; - nladdr.nl_pid = 0; - nladdr.nl_groups = 0; - - req.n.nlmsg_seq = 0; - req.n.nlmsg_flags |= NLM_F_ACK; - - status = sendmsg(fd, &msg, 0); * TODO: Error check * - close(fd); - return 0; -} -*/ int tun_addaddr(struct tun_t *this, struct in_addr *addr, @@ -373,17 +270,6 @@ this->addrs++; return 0; -#elif defined (__sun__) - - if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr4(this, addr, dstaddr, netmask); - - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Setting multiple addresses not possible on Solaris"); - return -1; - -#else -#error "Unknown platform!" #endif } @@ -455,12 +341,6 @@ #elif defined(__FreeBSD__) || defined (__APPLE__) ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = netmask->s_addr; - -#elif defined(__sun__) - ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = - netmask->s_addr; -#else -#error "Unknown platform!" #endif if (ioctl(fd, SIOCSIFNETMASK, (void *)&ifr) < 0) { @@ -593,8 +473,6 @@ struct in_addr *gateway, struct in_addr *mask, int delete) { - /* TODO: Learn how to set routing table on sun */ - #if defined(__linux__) struct rtentry r; @@ -687,14 +565,6 @@ } close(fd); return 0; - -#elif defined(__sun__) - SYS_ERR(DTUN, LOGL_NOTICE, errno, - "Could not set up routing on Solaris. Please add route manually."); - return 0; - -#else -#error "Unknown platform!" #endif } @@ -724,15 +594,6 @@ int devnum; struct ifaliasreq areq; int fd; - -#elif defined(__sun__) - int if_fd, ppa = -1; - static int ip_fd = 0; - int muxid; - struct ifreq ifr; - -#else -#error "Unknown platform!" #endif if (!(*tun = calloc(1, sizeof(struct tun_t)))) { @@ -805,90 +666,6 @@ close(fd); return 0; - -#elif defined(__sun__) - - if ((ip_fd = open("/dev/udp", O_RDWR, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't open /dev/udp"); - goto err_free; - } - - if (((*tun)->fd = open("/dev/tun", O_RDWR, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't open /dev/tun"); - close(ip_fd); - goto err_free; - } - - /* Assign a new PPA and get its unit number. */ - if ((ppa = ioctl((*tun)->fd, TUNNEWPPA, -1)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't assign new interface"); - goto sun_close_ip; - } - - if ((if_fd = open("/dev/tun", O_RDWR, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't open /dev/tun (2)"); - goto sun_close_ip; - } - if (ioctl(if_fd, I_PUSH, "ip") < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't push IP module"); - goto sun_close_if; - } - - /* Assign ppa according to the unit number returned by tun device */ - if (ioctl(if_fd, IF_UNITSEL, (char *)&ppa) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't set PPA %d", - ppa); - goto sun_close_if; - } - - /* Link the two streams */ - if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't link TUN device to IP"); - goto sun_close_if; - } - - /* Link the two streams */ - if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't link TUN device to IP"); - goto sun_close_if; - } - - close(if_fd); - - snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", ppa); - (*tun)->devname[sizeof((*tun)->devname)] = 0; - - memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, (*tun)->devname); - ifr.ifr_ip_muxid = muxid; - - if (ioctl(ip_fd, SIOCSIFMUXID, &ifr) < 0) { - ioctl(ip_fd, I_PUNLINK, muxid); - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't set multiplexor id"); - goto sun_close_ip; - } - - /* if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) - msg (M_ERR, "Set file descriptor to non-blocking failed"); */ - - return 0; - -sun_close_if: - close(if_fd); -sun_close_ip: - close(ip_fd); - goto err_close; - -#else -#error "Unknown platform!" #endif err_close: @@ -925,9 +702,6 @@ int tun_decaps(struct tun_t *this) { - -#if defined(__linux__) || defined (__FreeBSD__) || defined (__APPLE__) - unsigned char buffer[PACKET_MAX]; int status; @@ -940,44 +714,11 @@ return this->cb_ind(this, buffer, status); return 0; - -#elif defined (__sun__) - - unsigned char buffer[PACKET_MAX]; - struct strbuf sbuf; - int f = 0; - - sbuf.maxlen = PACKET_MAX; - sbuf.buf = buffer; - if (getmsg(this->fd, NULL, &sbuf, &f) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "getmsg() failed"); - return -1; - } - - if (this->cb_ind) - return this->cb_ind(this, buffer, sbuf.len); - - return 0; - -#endif - } int tun_encaps(struct tun_t *tun, void *pack, unsigned len) { - -#if defined(__linux__) || defined (__FreeBSD__) || defined (__APPLE__) - return write(tun->fd, pack, len); - -#elif defined (__sun__) - - struct strbuf sbuf; - sbuf.len = len; - sbuf.buf = pack; - return putmsg(tun->fd, NULL, &sbuf, 0); - -#endif } int tun_runscript(struct tun_t *tun, char *script) diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 8c9cfd3..1f0b3f9 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -870,13 +870,8 @@ exit(1); } options.net.s_addr = in46.v4.s_addr; -#if defined (__sun__) - options.netaddrs_addr = htonl(ntohl(options.net.s_addr) + 1); - options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); -#else options.netaddr.s_addr = options.net.s_addr; options.destaddr.s_addr = options.net.s_addr; -#endif } else { options.net.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/3846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6b8179259bacade52c39f96e688f828eff164ac Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:49 +0000 Subject: [PATCH] openggsn[master]: lib/tun: Mark internal helper functions 'static' Message-ID: Review at https://gerrit.osmocom.org/3847 lib/tun: Mark internal helper functions 'static' Change-Id: I53a8a89abb0080a39a153e9d3864c17b29aa193c --- M lib/tun.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/47/3847/1 diff --git a/lib/tun.c b/lib/tun.c index 32d4b27..e8368e5 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -67,7 +67,7 @@ #include -int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) +static int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { int len = RTA_LENGTH(dlen); int alen = NLMSG_ALIGN(n->nlmsg_len); @@ -82,7 +82,7 @@ } #endif -int tun_sifflags(struct tun_t *this, int flags) +static int tun_sifflags(struct tun_t *this, int flags) { struct ifreq ifr; int fd; @@ -468,7 +468,7 @@ } } -int tun_route(struct tun_t *this, +static int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) { -- To view, visit https://gerrit.osmocom.org/3847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53a8a89abb0080a39a153e9d3864c17b29aa193c Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:49 +0000 Subject: [PATCH] openggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... Message-ID: Review at https://gerrit.osmocom.org/3848 Introduce a VTY, factually turning OpenGGSN into an Osmocom program Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 --- M doc/ggsn.8 D examples/ggsn.conf A examples/osmo-ggsn.cfg M ggsn/Makefile.am D ggsn/cmdline.c D ggsn/cmdline.ggo D ggsn/cmdline.h M ggsn/ggsn.c A ggsn/ggsn.h A ggsn/ggsn_vty.c M lib/tun.c M lib/tun.h M sgsnemu/sgsnemu.c 13 files changed, 1,673 insertions(+), 2,177 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/48/3848/1 diff --git a/doc/ggsn.8 b/doc/ggsn.8 index 62d467a..89dcb61b 100644 --- a/doc/ggsn.8 +++ b/doc/ggsn.8 @@ -31,33 +31,13 @@ .B ggsn [ -.BI \-\-fg +.BI \-\-help ] [ -.BI \-\-debug +.BI \-\-daemonize ] [ -.BI \-\-conf " file" +.BI \-\-config-file " file" ] [ -.BI \-\-pidfile " file" -] [ -.BI \-\-statedir " file" -] [ -.BI \-\-listen " host" -] [ -.BI \-\-net " net" -] [ -.BI \-\-ipup " script" -] [ -.BI \-\-ipdown " script" -] [ -.BI \-\-dynip " net" -] [ -.BI \-\-statip " net" -] [ -.BI \-\-pcodns1 " host" -] [ -.BI \-\-pcodns2 " host" -] [ -.BI \-\-timelimit " seconds" +.BI \-\-version ] .SH DESCRIPTION .B ggsn @@ -115,86 +95,17 @@ Print version and exit. .TP -.BI --fg -Run in foreground (default = off) +.BI --daemonize +Run in background as a daemon (default = off) .TP -.BI --debug -Run in debug mode (default = off) - -.TP -.BI --conf " file" +.BI --config-file " file" Read configuration .I file -(default = /etc/ggsn.conf) where each line corresponds to one command -line option, but with the leading '--' removed. Command line options -override the options given in the configuration file. - -.TP -.BI --pidfile " file" -Filename of process id -.I file -(default = /var/run/ggsn.pid) - -.TP -.BI --statedir " path" -.I path -to directory of nonvolatile data (default = /var/lib/ggsn/) - -.TP -.BI --listen " host" -Local interface IP address to use for the Gn/Gp interface. This option -must be specified. For security issues it is not possible to use -INADDR_ANY. - -.TP -.BI --net " net" -Network address of the Gi interface (default = 192.168.0.0/24). The -network address is set during initialisation when -.B ggsn -establishes a tun device for the Gi interface. - -.TP -.BI --ipup " script" -Script executed after the Gi tun network interface has been brought -up. Executed with the following parameters: - -.TP -.BI --ipdown " script" -Script executed after the Gi tun network interface has been taken -down. Executed with the following parameters: - -.TP -.BI --dynip " net" -Dynamic IP address pool. Specifies a pool of dynamic IP addresses. If -this option is omitted the network address specified by the -.BI --net -option is used for dynamic IP address allocation. - -.TP -.BI --pcodns1 " host" -PCO DNS Server 1 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --pcodns2 " host" -PCO DNS Server 2 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --timelimit " seconds" -Exit -.B ggsn -after \fIseconds\fP. Used for debugging. - +(default = ./openggsn.cfg) .SH FILES -.I /etc/ggsn.conf +.I ./openggsn.cfg .RS The configuration file for .B ggsn. @@ -210,7 +121,7 @@ .SH BUGS Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/ggsn/ +.I https://osmocom.org/projects/openggsn .B ggsn has very limited management support. Currently both SNMP as well as @@ -250,6 +161,7 @@ .SH COPYRIGHT Copyright (C) 2002, 2003 by Mondru AB. +Copyright (C) 2017 Harald Welte The contents of this file may be used under the terms of the GNU General Public License Version 2, provided that the above copyright @@ -258,3 +170,4 @@ .SH AUTHORS Jens Jakobsen +Harald Welte diff --git a/examples/ggsn.conf b/examples/ggsn.conf deleted file mode 100644 index 6dcfe44..0000000 --- a/examples/ggsn.conf +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################## -# -# Sample ggsn configuration file -# -############################################################################## - -# TAG: fg -# Include this flag if process is to run in the foreground -# -#fg - -# TAG: debug -# Include this flag to include debug information. -#debug - - -# TAG: conf -# Configuration file to use. This file is the configuration file, -# so changing this parameter in the configuration file does not make -# sense. Use it on the command line instead. - -# TAG: pidfile -# File to store information about the process id of the program. -# The program must have write access to this file/directory. -#pidfile /var/run/ggsn.pid - -# TAG: statedir -# Directory to use for nonvolatile storage. -# The program must have write access to this directory. -#statedir /var/lib/ggsn/ - - -# TAG: listen -# Specifies the local IP address to listen to -#listen 10.0.0.240 - -# TAG: net -# IP network address of external packet data network -# Used to set up network interface. -#net 192.168.0.0/24 - -# TAG: ipup -# Script executed after network interface has been brought up. -# Executed with the following parameters: -#ipup /etc/ggsn/ip-up - -# TAG: ipdown -# Script executed after network interface has been taken down. -# Executed with the following parameters: -#ipdown /etc/ggsn/ip-down - -# TAG: dynip -# Dynamic IP address pool. -# Used for allocation of dynamic IP address when address is not given -# by HLR. -# If this option is not given then the net option is used as a substitute. -#dynip 192.168.0.0/24 - -# TAG: statip -# Use of this tag is currently UNSUPPORTED -# Static IP address pool. -# Used for allocation of static IP address by means of HLR. -#statip 192.168.1.0/24 - -# TAG: pcodns1 -# Protocol configuration option domain name system server 1. -#pcodns1 0.0.0.0 - -# TAG: pcodns2 -# Protocol configuration option domain name system server 2. -#pcodns2 0.0.0.0 - -# TAG: timelimit -# Exit after timelimit seconds. -# Setting timelimit to zero will cause the program not to exit. -#timelimit 0 - -# TAG: apn -# Use of this tag is EXPERIMENTAL -# Access point name to connect to when run in client mode. -#apn internet - -# TAG: qos -# Use of this tag is EXPERIMENTAL -# Requested Quality of Service used when run in client mode. -# 3 bytes corresponding to ???? -#qos 0x0b921f - -# TAG: qos -# Enable GTP datapath through Linux kernel driver gtp.ko (since 4.7). -#gtp-linux - diff --git a/examples/osmo-ggsn.cfg b/examples/osmo-ggsn.cfg new file mode 100644 index 0000000..763e561 --- /dev/null +++ b/examples/osmo-ggsn.cfg @@ -0,0 +1,71 @@ +! +! OpenGGSN (0.94.1-adac) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging print category 0 + logging timestamp 0 + logging level ip info + logging level tun info + logging level ggsn info + logging level sgsn notice + logging level icmp6 notice + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp info + logging level lstats notice + logging level lgsup notice + logging level loap notice + logging level lss7 notice + logging level lsccp notice + logging level lsua notice + logging level lm3ua notice + logging level lmgcp notice +! +stats interval 5 +! +line vty + no login +! +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown + apn inet6 + gtpu-mode tun + tun-device tun6 + type-support v6 + ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2000:0:0:0:0/56 + no shutdown + apn inet46 + gtpu-mode tun + tun-device tun46 + type-support v4v6 + ip prefix dynamic 176.16.46.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.46.0/24 + ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 + no shutdown + default-apn internet + no shutdown ggsn diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index c945f0b..fef12d3 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -2,17 +2,17 @@ AM_LDFLAGS = @EXEC_LDFLAGS@ -AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) + +ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD = @EXEC_LDADD@ -lgtp -lgtpnl -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) -else -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) +ggsn_LDADD += -lgtpnl endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/cmdline.c b/ggsn/cmdline.c deleted file mode 100644 index 31c0744..0000000 --- a/ggsn/cmdline.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* - File autogenerated by gengetopt version 2.22.6 - generated with the following command: - gengetopt -i cmdline.ggo --conf-parser - - The developers of gengetopt consider the fixed text that goes in all - gengetopt output files to be in the public domain: - we make no copyright claims on it. -*/ - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#ifndef FIX_UNUSED -#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ -#endif - -#include - -#include "cmdline.h" - -const char *gengetopt_args_info_purpose = ""; - -const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; - -const char *gengetopt_args_info_versiontext = ""; - -const char *gengetopt_args_info_description = ""; - -const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -f, --fg Run in foreground (default=off)", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file (default=`/etc/ggsn.conf')", - " --pidfile=STRING Filename of process id file\n (default=`/var/run/ggsn.pid')", - " --statedir=STRING Directory of nonvolatile data\n (default=`/var/lib/ggsn/')", - " -l, --listen=STRING Local interface", - " -n, --net=STRING Network (default=`192.168.0.0/24')", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --dynip=STRING Dynamic IP address pool", - " --statip=STRING Static IP address pool", - " --pcodns1=STRING PCO DNS Server 1 (default=`0.0.0.0')", - " --pcodns2=STRING PCO DNS Server 2 (default=`0.0.0.0')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " -a, --apn=STRING Access point name (default=`internet')", - " -q, --qos=INT Requested quality of service (default=`0x0b921f')", - " --logfile=STRING Logfile for errors", - " --loglevel=STRING Global log ldevel (default=`error')", - " -g, --gtp-linux GTP linux kernel support (default=off)", - 0 -}; - -typedef enum {ARG_NO - , ARG_FLAG - , ARG_STRING - , ARG_INT -} cmdline_parser_arg_type; - -static -void clear_given (struct gengetopt_args_info *args_info); -static -void clear_args (struct gengetopt_args_info *args_info); - -static int -cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error); - -struct line_list -{ - char * string_arg; - struct line_list * next; -}; - -static struct line_list *cmd_line_list = 0; -static struct line_list *cmd_line_list_tmp = 0; - -static void -free_cmd_list(void) -{ - /* free the list of a previous call */ - if (cmd_line_list) - { - while (cmd_line_list) { - cmd_line_list_tmp = cmd_line_list; - cmd_line_list = cmd_line_list->next; - free (cmd_line_list_tmp->string_arg); - free (cmd_line_list_tmp); - } - } -} - - -static char * -gengetopt_strdup (const char *s); - -static -void clear_given (struct gengetopt_args_info *args_info) -{ - args_info->help_given = 0 ; - args_info->version_given = 0 ; - args_info->fg_given = 0 ; - args_info->debug_given = 0 ; - args_info->conf_given = 0 ; - args_info->pidfile_given = 0 ; - args_info->statedir_given = 0 ; - args_info->listen_given = 0 ; - args_info->net_given = 0 ; - args_info->ipup_given = 0 ; - args_info->ipdown_given = 0 ; - args_info->dynip_given = 0 ; - args_info->statip_given = 0 ; - args_info->pcodns1_given = 0 ; - args_info->pcodns2_given = 0 ; - args_info->timelimit_given = 0 ; - args_info->apn_given = 0 ; - args_info->qos_given = 0 ; - args_info->logfile_given = 0 ; - args_info->loglevel_given = 0 ; - args_info->gtp_linux_given = 0 ; -} - -static -void clear_args (struct gengetopt_args_info *args_info) -{ - FIX_UNUSED (args_info); - args_info->fg_flag = 0; - args_info->debug_flag = 0; - args_info->conf_arg = gengetopt_strdup ("/etc/ggsn.conf"); - args_info->conf_orig = NULL; - args_info->pidfile_arg = gengetopt_strdup ("/var/run/ggsn.pid"); - args_info->pidfile_orig = NULL; - args_info->statedir_arg = gengetopt_strdup ("/var/lib/ggsn/"); - args_info->statedir_orig = NULL; - args_info->listen_arg = NULL; - args_info->listen_orig = NULL; - args_info->net_arg = gengetopt_strdup ("192.168.0.0/24"); - args_info->net_orig = NULL; - args_info->ipup_arg = NULL; - args_info->ipup_orig = NULL; - args_info->ipdown_arg = NULL; - args_info->ipdown_orig = NULL; - args_info->dynip_arg = NULL; - args_info->dynip_orig = NULL; - args_info->statip_arg = NULL; - args_info->statip_orig = NULL; - args_info->pcodns1_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns1_orig = NULL; - args_info->pcodns2_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns2_orig = NULL; - args_info->timelimit_arg = 0; - args_info->timelimit_orig = NULL; - args_info->apn_arg = gengetopt_strdup ("internet"); - args_info->apn_orig = NULL; - args_info->qos_arg = 0x0b921f; - args_info->qos_orig = NULL; - args_info->logfile_arg = NULL; - args_info->logfile_orig = NULL; - args_info->loglevel_arg = gengetopt_strdup ("error"); - args_info->loglevel_orig = NULL; - args_info->gtp_linux_flag = 0; - -} - -static -void init_args_info(struct gengetopt_args_info *args_info) -{ - - - args_info->help_help = gengetopt_args_info_help[0] ; - args_info->version_help = gengetopt_args_info_help[1] ; - args_info->fg_help = gengetopt_args_info_help[2] ; - args_info->debug_help = gengetopt_args_info_help[3] ; - args_info->conf_help = gengetopt_args_info_help[4] ; - args_info->pidfile_help = gengetopt_args_info_help[5] ; - args_info->statedir_help = gengetopt_args_info_help[6] ; - args_info->listen_help = gengetopt_args_info_help[7] ; - args_info->net_help = gengetopt_args_info_help[8] ; - args_info->ipup_help = gengetopt_args_info_help[9] ; - args_info->ipdown_help = gengetopt_args_info_help[10] ; - args_info->dynip_help = gengetopt_args_info_help[11] ; - args_info->statip_help = gengetopt_args_info_help[12] ; - args_info->pcodns1_help = gengetopt_args_info_help[13] ; - args_info->pcodns2_help = gengetopt_args_info_help[14] ; - args_info->timelimit_help = gengetopt_args_info_help[15] ; - args_info->apn_help = gengetopt_args_info_help[16] ; - args_info->qos_help = gengetopt_args_info_help[17] ; - args_info->logfile_help = gengetopt_args_info_help[18] ; - args_info->loglevel_help = gengetopt_args_info_help[19] ; - args_info->gtp_linux_help = gengetopt_args_info_help[20] ; - -} - -void -cmdline_parser_print_version (void) -{ - printf ("%s %s\n", - (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), - CMDLINE_PARSER_VERSION); - - if (strlen(gengetopt_args_info_versiontext) > 0) - printf("\n%s\n", gengetopt_args_info_versiontext); -} - -static void print_help_common(void) { - cmdline_parser_print_version (); - - if (strlen(gengetopt_args_info_purpose) > 0) - printf("\n%s\n", gengetopt_args_info_purpose); - - if (strlen(gengetopt_args_info_usage) > 0) - printf("\n%s\n", gengetopt_args_info_usage); - - printf("\n"); - - if (strlen(gengetopt_args_info_description) > 0) - printf("%s\n\n", gengetopt_args_info_description); -} - -void -cmdline_parser_print_help (void) -{ - int i = 0; - print_help_common(); - while (gengetopt_args_info_help[i]) - printf("%s\n", gengetopt_args_info_help[i++]); -} - -void -cmdline_parser_init (struct gengetopt_args_info *args_info) -{ - clear_given (args_info); - clear_args (args_info); - init_args_info (args_info); -} - -void -cmdline_parser_params_init(struct cmdline_parser_params *params) -{ - if (params) - { - params->override = 0; - params->initialize = 1; - params->check_required = 1; - params->check_ambiguity = 0; - params->print_errors = 1; - } -} - -struct cmdline_parser_params * -cmdline_parser_params_create(void) -{ - struct cmdline_parser_params *params = - (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); - cmdline_parser_params_init(params); - return params; -} - -static void -free_string_field (char **s) -{ - if (*s) - { - free (*s); - *s = 0; - } -} - - -static void -cmdline_parser_release (struct gengetopt_args_info *args_info) -{ - - free_string_field (&(args_info->conf_arg)); - free_string_field (&(args_info->conf_orig)); - free_string_field (&(args_info->pidfile_arg)); - free_string_field (&(args_info->pidfile_orig)); - free_string_field (&(args_info->statedir_arg)); - free_string_field (&(args_info->statedir_orig)); - free_string_field (&(args_info->listen_arg)); - free_string_field (&(args_info->listen_orig)); - free_string_field (&(args_info->net_arg)); - free_string_field (&(args_info->net_orig)); - free_string_field (&(args_info->ipup_arg)); - free_string_field (&(args_info->ipup_orig)); - free_string_field (&(args_info->ipdown_arg)); - free_string_field (&(args_info->ipdown_orig)); - free_string_field (&(args_info->dynip_arg)); - free_string_field (&(args_info->dynip_orig)); - free_string_field (&(args_info->statip_arg)); - free_string_field (&(args_info->statip_orig)); - free_string_field (&(args_info->pcodns1_arg)); - free_string_field (&(args_info->pcodns1_orig)); - free_string_field (&(args_info->pcodns2_arg)); - free_string_field (&(args_info->pcodns2_orig)); - free_string_field (&(args_info->timelimit_orig)); - free_string_field (&(args_info->apn_arg)); - free_string_field (&(args_info->apn_orig)); - free_string_field (&(args_info->qos_orig)); - free_string_field (&(args_info->logfile_arg)); - free_string_field (&(args_info->logfile_orig)); - free_string_field (&(args_info->loglevel_arg)); - free_string_field (&(args_info->loglevel_orig)); - - - - clear_given (args_info); -} - - -static void -write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) -{ - FIX_UNUSED (values); - if (arg) { - fprintf(outfile, "%s=\"%s\"\n", opt, arg); - } else { - fprintf(outfile, "%s\n", opt); - } -} - - -int -cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) -{ - int i = 0; - - if (!outfile) - { - fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); - return EXIT_FAILURE; - } - - if (args_info->help_given) - write_into_file(outfile, "help", 0, 0 ); - if (args_info->version_given) - write_into_file(outfile, "version", 0, 0 ); - if (args_info->fg_given) - write_into_file(outfile, "fg", 0, 0 ); - if (args_info->debug_given) - write_into_file(outfile, "debug", 0, 0 ); - if (args_info->conf_given) - write_into_file(outfile, "conf", args_info->conf_orig, 0); - if (args_info->pidfile_given) - write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); - if (args_info->statedir_given) - write_into_file(outfile, "statedir", args_info->statedir_orig, 0); - if (args_info->listen_given) - write_into_file(outfile, "listen", args_info->listen_orig, 0); - if (args_info->net_given) - write_into_file(outfile, "net", args_info->net_orig, 0); - if (args_info->ipup_given) - write_into_file(outfile, "ipup", args_info->ipup_orig, 0); - if (args_info->ipdown_given) - write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); - if (args_info->dynip_given) - write_into_file(outfile, "dynip", args_info->dynip_orig, 0); - if (args_info->statip_given) - write_into_file(outfile, "statip", args_info->statip_orig, 0); - if (args_info->pcodns1_given) - write_into_file(outfile, "pcodns1", args_info->pcodns1_orig, 0); - if (args_info->pcodns2_given) - write_into_file(outfile, "pcodns2", args_info->pcodns2_orig, 0); - if (args_info->timelimit_given) - write_into_file(outfile, "timelimit", args_info->timelimit_orig, 0); - if (args_info->apn_given) - write_into_file(outfile, "apn", args_info->apn_orig, 0); - if (args_info->qos_given) - write_into_file(outfile, "qos", args_info->qos_orig, 0); - if (args_info->logfile_given) - write_into_file(outfile, "logfile", args_info->logfile_orig, 0); - if (args_info->loglevel_given) - write_into_file(outfile, "loglevel", args_info->loglevel_orig, 0); - if (args_info->gtp_linux_given) - write_into_file(outfile, "gtp-linux", 0, 0 ); - - - i = EXIT_SUCCESS; - return i; -} - -int -cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) -{ - FILE *outfile; - int i = 0; - - outfile = fopen(filename, "w"); - - if (!outfile) - { - fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - i = cmdline_parser_dump(outfile, args_info); - fclose (outfile); - - return i; -} - -void -cmdline_parser_free (struct gengetopt_args_info *args_info) -{ - cmdline_parser_release (args_info); -} - -/** @brief replacement of strdup, which is not standard */ -char * -gengetopt_strdup (const char *s) -{ - char *result = 0; - if (!s) - return result; - - result = (char*)malloc(strlen(s) + 1); - if (result == (char*)0) - return (char*)0; - strcpy(result, s); - return result; -} - -int -cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) -{ - return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); -} - -int -cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int result; - result = cmdline_parser_internal (argc, argv, args_info, params, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) -{ - int result; - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) -{ - FIX_UNUSED (args_info); - FIX_UNUSED (prog_name); - return EXIT_SUCCESS; -} - - -static char *package_name = 0; - -/** - * @brief updates an option - * @param field the generic pointer to the field to update - * @param orig_field the pointer to the orig field - * @param field_given the pointer to the number of occurrence of this option - * @param prev_given the pointer to the number of occurrence already seen - * @param value the argument for this option (if null no arg was specified) - * @param possible_values the possible values for this option (if specified) - * @param default_value the default value (in case the option only accepts fixed values) - * @param arg_type the type of this option - * @param check_ambiguity @see cmdline_parser_params.check_ambiguity - * @param override @see cmdline_parser_params.override - * @param no_free whether to free a possible previous value - * @param multiple_option whether this is a multiple option - * @param long_opt the corresponding long option - * @param short_opt the corresponding short option (or '-' if none) - * @param additional_error possible further error specification - */ -static -int update_arg(void *field, char **orig_field, - unsigned int *field_given, unsigned int *prev_given, - char *value, const char *possible_values[], - const char *default_value, - cmdline_parser_arg_type arg_type, - int check_ambiguity, int override, - int no_free, int multiple_option, - const char *long_opt, char short_opt, - const char *additional_error) -{ - char *stop_char = 0; - const char *val = value; - int found; - char **string_field; - FIX_UNUSED (field); - - stop_char = 0; - found = 0; - - if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) - { - if (short_opt != '-') - fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", - package_name, long_opt, short_opt, - (additional_error ? additional_error : "")); - else - fprintf (stderr, "%s: `--%s' option given more than once%s\n", - package_name, long_opt, - (additional_error ? additional_error : "")); - return 1; /* failure */ - } - - FIX_UNUSED (default_value); - - if (field_given && *field_given && ! override) - return 0; - if (prev_given) - (*prev_given)++; - if (field_given) - (*field_given)++; - if (possible_values) - val = possible_values[found]; - - switch(arg_type) { - case ARG_FLAG: - *((int *)field) = !*((int *)field); - break; - case ARG_INT: - if (val) *((int *)field) = strtol (val, &stop_char, 0); - break; - case ARG_STRING: - if (val) { - string_field = (char **)field; - if (!no_free && *string_field) - free (*string_field); /* free previous string */ - *string_field = gengetopt_strdup (val); - } - break; - default: - break; - }; - - /* check numeric conversion */ - switch(arg_type) { - case ARG_INT: - if (val && !(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); - return 1; /* failure */ - } - break; - default: - ; - }; - - /* store the original value */ - switch(arg_type) { - case ARG_NO: - case ARG_FLAG: - break; - default: - if (value && orig_field) { - if (no_free) { - *orig_field = value; - } else { - if (*orig_field) - free (*orig_field); /* free previous string */ - *orig_field = gengetopt_strdup (value); - } - } - }; - - return 0; /* OK */ -} - - -int -cmdline_parser_internal ( - int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error) -{ - int c; /* Character of the parsed option. */ - - int error_occurred = 0; - struct gengetopt_args_info local_args_info; - - int override; - int initialize; - int check_required; - int check_ambiguity; - - package_name = argv[0]; - - override = params->override; - initialize = params->initialize; - check_required = params->check_required; - check_ambiguity = params->check_ambiguity; - - if (initialize) - cmdline_parser_init (args_info); - - cmdline_parser_init (&local_args_info); - - optarg = 0; - optind = 0; - opterr = params->print_errors; - optopt = '?'; - - while (1) - { - int option_index = 0; - - static struct option long_options[] = { - { "help", 0, NULL, 'h' }, - { "version", 0, NULL, 'V' }, - { "fg", 0, NULL, 'f' }, - { "debug", 0, NULL, 'd' }, - { "conf", 1, NULL, 'c' }, - { "pidfile", 1, NULL, 0 }, - { "statedir", 1, NULL, 0 }, - { "listen", 1, NULL, 'l' }, - { "net", 1, NULL, 'n' }, - { "ipup", 1, NULL, 0 }, - { "ipdown", 1, NULL, 0 }, - { "dynip", 1, NULL, 0 }, - { "statip", 1, NULL, 0 }, - { "pcodns1", 1, NULL, 0 }, - { "pcodns2", 1, NULL, 0 }, - { "timelimit", 1, NULL, 0 }, - { "apn", 1, NULL, 'a' }, - { "qos", 1, NULL, 'q' }, - { "logfile", 1, NULL, 0 }, - { "loglevel", 1, NULL, 0 }, - { "gtp-linux", 0, NULL, 'g' }, - { 0, 0, 0, 0 } - }; - - c = getopt_long (argc, argv, "hVfdc:l:n:a:q:g", long_options, &option_index); - - if (c == -1) break; /* Exit from `while (1)' loop. */ - - switch (c) - { - case 'h': /* Print help and exit. */ - cmdline_parser_print_help (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'V': /* Print version and exit. */ - cmdline_parser_print_version (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'f': /* Run in foreground. */ - - - if (update_arg((void *)&(args_info->fg_flag), 0, &(args_info->fg_given), - &(local_args_info.fg_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "fg", 'f', - additional_error)) - goto failure; - - break; - case 'd': /* Run in debug mode. */ - - - if (update_arg((void *)&(args_info->debug_flag), 0, &(args_info->debug_given), - &(local_args_info.debug_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "debug", 'd', - additional_error)) - goto failure; - - break; - case 'c': /* Read configuration file. */ - - - if (update_arg( (void *)&(args_info->conf_arg), - &(args_info->conf_orig), &(args_info->conf_given), - &(local_args_info.conf_given), optarg, 0, "/etc/ggsn.conf", ARG_STRING, - check_ambiguity, override, 0, 0, - "conf", 'c', - additional_error)) - goto failure; - - break; - case 'l': /* Local interface. */ - - - if (update_arg( (void *)&(args_info->listen_arg), - &(args_info->listen_orig), &(args_info->listen_given), - &(local_args_info.listen_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "listen", 'l', - additional_error)) - goto failure; - - break; - case 'n': /* Network. */ - - - if (update_arg( (void *)&(args_info->net_arg), - &(args_info->net_orig), &(args_info->net_given), - &(local_args_info.net_given), optarg, 0, "192.168.0.0/24", ARG_STRING, - check_ambiguity, override, 0, 0, - "net", 'n', - additional_error)) - goto failure; - - break; - case 'a': /* Access point name. */ - - - if (update_arg( (void *)&(args_info->apn_arg), - &(args_info->apn_orig), &(args_info->apn_given), - &(local_args_info.apn_given), optarg, 0, "internet", ARG_STRING, - check_ambiguity, override, 0, 0, - "apn", 'a', - additional_error)) - goto failure; - - break; - case 'q': /* Requested quality of service. */ - - - if (update_arg( (void *)&(args_info->qos_arg), - &(args_info->qos_orig), &(args_info->qos_given), - &(local_args_info.qos_given), optarg, 0, "0x0b921f", ARG_INT, - check_ambiguity, override, 0, 0, - "qos", 'q', - additional_error)) - goto failure; - - break; - case 'g': /* GTP linux kernel support. */ - - - if (update_arg((void *)&(args_info->gtp_linux_flag), 0, &(args_info->gtp_linux_given), - &(local_args_info.gtp_linux_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "gtp-linux", 'g', - additional_error)) - goto failure; - - break; - - case 0: /* Long option with no short option */ - /* Filename of process id file. */ - if (strcmp (long_options[option_index].name, "pidfile") == 0) - { - - - if (update_arg( (void *)&(args_info->pidfile_arg), - &(args_info->pidfile_orig), &(args_info->pidfile_given), - &(local_args_info.pidfile_given), optarg, 0, "/var/run/ggsn.pid", ARG_STRING, - check_ambiguity, override, 0, 0, - "pidfile", '-', - additional_error)) - goto failure; - - } - /* Directory of nonvolatile data. */ - else if (strcmp (long_options[option_index].name, "statedir") == 0) - { - - - if (update_arg( (void *)&(args_info->statedir_arg), - &(args_info->statedir_orig), &(args_info->statedir_given), - &(local_args_info.statedir_given), optarg, 0, "/var/lib/ggsn/", ARG_STRING, - check_ambiguity, override, 0, 0, - "statedir", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-up. */ - else if (strcmp (long_options[option_index].name, "ipup") == 0) - { - - - if (update_arg( (void *)&(args_info->ipup_arg), - &(args_info->ipup_orig), &(args_info->ipup_given), - &(local_args_info.ipup_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipup", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-down. */ - else if (strcmp (long_options[option_index].name, "ipdown") == 0) - { - - - if (update_arg( (void *)&(args_info->ipdown_arg), - &(args_info->ipdown_orig), &(args_info->ipdown_given), - &(local_args_info.ipdown_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipdown", '-', - additional_error)) - goto failure; - - } - /* Dynamic IP address pool. */ - else if (strcmp (long_options[option_index].name, "dynip") == 0) - { - - - if (update_arg( (void *)&(args_info->dynip_arg), - &(args_info->dynip_orig), &(args_info->dynip_given), - &(local_args_info.dynip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "dynip", '-', - additional_error)) - goto failure; - - } - /* Static IP address pool. */ - else if (strcmp (long_options[option_index].name, "statip") == 0) - { - - - if (update_arg( (void *)&(args_info->statip_arg), - &(args_info->statip_orig), &(args_info->statip_given), - &(local_args_info.statip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "statip", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 1. */ - else if (strcmp (long_options[option_index].name, "pcodns1") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns1_arg), - &(args_info->pcodns1_orig), &(args_info->pcodns1_given), - &(local_args_info.pcodns1_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns1", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 2. */ - else if (strcmp (long_options[option_index].name, "pcodns2") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns2_arg), - &(args_info->pcodns2_orig), &(args_info->pcodns2_given), - &(local_args_info.pcodns2_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns2", '-', - additional_error)) - goto failure; - - } - /* Exit after timelimit seconds. */ - else if (strcmp (long_options[option_index].name, "timelimit") == 0) - { - - - if (update_arg( (void *)&(args_info->timelimit_arg), - &(args_info->timelimit_orig), &(args_info->timelimit_given), - &(local_args_info.timelimit_given), optarg, 0, "0", ARG_INT, - check_ambiguity, override, 0, 0, - "timelimit", '-', - additional_error)) - goto failure; - - } - /* Logfile for errors. */ - else if (strcmp (long_options[option_index].name, "logfile") == 0) - { - - - if (update_arg( (void *)&(args_info->logfile_arg), - &(args_info->logfile_orig), &(args_info->logfile_given), - &(local_args_info.logfile_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "logfile", '-', - additional_error)) - goto failure; - - } - /* Global log ldevel. */ - else if (strcmp (long_options[option_index].name, "loglevel") == 0) - { - - - if (update_arg( (void *)&(args_info->loglevel_arg), - &(args_info->loglevel_orig), &(args_info->loglevel_given), - &(local_args_info.loglevel_given), optarg, 0, "error", ARG_STRING, - check_ambiguity, override, 0, 0, - "loglevel", '-', - additional_error)) - goto failure; - - } - - break; - case '?': /* Invalid option. */ - /* `getopt_long' already printed an error message. */ - goto failure; - - default: /* bug: option not considered. */ - fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); - abort (); - } /* switch */ - } /* while */ - - - - - cmdline_parser_release (&local_args_info); - - if ( error_occurred ) - return (EXIT_FAILURE); - - return 0; - -failure: - - cmdline_parser_release (&local_args_info); - return (EXIT_FAILURE); -} - -#ifndef CONFIG_FILE_LINE_SIZE -#define CONFIG_FILE_LINE_SIZE 2048 -#endif -#define ADDITIONAL_ERROR " in configuration file " - -#define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) -/* 3 is for "--" and "=" */ - -static int -_cmdline_parser_configfile (const char *filename, int *my_argc) -{ - FILE* file; - char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE+1]; - char linebuf[CONFIG_FILE_LINE_SIZE]; - int line_num = 0; - int result = 0, equal; - char *fopt, *farg; - char *str_index; - size_t len, next_token; - char delimiter; - - if ((file = fopen(filename, "r")) == 0) - { - fprintf (stderr, "%s: Error opening configuration file '%s'\n", - CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) - { - ++line_num; - my_argv[0] = '\0'; - len = strlen(linebuf); - if (len > (CONFIG_FILE_LINE_BUFFER_SIZE-1)) - { - fprintf (stderr, "%s:%s:%d: Line too long in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - - /* find first non-whitespace character in the line */ - next_token = strspn (linebuf, " \t\r\n"); - str_index = linebuf + next_token; - - if ( str_index[0] == '\0' || str_index[0] == '#') - continue; /* empty line or comment line is skipped */ - - fopt = str_index; - - /* truncate fopt at the end of the first non-valid character */ - next_token = strcspn (fopt, " \t\r\n="); - - if (fopt[next_token] == '\0') /* the line is over */ - { - farg = 0; - equal = 0; - goto noarg; - } - - /* remember if equal sign is present */ - equal = (fopt[next_token] == '='); - fopt[next_token++] = '\0'; - - /* advance pointers to the next token after the end of fopt */ - next_token += strspn (fopt + next_token, " \t\r\n"); - - /* check for the presence of equal sign, and if so, skip it */ - if ( !equal ) - if ((equal = (fopt[next_token] == '='))) - { - next_token++; - next_token += strspn (fopt + next_token, " \t\r\n"); - } - str_index += next_token; - - /* find argument */ - farg = str_index; - if ( farg[0] == '\"' || farg[0] == '\'' ) - { /* quoted argument */ - str_index = strchr (++farg, str_index[0] ); /* skip opening quote */ - if (! str_index) - { - fprintf - (stderr, - "%s:%s:%d: unterminated string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - else - { /* read up the remaining part up to a delimiter */ - next_token = strcspn (farg, " \t\r\n#\'\""); - str_index += next_token; - } - - /* truncate farg at the delimiter and store it for further check */ - delimiter = *str_index, *str_index++ = '\0'; - - /* everything but comment is illegal at the end of line */ - if (delimiter != '\0' && delimiter != '#') - { - str_index += strspn(str_index, " \t\r\n"); - if (*str_index != '\0' && *str_index != '#') - { - fprintf - (stderr, - "%s:%s:%d: malformed string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - - noarg: - if (!strcmp(fopt,"include")) { - if (farg && *farg) { - result = _cmdline_parser_configfile(farg, my_argc); - } else { - fprintf(stderr, "%s:%s:%d: include requires a filename argument.\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - } - continue; - } - len = strlen(fopt); - strcat (my_argv, len > 1 ? "--" : "-"); - strcat (my_argv, fopt); - if (len > 1 && ((farg && *farg) || equal)) - strcat (my_argv, "="); - if (farg && *farg) - strcat (my_argv, farg); - ++(*my_argc); - - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(my_argv); - } /* while */ - - if (file) - fclose(file); - return result; -} - -int -cmdline_parser_configfile ( - const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required) -{ - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - return cmdline_parser_config_file (filename, args_info, ¶ms); -} - -int -cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int i, result; - int my_argc = 1; - char **my_argv_arg; - char *additional_error; - - /* store the program name */ - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup (CMDLINE_PARSER_PACKAGE); - - result = _cmdline_parser_configfile(filename, &my_argc); - - if (result != EXIT_FAILURE) { - my_argv_arg = (char **) malloc((my_argc+1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - - my_argv_arg[my_argc] = 0; - - additional_error = (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy (additional_error, ADDITIONAL_ERROR); - strcat (additional_error, filename); - result = - cmdline_parser_internal (my_argc, my_argv_arg, args_info, - params, - additional_error); - - free (additional_error); - free (my_argv_arg); - } - - free_cmd_list(); - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} diff --git a/ggsn/cmdline.ggo b/ggsn/cmdline.ggo deleted file mode 100644 index 7426707..0000000 --- a/ggsn/cmdline.ggo +++ /dev/null @@ -1,38 +0,0 @@ -# OpenGGSN - Gateway GPRS Support Node -# Copyright (C) 2002, 2003, 2004 Mondru AB. -# -# The contents of this file may be used under the terms of the GNU -# General Public License Version 2, provided that the above copyright -# notice and this permission notice is included in all copies or -# substantial portions of the software. -# -# Use "gengetopt --conf-parser < cmdline.ggo" -# to generate cmdline.c and cmdline.h - -option "fg" f "Run in foreground" flag off -option "debug" d "Run in debug mode" flag off - -option "conf" c "Read configuration file" string default="/etc/ggsn.conf" no -option "pidfile" - "Filename of process id file" string default="/var/run/ggsn.pid" no -option "statedir" - "Directory of nonvolatile data" string default="/var/lib/ggsn/" no - -option "listen" l "Local interface" string no -option "net" n "Network" string default="192.168.0.0/24" no -option "ipup" - "Script to run after link-up" string no -option "ipdown" - "Script to run after link-down" string no - -option "dynip" - "Dynamic IP address pool" string no -option "statip" - "Static IP address pool" string no - -option "pcodns1" - "PCO DNS Server 1" string default="0.0.0.0" no -option "pcodns2" - "PCO DNS Server 2" string default="0.0.0.0" no - -option "timelimit" - "Exit after timelimit seconds" int default="0" no - -option "apn" a "Access point name" string default="internet" no -option "qos" q "Requested quality of service" int default="0x0b921f" no -option "logfile" - "Logfile for errors" string no -option "loglevel" - "Global log ldevel" string default="error" no - -option "gtp-linux" g "GTP linux kernel support" flag off - diff --git a/ggsn/cmdline.h b/ggsn/cmdline.h deleted file mode 100644 index 57f5cae..0000000 --- a/ggsn/cmdline.h +++ /dev/null @@ -1,275 +0,0 @@ -/** @file cmdline.h - * @brief The header file for the command line option parser - * generated by GNU Gengetopt version 2.22.6 - * http://www.gnu.org/software/gengetopt. - * DO NOT modify this file, since it can be overwritten - * @author GNU Gengetopt by Lorenzo Bettini */ - -#ifndef CMDLINE_H -#define CMDLINE_H - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include /* for FILE */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef CMDLINE_PARSER_PACKAGE -/** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE -#endif - -#ifndef CMDLINE_PARSER_PACKAGE_NAME -/** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif -#endif - -#ifndef CMDLINE_PARSER_VERSION -/** @brief the program version */ -#define CMDLINE_PARSER_VERSION VERSION -#endif - -/** @brief Where the command line options are stored */ -struct gengetopt_args_info -{ - const char *help_help; /**< @brief Print help and exit help description. */ - const char *version_help; /**< @brief Print version and exit help description. */ - int fg_flag; /**< @brief Run in foreground (default=off). */ - const char *fg_help; /**< @brief Run in foreground help description. */ - int debug_flag; /**< @brief Run in debug mode (default=off). */ - const char *debug_help; /**< @brief Run in debug mode help description. */ - char * conf_arg; /**< @brief Read configuration file (default='/etc/ggsn.conf'). */ - char * conf_orig; /**< @brief Read configuration file original value given at command line. */ - const char *conf_help; /**< @brief Read configuration file help description. */ - char * pidfile_arg; /**< @brief Filename of process id file (default='/var/run/ggsn.pid'). */ - char * pidfile_orig; /**< @brief Filename of process id file original value given at command line. */ - const char *pidfile_help; /**< @brief Filename of process id file help description. */ - char * statedir_arg; /**< @brief Directory of nonvolatile data (default='/var/lib/ggsn/'). */ - char * statedir_orig; /**< @brief Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /**< @brief Directory of nonvolatile data help description. */ - char * listen_arg; /**< @brief Local interface. */ - char * listen_orig; /**< @brief Local interface original value given at command line. */ - const char *listen_help; /**< @brief Local interface help description. */ - char * net_arg; /**< @brief Network (default='192.168.0.0/24'). */ - char * net_orig; /**< @brief Network original value given at command line. */ - const char *net_help; /**< @brief Network help description. */ - char * ipup_arg; /**< @brief Script to run after link-up. */ - char * ipup_orig; /**< @brief Script to run after link-up original value given at command line. */ - const char *ipup_help; /**< @brief Script to run after link-up help description. */ - char * ipdown_arg; /**< @brief Script to run after link-down. */ - char * ipdown_orig; /**< @brief Script to run after link-down original value given at command line. */ - const char *ipdown_help; /**< @brief Script to run after link-down help description. */ - char * dynip_arg; /**< @brief Dynamic IP address pool. */ - char * dynip_orig; /**< @brief Dynamic IP address pool original value given at command line. */ - const char *dynip_help; /**< @brief Dynamic IP address pool help description. */ - char * statip_arg; /**< @brief Static IP address pool. */ - char * statip_orig; /**< @brief Static IP address pool original value given at command line. */ - const char *statip_help; /**< @brief Static IP address pool help description. */ - char * pcodns1_arg; /**< @brief PCO DNS Server 1 (default='0.0.0.0'). */ - char * pcodns1_orig; /**< @brief PCO DNS Server 1 original value given at command line. */ - const char *pcodns1_help; /**< @brief PCO DNS Server 1 help description. */ - char * pcodns2_arg; /**< @brief PCO DNS Server 2 (default='0.0.0.0'). */ - char * pcodns2_orig; /**< @brief PCO DNS Server 2 original value given at command line. */ - const char *pcodns2_help; /**< @brief PCO DNS Server 2 help description. */ - int timelimit_arg; /**< @brief Exit after timelimit seconds (default='0'). */ - char * timelimit_orig; /**< @brief Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /**< @brief Exit after timelimit seconds help description. */ - char * apn_arg; /**< @brief Access point name (default='internet'). */ - char * apn_orig; /**< @brief Access point name original value given at command line. */ - const char *apn_help; /**< @brief Access point name help description. */ - int qos_arg; /**< @brief Requested quality of service (default='0x0b921f'). */ - char * qos_orig; /**< @brief Requested quality of service original value given at command line. */ - const char *qos_help; /**< @brief Requested quality of service help description. */ - char * logfile_arg; /**< @brief Logfile for errors. */ - char * logfile_orig; /**< @brief Logfile for errors original value given at command line. */ - const char *logfile_help; /**< @brief Logfile for errors help description. */ - char * loglevel_arg; /**< @brief Global log ldevel (default='error'). */ - char * loglevel_orig; /**< @brief Global log ldevel original value given at command line. */ - const char *loglevel_help; /**< @brief Global log ldevel help description. */ - int gtp_linux_flag; /**< @brief GTP linux kernel support (default=off). */ - const char *gtp_linux_help; /**< @brief GTP linux kernel support help description. */ - - unsigned int help_given ; /**< @brief Whether help was given. */ - unsigned int version_given ; /**< @brief Whether version was given. */ - unsigned int fg_given ; /**< @brief Whether fg was given. */ - unsigned int debug_given ; /**< @brief Whether debug was given. */ - unsigned int conf_given ; /**< @brief Whether conf was given. */ - unsigned int pidfile_given ; /**< @brief Whether pidfile was given. */ - unsigned int statedir_given ; /**< @brief Whether statedir was given. */ - unsigned int listen_given ; /**< @brief Whether listen was given. */ - unsigned int net_given ; /**< @brief Whether net was given. */ - unsigned int ipup_given ; /**< @brief Whether ipup was given. */ - unsigned int ipdown_given ; /**< @brief Whether ipdown was given. */ - unsigned int dynip_given ; /**< @brief Whether dynip was given. */ - unsigned int statip_given ; /**< @brief Whether statip was given. */ - unsigned int pcodns1_given ; /**< @brief Whether pcodns1 was given. */ - unsigned int pcodns2_given ; /**< @brief Whether pcodns2 was given. */ - unsigned int timelimit_given ; /**< @brief Whether timelimit was given. */ - unsigned int apn_given ; /**< @brief Whether apn was given. */ - unsigned int qos_given ; /**< @brief Whether qos was given. */ - unsigned int logfile_given ; /**< @brief Whether logfile was given. */ - unsigned int loglevel_given ; /**< @brief Whether loglevel was given. */ - unsigned int gtp_linux_given ; /**< @brief Whether gtp-linux was given. */ - -} ; - -/** @brief The additional parameters to pass to parser functions */ -struct cmdline_parser_params -{ - int override; /**< @brief whether to override possibly already present options (default 0) */ - int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ - int check_required; /**< @brief whether to check that all required options were provided (default 1) */ - int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ - int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ -} ; - -/** @brief the purpose string of the program */ -extern const char *gengetopt_args_info_purpose; -/** @brief the usage string of the program */ -extern const char *gengetopt_args_info_usage; -/** @brief the description string of the program */ -extern const char *gengetopt_args_info_description; -/** @brief all the lines making the help output */ -extern const char *gengetopt_args_info_help[]; - -/** - * The command line parser - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser (int argc, char **argv, - struct gengetopt_args_info *args_info); - -/** - * The command line parser (version with additional parameters - deprecated) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_ext() instead - */ -int cmdline_parser2 (int argc, char **argv, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The command line parser (version with additional parameters) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_ext (int argc, char **argv, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Save the contents of the option struct into an already open FILE stream. - * @param outfile the stream where to dump options - * @param args_info the option struct to dump - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_dump(FILE *outfile, - struct gengetopt_args_info *args_info); - -/** - * Save the contents of the option struct into a (text) file. - * This file can be read by the config file parser (if generated by gengetopt) - * @param filename the file where to save - * @param args_info the option struct to save - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_file_save(const char *filename, - struct gengetopt_args_info *args_info); - -/** - * Print the help - */ -void cmdline_parser_print_help(void); -/** - * Print the version - */ -void cmdline_parser_print_version(void); - -/** - * Initializes all the fields a cmdline_parser_params structure - * to their default values - * @param params the structure to initialize - */ -void cmdline_parser_params_init(struct cmdline_parser_params *params); - -/** - * Allocates dynamically a cmdline_parser_params structure and initializes - * all its fields to their default values - * @return the created and initialized cmdline_parser_params structure - */ -struct cmdline_parser_params *cmdline_parser_params_create(void); - -/** - * Initializes the passed gengetopt_args_info structure's fields - * (also set default values for options that have a default) - * @param args_info the structure to initialize - */ -void cmdline_parser_init (struct gengetopt_args_info *args_info); -/** - * Deallocates the string fields of the gengetopt_args_info structure - * (but does not deallocate the structure itself) - * @param args_info the structure to deallocate - */ -void cmdline_parser_free (struct gengetopt_args_info *args_info); - -/** - * The config file parser (deprecated version) - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_config_file() instead - */ -int cmdline_parser_configfile (const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The config file parser - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Checks that all the required options were specified - * @param args_info the structure to check - * @param prog_name the name of the program that will be used to print - * possible errors - * @return - */ -int cmdline_parser_required (struct gengetopt_args_info *args_info, - const char *prog_name); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* CMDLINE_H */ diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 2ab0e43..da46a62 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,6 +1,7 @@ /* * OpenGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -19,42 +20,41 @@ #include "../config.h" -#include - #ifdef HAVE_STDINT_H #include #endif +#include #include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include - #include +#include +#include -#include +#include +#include +#include +#include #include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include #include "../lib/tun.h" #include "../lib/ippool.h" @@ -62,82 +62,188 @@ #include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" -#include "cmdline.h" #include "gtp-kernel.h" #include "icmpv6.h" +#include "ggsn.h" -int end = 0; -int maxfd = 0; /* For select() */ +void *tall_ggsn_ctx; -struct in_addr listen_; -struct in46_addr netaddr, destaddr, net; /* Network interface */ -size_t prefixlen; -struct in46_addr dns1, dns2; /* PCO DNS address */ -char *ipup, *ipdown; /* Filename of scripts */ -int debug; /* Print debug output */ -struct ul255_t pco; +static int end = 0; +static int daemonize = 0; +static struct ctrl_handle *g_ctrlh; + struct ul255_t qos; struct ul255_t apn; -struct gsn_t *gsn; /* GSN instance */ -struct tun_t *tun; /* TUN instance */ -struct ippool_t *ippool; /* Pool of IP addresses */ +#define LOGPAPN(level, apn, fmt, args...) \ + LOGP(DGGSN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args) -/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ -void signal_handler(int s) +#define LOGPGGSN(level, ggsn, fmt, args...) \ + LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) + +#define LOGPPDP(level, pdp, fmt, args...) \ + LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); + + +static void pool_close_all_pdp(struct ippool_t *pool) { - DEBUGP(DGGSN, "Received signal %d, exiting.\n", s); - end = 1; -} + unsigned int i; -/* Used to write process ID to file. Assume someone else will delete */ -void log_pid(char *pidfile) -{ - FILE *file; - mode_t oldmask; - - oldmask = umask(022); - file = fopen(pidfile, "w"); - umask(oldmask); - if (!file) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to create process ID file: %s!", pidfile); + if (!pool) return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + struct pdp_t *pdp; + + if (!member->inuse) + continue; + pdp = member->peer; + if (!pdp) + continue; + LOGPPDP(LOGL_DEBUG, pdp, "Sending DELETE PDP CTX due to shutdown\n"); + gtp_delete_context_req(pdp->gsn, pdp, NULL, 1); } - fprintf(file, "%d\n", (int)getpid()); - fclose(file); } -#if defined(__sun__) -int daemon(int nochdir, int noclose) +int apn_stop(struct apn_ctx *apn, bool force) { - int fd; + if (!apn->started) + return 0; - switch (fork()) { - case -1: - return (-1); - case 0: + LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); + /* check if pools have any active PDP contexts and bail out */ + pool_close_all_pdp(apn->v4.pool); + pool_close_all_pdp(apn->v6.pool); + + /* shutdown whatever old state might be left */ + if (apn->tun.tun) { + /* run ip-down script */ + if (apn->tun.cfg.ipdown_script) { + LOGPAPN( LOGL_INFO, apn, "Running %s\n", apn->tun.cfg.ipdown_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipdown_script); + } + /* release tun device */ + LOGPAPN(LOGL_INFO, apn, "Closing TUN device\n"); + osmo_fd_unregister(&apn->tun.fd); + tun_free(apn->tun.tun); + apn->tun.tun = NULL; + } + + if (apn->v4.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv4 pool\n"); + ippool_free(apn->v4.pool); + apn->v4.pool = NULL; + } + if (apn->v6.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv6 pool\n"); + ippool_free(apn->v6.pool); + apn->v6.pool = NULL; + } + + apn->started = false; + return 0; +} + +/* actually start the APN with its current config */ +int apn_start(struct apn_ctx *apn) +{ + if (apn->started) + return 0; + + LOGPAPN(LOGL_INFO, apn, "Starting\n"); + switch (apn->cfg.gtpu_mode) { + case APN_GTPU_MODE_TUN: + LOGPAPN(LOGL_INFO, apn, "Opening TUN device %s\n", apn->tun.cfg.dev_name); + if (tun_new(&apn->tun.tun, apn->tun.cfg.dev_name)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to configure tun device\n"); + return -1; + } + LOGPAPN(LOGL_INFO, apn, "Opened TUN device %s\n", apn->tun.tun->devname); + + /* Register with libosmcoore */ + osmo_fd_setup(&apn->tun.fd, apn->tun.tun->fd, BSC_FD_READ, ggsn_tun_fd_cb, apn, 0); + osmo_fd_register(&apn->tun.fd); + + /* Set TUN library callback */ + tun_set_cb_ind(apn->tun.tun, cb_tun_ind); + + if (apn->v4.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IP address %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v4.cfg.ifconfig_prefix.addr, NULL, + apn->v4.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv4 address %s: %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->v6.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IPv6 address %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL, + apn->v6.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->tun.cfg.ipup_script) { + LOGPAPN(LOGL_INFO, apn, "Running ip-up script %s\n", + apn->tun.cfg.ipup_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipup_script); + } + /* set back-pointer from TUN device to APN */ + apn->tun.tun->priv = apn; + break; + case APN_GTPU_MODE_KERNEL_GTP: + LOGPAPN(LOGL_ERROR, apn, "FIXME: Kernel GTP\n"); +#if 0 + /* use GTP kernel module for data packet encapsulation */ + if (gtp_kernel_init(gsn, &net.v4, prefixlen, net_arg) < 0) + goto err; +#endif break; default: - _exit(0); + LOGPAPN(LOGL_ERROR, apn, "Unknown GTPU Mode %d\n", apn->cfg.gtpu_mode); + return -1; } - if (setsid() == -1) - return (-1); - - if (!nochdir) - chdir("/"); - - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { - dup2(fd, STDIN_FILENO); - dup2(fd, STDOUT_FILENO); - dup2(fd, STDERR_FILENO); - if (fd > 2) - close(fd); + /* Create IPv4 pool */ + if (apn->v4.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", + in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, + &apn->v4.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + apn_stop(apn, false); + return -1; + } } - return (0); + + /* Create IPv6 pool */ + if (apn->v6.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", + in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, + &apn->v6.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + apn_stop(apn, false); + return -1; + } + } + + LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); + apn->started = true; + return 0; } -#endif static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { @@ -148,27 +254,29 @@ snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); - if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); + if (ctrl_cmd_send_trap(g_ctrlh, var, val) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Failed to create and send TRAP %s\n", var); return false; } return true; } -int delete_context(struct pdp_t *pdp) +static int delete_context(struct pdp_t *pdp) { - DEBUGP(DGGSN, "Deleting PDP context\n"); + struct gsn_t *gsn = pdp->gsn; + struct ippoolm_t *ipp = (struct ippoolm_t *)pdp->peer; + + LOGPPDP(LOGL_INFO, pdp, "Deleting PDP context\n"); struct ippoolm_t *member = pdp->peer; if (pdp->peer) { send_trap(gsn, pdp, member, "imsi-rem-ip"); /* TRAP with IP removal */ - ippool_freeip(ippool, (struct ippoolm_t *)pdp->peer); + ippool_freeip(ipp->pool, ipp); } else - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Peer not defined!"); + LOGPPDP(LOGL_ERROR, pdp, "Cannot find/free IP Pool member\n"); if (gtp_kernel_tunnel_del(pdp)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot delete tunnel from kernel: %s\n", + LOGPPDP(LOGL_ERROR, pdp, "Cannot delete tunnel from kernel:%s\n", strerror(errno)); } @@ -236,31 +344,74 @@ return false; } +/* construct an IPCP PCO from up to two given DNS addreses */ +static int build_ipcp_pco(struct msgb *msg, uint8_t id, const struct in46_addr *dns1, + const struct in46_addr *dns2) +{ + uint8_t *len1, *len2; + uint8_t *start = msg->tail; + unsigned int len_appended; + + /* Three byte T16L header */ + msgb_put_u16(msg, 0x8021); /* IPCP */ + len1 = msgb_put(msg, 1); /* Length of contents: delay */ + + msgb_put_u8(msg, 0x02); /* ACK */ + msgb_put_u8(msg, id); /* ID: Needs to match request */ + msgb_put_u8(msg, 0x00); /* Length MSB */ + len2 = msgb_put(msg, 1); /* Length LSB: delay */ + + if (dns1 && dns1->len == 4) { + msgb_put_u8(msg, 0x81); /* DNS1 Tag */ + msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ + msgb_put_u32(msg, dns1->v4.s_addr); + } + + if (dns2 && dns2->len == 4) { + msgb_put_u8(msg, 0x83); /* DNS2 Tag */ + msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ + msgb_put_u32(msg, dns2->v4.s_addr); + } + + /* patch in length values */ + len_appended = msg->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; + + return 0; +} + /* process one PCO request from a MS/UE, putting together the proper responses */ -static void process_pco(struct pdp_t *pdp) +static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + unsigned int i; + + OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ /* FIXME: also check if primary / secondary DNS was requested */ if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { /* FIXME: properly implement this for IPCP */ - uint8_t *cur = msgb_put(msg, pco.l-1); - memcpy(cur, pco.v+1, pco.l-1); + build_ipcp_pco(msg, 0, &apn->v4.cfg.dns[0], &apn->v4.cfg.dns[1]); } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { - if (dns1.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); - if (dns2.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + if (i46a->len != 16) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); + } } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { - if (dns1.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); - if (dns2.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + if (i46a->len != 4) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); + } } if (msgb_length(msg) > 1) { @@ -274,11 +425,29 @@ int create_context_ind(struct pdp_t *pdp) { + static char name_buf[256]; + struct gsn_t *gsn = pdp->gsn; + struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr; struct ippoolm_t *member; + struct apn_ctx *apn; int rc; - DEBUGP(DGGSN, "Received create PDP context request\n"); + osmo_apn_to_str(name_buf, pdp->apn_req.v, pdp->apn_req.l); + + LOGPPDP(LOGL_DEBUG, pdp, "Processing create PDP context request for APN '%s'\n", name_buf); + + /* First find an exact APN name match */ + apn = ggsn_find_apn(ggsn, name_buf); + /* then try default (if any) */ + if (!apn) + apn = ggsn->cfg.default_apn; + if (!apn) { + /* no APN found for what user requested */ + LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_MISSING_APN); + return 0; + } /* FIXME: we manually force all context requests to dynamic here! */ if (pdp->eua.l > 2) @@ -290,21 +459,30 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + LOGPPDP(LOGL_ERROR, pdp, "Cannot decode EUA from MS/SGSN: %s\n", osmo_hexdump(pdp->eua.v, pdp->eua.l)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); return 0; } - rc = ippool_newip(ippool, &member, &addr, 0); - if (rc < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); - gtp_create_context_resp(gsn, pdp, -rc); - return 0; /* Allready in use, or no more available */ - } + if (addr.len == sizeof(struct in_addr)) { + rc = ippool_newip(apn->v4.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + in46a_to_eua(&member->addr, &pdp->eua); - if (addr.len == sizeof(struct in6_addr)) { + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ + if (gtp_kernel_tunnel_add(pdp) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; + } + } else if (addr.len == sizeof(struct in6_addr)) { struct in46_addr tmp; + rc = ippool_newip(apn->v6.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + /* IPv6 doesn't really send the real/allocated address at this point, but just * the link-identifier which the MS shall use for router solicitation */ tmp.len = addr.len; @@ -314,43 +492,46 @@ memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); in46a_to_eua(&tmp, &pdp->eua); } else - in46a_to_eua(&member->addr, &pdp->eua); - pdp->peer = member; - pdp->ipif = tun; /* TODO */ - member->peer = pdp; + OSMO_ASSERT(0); - /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ - if (gtp_kernel_tunnel_add(pdp) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot add tunnel to kernel: %s\n", strerror(errno)); - gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); - return 0; - } + pdp->peer = member; + pdp->ipif = apn->tun.tun; /* TODO */ + member->peer = pdp; if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } - process_pco(pdp); + process_pco(apn, pdp); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ + +err_pool_full: + LOGPPDP(LOGL_ERROR, pdp, "Cannot allocate IP address from pool (full!)\n"); + gtp_create_context_resp(gsn, pdp, -rc); + return 0; /* Already in use, or no more available */ } -/* Callback for receiving messages from tun */ -int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) +/* Internet-originated IP packet, needs to be sent via GTP towards MS */ +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { + struct apn_ctx *apn = tun->priv; struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + struct ippool_t *pool; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + pool = apn->v4.pool; } else if (iph->version == 6) { /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct @@ -358,20 +539,25 @@ * prefix, i.e. the first 8 bytes of the address */ dst.len = 8; dst.v6 = ip6h->ip6_dst; + pool = apn->v6.pool; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); + LOGP(DTUN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } - DEBUGP(DGGSN, "Received packet from tun!\n"); + /* IPv6 packet but no IPv6 pool, or IPv4 packet with no IPv4 pool */ + if (!pool) + return 0; - if (ippool_getip(ippool, &ipm, &dst)) { - DEBUGP(DGGSN, "Received packet with no destination!!!\n"); + DEBUGP(DTUN, "Received packet from tun!\n"); + + if (ippool_getip(pool, &ipm, &dst)) { + DEBUGP(DTUN, "Received packet with no PDP contex!!\n"); return 0; } if (ipm->peer) /* Check if a peer protocol is defined */ - gtp_data_req(gsn, (struct pdp_t *)ipm->peer, pack, len); + gtp_data_req(apn->ggsn->gsn, (struct pdp_t *)ipm->peer, pack, len); return 0; } @@ -380,435 +566,303 @@ .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } }; -int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) +/* MS-originated GTP1-U packet, needs to be sent via TUN device */ +static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + LOGPPDP(LOGL_DEBUG, pdp, "Packet received: forwarding to tun\n"); switch (iph->version) { case 6: /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(gsn, pdp, pack, len); + return handle_router_mcast(pdp->gsn, pdp, pack, len); break; case 4: break; default: - LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", + osmo_hexdump(pack, len)); return -1; } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } +static char *config_file = "openggsn.cfg"; + +/* callback for tun device osmocom select loop integration */ +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct apn_ctx *apn = fd->data; + + OSMO_ASSERT(what & BSC_FD_READ); + + return tun_decaps(apn->tun.tun); +} + +/* callback for libgtp osmocom select loop integration */ +static int ggsn_gtp_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct ggsn_ctx *ggsn = fd->data; + int rc; + + OSMO_ASSERT(what & BSC_FD_READ); + + switch (fd->priv_nr) { + case 0: + rc = gtp_decaps0(ggsn->gsn); + break; + case 1: + rc = gtp_decaps1c(ggsn->gsn); + break; + case 2: + rc = gtp_decaps1u(ggsn->gsn); + break; + default: + OSMO_ASSERT(0); + break; + } + return rc; +} + +static void ggsn_gtp_tmr_start(struct ggsn_ctx *ggsn) +{ + struct timeval next; + + /* Retrieve next retransmission as timeval */ + gtp_retranstimeout(ggsn->gsn, &next); + + /* re-schedule the timer */ + osmo_timer_schedule(&ggsn->gtp_timer, next.tv_sec, next.tv_usec/1000); +} + +/* timer callback for libgtp retransmission and ping */ +static void ggsn_gtp_tmr_cb(void *data) +{ + struct ggsn_ctx *ggsn = data; + + /* do all the retransmissions as needed */ + gtp_retrans(ggsn->gsn); + + ggsn_gtp_tmr_start(ggsn); +} + +/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ +static void signal_handler(int s) +{ + LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); + switch (s) { + case SIGINT: + LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); + end = 1; + break; + case SIGABRT: + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_ggsn_ctx, stderr); + break; + case SIGUSR2: + talloc_report_full(tall_vty_ctx, stderr); + break; + default: + break; + } +} + + +/* Start a given GGSN */ +int ggsn_start(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + int rc; + + if (ggsn->started) + return 0; + + LOGPGGSN(LOGL_INFO, ggsn, "Starting GGSN\n"); + + /* Start libgtp listener */ + if (gtp_new(&ggsn->gsn, ggsn->cfg.state_dir, &ggsn->cfg.listen_addr.v4, GTP_MODE_GGSN)) { + LOGPGGSN(LOGL_ERROR, ggsn, "Failed to create GTP: %s\n", strerror(errno)); + return -1; + } + ggsn->gsn->priv = ggsn; + + /* Register File Descriptors */ + osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); + rc = osmo_fd_register(&ggsn->gtp_fd0); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1c, ggsn->gsn->fd1c, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 1); + rc = osmo_fd_register(&ggsn->gtp_fd1c); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1u, ggsn->gsn->fd1u, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 2); + rc = osmo_fd_register(&ggsn->gtp_fd1u); + OSMO_ASSERT(rc == 0); + + /* Start GTP re-transmission timer */ + osmo_timer_setup(&ggsn->gtp_timer, ggsn_gtp_tmr_cb, ggsn); + + gtp_set_cb_data_ind(ggsn->gsn, encaps_tun); + gtp_set_cb_delete_context(ggsn->gsn, delete_context); + gtp_set_cb_create_context_ind(ggsn->gsn, create_context_ind); + + LOGPGGSN(LOGL_NOTICE, ggsn, "Successfully started\n"); + ggsn->started = true; + + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_start(apn); + + return 0; +} + +/* Stop a given GGSN */ +int ggsn_stop(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + + if (!ggsn->started) + return 0; + + /* iterate over all APNs and stop them */ + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_stop(apn, true); + + osmo_timer_del(&ggsn->gtp_timer); + + osmo_fd_unregister(&ggsn->gtp_fd1u); + osmo_fd_unregister(&ggsn->gtp_fd1c); + osmo_fd_unregister(&ggsn->gtp_fd0); + + if (ggsn->gsn) { + gtp_free(ggsn->gsn); + ggsn->gsn = NULL; + } + + ggsn->started = false; + return 0; +} + +static void print_usage() +{ + printf("Usage: osmo-ggsn [-h] [-D] [-c configfile] [-V]\n"); +} + +static void print_help() +{ + printf( " Some useful help...\n" + " -h --help This help text\n" + " -D --daemonize Fork the process into a background daemon\n" + " -c --config-file filename The config file to use\n" + " -V --version Print the version of OsmoGGSN\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' }, + { "daemonize", 0, 0, 'D' }, + { "config-file", 1, 0, 'c' }, + { "version", 0, 0, 'V' }, + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "hdc:V", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_usage(); + print_help(); + exit(0); + case 'D': + daemonize = 1; + break; + case 'c': + config_file = optarg; + break; + case 'V': + print_version(1); + exit(0); + break; + } + } +} + int main(int argc, char **argv) { - /* gengeopt declarations */ - struct gengetopt_args_info args_info; - - struct hostent *host; + struct ggsn_ctx *ggsn; + int rc; /* Handle keyboard interrupt SIGINT */ - struct sigaction s; - s.sa_handler = (void *)signal_handler; - if ((0 != sigemptyset(&s.sa_mask)) && debug) - printf("sigemptyset failed.\n"); - s.sa_flags = SA_RESETHAND; - if ((sigaction(SIGINT, &s, NULL) != 0) && debug) - printf("Could not register SIGINT signal handler.\n"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + msgb_talloc_ctx_init(tall_ggsn_ctx, 0); - fd_set fds; /* For select() */ - struct timeval idleTime; /* How long to select() */ + signal(SIGINT, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); - int timelimit; /* Number of seconds to be connected */ - int starttime; /* Time program was started */ - + osmo_init_ignore_signals(); osmo_init_logging(&log_info); + osmo_stats_init(tall_ggsn_ctx); - if (cmdline_parser(argc, argv, &args_info) != 0) - exit(1); - if (args_info.debug_flag) { - printf("listen: %s\n", args_info.listen_arg); - if (args_info.conf_arg) - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp_linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); + vty_init(&g_vty_info); + logging_vty_add_cmds(NULL); + osmo_stats_vty_add_cmds(&log_info); + ggsn_vty_init(); + ctrl_vty_init(tall_ggsn_ctx); + + handle_options(argc, argv); + + rate_ctr_init(tall_ggsn_ctx); + + rc = vty_read_config_file(config_file, NULL); + if (rc < 0) { + fprintf(stderr, "Failed to open config file: '%s'\n", config_file); + exit(2); } - /* Try out our new parser */ - - if (cmdline_parser_configfile(args_info.conf_arg, &args_info, 0, 0, 0) - != 0) + rc = telnet_init_dynif(tall_ggsn_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_GGSN); + if (rc < 0) exit(1); - /* Open a log file */ - if (args_info.logfile_arg) { - struct log_target *tgt; - int lvl; - - tgt = log_target_find(LOG_TGT_TYPE_FILE, args_info.logfile_arg); - if (!tgt) { - tgt = log_target_create_file(args_info.logfile_arg); - if (!tgt) { - LOGP(DGGSN, LOGL_ERROR, - "Failed to create logfile: %s\n", - args_info.logfile_arg); - exit(1); - } - log_add_target(tgt); - } - log_set_all_filter(tgt, 1); - log_set_use_color(tgt, 0); - - if (args_info.loglevel_arg) { - lvl = log_parse_level(args_info.loglevel_arg); - log_set_log_level(tgt, lvl); - LOGP(DGGSN, LOGL_NOTICE, - "Set file log level to %s\n", - log_level_str(lvl)); - } - } - - if (args_info.debug_flag) { - printf("cmdline_parser_configfile\n"); - printf("listen: %s\n", args_info.listen_arg); - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp-linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); - } - - /* Handle each option */ - - /* debug */ - debug = args_info.debug_flag; - - /* listen */ - /* Do hostname lookup to translate hostname to IP address */ - /* Any port listening is not possible as a valid address is */ - /* required for create_pdp_context_response messages */ - if (args_info.listen_arg) { - if (!(host = gethostbyname(args_info.listen_arg))) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid listening address: %s!", - args_info.listen_arg); - exit(1); - } else { - memcpy(&listen_.s_addr, host->h_addr, host->h_length); - } - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Listening address must be specified! " - "Please use command line option --listen or " - "edit %s configuration file\n", args_info.conf_arg); + g_ctrlh = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); + if (!g_ctrlh) { + LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); exit(1); } - /* net */ - /* Store net as in_addr net and mask */ - if (args_info.net_arg) { - if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid network address: %s!", - args_info.net_arg); - exit(1); - } - /* default for network + destination address = net + 1 */ - netaddr = net; - in46a_inc(&netaddr); - destaddr = netaddr; - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Network address must be specified: %s!", - args_info.net_arg); - exit(1); - } - - /* dynip */ - struct in46_prefix i46p; - size_t prefixlen; - if (!args_info.dynip_arg) { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } else { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } - i46p.prefixlen = prefixlen; - if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); - exit(1); - } - - /* DNS1 and DNS2 */ - memset(&dns1, 0, sizeof(dns1)); - if (args_info.pcodns1_arg) { - size_t tmp; - if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - memset(&dns2, 0, sizeof(dns2)); - if (args_info.pcodns2_arg) { - size_t tmp; - if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); + if (daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); exit(1); } } - unsigned int cur = 0; - pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[cur++] = 0x80; /* IPCP */ - pco.v[cur++] = 0x21; - pco.v[cur++] = 0xFF; /* Length of contents */ - pco.v[cur++] = 0x02; /* ACK */ - pco.v[cur++] = 0x00; /* ID: Need to match request */ - pco.v[cur++] = 0x00; /* Length */ - pco.v[cur++] = 0xFF; /* overwritten */ - if (dns1.len == 4) { - pco.v[cur++] = 0x81; /* DNS 1 */ - pco.v[cur++] = 2 + dns1.len; - if (dns1.len == 4) - memcpy(&pco.v[cur], &dns1.v4, dns1.len); - else - memcpy(&pco.v[cur], &dns1.v6, dns1.len); - cur += dns1.len; - } - if (dns2.len == 4) { - pco.v[cur++] = 0x83; - pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ - if (dns2.len == 4) - memcpy(&pco.v[cur], &dns2.v4, dns2.len); - else - memcpy(&pco.v[cur], &dns2.v6, dns2.len); - cur += dns2.len; - } - pco.l = cur; - /* patch in length values */ - pco.v[3] = pco.l - 4; - pco.v[7] = pco.l - 4; - - /* ipup */ - ipup = args_info.ipup_arg; - - /* ipdown */ - ipdown = args_info.ipdown_arg; - - /* Timelimit */ - timelimit = args_info.timelimit_arg; - starttime = time(NULL); - +#if 0 /* qos */ qos.l = 3; qos.v[2] = (args_info.qos_arg) & 0xff; qos.v[1] = ((args_info.qos_arg) >> 8) & 0xff; qos.v[0] = ((args_info.qos_arg) >> 16) & 0xff; +#endif - /* apn */ - if (strlen(args_info.apn_arg) > (sizeof(apn.v) - 1)) { - LOGP(DGGSN, LOGL_ERROR, "Invalid APN\n"); - return -1; - } - apn.l = strlen(args_info.apn_arg) + 1; - apn.v[0] = (char)strlen(args_info.apn_arg); - strncpy((char *)&apn.v[1], args_info.apn_arg, sizeof(apn.v) - 1); - - /* foreground */ - /* If flag not given run as a daemon */ - if (!args_info.fg_flag) { - FILE *f; - int rc; - /* Close the standard file descriptors. */ - /* Is this really needed ? */ - f = freopen("/dev/null", "w", stdout); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdout to /dev/null"); - } - f = freopen("/dev/null", "w", stderr); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stderr to /dev/null"); - } - f = freopen("/dev/null", "r", stdin); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdin to /dev/null"); - } - rc = daemon(0, 0); - if (rc != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, rc, - "Could not daemonize"); - exit(1); - } + /* Main select loop */ + while (!end) { + osmo_select_main(0); } - /* pidfile */ - /* This has to be done after we have our final pid */ - if (args_info.pidfile_arg) { - log_pid(args_info.pidfile_arg); - } - - DEBUGP(DGGSN, "gtpclient: Initialising GTP tunnel\n"); - - if (gtp_new(&gsn, args_info.statedir_arg, &listen_, GTP_MODE_GGSN)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create gtp"); - exit(1); - } - if (gsn->fd0 > maxfd) - maxfd = gsn->fd0; - if (gsn->fd1c > maxfd) - maxfd = gsn->fd1c; - if (gsn->fd1u > maxfd) - maxfd = gsn->fd1u; - - /* use GTP kernel module for data packet encapsulation */ - if (args_info.gtp_linux_given) { - if (gtp_kernel_init(gsn, &net.v4, prefixlen, args_info.net_arg) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to initialize kernel GTP\n"); - goto err; - } - } - - gtp_set_cb_data_ind(gsn, encaps_tun); - gtp_set_cb_delete_context(gsn, delete_context); - gtp_set_cb_create_context_ind(gsn, create_context_ind); - - gsn->ctrl = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); - if (!gsn->ctrl) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); - exit(1); - } - - /* skip the configuration of the tun0 if we're using the gtp0 device */ - if (gtp_kernel_enabled()) - goto skip_tun; - - /* Create a tunnel interface */ - DEBUGP(DGGSN, "Creating tun interface\n"); - if (tun_new((struct tun_t **)&tun)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create tun"); - exit(1); - } - - DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); - exit(1); - } - - tun_set_cb_ind(tun, cb_tun_ind); - if (tun->fd > maxfd) - maxfd = tun->fd; - - if (ipup) - tun_runscript(tun, ipup); - -skip_tun: - - /******************************************************************/ - /* Main select loop */ - /******************************************************************/ - - while ((((starttime + timelimit) > time(NULL)) || (0 == timelimit)) - && (!end)) { - - FD_ZERO(&fds); - if (tun) - FD_SET(tun->fd, &fds); - FD_SET(gsn->fd0, &fds); - FD_SET(gsn->fd1c, &fds); - FD_SET(gsn->fd1u, &fds); - - gtp_retranstimeout(gsn, &idleTime); - switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) { - case -1: /* errno == EINTR : unblocked signal */ - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "select() returned -1"); - /* On error, select returns without modifying fds */ - FD_ZERO(&fds); - break; - case 0: - /* printf("Select returned 0\n"); */ - gtp_retrans(gsn); /* Only retransmit if nothing else */ - break; - default: - break; - } - - if (tun && tun->fd != -1 && FD_ISSET(tun->fd, &fds) && - tun_decaps(tun) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "TUN read failed (fd)=(%d)", tun->fd); - } - - if (FD_ISSET(gsn->fd0, &fds)) - gtp_decaps0(gsn); - - if (FD_ISSET(gsn->fd1c, &fds)) - gtp_decaps1c(gsn); - - if (FD_ISSET(gsn->fd1u, &fds)) - gtp_decaps1u(gsn); - - osmo_select_main(1); - } -err: - gtp_kernel_stop(); - cmdline_parser_free(&args_info); - ippool_free(ippool); - gtp_free(gsn); - if (tun) - tun_free(tun); + llist_for_each_entry(ggsn, &g_ggsn_list, list) + ggsn_stop(ggsn); return 1; - } diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h new file mode 100644 index 0000000..bab6cf7 --- /dev/null +++ b/ggsn/ggsn.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "../lib/tun.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "../lib/in46_addr.h" +#include "../gtp/gtp.h" + +#define APN_TYPE_IPv4 0x01 /* v4-only */ +#define APN_TYPE_IPv6 0x02 /* v6-only */ +#define APN_TYPE_IPv4v6 0x04 /* v4v6 dual-stack */ + +struct ggsn_ctx; + +struct apn_ctx_ip { + struct { + struct in46_prefix ifconfig_prefix; + struct in46_prefix static_prefix; + struct in46_prefix dynamic_prefix; + /* v4 DNS server names */ + struct in46_addr dns[2]; + } cfg; + + /* v4 address pool */ + struct ippool_t *pool; +}; + +struct apn_name { + struct llist_head list; + char *name; +}; + +enum apn_gtpu_mode { + APN_GTPU_MODE_TUN = 0, /* default */ + APN_GTPU_MODE_KERNEL_GTP, +}; + +struct apn_ctx { + /* list of APNs inside GGSN */ + struct llist_head list; + /* back-pointer to GGSN */ + struct ggsn_ctx *ggsn; + + bool started; + + struct { + /* Primary name */ + char *name; + /* Description string */ + char *description; + /* List of secondary APN names */ + struct llist_head name_list; + /* types supported address types on this APN */ + uint32_t apn_type_mask; + /* GTP-U via TUN device or in Linux kernel */ + enum apn_gtpu_mode gtpu_mode; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* corresponding tun device */ + struct { + struct { + /* name of the network device */ + char *dev_name; + /* ip-up and ip-down script names/paths */ + char *ipup_script; + char *ipdown_script; + } cfg; + struct tun_t *tun; + struct osmo_fd fd; + } tun; + + struct apn_ctx_ip v4; + struct apn_ctx_ip v6; +}; + +struct ggsn_ctx { + /* global list of GGSNs */ + struct llist_head list; + + /* list of APNs in this GGSN */ + struct llist_head apn_list; + + bool started; + + struct { + char *name; + /* Description string */ + char *description; + /* an APN that shall be used as default for any non-matching APN */ + struct apn_ctx *default_apn; + /* ADdress to which we listen for GTP */ + struct in46_addr listen_addr; + /* directory for state file */ + char *state_dir; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* The libgtp (G)GSN instance, i.e. what listens to GTP */ + struct gsn_t *gsn; + + /* osmo-fd for gsn */ + struct osmo_fd gtp_fd0; + struct osmo_fd gtp_fd1c; + struct osmo_fd gtp_fd1u; + + struct osmo_timer_list gtp_timer; +}; + +/* ggsn_vty.c */ +extern struct llist_head g_ggsn_list; +extern struct vty_app_info g_vty_info; +extern int ggsn_vty_init(void); +struct ggsn_ctx *ggsn_find(const char *name); +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name); +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name); +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name); + +/* ggsn.c */ +extern void *tall_ggsn_ctx; +extern int ggsn_start(struct ggsn_ctx *ggsn); +extern int ggsn_stop(struct ggsn_ctx *ggsn); +extern int apn_start(struct apn_ctx *apn); +extern int apn_stop(struct apn_ctx *apn, bool force); diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c new file mode 100644 index 0000000..f23a298 --- /dev/null +++ b/ggsn/ggsn_vty.c @@ -0,0 +1,890 @@ +/* + * (C) 2017 by Harald Welte + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +#include "ggsn.h" + +#define PREFIX_STR "Prefix (Network/Netmask)\n" +#define IFCONFIG_STR "GGSN-based interface configuration\n" +#define GGSN_STR "Gateway GPRS Support NODE (GGSN)\n" + +LLIST_HEAD(g_ggsn_list); + +enum ggsn_vty_node { + GGSN_NODE = _LAST_OSMOVTY_NODE + 1, + APN_NODE, +}; + +struct ggsn_ctx *ggsn_find(const char *name) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + if (!strcmp(ggsn->cfg.name, name)) + return ggsn; + } + return NULL; +} + +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name) +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(name); + if (ggsn) + return ggsn; + + ggsn = talloc_zero(ctx, struct ggsn_ctx); + if (!ggsn) + return NULL; + + ggsn->cfg.name = talloc_strdup(ggsn, name); + ggsn->cfg.state_dir = talloc_strdup(ggsn, "/tmp"); + ggsn->cfg.shutdown = true; + INIT_LLIST_HEAD(&ggsn->apn_list); + + llist_add_tail(&ggsn->list, &g_ggsn_list); + return ggsn; +} + +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn; + + llist_for_each_entry(apn, &ggsn->apn_list, list) { + if (!strcmp(apn->cfg.name, name)) + return apn; + } + return NULL; +} + +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn = ggsn_find_apn(ggsn, name); + if (apn) + return apn; + + apn = talloc_zero(ggsn, struct apn_ctx); + if (!apn) + return NULL; + apn->ggsn = ggsn; + apn->cfg.name = talloc_strdup(apn, name); + apn->cfg.shutdown = true; + INIT_LLIST_HEAD(&apn->cfg.name_list); + + llist_add_tail(&apn->list, &ggsn->apn_list); + return apn; +} + +/* GGSN Node */ + +static struct cmd_node ggsn_node = { + GGSN_NODE, + "%s(config-ggsn)# ", + 1, +}; + +DEFUN(cfg_ggsn, cfg_ggsn_cmd, + "ggsn NAME", + "Configure the Gateway GPRS Support Node\n" "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find_or_create(tall_ggsn_ctx, argv[0]); + if (!ggsn) + return CMD_WARNING; + + vty->node = GGSN_NODE; + vty->index = ggsn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ggsn, cfg_no_ggsn_cmd, + "no ggsn NAME", + NO_STR "Remove the named Gateway GPRS Support Node\n" + "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!ggsn->cfg.shutdown) { + vty_out(vty, "%% GGSN %s is still active, please shutdown first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!llist_empty(&ggsn->apn_list)) { + vty_out(vty, "%% GGSN %s still has APNs configured, please remove first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&ggsn->list); + talloc_free(ggsn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, + "gtp local-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address for the local GTP bind\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_state_dir, cfg_ggsn_state_dir_cmd, + "gtp state-dir PATH", + "GTP Parameters\n" + "Set the directory for the GTP State file\n" + "Local Directory\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + osmo_talloc_replace_string(ggsn, &ggsn->cfg.state_dir, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_apn, cfg_ggsn_apn_cmd, + "apn NAME", "APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_or_create_apn(ggsn, argv[0]); + if (!apn) + return CMD_WARNING; + + vty->node = APN_NODE; + vty->index = apn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_apn, cfg_ggsn_no_apn_cmd, + "no apn NAME", + NO_STR "Remove APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!apn->cfg.shutdown) { + vty_out(vty, "%% APN %s still active, please shutdown first%s", + apn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&apn->list); + talloc_free(apn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_default_apn, cfg_ggsn_default_apn_cmd, + "default-apn NAME", + "Set a default-APN to be used if no other APN matches\n" + "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No APN of name '%s' found%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + ggsn->cfg.default_apn = apn; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_default_apn, cfg_ggsn_no_default_apn_cmd, + "no default-apn", + NO_STR "Remove default-APN to be used if no other APN matches\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + ggsn->cfg.default_apn = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_shutdown, cfg_ggsn_shutdown_cmd, + "shutdown ggsn", + "Put the GGSN in administrative shut-down\n" GGSN_STR) +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (!ggsn->cfg.shutdown) { + if (ggsn_stop(ggsn)) { + vty_out(vty, "%% Failed to shutdown GGSN%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_shutdown, cfg_ggsn_no_shutdown_cmd, + "no shutdown ggsn", + NO_STR GGSN_STR "Remove the GGSN from administrative shut-down\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (ggsn->cfg.shutdown) { + if (ggsn_start(ggsn) < 0) { + vty_out(vty, "%% Failed to start GGSN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + +/* APN Node */ + +static struct cmd_node apn_node = { + APN_NODE, + "%s(config-ggsn-apn)# ", + 1, +}; + +static const struct value_string pdp_type_names[] = { + { APN_TYPE_IPv4, "v4" }, + { APN_TYPE_IPv6, "v6" }, + { APN_TYPE_IPv4v6, "v4v6" }, + { 0, NULL } +}; + +static const struct value_string apn_gtpu_mode_names[] = { + { APN_GTPU_MODE_TUN, "tun" }, + { APN_GTPU_MODE_KERNEL_GTP, "kernel-gtp" }, + { 0, NULL } +}; + + +#define V4V6V46_STRING "IPv4(-only) PDP Type\n" \ + "IPv6(-only) PDP Type\n" \ + "IPv4v6 (dual-stack) PDP Type\n" + +DEFUN(cfg_apn_type_support, cfg_apn_type_support_cmd, + "type-support (v4|v6|v4v6)", + "Enable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask |= type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_type_support, cfg_apn_no_type_support_cmd, + "no type-support (v4|v6|v4v6)", + NO_STR "Disable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask &= ~type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_gtpu_mode, cfg_apn_gtpu_mode_cmd, + "gtpu-mode (tun|kernel-gtp)", + "Set the Mode for this APN (tun or Linux Kernel GTP)\n" + "GTP-U in userspace using TUN device\n" + "GTP-U in kernel using Linux Kernel GTP\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + apn->cfg.gtpu_mode = get_string_value(apn_gtpu_mode_names, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_tun_dev_name, cfg_apn_tun_dev_name_cmd, + "tun-device NAME", + "Configure tun device name\n" + "TUN device name") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.dev_name, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipup_script, cfg_apn_ipup_script_cmd, + "ipup-script PATH", + "Configure name/path of ip-up script\n" + "File/Path name of ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipup_script, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipup_script, cfg_apn_no_ipup_script_cmd, + "no ipup-script", + NO_STR "Disable ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipup_script); + apn->tun.cfg.ipup_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipdown_script, cfg_apn_ipdown_script_cmd, + "ipdown-script PATH", + "Configure name/path of ip-down script\n" + "File/Path name of ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipdown_script, argv[0]); + return CMD_SUCCESS; +} + +/* convert prefix from "A.B.C.D/M" notation to in46_prefix */ +static void str2prefix(struct in46_prefix *pfx, const char *in) +{ + size_t t; + + ippool_aton(&pfx->addr, &t, in, 0); + pfx->prefixlen = t; +} + +DEFUN(cfg_apn_no_ipdown_script, cfg_apn_no_ipdown_script_cmd, + "no ipdown-script", + NO_STR "Disable ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipdown_script); + apn->tun.cfg.ipdown_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_prefix, cfg_apn_ip_prefix_cmd, + "ip prefix (static|dynamic) A.B.C.D/M", + IP_STR PREFIX_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + /* first update our parsed prefix */ + if (!strcmp(argv[0], "static")) + pfx = &apn->v4.cfg.static_prefix; + else + pfx = &apn->v4.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_ifconfig, cfg_apn_ip_ifconfig_cmd, + "ip ifconfig A.B.C.D/M", + IP_STR IFCONFIG_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v4.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ip_ifconfig, cfg_apn_no_ip_ifconfig_cmd, + "no ip ifconfig", + NO_STR IP_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v4.cfg.ifconfig_prefix, 0, sizeof(apn->v4.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_prefix, cfg_apn_ipv6_prefix_cmd, + "ipv6 prefix (static|dynamic) X:X::X:X/M", + IP6_STR PREFIX_STR "IPv6 Address/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + if (!strcmp(argv[0], "static")) + pfx = &apn->v6.cfg.static_prefix; + else + pfx = &apn->v6.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_ifconfig, cfg_apn_ipv6_ifconfig_cmd, + "ipv6 ifconfig X:X::X:X/M", + IP6_STR IFCONFIG_STR "IPv6 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v6.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipv6_ifconfig, cfg_apn_no_ipv6_ifconfig_cmd, + "no ipv6 ifconfig", + NO_STR IP6_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v6.cfg.ifconfig_prefix, 0, sizeof(apn->v6.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +#define DNS_STRINGS "Configure DNS Server\n" "primary/secondary DNS\n" "IP address of DNS Sever\n" + +DEFUN(cfg_apn_ip_dns, cfg_apn_ip_dns_cmd, + "ip dns <0-1> A.B.C.D", + IP_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v4.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_dns, cfg_apn_ipv6_dns_cmd, + "ipv6 dns <0-1> X:X::X:X", + IP6_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v6.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_dns, cfg_apn_no_dns_cmd, + "no (ip|ipv6) dns <0-1>", + NO_STR IP_STR IP6_STR "Disable DNS Server\n" "primary/secondary DNS\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_addr *a; + int idx = atoi(argv[1]); + + if (!strcmp(argv[0], "ip")) + a = &apn->v4.cfg.dns[idx]; + else + a = &apn->v6.cfg.dns[idx]; + + memset(a, 0, sizeof(*a)); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, + "shutdown", + "Put the APN in administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (!apn->cfg.shutdown) { + if (apn_stop(apn, false)) { + vty_out(vty, "%% Failed to Stop APN%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_shutdown, cfg_apn_no_shutdown_cmd, + "no shutdown", + NO_STR "Remove the APN from administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (apn->cfg.shutdown) { + if (apn_start(apn) < 0) { + vty_out(vty, "%% Failed to start APN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + + +static void vty_dump_prefix(struct vty *vty, const char *pre, const struct in46_prefix *pfx) +{ + vty_out(vty, "%s %s%s", pre, in46p_ntoa(pfx), VTY_NEWLINE); +} + +static void config_write_apn(struct vty *vty, struct apn_ctx *apn) +{ + unsigned int i; + + vty_out(vty, " apn %s%s", apn->cfg.name, VTY_NEWLINE); + if (apn->cfg.description) + vty_out(vty, " description %s%s", apn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtpu-mode %s%s", get_value_string(apn_gtpu_mode_names, apn->cfg.gtpu_mode), + VTY_NEWLINE); + if (apn->tun.cfg.dev_name) + vty_out(vty, " tun-device %s%s", apn->tun.cfg.dev_name, VTY_NEWLINE); + if (apn->tun.cfg.ipup_script) + vty_out(vty, " ipup-script %s%s", apn->tun.cfg.ipup_script, VTY_NEWLINE); + if (apn->tun.cfg.ipdown_script) + vty_out(vty, " ipdown-script %s%s", apn->tun.cfg.ipdown_script, VTY_NEWLINE); + + for (i = 0; i < 32; i++) { + if (!(apn->cfg.apn_type_mask & (1 << i))) + continue; + vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), + VTY_NEWLINE); + } + + /* IPv4 prefixes + DNS */ + if (apn->v4.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix static", &apn->v4.cfg.static_prefix); + if (apn->v4.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix dynamic", &apn->v4.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + if (!apn->v4.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v4.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v4.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ip ifconfig ", &apn->v4.cfg.ifconfig_prefix); + + /* IPv6 prefixes + DNS */ + if (apn->v6.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix static", &apn->v6.cfg.static_prefix); + if (apn->v6.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix dynamic", &apn->v6.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + if (!apn->v6.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v6.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); + + /* must be last */ + vty_out(vty, " %sshutdown%s", apn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); +} + +static int config_write_ggsn(struct vty *vty) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + struct apn_ctx *apn; + vty_out(vty, "ggsn %s%s", ggsn->cfg.name, VTY_NEWLINE); + if (ggsn->cfg.description) + vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); + vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + llist_for_each_entry(apn, &ggsn->apn_list, list) + config_write_apn(vty, apn); + if (ggsn->cfg.default_apn) + vty_out(vty, " default-apn %s%s", ggsn->cfg.default_apn->cfg.name, VTY_NEWLINE); + /* must be last */ + vty_out(vty, " %sshutdown ggsn%s", ggsn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); + } + + return 0; +} + +static const char *print_gsnaddr(const struct ul16_t *in) +{ + struct in46_addr in46; + + in46.len = in->l; + OSMO_ASSERT(in->l <= sizeof(in46.v6)); + memcpy(&in46.v6, in->v, in->l); + + return in46a_ntoa(&in46); +} + +static void show_one_pdp(struct vty *vty, struct pdp_t *pdp) +{ + struct in46_addr eua46; + + vty_out(vty, "IMSI: %s, NSAPI: %u, MSISDN: %s%s", imsi_gtp2str(&pdp->imsi), pdp->nsapi, + osmo_hexdump_nospc(pdp->msisdn.v, pdp->msisdn.l), VTY_NEWLINE); + + vty_out(vty, " Control: %s:%08x ", print_gsnaddr(&pdp->gsnlc), pdp->teic_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnrc), pdp->teic_gn, VTY_NEWLINE); + + vty_out(vty, " Data: %s:%08x ", print_gsnaddr(&pdp->gsnlu), pdp->teid_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnru), pdp->teid_gn, VTY_NEWLINE); + + in46a_from_eua(&pdp->eua, &eua46); + vty_out(vty, " End-User Address: %s%s", in46a_ntoa(&eua46), VTY_NEWLINE); +} + +DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, + "show pdp-context imsi IMSI [<0-15>]", + SHOW_STR "Display information on PDP Context\n" + "PDP contexts for given IMSI\n" + "PDP context for given NSAPI\n") +{ + uint64_t imsi = strtoull(argv[0], NULL, 10); + unsigned int nsapi; + struct pdp_t *pdp; + int num_found = 0; + + if (argc > 1) { + nsapi = atoi(argv[1]); + if (pdp_getimsi(&pdp, imsi, nsapi)) { + show_one_pdp(vty, pdp); + num_found++; + } + } else { + for (nsapi = 0; nsapi < PDP_MAXNSAPI; nsapi++) { + if (pdp_getimsi(&pdp, imsi, nsapi)) + continue; + show_one_pdp(vty, pdp); + num_found++; + } + } + if (num_found == 0) { + vty_out(vty, "%% No such PDP context found%s", VTY_NEWLINE); + return CMD_WARNING; + } else + return CMD_SUCCESS; +} + +/* show all (active) PDP contexts within a pool */ +static void ippool_show_pdp_contexts(struct vty *vty, struct ippool_t *pool) +{ + unsigned int i; + + if (!pool) + return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + if (member->inuse == 0) + continue; + show_one_pdp(vty, member->peer); + } +} + +/* show all (active) PDP contexts within an APN */ +static void apn_show_pdp_contexts(struct vty *vty, struct apn_ctx *apn) +{ + ippool_show_pdp_contexts(vty, apn->v4.pool); + ippool_show_pdp_contexts(vty, apn->v6.pool); +} + +DEFUN(show_pdpctx, show_pdpctx_cmd, + "show pdp-context ggsn NAME [apn APN]", + SHOW_STR "Show PDP Context Information\n" + GGSN_STR "GGSN Name\n") // FIXME +{ + struct ggsn_ctx *ggsn; + struct apn_ctx *apn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (argc < 2) { + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_show_pdp_contexts(vty, apn); + } else { + apn = ggsn_find_apn(ggsn, argv[1]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + apn_show_pdp_contexts(vty, apn); + } + + return CMD_SUCCESS; +} + +static void show_apn(struct vty *vty, struct apn_ctx *apn) +{ + vty_out(vty, " APN: %s%s", apn->cfg.name, VTY_NEWLINE); + /* FIXME */ +} + +static void show_one_ggsn(struct vty *vty, struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + vty_out(vty, "GGSN %s: Bound to %s%s", ggsn->cfg.name, in46a_ntoa(&ggsn->cfg.listen_addr), + VTY_NEWLINE); + /* FIXME */ + + llist_for_each_entry(apn, &ggsn->apn_list, list) + show_apn(vty, apn); +} + +DEFUN(show_ggsn, show_ggsn_cmd, + "show ggsn [NAME]", + SHOW_STR "Display information on the GGSN\n") +{ + struct ggsn_ctx *ggsn; + + if (argc == 0) { + llist_for_each_entry(ggsn, &g_ggsn_list, list) + show_one_ggsn(vty, ggsn); + } else { + ggsn = ggsn_find(argv[0]); + if (!ggsn) + return CMD_WARNING; + show_one_ggsn(vty, ggsn); + } + + return CMD_SUCCESS; +} + +int ggsn_vty_init(void) +{ + install_element_ve(&show_pdpctx_cmd); + install_element_ve(&show_pdpctx_imsi_cmd); + install_element_ve(&show_ggsn_cmd); + + install_element(CONFIG_NODE, &cfg_ggsn_cmd); + install_element(CONFIG_NODE, &cfg_no_ggsn_cmd); + install_node(&ggsn_node, config_write_ggsn); + vty_install_default(GGSN_NODE); + install_element(GGSN_NODE, &cfg_description_cmd); + install_element(GGSN_NODE, &cfg_no_description_cmd); + install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); + install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_default_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_default_apn_cmd); + + install_node(&apn_node, NULL); + vty_install_default(APN_NODE); + install_element(APN_NODE, &cfg_description_cmd); + install_element(APN_NODE, &cfg_no_description_cmd); + install_element(APN_NODE, &cfg_apn_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_no_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_gtpu_mode_cmd); + install_element(APN_NODE, &cfg_apn_type_support_cmd); + install_element(APN_NODE, &cfg_apn_no_type_support_cmd); + install_element(APN_NODE, &cfg_apn_tun_dev_name_cmd); + install_element(APN_NODE, &cfg_apn_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_ip_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ip_dns_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_dns_cmd); + install_element(APN_NODE, &cfg_apn_no_dns_cmd); + install_element(APN_NODE, &cfg_apn_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + + return 0; +} + +static int ggsn_vty_is_config_node(struct vty *vty, int node) +{ + switch (node) { + case GGSN_NODE: + case APN_NODE: + return 1; + default: + return 0; + } +} + +static int ggsn_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + case GGSN_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + vty->index_sub = NULL; + break; + case APN_NODE: + vty->node = GGSN_NODE; + { + struct apn_ctx *apn = vty->index; + vty->index = apn->ggsn; + vty->index_sub = &apn->ggsn->cfg.description; + } + break; + } + + return vty->node; +} + +static const char ggsn_copyright[] = + "Copyright (C) 2011-2017 Harald Welte \r\n" + "Copyright (C) 2012-2017 Holger Hans Peter Freyther \r\n" + "Copyright (C) 2012-2017 sysmocom - s.f.m.c. GmbH\r\n" + "Copyright (C) 2002-2005 Mondru AB\r\n" + "License GPLv2: GNU GPL version 2 \r\n" + "This is free software: you are free to change and redistribute it.\r\n" + "There is NO WARRANTY, to the extent permitted by law.\r\n"; + +struct vty_app_info g_vty_info = { + .name = "OpenGGSN", + .version = PACKAGE_VERSION, + .copyright = ggsn_copyright, + .go_parent_cb = ggsn_vty_go_parent, + .is_config_node = ggsn_vty_is_config_node, +}; diff --git a/lib/tun.c b/lib/tun.c index e8368e5..76ac379 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -583,7 +583,7 @@ return tun_route(this, dst, gateway, mask, 1); } -int tun_new(struct tun_t **tun) +int tun_new(struct tun_t **tun, const char *dev_name) { #if defined(__linux__) @@ -615,6 +615,8 @@ /* Set device flags. For some weird reason this is also the method used to obtain the network interface name */ memset(&ifr, 0, sizeof(ifr)); + if (dev_name) + strcpy(ifr.ifr_name, dev_name); ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); diff --git a/lib/tun.h b/lib/tun.h index 67ef39d..50ac806 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -65,7 +65,7 @@ void *priv; }; -extern int tun_new(struct tun_t **tun); +extern int tun_new(struct tun_t **tun, const char *dev_name); extern int tun_free(struct tun_t *tun); extern int tun_decaps(struct tun_t *this); extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1f0b3f9..ed1fb93 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1461,7 +1461,7 @@ if (options.createif) { printf("Setting up interface\n"); /* Create a tunnel interface */ - if (tun_new((struct tun_t **)&tun)) { + if (tun_new((struct tun_t **)&tun, NULL)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Failed to create tun"); exit(1); -- To view, visit https://gerrit.osmocom.org/3848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:50 +0000 Subject: [PATCH] openggsn[master]: Documentation update: Remove NEWS, README.Solaris, update RE... Message-ID: Review at https://gerrit.osmocom.org/3849 Documentation update: Remove NEWS, README.Solaris, update README.md * README.Solaris is obsolete and related code has been removed * NEWS file was unmaintained for more than a decade, remove it * Remove "Performance" chapter about 550MHz Athlon * gengetopt is no longer needed for ggsn * remove compilation/installation instructions horribly out of date * command line syntax of 'ggsn' program has changed Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db --- M Makefile.am D NEWS D README.Solaris M README.md 4 files changed, 3 insertions(+), 240 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/49/3849/1 diff --git a/Makefile.am b/Makefile.am index 970fbf7..00091ef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,4 +10,4 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris +EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX diff --git a/NEWS b/NEWS deleted file mode 100644 index b1352a5..0000000 --- a/NEWS +++ /dev/null @@ -1,78 +0,0 @@ -OPENGGSN NEWS -============= - -OpenGGSN - Gateway GPRS Support Node -Copyright (C) 2002, 2003, 2004 Mondru AB. - -Version 0.84 -============ - -* Initial MAC OSX support (Thanks to Pekka Nikander) -* Quality assurance and improved error logging (Thanks to Pekka - Nikander and Jonny Winberg) - -Version 0.83 -============ - -* Added selection mode and charging characteristics option to sgsnemu. -* Bug fixes on charging characteristics and PPP PCO length.(Thanks to - Loic Bernable ). -* Improved Solaris support, hash table bugfix and improved logging. - -Version 0.82 -============ - -* Improved Solaris support. -* Routing manipulation and IP address alias capability for FreeBSD. -* Initial Debian port (Thanks to ARAKI Yasuhiro ). - -Version 0.81 -============ - - * Initial FreeBSD port (Thanks to Pavel Andreev ). - * IMSI '1111' bugfix (Thanks to Pavel Andreev ). - -Version 0.8 -=========== - - * Support for compilation under Solaris. - * Iptables firewall script. - * New options for sgsnemu - - -Version 0.7 -=========== - - * Support for GTP1. Currently without support for the secondary pdp - context activation procedure. - * sgsnemu will first attempt to use GTP1. If that fails it will - fallback to using GTP0. - * Standards compliance document. - -Version 0.6 -=========== - - * Improved README file. - * Now uses ioctl instead of ifconfig and route in ggsn and sgsnemu. - * Absolute path to gtp library in ggsn/Makefile.am and ggsn/Makefile.am - * Compiles with gengetopt 2.8 (Thanks to Lorenzo Bettini ) - * sgsnemu is now able to handle several contexts and allocate - interface IP addresses for each context. - * ggsn now supports protocol configuration option DNS - addresses. This allow mobile stations to set up DNS based on - information configured in the ggsn. - * Ping facility in sgsnemu allow testing without the need to route - packets through the tun interface. - * Man pages for ggsn and sgsnemu. - * Sys 5 init script. - * Spec file for building binary RPM packages. - * If not --createif exit after "ping" or "echo" finishes - * If sgsnemu echo failure, exit with code != 0 - - -Version 0.5 -=========== - - * Initial release. See README file for installation and usage - instructions. - diff --git a/README.Solaris b/README.Solaris deleted file mode 100644 index 2ac6dbc..0000000 --- a/README.Solaris +++ /dev/null @@ -1,41 +0,0 @@ -OpenGGSN/Solaris notes -====================== - -Solaris support is experimental, please test and report bugs. The -Solaris port is tested under Solaris 8. - -Compiling ---------- - -You need to edit the following line in ggsn/Makefile.in and -sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -After this you install by the following commands: -./configure -make -make install - - -TUN ---- - -You might or might not need to install the tun driver manually. For -general information about tun see http://vtun.sourceforge.net/tun/ - - -Known problems --------------- - -Currently multiple IP addresses on the same network interface is not -implemented for Solaris. - -Currently routing table manipulation is not implemented for -Solaris. You have to set the routes manually after you start ggsn or -sgsnemu. - diff --git a/README.md b/README.md index 8e4ceae..829adcd 100644 --- a/README.md +++ b/README.md @@ -174,26 +174,6 @@ will fallback to GTPv0. -Performance -=========== - -Two experiments were performed in order to test the performance of -sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of -RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had -100 Mb/s NICs (RTL-8139) and were connected through a crossed patch -cable. Both tests were performed by sending ICMP echo packets from -sgsnemu to the ggsn. - -89.5 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1400 bytes. Transfer time 1.27 sec, no packets lost. - -71.4 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1000 bytes. Transfer time 1.15 sec, no packets lost. - -12,1 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 100 bytes. Transfer time 0.84 sec, no packets lost. - - Required software ================= @@ -209,19 +189,12 @@ Alternatively you can execute "modprobe tun" on the commandline. -For Solaris the tun driver needs to be installed manually. For general -information about tun see http://vtun.sourceforge.net/tun/ - Gengetopt --------- Gengetopt is required if you want to change the options defined in the cmdline.ggo source file. You need at least gengetopt version 2.8. If you are just going to compile the programs you don't need gengetopt. - -To use gengetopt for the ggsn do the following: -cd ggsn -gengetopt < cmdline.ggo --conf-parser To use gengetopt for the sgsnemu do the following: cd sgsnemu @@ -234,98 +207,7 @@ Compilation and Installation ============================ - -Setting up autotools --------------------- - -You do not need to perform this step if you are only going to compile -the package: - -1. Get version from somewhere: Script to extract version from configure.in -2. Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config -3. Run autoscan and copy configure.scan to configure.in -4. Add/edit the following lines in configure.in: - - AC_INIT(openggsn, 0.70, jj at openggsn.org) - - AC_CONFIG_SRCDIR([gtp/gtp.c]) - - AM_CONFIG_HEADER([config.h]) - - AC_PROG_LIBTOOL - - AM_PROG_LIBTOOL - - AM_INIT_AUTOMAKE() -5. libtoolize --automake --copy - (ads copy of ltmain.sh) -6. aclocal -7. autoheader -8. automake --add-missing --copy - (Ads copy of mkinstalldirs missing, install-sh, depcomp) -9. automake -10. autoconf - -The above will initialise the project to the current version of -autotools (As installed in RedHat 8.0). See -http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 -for details on autotools. - - -Checking out from CVS ---------------------- - -To download the latest source code from anonymous CVS: - -cvs -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn login -cvs -z3 -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Or to download from developer CVS: - -export CVS_RSH=ssh -cvs -z3 -d:ext:developername at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Both the above sets of commands creates a new directory called openggsn. - - -Compilation and installation ----------------------------- - -If compiling under Solaris you need to edit the following line in -ggsn/Makefile.in and sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -Note that the above is not necessary on other platforms. Compilation -and installation is performed by the following steps: - - 1. ./configure - 2. make clean - 3. cd gtp - 4. make - 5. make install (as root) - 6. cd .. - (Step 3 to 6 you only need to run the first time to install libgtp) - 7. make - 8. make install (as root) - 9. Add /usr/local/lib to /etc/ld.so.conf -10. run ldconfig - -(Steps 9 and 10 are not required as path to libgtp is included in Makefile) - -Documentation can be converted to html by issuing: - - 1. txt2html -pm -tf README > README.html - 2. txt2html -pm -tf NEWS > NEWS.html - 3. man2htm ggsn.8 > ggsn.html - 4. man2htm sgsnemu.8 > sgsnemu.html - - -Installation from binary ------------------------- - -1. rpm -i openggsn-.rpm - -This will install binaries, man pages, configuration files as well as -a Sys V init script for the ggsn. +Please refer to the project homepage Running ggsn @@ -337,7 +219,7 @@ Start the ggsn as root using the command: -ggsn -c examples/ggsn.conf --fg -l 10.0.0.40 --net 192.168.0.0/24 --dynip 192.168.0.0/24 +ggsn -c examples/ggsn.conf First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is -- To view, visit https://gerrit.osmocom.org/3849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:50 +0000 Subject: [PATCH] openggsn[master]: ggsn: Handle SIGTERM like SIGINT and terminate Message-ID: Review at https://gerrit.osmocom.org/3850 ggsn: Handle SIGTERM like SIGINT and terminate Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/50/3850/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index da46a62..5091764 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -655,6 +655,7 @@ LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); switch (s) { case SIGINT: + case SIGTERM: LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); end = 1; break; @@ -801,11 +802,12 @@ struct ggsn_ctx *ggsn; int rc; - /* Handle keyboard interrupt SIGINT */ tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); + /* Handle keyboard interrupt SIGINT */ signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:51 +0000 Subject: [PATCH] openggsn[master]: Rename OpenGGSN to OsmoGGSN Message-ID: Review at https://gerrit.osmocom.org/3851 Rename OpenGGSN to OsmoGGSN Osmocom has maintained this program since about 7 years now, while the original author / copyright holder has completely disappeared. With the introduction of Osmocom-style CTRL and VTY interfaces, the way how the program is used and configured has substantially changed. In order to avoid confusion in terms of configuration file format etc, let's rename it to OsmoGGSN. Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d --- M .gitignore M AUTHORS M README.FreeBSD M README.MacOSX M README.md M configure.ac M debian/changelog M debian/control M debian/copyright D debian/openggsn.examples A debian/osmo-ggsn.examples R debian/osmo-ggsn.init R debian/osmo-ggsn.install M debian/rules M doc/Compliance.html M doc/Makefile.am R doc/osmo-ggsn.8 M doc/sgsnemu.8 D examples/ggsn.init A examples/osmo-ggsn.init M ggsn/Makefile.am M ggsn/ggsn.c M ggsn/ggsn_vty.c M gtp/gtp.c M gtp/gtp.h M gtp/gtpie.c M gtp/gtpie.h M gtp/pdp.c M gtp/pdp.h M gtp/queue.c M gtp/queue.h M libgtp.pc.in D openggsn.spec.in A osmo-ggsn.spec.in M sgsnemu/cmdline.ggo M sgsnemu/sgsnemu.c 36 files changed, 316 insertions(+), 302 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/51/3851/1 diff --git a/.gitignore b/.gitignore index 111fa98..6885cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,13 +15,13 @@ libtool ltmain.sh missing -openggsn.spec +osmo-ggsn.spec stamp-h1 doc/Makefile.in ggsn/Makefile.in gtp/Makefile.in sgsnemu/Makefile.in -debian/openggsn/ +debian/osmo-ggsn/ debian/*.debhelper debian/libgtp/ debian/*.log @@ -33,7 +33,7 @@ debian/files debian/libgtp-dev/ libgtp.pc -ggsn/ggsn +ggsn/osmo-ggsn m4/ *.swp *.o diff --git a/AUTHORS b/AUTHORS index 5f10990..cba1896 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -OpenGGSN - Gateway GPRS Support Node +OsmoGGSN - Osmocom Gateway GPRS Support Node, based on OpenGGSN Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen Copyright (C) 2010-2017 Harald Welte Copyright (C) 2012-2016 Holger Hans Peter Freyther diff --git a/README.FreeBSD b/README.FreeBSD index b5cc66d..2f4bce5 100644 --- a/README.FreeBSD +++ b/README.FreeBSD @@ -1,4 +1,4 @@ -OpenGGSN/FreeBSD notes +OsmoGGSN/FreeBSD notes FreeBSD support is experimental, please test and report bugs. The FreeBSD port is tested on FreeBSD 4.x, but may also work on 5.x series. diff --git a/README.MacOSX b/README.MacOSX index 0a904cd..a8c4776 100644 --- a/README.MacOSX +++ b/README.MacOSX @@ -1,4 +1,4 @@ -OpenGGSN/Mac OS X notes +OsmoGGSN/Mac OS X notes Mac OS X support is experimental, please test and report bugs. The Mac OS X port is tested on Mac OS X 10.3.5, but may also work on diff --git a/README.md b/README.md index 829adcd..42613cf 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -OpenGGSN - Open Source GGSN +OsmoGGSN - Open Source GGSN =========================== This repository contains a C-language implementation of a GGSN (Gateway GPRS Support Node), a core network element of ETSI/3GPP cellular networks such as GPRS, EDGE, UMTS or HSPA. -OpenGGSN is part of the [Osmocom](https://osmocom.org/) Open Source +OsmoGGSN is part of the [Osmocom](https://osmocom.org/) Open Source Mobile Communications projects, even thogh it was previously developed by Mondru AB. @@ -18,11 +18,11 @@ GIT Repository -------------- -You can clone from the official libosmocore.git repository using +You can clone from the official osmo-ggsn.git repository using - git clone git://git.osmocom.org/openggsn.git + git clone git://git.osmocom.org/osmo-ggsn.git -There is a cgit interface at http://git.osmocom.org/openggsn/ +There is a cgit interface at http://git.osmocom.org/osmo-ggsn/ Documentation ------------- @@ -34,7 +34,7 @@ Mailing List ------------ -Discussions related to openggsn are happening on the +Discussions related to OsmoGGSN are happening on the osmocom-net-gprs at lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/osmocom-net-gprs for subscription options and the list archive. @@ -54,10 +54,8 @@ https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details -The current patch queue for OpenGGSN can be seen at -https://gerrit.osmocom.org/#/q/project:openggsn+status:open -OPENGGSN README -=============== +The current patch queue for OsmoGGSN can be seen at +https://gerrit.osmocom.org/#/q/project:osmo-ggsn+status:open QuickStart @@ -67,7 +65,7 @@ ------------ *Linux* -OpenGGSN was originally developed and tested using Redhat 8.0 and 9.0 +OsmoGGSN was originally developed and tested using Redhat 8.0 and 9.0 and is these days mostly developed on Debian GNU/Linux. It should run also on other Linux distributions as well as FreeBSD, but this is untested. Compilation on Solaris 2.8 has also been verified. @@ -84,7 +82,7 @@ Installation from binary ------------------------ -OpenGGSN is built for common versions of Debian and Ubuntu as part of +OsmoGGSN is built for common versions of Debian and Ubuntu as part of the [Osmocom Nightly Builds](https://osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds) project. If you don't want to do development, it is suggested to simply use those binary packages, rather than building yourself from source. @@ -141,13 +139,13 @@ Features ======== -OpenGGSN is an open source implementation of GPRS Support Nodes +OsmoGGSN is an open source implementation of GPRS Support Nodes (GSNs). It implements the GPRS tunneling protocol (GTP) version 0 and version 1. -OpenGGSN provides 3 components: +OsmoGGSN provides 3 components: * gtplib - * ggsn + * osmo-ggsn * sgsnemu *gtplib* @@ -157,8 +155,8 @@ 29.060). At the moment no interface documentation is available for download. -*ggsn* -The ggsn implements a Gateway GPRS Support Node. The GGSN is a small +*osmo-ggsn* +The osmo-ggsn implements a Gateway GPRS Support Node. The GGSN is a small application which is provided in order to test and demonstrate the use of gtplib. It is fully compliant to the 3GPP standards, but lacks important functionality such as charging and management. Use this @@ -180,7 +178,7 @@ Tun --- -Both ggsn and sgsnemu uses the tun package. You need at least tun +Both osmo-ggsn and sgsnemu uses the tun package. You need at least tun version 1.1. With Linux tun is normally included from kernel version 2.4.7. To configure automatic loading: @@ -210,16 +208,16 @@ Please refer to the project homepage -Running ggsn -============ +Running osmo-ggsn +================= -Use ggsn -h for a list of available options. All options available on +Use osmo-ggsn -h for a list of available options. All options available on the command line can also be given in a configuration file. See -examples/ggsn.conf for the format of this file. +examples/osmo-ggsn.cfg for the format of this file. -Start the ggsn as root using the command: +Start osmo-ggsn as root using the command: -ggsn -c examples/ggsn.conf +osmo-ggsn -c examples/osmo-ggsn.cfg First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is @@ -248,9 +246,9 @@ echo 1 > /proc/sys/net/ipv4/ip_forward If you installed using a binary RPM package it is possible to start -ggsn by using the Sys 5 script: +osmo-ggsn by using the Sys 5 script: -/etc/init.d/ggsn start +/etc/init.d/osmo-ggsn start Running sgsnemu @@ -285,7 +283,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1823]: GTP: gtp_newgsn() started + OsmoGGSN[1823]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request @@ -321,7 +319,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1838]: GTP: gtp_newgsn() started + OsmoGGSN[1838]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request diff --git a/configure.ac b/configure.ac index 63d3117..c19eedc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) +AC_INIT(osmo-ggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) AC_CONFIG_SRCDIR([gtp/gtp.c]) AM_CONFIG_HEADER([config.h]) #AC_CONFIG_HEADER([config.h]) @@ -145,9 +145,9 @@ sgsnemu/Makefile tests/Makefile libgtp.pc - openggsn.spec]) + osmo-ggsn.spec]) AC_OUTPUT echo " -openggsn Configuration: +osmo-ggsn Configuration: GTP Linux kernel support: ${enable_gtp_linux}" diff --git a/debian/changelog b/debian/changelog index 17a0a36..674a997 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-ggsn (0.99) UNRELEASED; urgency=medium + + * Transition to OsmoGGSN + + -- Harald Welte Tue, 05 Sep 2017 09:34:20 +0200 + openggsn (0.94) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] diff --git a/debian/control b/debian/control index 4e5b168..bed17e2 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: openggsn +Source: osmo-ggsn Maintainer: Harald Welte Section: net Priority: optional @@ -9,16 +9,16 @@ dh-autoreconf, libosmocore-dev (>= 0.8.0) Standards-Version: 3.9.6 -Vcs-Browser: http://ggsn.git.sourceforge.net/git/gitweb.cgi?p=ggsn/ggsn;a=summary -Vcs-Git: git://ggsn.git.sourceforge.net/gitroot/ggsn/ggsn +Vcs-Browser: http://git.osmocom.org/osmo-ggsn/ +Vcs-Git: git://git.osmocom.org/osmo-ggsn Homepage: https://projects.osmocom.org/projects/openggsn -Package: openggsn +Package: osmo-ggsn Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Gateway GPRS Support Node (GGSN) - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +Description: Osmocom Gateway GPRS Support Node (GGSN) + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -29,11 +29,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Description: library implementing the GTP protocol between SGSN and GGSN - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . - This library is part of openggsn and implements the GTP protocol between + This library is part of OsmoGGSN and implements the GTP protocol between SGSN (Serving GPRS support node) and GGSN. Package: libgtp-dev @@ -43,17 +43,17 @@ Depends: ${misc:Depends}, libgtp1 (= ${binary:Version}) Description: Development files for libgtp - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . The library libgtp implements the GTP protocol between SGSN and GGSN and this package contains the development files for this library. -Package: openggsn-dbg +Package: osmo-ggsn-dbg Section: debug Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), openggsn (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same -Description: Debug symbols for OpenGGSN +Description: Debug symbols for OsmoGGSN diff --git a/debian/copyright b/debian/copyright index b3339d9..a6507bd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,11 +1,13 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: openggsn -Source: http://sourceforge.net/projects/ggsn/ +Upstream-Name: osmo-ggsn +Source: https://osmocom.org/projects/openggsn Files: * -Copyright: 2002 Jens Jakobsen - 2002-2004 Mondru AB - 2010-2011 Harald Welte +Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen +Copyright (C) 2010-2017 Harald Welte +Copyright (C) 2012-2016 Holger Hans Peter Freyther +Copyright (C) 2014-2016 Pablo Neira Ayuso +Copyright (C) 2014-2016 sysmocom - s.f.m.c. GmbH License: GPL-2 Files: lib/getopt.c @@ -15,7 +17,7 @@ License: LGPL-2.1+ Files: debian/* -Copyright: 2010-2015 Harald Welte +Copyright: 2010-2017 Harald Welte 2016 Ruben Undheim License: GPL-2 diff --git a/debian/openggsn.examples b/debian/openggsn.examples deleted file mode 100644 index 1fa82f3..0000000 --- a/debian/openggsn.examples +++ /dev/null @@ -1,2 +0,0 @@ -examples/ggsn.conf -examples/sgsnemu.conf diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples new file mode 100644 index 0000000..3898d26 --- /dev/null +++ b/debian/osmo-ggsn.examples @@ -0,0 +1,2 @@ +examples/osmo-ggsn.conf +examples/sgsnemu.conf diff --git a/debian/openggsn.init b/debian/osmo-ggsn.init similarity index 91% rename from debian/openggsn.init rename to debian/osmo-ggsn.init index d4fcb18..6fe1b87 100755 --- a/debian/openggsn.init +++ b/debian/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 2 3 4 5 @@ -13,18 +13,18 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" +DESC="OsmoGGSN Gateway GPRS Support Node" NAME=ggsn -DAEMON=/usr/bin/ggsn +DAEMON=/usr/bin/osmo-ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/openggsn +SCRIPTNAME=/etc/init.d/osmo-ggsn # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present -[ -r /etc/default/openggsn ] && . /etc/default/openggsn +[ -r /etc/default/osmo-ggsn ] && . /etc/default/osmo-ggsn # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -46,13 +46,13 @@ || return 1 # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn fi # Check for GTP restart counter - if [ ! -f /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart + if [ ! -f /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart fi start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ diff --git a/debian/openggsn.install b/debian/osmo-ggsn.install similarity index 67% rename from debian/openggsn.install rename to debian/osmo-ggsn.install index 4b301e1..522a3d1 100644 --- a/debian/openggsn.install +++ b/debian/osmo-ggsn.install @@ -1,3 +1,3 @@ -/usr/bin/ggsn +/usr/bin/osmo-ggsn /usr/bin/sgsnemu /usr/share/man/man8/* diff --git a/debian/rules b/debian/rules index aa95e28..6f27da9 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,7 @@ dh $@ --with autoreconf override_dh_strip: - dh_strip --dbg-package=openggsn-dbg + dh_strip --dbg-package=osmo-ggsn-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version diff --git a/doc/Compliance.html b/doc/Compliance.html index f33bc6f..4c2fc3a 100644 --- a/doc/Compliance.html +++ b/doc/Compliance.html @@ -7,7 +7,7 @@

Protocol Compliance List

-OpenGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the following tables the support of each individual message type is detailed. The numbers before each feature indicates the relevant section in the standard.
diff --git a/doc/Makefile.am b/doc/Makefile.am index 43b00d0..7e2246c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -man_MANS = ggsn.8 sgsnemu.8 +man_MANS = osmo-ggsn.8 sgsnemu.8 man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) diff --git a/doc/ggsn.8 b/doc/osmo-ggsn.8 similarity index 89% rename from doc/ggsn.8 rename to doc/osmo-ggsn.8 index 89dcb61b..b9f928f 100644 --- a/doc/ggsn.8 +++ b/doc/osmo-ggsn.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -12,24 +12,24 @@ .\" * .\" * Contributor(s): .\" * -.\" Manual page for ggsn +.\" Manual page for osmo-ggsn .\" SH section heading .\" SS subsection heading .\" LP paragraph .\" IP indented paragraph .\" TP hanging label -.TH ggsn 8 "July 2003" +.TH osmo-ggsn 8 "August 2017" .SH NAME -ggsn \- Gateway GPRS Support Node. +osmo-ggsn \- Gateway GPRS Support Node. .SH SYNOPSIS -.B ggsn +.B osmo-ggsn \-\-help -.B ggsn +.B osmo-ggsn \-\-version -.B ggsn +.B osmo-ggsn [ .BI \-\-help ] [ @@ -40,9 +40,9 @@ .BI \-\-version ] .SH DESCRIPTION -.B ggsn +.B osmo-ggsn is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Gateway GPRS Support Node. It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -62,14 +62,14 @@ The other interface can be thought of as the uplink interface, and interfaces the GGSN to an external data network. Gi is most often an interface to the Internet. -.B ggsn +.B osmo-ggsn uses the .B TUN/TAP driver for the Gi interface. A tun network interface is established when the -.B ggsn +.B osmo-ggsn is started. -.B ggsn +.B osmo-ggsn will accept incoming connections from mobile stations through the radio access network and the SGSN. When a connection request is received the ggsn will allocate a dynamic IP address for the mobile @@ -79,7 +79,7 @@ framework. Typically -.B ggsn +.B osmo-ggsn will be deployed with two Ethernet interfaces. One for the Gn/Gp interface, and one for the Gi interface. Policy routing and firewall rules should be used in order to separate Gi traffic from Gn/Gp @@ -105,25 +105,25 @@ (default = ./openggsn.cfg) .SH FILES -.I ./openggsn.cfg +.I ./osmo-ggsn.cfg .RS The configuration file for -.B ggsn. +.B osmo-ggsn. .RE -.I /var/run/ggsn.pid +.I /var/run/osmo-ggsn.pid .RS Process ID file. .RE -.I /var/lib/ggsn +.I /var/lib/osmo-ggsn .RS Directory holding nonvolatile data. .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at +Report all bugs to the OsmoGGSN bug tracking list at .I https://osmocom.org/projects/openggsn -.B ggsn +.B osmo-ggsn has very limited management support. Currently both SNMP as well as billing mechanisms are missing. @@ -135,13 +135,13 @@ .LP Besides the long options documented in this man page -.B ggsn +.B osmo-ggsn also accepts a number of short options with the same functionality. Use -.B ggsn --help +.B osmo-ggsn --help for a full list of all the available options. The TUN/TAP driver is required for proper operation of -.B ggsn. +.B osmo-ggsn. For linux kernels later than 2.4.7 the TUN/TAP driver is included in the kernel, but typically needs to be loaded manually with .B modprobe tun. For automatic loading the line @@ -152,7 +152,7 @@ .I http://vtun.sourceforge.net/tun/ for information on how to install and configure the tun driver. -.B ggsn +.B osmo-ggsn uses the GPRS Tunneling Protocol (GTP) as specified by the Third Generation Partnership Project (3GPP). 3GPP protocols specifications can be found at diff --git a/doc/sgsnemu.8 b/doc/sgsnemu.8 index af8f3ff..197bd5d 100644 --- a/doc/sgsnemu.8 +++ b/doc/sgsnemu.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -90,7 +90,7 @@ .SH DESCRIPTION .B sgsnemu is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Serving GPRS Support Node (SGSN) emulator. It can be used for testing Gateway GPRS Support Nodes (GGSNs), GPRS core networks as well as GPRS roaming connections. @@ -348,8 +348,8 @@ .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/sgsnemu/ +Report all bugs to the OsmoGGSN bug tracking list at +.I http://osmocom.org/projects/openggsn/issues .SH "SEE ALSO" diff --git a/examples/ggsn.init b/examples/ggsn.init deleted file mode 100644 index 7d9689a..0000000 --- a/examples/ggsn.init +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# ggsn This shell script takes care of starting and stopping -# ggsn. -# -# chkconfig: - 65 35 -# description: ggsn is a Gateway GPRS Support Node. - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -if [ -f /etc/sysconfig/ggsn ]; then - . /etc/sysconfig/ggsn -fi - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -f /usr/bin/ggsn ] || exit 0 -[ -f /etc/ggsn.conf ] || exit 0 - -RETVAL=0 -prog="ggsn" - -start() { - # Start daemons. - echo -n $"Starting $prog: " - - # Load tun module - /sbin/modprobe tun >/dev/null 2>&1 - - # Enable routing of packets: WARNING!!! - # Users should enable this explicitly - # echo 1 > /proc/sys/net/ipv4/ip_forward - - # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn - fi - - # Check for GTP restart counter - if [ ! -d /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart - fi - - - daemon /usr/bin/ggsn - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ggsn - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n $"Shutting down $prog: " - killproc ggsn - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ggsn /var/run/ggsn.pid - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/ggsn ] ; then - stop - start - RETVAL=$? - fi - ;; - status) - status ggsn - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL - diff --git a/examples/osmo-ggsn.init b/examples/osmo-ggsn.init new file mode 100644 index 0000000..2deb378 --- /dev/null +++ b/examples/osmo-ggsn.init @@ -0,0 +1,97 @@ +#!/bin/sh +# +# osmo-ggsn This shell script takes care of starting and stopping +# osmo-ggsn. +# +# chkconfig: - 65 35 +# description: osmo-ggsn is a Gateway GPRS Support Node. + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +if [ -f /etc/sysconfig/osmo-ggsn ]; then + . /etc/sysconfig/osmo-ggsn +fi + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -f /usr/bin/osmo-ggsn ] || exit 0 +[ -f /etc/osmo-ggsn.cfg ] || exit 0 + +RETVAL=0 +prog="osmo-ggsn" + +start() { + # Start daemons. + echo -n $"Starting $prog: " + + # Load tun module + /sbin/modprobe tun >/dev/null 2>&1 + + # Enable routing of packets: WARNING!!! + # Users should enable this explicitly + # echo 1 > /proc/sys/net/ipv4/ip_forward + + # Check for runtime directory of nonvolatile data + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn + fi + + # Check for GTP restart counter + if [ ! -d /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart + fi + + + daemon /usr/bin/osmo-ggsn + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/osmo-ggsn + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n $"Shutting down $prog: " + killproc osmo-ggsn + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f /var/lock/subsys/osmo-ggsn /var/run/osmo-ggsn.pid + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/osmo-ggsn ] ; then + stop + start + RETVAL=$? + fi + ;; + status) + status osmo-ggsn + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL + diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index fef12d3..8a468a9 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -1,19 +1,19 @@ -bin_PROGRAMS = ggsn +bin_PROGRAMS = osmo-ggsn AM_LDFLAGS = @EXEC_LDFLAGS@ AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) +osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD += -lgtpnl +osmo_ggsn_LDADD += -lgtpnl endif -ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a +osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL -ggsn_SOURCES += gtp-kernel.c +osmo_ggsn_SOURCES += gtp-kernel.c endif diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5091764..dc1251d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte * @@ -590,7 +590,7 @@ return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } -static char *config_file = "openggsn.cfg"; +static char *config_file = "osmo-ggsn.cfg"; /* callback for tun device osmocom select loop integration */ static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) @@ -802,7 +802,7 @@ struct ggsn_ctx *ggsn; int rc; - tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "OsmoGGSN"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); /* Handle keyboard interrupt SIGINT */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index f23a298..4a3e753 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -882,7 +882,7 @@ "There is NO WARRANTY, to the extent permitted by law.\r\n"; struct vty_app_info g_vty_info = { - .name = "OpenGGSN", + .name = "OsmoGGSN", .version = PACKAGE_VERSION, .copyright = ggsn_copyright, .go_parent_cb = ggsn_vty_go_parent, diff --git a/gtp/gtp.c b/gtp/gtp.c index 7ce41bb..d0c2b1a 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1,6 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2010-2011, 2016-2017 Harald Welte + * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/gtp.h b/gtp/gtp.h index 7fa9ae7..b40c6df 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.c b/gtp/gtpie.c index c8db449..0744370 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.h b/gtp/gtpie.h index fb8598e..9fe7943 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/pdp.c b/gtp/pdp.c index c576a4e..ff9c681 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/pdp.h b/gtp/pdp.h index c51e9e2..cb98920 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.c b/gtp/queue.c index fbfa1ec..82cd7b4 100644 --- a/gtp/queue.c +++ b/gtp/queue.c @@ -1,7 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2011 Harald Welte + * Copyright (C) 2016 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.h b/gtp/queue.h index 556b6ef..2e253dd 100644 --- a/gtp/queue.h +++ b/gtp/queue.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/libgtp.pc.in b/libgtp.pc.in index 2201608..e6048e9 100644 --- a/libgtp.pc.in +++ b/libgtp.pc.in @@ -3,7 +3,7 @@ libdir=@libdir@ includedir=@includedir@ -Name: OpenGGSN STP Library +Name: OsmoGGSN GTP Library Description: C Utility Library Version: @VERSION@ Libs: -L${libdir} -lgtp diff --git a/openggsn.spec.in b/openggsn.spec.in deleted file mode 100644 index f15866e..0000000 --- a/openggsn.spec.in +++ /dev/null @@ -1,87 +0,0 @@ -Summary: Open Source Gateway GPRS Support Node (GGSN) -Name: @PACKAGE@ -Version: @VERSION@ -Release: 1 -URL: http://sourceforge.net/projects/ggsn/ -Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz -License: GPL -Group: System Environment/Daemons -BuildRoot: %{_tmppath}/%{name}-root - -%description -OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile -operators as the interface between the Internet and the rest of the -mobile network infrastructure. The project also provides an SGSN -emulator suitable for GPRS core network testing. - -%prep -%setup -q - -%build - -./configure --prefix=/usr --enable-static-exec - -make - -%install - -make install prefix=$RPM_BUILD_ROOT/usr -strip $RPM_BUILD_ROOT/usr/bin/ggsn -strip $RPM_BUILD_ROOT/usr/bin/sgsnemu - -#Copy ggsn init script in place -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d -install -m755 examples/ggsn.init \ - $RPM_BUILD_ROOT/etc/rc.d/init.d/ggsn - -#Copy ggsn.conf in place -install -m755 examples/ggsn.conf \ - $RPM_BUILD_ROOT/etc/ggsn.conf - -#Copy gsn_restart file in place -mkdir -p $RPM_BUILD_ROOT/var/lib/ggsn -echo "0" > $RPM_BUILD_ROOT/var/lib/ggsn/gsn_restart - -#Clean up unwanted library files -rm -rf $RPM_BUILD_ROOT/usr/include/* -rm -rf $RPM_BUILD_ROOT/usr/lib/* - - -%clean -rm -rf $RPM_BUILD_ROOT -make clean - -%post -/sbin/chkconfig --add ggsn - -%files -%defattr(-,root,root) - -/usr/bin/ggsn -/usr/bin/sgsnemu -/etc/rc.d/init.d/ggsn -%dir /var/lib/ggsn -/var/lib/ggsn/gsn_restart - -%doc AUTHORS COPYING INSTALL NEWS README.md -%doc examples/ggsn.conf -%doc examples/sgsnemu.conf -%doc examples/ggsn.init -%doc examples/firewall -%doc /usr/man/man8/ggsn.8.gz -%doc /usr/man/man8/sgsnemu.8.gz - -%config /etc/ggsn.conf - - -#/usr/lib/libgtp.a -#/usr/lib/libgtp.la -#/usr/lib/libgtp.so -#/usr/lib/libgtp.so.0 -#/usr/lib/libgtp.so.0.0.0 - - - -%changelog -* Mon Jun 30 2003 -- Initial build. diff --git a/osmo-ggsn.spec.in b/osmo-ggsn.spec.in new file mode 100644 index 0000000..9613bca --- /dev/null +++ b/osmo-ggsn.spec.in @@ -0,0 +1,90 @@ +Summary: Osmocom Gateway GPRS Support Node (GGSN) +Name: @PACKAGE@ +Version: @VERSION@ +Release: 1 +URL: https://osmocom.org/projects/openggsn +Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz +License: GPL +Group: System Environment/Daemons +BuildRoot: %{_tmppath}/%{name}-root + +%description +OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +operators as the interface between the Internet and the rest of the +mobile network infrastructure. The project also provides an SGSN +emulator suitable for GPRS core network testing. + +%prep +%setup -q + +%build + +./configure --prefix=/usr --enable-static-exec + +make + +%install + +make install prefix=$RPM_BUILD_ROOT/usr +strip $RPM_BUILD_ROOT/usr/bin/osmo-ggsn +strip $RPM_BUILD_ROOT/usr/bin/sgsnemu + +#Copy osmo-ggsn init script in place +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +install -m755 examples/osmo-ggsn.init \ + $RPM_BUILD_ROOT/etc/rc.d/init.d/osmo-ggsn + +#Copy osmo-ggsn.conf in place +install -m755 examples/osmo-ggsn.cfg \ + $RPM_BUILD_ROOT/etc/osmo-ggsn.cfg + +#Copy gsn_restart file in place +mkdir -p $RPM_BUILD_ROOT/var/lib/osmo-ggsn +echo "0" > $RPM_BUILD_ROOT/var/lib/osmo-ggsn/gsn_restart + +#Clean up unwanted library files +rm -rf $RPM_BUILD_ROOT/usr/include/* +rm -rf $RPM_BUILD_ROOT/usr/lib/* + + +%clean +rm -rf $RPM_BUILD_ROOT +make clean + +%post +/sbin/chkconfig --add osmo-ggsn + +%files +%defattr(-,root,root) + +/usr/bin/osmo-ggsn +/usr/bin/sgsnemu +/etc/rc.d/init.d/osmo-ggsn +%dir /var/lib/osmo-ggsn +/var/lib/osmo-ggsn/gsn_restart + +%doc AUTHORS COPYING INSTALL NEWS README.md +%doc examples/osmo-ggsn.conf +%doc examples/sgsnemu.conf +%doc examples/osmo-ggsn.init +%doc examples/firewall +%doc /usr/man/man8/osmo-ggsn.8.gz +%doc /usr/man/man8/sgsnemu.8.gz + +%config /etc/osmo-ggsn.cfg + + +#/usr/lib/libgtp.a +#/usr/lib/libgtp.la +#/usr/lib/libgtp.so +#/usr/lib/libgtp.so.0 +#/usr/lib/libgtp.so.0.0.0 + + + +%changelog +* Mon Jun 30 2017 +- Update to OsmoGGSN + +* Mon Jun 30 2003 +- Initial build. diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0c1b06c..ee5e55d 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -1,4 +1,4 @@ -# OpenGGSN - Gateway GPRS Support Node +# OsmoGGSN - Gateway GPRS Support Node # Copyright (C) 2002, 2003, 2004 Mondru AB. # # The contents of this file may be used under the terms of the GNU diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index ed1fb93..0157e22 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU -- To view, visit https://gerrit.osmocom.org/3851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:51 +0000 Subject: [PATCH] openggsn[master]: remove bogus 'version' script Message-ID: Review at https://gerrit.osmocom.org/3852 remove bogus 'version' script Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 --- D version 1 file changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/52/3852/1 diff --git a/version b/version deleted file mode 100755 index ba4d6a5..0000000 --- a/version +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Little shell script to grab current version number from configure.in -# -# $Id: version,v 1.3 2003/01/28 22:39:30 jjako Exp $ - -VER=`grep AC_INIT configure.in | awk -F'[(),]' '{print $3}'` -if [ "$1" == "-VERSION" ] -then - echo $VER | awk -F'.' '{print $1}' - exit -fi -if [ "$1" == "-PATCHLEVEL" ] -then - echo $VER | awk -F'.' '{print $2}' - exit -fi -if [ "$1" == "-SUBLEVEL" ] -then - echo $VER | awk -F'.' '{print $3}' - exit -fi -echo $VER -exit -- To view, visit https://gerrit.osmocom.org/3852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:51 +0000 Subject: [PATCH] openggsn[master]: Move examples to doc/examples and include them in DIST Message-ID: Review at https://gerrit.osmocom.org/3853 Move examples to doc/examples and include them in DIST Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 --- M configure.ac R contrib/osmo-ggsn.init M doc/Makefile.am A doc/examples/Makefile.am R doc/examples/firewall R doc/examples/osmo-ggsn.cfg R doc/examples/sgsnemu.conf 7 files changed, 26 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/53/3853/1 diff --git a/configure.ac b/configure.ac index c19eedc..19548d1 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,7 @@ AC_CONFIG_FILES([Makefile doc/Makefile + doc/examples/Makefile ggsn/Makefile gtp/Makefile lib/Makefile diff --git a/examples/osmo-ggsn.init b/contrib/osmo-ggsn.init similarity index 100% rename from examples/osmo-ggsn.init rename to contrib/osmo-ggsn.init diff --git a/doc/Makefile.am b/doc/Makefile.am index 7e2246c..46c634e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,5 +2,6 @@ man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) - - +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..530c3fa --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,22 @@ +CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,' + +dist-hook: + for f in $$($(CFG_FILES)); do \ + j="$(distdir)/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +install-data-hook: + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +uninstall-hook: + @$(PRE_UNINSTALL) + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + $(RM) $$j; \ + done diff --git a/examples/firewall b/doc/examples/firewall similarity index 100% rename from examples/firewall rename to doc/examples/firewall diff --git a/examples/osmo-ggsn.cfg b/doc/examples/osmo-ggsn.cfg similarity index 100% rename from examples/osmo-ggsn.cfg rename to doc/examples/osmo-ggsn.cfg diff --git a/examples/sgsnemu.conf b/doc/examples/sgsnemu.conf similarity index 100% rename from examples/sgsnemu.conf rename to doc/examples/sgsnemu.conf -- To view, visit https://gerrit.osmocom.org/3853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:26:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:26:51 +0000 Subject: [PATCH] openggsn[master]: ggsn: Add ability to specify local IP addresses for GTP-C an... Message-ID: Review at https://gerrit.osmocom.org/3854 ggsn: Add ability to specify local IP addresses for GTP-C and GTP-U In case the GGSN is behind some kind of DNAT, the public GTP-C and GTP-U IP addresses as exposed inside the GTP payload information elements are different from the (internal, behind-nat) IP address to which it listens/binds. Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 50 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/54/3854/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index dc1251d..0ac6408 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -691,6 +691,14 @@ } ggsn->gsn->priv = ggsn; + /* patch in different addresses to use (in case we're behind NAT, the listen + * address is different from what we advertise externally) */ + if (ggsn->cfg.gtpc_addr.v4.s_addr) + ggsn->gsn->gsnc = ggsn->cfg.gtpc_addr.v4; + + if (ggsn->cfg.gtpu_addr.v4.s_addr) + ggsn->gsn->gsnu = ggsn->cfg.gtpu_addr.v4; + /* Register File Descriptors */ osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); rc = osmo_fd_register(&ggsn->gtp_fd0); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index bab6cf7..2dd963c 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -99,6 +99,10 @@ struct apn_ctx *default_apn; /* ADdress to which we listen for GTP */ struct in46_addr listen_addr; + /* Local GTP-C address advertised in GTP */ + struct in46_addr gtpc_addr; + /* Local GTP-U address advertised in GTP */ + struct in46_addr gtpu_addr; /* directory for state file */ char *state_dir; /* administratively shut-down (true) or not (false) */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 4a3e753..d7bd9a7 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -165,8 +165,8 @@ return CMD_SUCCESS; } -DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, - "gtp local-ip A.B.C.D", +DEFUN(cfg_ggsn_bind_ip, cfg_ggsn_bind_ip_cmd, + "gtp bind-ip A.B.C.D", "GTP Parameters\n" "Set the IP address for the local GTP bind\n" "IPv4 Address\n") @@ -175,6 +175,34 @@ size_t t; ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpc_ip, cfg_ggsn_gtpc_ip_cmd, + "gtp control-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-C messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpc_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpu_ip, cfg_ggsn_gtpu_ip_cmd, + "gtp user-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-U messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpu_addr, &t, argv[0], 0); return CMD_SUCCESS; } @@ -633,7 +661,11 @@ if (ggsn->cfg.description) vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); - vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + vty_out(vty, " gtp bind-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpc_addr.v4.s_addr) + vty_out(vty, " gtp control-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpc_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpu_addr.v4.s_addr) + vty_out(vty, " gtp user-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpu_addr), VTY_NEWLINE); llist_for_each_entry(apn, &ggsn->apn_list, list) config_write_apn(vty, apn); if (ggsn->cfg.default_apn) @@ -806,7 +838,9 @@ install_element(GGSN_NODE, &cfg_no_description_cmd); install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); - install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_bind_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpc_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpu_ip_cmd); install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); -- To view, visit https://gerrit.osmocom.org/3854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:29:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:29:22 +0000 Subject: [PATCH] openggsn[master]: Move examples to doc/examples and include them in DIST In-Reply-To: References: Message-ID: Move examples to doc/examples and include them in DIST Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 --- M configure.ac R contrib/osmo-ggsn.init M debian/osmo-ggsn.examples M doc/Makefile.am A doc/examples/Makefile.am R doc/examples/firewall R doc/examples/osmo-ggsn.cfg R doc/examples/sgsnemu.conf 8 files changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/53/3853/2 diff --git a/configure.ac b/configure.ac index c19eedc..19548d1 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,7 @@ AC_CONFIG_FILES([Makefile doc/Makefile + doc/examples/Makefile ggsn/Makefile gtp/Makefile lib/Makefile diff --git a/examples/osmo-ggsn.init b/contrib/osmo-ggsn.init similarity index 100% rename from examples/osmo-ggsn.init rename to contrib/osmo-ggsn.init diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples index 3898d26..775b9cd 100644 --- a/debian/osmo-ggsn.examples +++ b/debian/osmo-ggsn.examples @@ -1,2 +1,2 @@ -examples/osmo-ggsn.conf -examples/sgsnemu.conf +doc/examples/osmo-ggsn.conf +doc/examples/sgsnemu.conf diff --git a/doc/Makefile.am b/doc/Makefile.am index 7e2246c..46c634e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,5 +2,6 @@ man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) - - +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..530c3fa --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,22 @@ +CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,' + +dist-hook: + for f in $$($(CFG_FILES)); do \ + j="$(distdir)/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +install-data-hook: + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +uninstall-hook: + @$(PRE_UNINSTALL) + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + $(RM) $$j; \ + done diff --git a/examples/firewall b/doc/examples/firewall similarity index 100% rename from examples/firewall rename to doc/examples/firewall diff --git a/examples/osmo-ggsn.cfg b/doc/examples/osmo-ggsn.cfg similarity index 100% rename from examples/osmo-ggsn.cfg rename to doc/examples/osmo-ggsn.cfg diff --git a/examples/sgsnemu.conf b/doc/examples/sgsnemu.conf similarity index 100% rename from examples/sgsnemu.conf rename to doc/examples/sgsnemu.conf -- To view, visit https://gerrit.osmocom.org/3853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:35:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:35:43 +0000 Subject: [PATCH] openggsn[master]: update jenkins.sh to conform with current build environment Message-ID: Review at https://gerrit.osmocom.org/3855 update jenkins.sh to conform with current build environment Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c --- M contrib/jenkins.sh 1 file changed, 33 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/55/3855/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 30416b2..f319acb 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,21 +1,39 @@ #!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -mkdir deps || true -cd deps -osmo-deps.sh libosmocore +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst -cd libosmocore +mkdir "$deps" || true +rm -rf "$inst" + +osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +set +x +echo +echo +echo +echo " =============================== openggsn ===============================" +echo +set -x + +cd "$base" autoreconf --install --force -./configure --prefix=$PWD/../install -$MAKE $PARALLEL_MAKE install - -cd ../../ - -deps/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - -autoreconf --install --force -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck +./configure +$MAKE $PARALLEL_MAKE +$MAKE distcheck -- To view, visit https://gerrit.osmocom.org/3855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:45:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:45:04 +0000 Subject: [PATCH] openggsn[master]: Documentation update: Remove NEWS, README.Solaris, update RE... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3849 to look at the new patch set (#3). Documentation update: Remove NEWS, README.Solaris, update README.md * README.Solaris is obsolete and related code has been removed * NEWS file was unmaintained for more than a decade, remove it * Remove "Performance" chapter about 550MHz Athlon * gengetopt is no longer needed for ggsn * remove compilation/installation instructions horribly out of date * command line syntax of 'ggsn' program has changed Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db --- M Makefile.am D NEWS D README.Solaris M README.md 4 files changed, 3 insertions(+), 240 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/49/3849/3 diff --git a/Makefile.am b/Makefile.am index 1d7eaba..517e265 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,6 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris +EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX @RELMAKE@ diff --git a/NEWS b/NEWS deleted file mode 100644 index b1352a5..0000000 --- a/NEWS +++ /dev/null @@ -1,78 +0,0 @@ -OPENGGSN NEWS -============= - -OpenGGSN - Gateway GPRS Support Node -Copyright (C) 2002, 2003, 2004 Mondru AB. - -Version 0.84 -============ - -* Initial MAC OSX support (Thanks to Pekka Nikander) -* Quality assurance and improved error logging (Thanks to Pekka - Nikander and Jonny Winberg) - -Version 0.83 -============ - -* Added selection mode and charging characteristics option to sgsnemu. -* Bug fixes on charging characteristics and PPP PCO length.(Thanks to - Loic Bernable ). -* Improved Solaris support, hash table bugfix and improved logging. - -Version 0.82 -============ - -* Improved Solaris support. -* Routing manipulation and IP address alias capability for FreeBSD. -* Initial Debian port (Thanks to ARAKI Yasuhiro ). - -Version 0.81 -============ - - * Initial FreeBSD port (Thanks to Pavel Andreev ). - * IMSI '1111' bugfix (Thanks to Pavel Andreev ). - -Version 0.8 -=========== - - * Support for compilation under Solaris. - * Iptables firewall script. - * New options for sgsnemu - - -Version 0.7 -=========== - - * Support for GTP1. Currently without support for the secondary pdp - context activation procedure. - * sgsnemu will first attempt to use GTP1. If that fails it will - fallback to using GTP0. - * Standards compliance document. - -Version 0.6 -=========== - - * Improved README file. - * Now uses ioctl instead of ifconfig and route in ggsn and sgsnemu. - * Absolute path to gtp library in ggsn/Makefile.am and ggsn/Makefile.am - * Compiles with gengetopt 2.8 (Thanks to Lorenzo Bettini ) - * sgsnemu is now able to handle several contexts and allocate - interface IP addresses for each context. - * ggsn now supports protocol configuration option DNS - addresses. This allow mobile stations to set up DNS based on - information configured in the ggsn. - * Ping facility in sgsnemu allow testing without the need to route - packets through the tun interface. - * Man pages for ggsn and sgsnemu. - * Sys 5 init script. - * Spec file for building binary RPM packages. - * If not --createif exit after "ping" or "echo" finishes - * If sgsnemu echo failure, exit with code != 0 - - -Version 0.5 -=========== - - * Initial release. See README file for installation and usage - instructions. - diff --git a/README.Solaris b/README.Solaris deleted file mode 100644 index 2ac6dbc..0000000 --- a/README.Solaris +++ /dev/null @@ -1,41 +0,0 @@ -OpenGGSN/Solaris notes -====================== - -Solaris support is experimental, please test and report bugs. The -Solaris port is tested under Solaris 8. - -Compiling ---------- - -You need to edit the following line in ggsn/Makefile.in and -sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -After this you install by the following commands: -./configure -make -make install - - -TUN ---- - -You might or might not need to install the tun driver manually. For -general information about tun see http://vtun.sourceforge.net/tun/ - - -Known problems --------------- - -Currently multiple IP addresses on the same network interface is not -implemented for Solaris. - -Currently routing table manipulation is not implemented for -Solaris. You have to set the routes manually after you start ggsn or -sgsnemu. - diff --git a/README.md b/README.md index 8e4ceae..829adcd 100644 --- a/README.md +++ b/README.md @@ -174,26 +174,6 @@ will fallback to GTPv0. -Performance -=========== - -Two experiments were performed in order to test the performance of -sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of -RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had -100 Mb/s NICs (RTL-8139) and were connected through a crossed patch -cable. Both tests were performed by sending ICMP echo packets from -sgsnemu to the ggsn. - -89.5 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1400 bytes. Transfer time 1.27 sec, no packets lost. - -71.4 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1000 bytes. Transfer time 1.15 sec, no packets lost. - -12,1 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 100 bytes. Transfer time 0.84 sec, no packets lost. - - Required software ================= @@ -209,19 +189,12 @@ Alternatively you can execute "modprobe tun" on the commandline. -For Solaris the tun driver needs to be installed manually. For general -information about tun see http://vtun.sourceforge.net/tun/ - Gengetopt --------- Gengetopt is required if you want to change the options defined in the cmdline.ggo source file. You need at least gengetopt version 2.8. If you are just going to compile the programs you don't need gengetopt. - -To use gengetopt for the ggsn do the following: -cd ggsn -gengetopt < cmdline.ggo --conf-parser To use gengetopt for the sgsnemu do the following: cd sgsnemu @@ -234,98 +207,7 @@ Compilation and Installation ============================ - -Setting up autotools --------------------- - -You do not need to perform this step if you are only going to compile -the package: - -1. Get version from somewhere: Script to extract version from configure.in -2. Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config -3. Run autoscan and copy configure.scan to configure.in -4. Add/edit the following lines in configure.in: - - AC_INIT(openggsn, 0.70, jj at openggsn.org) - - AC_CONFIG_SRCDIR([gtp/gtp.c]) - - AM_CONFIG_HEADER([config.h]) - - AC_PROG_LIBTOOL - - AM_PROG_LIBTOOL - - AM_INIT_AUTOMAKE() -5. libtoolize --automake --copy - (ads copy of ltmain.sh) -6. aclocal -7. autoheader -8. automake --add-missing --copy - (Ads copy of mkinstalldirs missing, install-sh, depcomp) -9. automake -10. autoconf - -The above will initialise the project to the current version of -autotools (As installed in RedHat 8.0). See -http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 -for details on autotools. - - -Checking out from CVS ---------------------- - -To download the latest source code from anonymous CVS: - -cvs -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn login -cvs -z3 -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Or to download from developer CVS: - -export CVS_RSH=ssh -cvs -z3 -d:ext:developername at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Both the above sets of commands creates a new directory called openggsn. - - -Compilation and installation ----------------------------- - -If compiling under Solaris you need to edit the following line in -ggsn/Makefile.in and sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -Note that the above is not necessary on other platforms. Compilation -and installation is performed by the following steps: - - 1. ./configure - 2. make clean - 3. cd gtp - 4. make - 5. make install (as root) - 6. cd .. - (Step 3 to 6 you only need to run the first time to install libgtp) - 7. make - 8. make install (as root) - 9. Add /usr/local/lib to /etc/ld.so.conf -10. run ldconfig - -(Steps 9 and 10 are not required as path to libgtp is included in Makefile) - -Documentation can be converted to html by issuing: - - 1. txt2html -pm -tf README > README.html - 2. txt2html -pm -tf NEWS > NEWS.html - 3. man2htm ggsn.8 > ggsn.html - 4. man2htm sgsnemu.8 > sgsnemu.html - - -Installation from binary ------------------------- - -1. rpm -i openggsn-.rpm - -This will install binaries, man pages, configuration files as well as -a Sys V init script for the ggsn. +Please refer to the project homepage Running ggsn @@ -337,7 +219,7 @@ Start the ggsn as root using the command: -ggsn -c examples/ggsn.conf --fg -l 10.0.0.40 --net 192.168.0.0/24 --dynip 192.168.0.0/24 +ggsn -c examples/ggsn.conf First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is -- To view, visit https://gerrit.osmocom.org/3849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:45:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:45:04 +0000 Subject: [PATCH] openggsn[master]: Rename OpenGGSN to OsmoGGSN In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3851 to look at the new patch set (#3). Rename OpenGGSN to OsmoGGSN Osmocom has maintained this program since about 7 years now, while the original author / copyright holder has completely disappeared. With the introduction of Osmocom-style CTRL and VTY interfaces, the way how the program is used and configured has substantially changed. In order to avoid confusion in terms of configuration file format etc, let's rename it to OsmoGGSN. Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d --- M .gitignore M AUTHORS M README.FreeBSD M README.MacOSX M README.md M configure.ac M debian/changelog M debian/control M debian/copyright D debian/openggsn.examples A debian/osmo-ggsn.examples R debian/osmo-ggsn.init R debian/osmo-ggsn.install M debian/rules M doc/Compliance.html M doc/Makefile.am R doc/osmo-ggsn.8 M doc/sgsnemu.8 D examples/ggsn.init A examples/osmo-ggsn.init M ggsn/Makefile.am M ggsn/ggsn.c M ggsn/ggsn_vty.c M gtp/gtp.c M gtp/gtp.h M gtp/gtpie.c M gtp/gtpie.h M gtp/pdp.c M gtp/pdp.h M gtp/queue.c M gtp/queue.h M libgtp.pc.in D openggsn.spec.in A osmo-ggsn.spec.in M sgsnemu/cmdline.ggo M sgsnemu/sgsnemu.c 36 files changed, 316 insertions(+), 302 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/51/3851/3 diff --git a/.gitignore b/.gitignore index 111fa98..6885cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,13 +15,13 @@ libtool ltmain.sh missing -openggsn.spec +osmo-ggsn.spec stamp-h1 doc/Makefile.in ggsn/Makefile.in gtp/Makefile.in sgsnemu/Makefile.in -debian/openggsn/ +debian/osmo-ggsn/ debian/*.debhelper debian/libgtp/ debian/*.log @@ -33,7 +33,7 @@ debian/files debian/libgtp-dev/ libgtp.pc -ggsn/ggsn +ggsn/osmo-ggsn m4/ *.swp *.o diff --git a/AUTHORS b/AUTHORS index 5f10990..cba1896 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -OpenGGSN - Gateway GPRS Support Node +OsmoGGSN - Osmocom Gateway GPRS Support Node, based on OpenGGSN Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen Copyright (C) 2010-2017 Harald Welte Copyright (C) 2012-2016 Holger Hans Peter Freyther diff --git a/README.FreeBSD b/README.FreeBSD index b5cc66d..2f4bce5 100644 --- a/README.FreeBSD +++ b/README.FreeBSD @@ -1,4 +1,4 @@ -OpenGGSN/FreeBSD notes +OsmoGGSN/FreeBSD notes FreeBSD support is experimental, please test and report bugs. The FreeBSD port is tested on FreeBSD 4.x, but may also work on 5.x series. diff --git a/README.MacOSX b/README.MacOSX index 0a904cd..a8c4776 100644 --- a/README.MacOSX +++ b/README.MacOSX @@ -1,4 +1,4 @@ -OpenGGSN/Mac OS X notes +OsmoGGSN/Mac OS X notes Mac OS X support is experimental, please test and report bugs. The Mac OS X port is tested on Mac OS X 10.3.5, but may also work on diff --git a/README.md b/README.md index 829adcd..42613cf 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -OpenGGSN - Open Source GGSN +OsmoGGSN - Open Source GGSN =========================== This repository contains a C-language implementation of a GGSN (Gateway GPRS Support Node), a core network element of ETSI/3GPP cellular networks such as GPRS, EDGE, UMTS or HSPA. -OpenGGSN is part of the [Osmocom](https://osmocom.org/) Open Source +OsmoGGSN is part of the [Osmocom](https://osmocom.org/) Open Source Mobile Communications projects, even thogh it was previously developed by Mondru AB. @@ -18,11 +18,11 @@ GIT Repository -------------- -You can clone from the official libosmocore.git repository using +You can clone from the official osmo-ggsn.git repository using - git clone git://git.osmocom.org/openggsn.git + git clone git://git.osmocom.org/osmo-ggsn.git -There is a cgit interface at http://git.osmocom.org/openggsn/ +There is a cgit interface at http://git.osmocom.org/osmo-ggsn/ Documentation ------------- @@ -34,7 +34,7 @@ Mailing List ------------ -Discussions related to openggsn are happening on the +Discussions related to OsmoGGSN are happening on the osmocom-net-gprs at lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/osmocom-net-gprs for subscription options and the list archive. @@ -54,10 +54,8 @@ https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details -The current patch queue for OpenGGSN can be seen at -https://gerrit.osmocom.org/#/q/project:openggsn+status:open -OPENGGSN README -=============== +The current patch queue for OsmoGGSN can be seen at +https://gerrit.osmocom.org/#/q/project:osmo-ggsn+status:open QuickStart @@ -67,7 +65,7 @@ ------------ *Linux* -OpenGGSN was originally developed and tested using Redhat 8.0 and 9.0 +OsmoGGSN was originally developed and tested using Redhat 8.0 and 9.0 and is these days mostly developed on Debian GNU/Linux. It should run also on other Linux distributions as well as FreeBSD, but this is untested. Compilation on Solaris 2.8 has also been verified. @@ -84,7 +82,7 @@ Installation from binary ------------------------ -OpenGGSN is built for common versions of Debian and Ubuntu as part of +OsmoGGSN is built for common versions of Debian and Ubuntu as part of the [Osmocom Nightly Builds](https://osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds) project. If you don't want to do development, it is suggested to simply use those binary packages, rather than building yourself from source. @@ -141,13 +139,13 @@ Features ======== -OpenGGSN is an open source implementation of GPRS Support Nodes +OsmoGGSN is an open source implementation of GPRS Support Nodes (GSNs). It implements the GPRS tunneling protocol (GTP) version 0 and version 1. -OpenGGSN provides 3 components: +OsmoGGSN provides 3 components: * gtplib - * ggsn + * osmo-ggsn * sgsnemu *gtplib* @@ -157,8 +155,8 @@ 29.060). At the moment no interface documentation is available for download. -*ggsn* -The ggsn implements a Gateway GPRS Support Node. The GGSN is a small +*osmo-ggsn* +The osmo-ggsn implements a Gateway GPRS Support Node. The GGSN is a small application which is provided in order to test and demonstrate the use of gtplib. It is fully compliant to the 3GPP standards, but lacks important functionality such as charging and management. Use this @@ -180,7 +178,7 @@ Tun --- -Both ggsn and sgsnemu uses the tun package. You need at least tun +Both osmo-ggsn and sgsnemu uses the tun package. You need at least tun version 1.1. With Linux tun is normally included from kernel version 2.4.7. To configure automatic loading: @@ -210,16 +208,16 @@ Please refer to the project homepage -Running ggsn -============ +Running osmo-ggsn +================= -Use ggsn -h for a list of available options. All options available on +Use osmo-ggsn -h for a list of available options. All options available on the command line can also be given in a configuration file. See -examples/ggsn.conf for the format of this file. +examples/osmo-ggsn.cfg for the format of this file. -Start the ggsn as root using the command: +Start osmo-ggsn as root using the command: -ggsn -c examples/ggsn.conf +osmo-ggsn -c examples/osmo-ggsn.cfg First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is @@ -248,9 +246,9 @@ echo 1 > /proc/sys/net/ipv4/ip_forward If you installed using a binary RPM package it is possible to start -ggsn by using the Sys 5 script: +osmo-ggsn by using the Sys 5 script: -/etc/init.d/ggsn start +/etc/init.d/osmo-ggsn start Running sgsnemu @@ -285,7 +283,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1823]: GTP: gtp_newgsn() started + OsmoGGSN[1823]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request @@ -321,7 +319,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1838]: GTP: gtp_newgsn() started + OsmoGGSN[1838]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request diff --git a/configure.ac b/configure.ac index 9d3a8e4..e6b84fa 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) +AC_INIT(osmo-ggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) AC_CONFIG_SRCDIR([gtp/gtp.c]) AM_CONFIG_HEADER([config.h]) #AC_CONFIG_HEADER([config.h]) @@ -149,9 +149,9 @@ sgsnemu/Makefile tests/Makefile libgtp.pc - openggsn.spec]) + osmo-ggsn.spec]) AC_OUTPUT echo " -openggsn Configuration: +osmo-ggsn Configuration: GTP Linux kernel support: ${enable_gtp_linux}" diff --git a/debian/changelog b/debian/changelog index 357cc01..7c82dbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-ggsn (0.94.0) UNRELEASED; urgency=medium + + * Transition to OsmoGGSN + + -- Harald Welte Tue, 05 Sep 2017 09:34:20 +0200 + openggsn (0.94.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] diff --git a/debian/control b/debian/control index 4e5b168..bed17e2 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: openggsn +Source: osmo-ggsn Maintainer: Harald Welte Section: net Priority: optional @@ -9,16 +9,16 @@ dh-autoreconf, libosmocore-dev (>= 0.8.0) Standards-Version: 3.9.6 -Vcs-Browser: http://ggsn.git.sourceforge.net/git/gitweb.cgi?p=ggsn/ggsn;a=summary -Vcs-Git: git://ggsn.git.sourceforge.net/gitroot/ggsn/ggsn +Vcs-Browser: http://git.osmocom.org/osmo-ggsn/ +Vcs-Git: git://git.osmocom.org/osmo-ggsn Homepage: https://projects.osmocom.org/projects/openggsn -Package: openggsn +Package: osmo-ggsn Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Gateway GPRS Support Node (GGSN) - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +Description: Osmocom Gateway GPRS Support Node (GGSN) + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -29,11 +29,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Description: library implementing the GTP protocol between SGSN and GGSN - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . - This library is part of openggsn and implements the GTP protocol between + This library is part of OsmoGGSN and implements the GTP protocol between SGSN (Serving GPRS support node) and GGSN. Package: libgtp-dev @@ -43,17 +43,17 @@ Depends: ${misc:Depends}, libgtp1 (= ${binary:Version}) Description: Development files for libgtp - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . The library libgtp implements the GTP protocol between SGSN and GGSN and this package contains the development files for this library. -Package: openggsn-dbg +Package: osmo-ggsn-dbg Section: debug Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), openggsn (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same -Description: Debug symbols for OpenGGSN +Description: Debug symbols for OsmoGGSN diff --git a/debian/copyright b/debian/copyright index b3339d9..a6507bd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,11 +1,13 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: openggsn -Source: http://sourceforge.net/projects/ggsn/ +Upstream-Name: osmo-ggsn +Source: https://osmocom.org/projects/openggsn Files: * -Copyright: 2002 Jens Jakobsen - 2002-2004 Mondru AB - 2010-2011 Harald Welte +Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen +Copyright (C) 2010-2017 Harald Welte +Copyright (C) 2012-2016 Holger Hans Peter Freyther +Copyright (C) 2014-2016 Pablo Neira Ayuso +Copyright (C) 2014-2016 sysmocom - s.f.m.c. GmbH License: GPL-2 Files: lib/getopt.c @@ -15,7 +17,7 @@ License: LGPL-2.1+ Files: debian/* -Copyright: 2010-2015 Harald Welte +Copyright: 2010-2017 Harald Welte 2016 Ruben Undheim License: GPL-2 diff --git a/debian/openggsn.examples b/debian/openggsn.examples deleted file mode 100644 index 1fa82f3..0000000 --- a/debian/openggsn.examples +++ /dev/null @@ -1,2 +0,0 @@ -examples/ggsn.conf -examples/sgsnemu.conf diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples new file mode 100644 index 0000000..3898d26 --- /dev/null +++ b/debian/osmo-ggsn.examples @@ -0,0 +1,2 @@ +examples/osmo-ggsn.conf +examples/sgsnemu.conf diff --git a/debian/openggsn.init b/debian/osmo-ggsn.init similarity index 91% rename from debian/openggsn.init rename to debian/osmo-ggsn.init index d4fcb18..6fe1b87 100755 --- a/debian/openggsn.init +++ b/debian/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 2 3 4 5 @@ -13,18 +13,18 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" +DESC="OsmoGGSN Gateway GPRS Support Node" NAME=ggsn -DAEMON=/usr/bin/ggsn +DAEMON=/usr/bin/osmo-ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/openggsn +SCRIPTNAME=/etc/init.d/osmo-ggsn # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present -[ -r /etc/default/openggsn ] && . /etc/default/openggsn +[ -r /etc/default/osmo-ggsn ] && . /etc/default/osmo-ggsn # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -46,13 +46,13 @@ || return 1 # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn fi # Check for GTP restart counter - if [ ! -f /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart + if [ ! -f /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart fi start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ diff --git a/debian/openggsn.install b/debian/osmo-ggsn.install similarity index 67% rename from debian/openggsn.install rename to debian/osmo-ggsn.install index 4b301e1..522a3d1 100644 --- a/debian/openggsn.install +++ b/debian/osmo-ggsn.install @@ -1,3 +1,3 @@ -/usr/bin/ggsn +/usr/bin/osmo-ggsn /usr/bin/sgsnemu /usr/share/man/man8/* diff --git a/debian/rules b/debian/rules index aa95e28..6f27da9 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,7 @@ dh $@ --with autoreconf override_dh_strip: - dh_strip --dbg-package=openggsn-dbg + dh_strip --dbg-package=osmo-ggsn-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version diff --git a/doc/Compliance.html b/doc/Compliance.html index f33bc6f..4c2fc3a 100644 --- a/doc/Compliance.html +++ b/doc/Compliance.html @@ -7,7 +7,7 @@

Protocol Compliance List

-OpenGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the following tables the support of each individual message type is detailed. The numbers before each feature indicates the relevant section in the standard.
diff --git a/doc/Makefile.am b/doc/Makefile.am index 43b00d0..7e2246c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -man_MANS = ggsn.8 sgsnemu.8 +man_MANS = osmo-ggsn.8 sgsnemu.8 man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) diff --git a/doc/ggsn.8 b/doc/osmo-ggsn.8 similarity index 89% rename from doc/ggsn.8 rename to doc/osmo-ggsn.8 index 89dcb61b..b9f928f 100644 --- a/doc/ggsn.8 +++ b/doc/osmo-ggsn.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -12,24 +12,24 @@ .\" * .\" * Contributor(s): .\" * -.\" Manual page for ggsn +.\" Manual page for osmo-ggsn .\" SH section heading .\" SS subsection heading .\" LP paragraph .\" IP indented paragraph .\" TP hanging label -.TH ggsn 8 "July 2003" +.TH osmo-ggsn 8 "August 2017" .SH NAME -ggsn \- Gateway GPRS Support Node. +osmo-ggsn \- Gateway GPRS Support Node. .SH SYNOPSIS -.B ggsn +.B osmo-ggsn \-\-help -.B ggsn +.B osmo-ggsn \-\-version -.B ggsn +.B osmo-ggsn [ .BI \-\-help ] [ @@ -40,9 +40,9 @@ .BI \-\-version ] .SH DESCRIPTION -.B ggsn +.B osmo-ggsn is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Gateway GPRS Support Node. It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -62,14 +62,14 @@ The other interface can be thought of as the uplink interface, and interfaces the GGSN to an external data network. Gi is most often an interface to the Internet. -.B ggsn +.B osmo-ggsn uses the .B TUN/TAP driver for the Gi interface. A tun network interface is established when the -.B ggsn +.B osmo-ggsn is started. -.B ggsn +.B osmo-ggsn will accept incoming connections from mobile stations through the radio access network and the SGSN. When a connection request is received the ggsn will allocate a dynamic IP address for the mobile @@ -79,7 +79,7 @@ framework. Typically -.B ggsn +.B osmo-ggsn will be deployed with two Ethernet interfaces. One for the Gn/Gp interface, and one for the Gi interface. Policy routing and firewall rules should be used in order to separate Gi traffic from Gn/Gp @@ -105,25 +105,25 @@ (default = ./openggsn.cfg) .SH FILES -.I ./openggsn.cfg +.I ./osmo-ggsn.cfg .RS The configuration file for -.B ggsn. +.B osmo-ggsn. .RE -.I /var/run/ggsn.pid +.I /var/run/osmo-ggsn.pid .RS Process ID file. .RE -.I /var/lib/ggsn +.I /var/lib/osmo-ggsn .RS Directory holding nonvolatile data. .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at +Report all bugs to the OsmoGGSN bug tracking list at .I https://osmocom.org/projects/openggsn -.B ggsn +.B osmo-ggsn has very limited management support. Currently both SNMP as well as billing mechanisms are missing. @@ -135,13 +135,13 @@ .LP Besides the long options documented in this man page -.B ggsn +.B osmo-ggsn also accepts a number of short options with the same functionality. Use -.B ggsn --help +.B osmo-ggsn --help for a full list of all the available options. The TUN/TAP driver is required for proper operation of -.B ggsn. +.B osmo-ggsn. For linux kernels later than 2.4.7 the TUN/TAP driver is included in the kernel, but typically needs to be loaded manually with .B modprobe tun. For automatic loading the line @@ -152,7 +152,7 @@ .I http://vtun.sourceforge.net/tun/ for information on how to install and configure the tun driver. -.B ggsn +.B osmo-ggsn uses the GPRS Tunneling Protocol (GTP) as specified by the Third Generation Partnership Project (3GPP). 3GPP protocols specifications can be found at diff --git a/doc/sgsnemu.8 b/doc/sgsnemu.8 index af8f3ff..197bd5d 100644 --- a/doc/sgsnemu.8 +++ b/doc/sgsnemu.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -90,7 +90,7 @@ .SH DESCRIPTION .B sgsnemu is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Serving GPRS Support Node (SGSN) emulator. It can be used for testing Gateway GPRS Support Nodes (GGSNs), GPRS core networks as well as GPRS roaming connections. @@ -348,8 +348,8 @@ .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/sgsnemu/ +Report all bugs to the OsmoGGSN bug tracking list at +.I http://osmocom.org/projects/openggsn/issues .SH "SEE ALSO" diff --git a/examples/ggsn.init b/examples/ggsn.init deleted file mode 100644 index 7d9689a..0000000 --- a/examples/ggsn.init +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# ggsn This shell script takes care of starting and stopping -# ggsn. -# -# chkconfig: - 65 35 -# description: ggsn is a Gateway GPRS Support Node. - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -if [ -f /etc/sysconfig/ggsn ]; then - . /etc/sysconfig/ggsn -fi - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -f /usr/bin/ggsn ] || exit 0 -[ -f /etc/ggsn.conf ] || exit 0 - -RETVAL=0 -prog="ggsn" - -start() { - # Start daemons. - echo -n $"Starting $prog: " - - # Load tun module - /sbin/modprobe tun >/dev/null 2>&1 - - # Enable routing of packets: WARNING!!! - # Users should enable this explicitly - # echo 1 > /proc/sys/net/ipv4/ip_forward - - # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn - fi - - # Check for GTP restart counter - if [ ! -d /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart - fi - - - daemon /usr/bin/ggsn - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ggsn - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n $"Shutting down $prog: " - killproc ggsn - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ggsn /var/run/ggsn.pid - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/ggsn ] ; then - stop - start - RETVAL=$? - fi - ;; - status) - status ggsn - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL - diff --git a/examples/osmo-ggsn.init b/examples/osmo-ggsn.init new file mode 100644 index 0000000..2deb378 --- /dev/null +++ b/examples/osmo-ggsn.init @@ -0,0 +1,97 @@ +#!/bin/sh +# +# osmo-ggsn This shell script takes care of starting and stopping +# osmo-ggsn. +# +# chkconfig: - 65 35 +# description: osmo-ggsn is a Gateway GPRS Support Node. + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +if [ -f /etc/sysconfig/osmo-ggsn ]; then + . /etc/sysconfig/osmo-ggsn +fi + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -f /usr/bin/osmo-ggsn ] || exit 0 +[ -f /etc/osmo-ggsn.cfg ] || exit 0 + +RETVAL=0 +prog="osmo-ggsn" + +start() { + # Start daemons. + echo -n $"Starting $prog: " + + # Load tun module + /sbin/modprobe tun >/dev/null 2>&1 + + # Enable routing of packets: WARNING!!! + # Users should enable this explicitly + # echo 1 > /proc/sys/net/ipv4/ip_forward + + # Check for runtime directory of nonvolatile data + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn + fi + + # Check for GTP restart counter + if [ ! -d /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart + fi + + + daemon /usr/bin/osmo-ggsn + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/osmo-ggsn + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n $"Shutting down $prog: " + killproc osmo-ggsn + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f /var/lock/subsys/osmo-ggsn /var/run/osmo-ggsn.pid + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/osmo-ggsn ] ; then + stop + start + RETVAL=$? + fi + ;; + status) + status osmo-ggsn + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL + diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index fef12d3..8a468a9 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -1,19 +1,19 @@ -bin_PROGRAMS = ggsn +bin_PROGRAMS = osmo-ggsn AM_LDFLAGS = @EXEC_LDFLAGS@ AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) +osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD += -lgtpnl +osmo_ggsn_LDADD += -lgtpnl endif -ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a +osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL -ggsn_SOURCES += gtp-kernel.c +osmo_ggsn_SOURCES += gtp-kernel.c endif diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index e6fc117..5e85180 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte * @@ -590,7 +590,7 @@ return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } -static char *config_file = "openggsn.cfg"; +static char *config_file = "osmo-ggsn.cfg"; /* callback for tun device osmocom select loop integration */ static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) @@ -802,7 +802,7 @@ struct ggsn_ctx *ggsn; int rc; - tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "OsmoGGSN"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); /* Handle keyboard interrupt SIGINT */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index f23a298..4a3e753 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -882,7 +882,7 @@ "There is NO WARRANTY, to the extent permitted by law.\r\n"; struct vty_app_info g_vty_info = { - .name = "OpenGGSN", + .name = "OsmoGGSN", .version = PACKAGE_VERSION, .copyright = ggsn_copyright, .go_parent_cb = ggsn_vty_go_parent, diff --git a/gtp/gtp.c b/gtp/gtp.c index 87ab075..27a07b1 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1,6 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2010-2011, 2016-2017 Harald Welte + * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/gtp.h b/gtp/gtp.h index 7fa9ae7..b40c6df 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.c b/gtp/gtpie.c index c8db449..0744370 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.h b/gtp/gtpie.h index fb8598e..9fe7943 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/pdp.c b/gtp/pdp.c index c576a4e..ff9c681 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/pdp.h b/gtp/pdp.h index c51e9e2..cb98920 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.c b/gtp/queue.c index fbfa1ec..82cd7b4 100644 --- a/gtp/queue.c +++ b/gtp/queue.c @@ -1,7 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2011 Harald Welte + * Copyright (C) 2016 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.h b/gtp/queue.h index 556b6ef..2e253dd 100644 --- a/gtp/queue.h +++ b/gtp/queue.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/libgtp.pc.in b/libgtp.pc.in index 2201608..e6048e9 100644 --- a/libgtp.pc.in +++ b/libgtp.pc.in @@ -3,7 +3,7 @@ libdir=@libdir@ includedir=@includedir@ -Name: OpenGGSN STP Library +Name: OsmoGGSN GTP Library Description: C Utility Library Version: @VERSION@ Libs: -L${libdir} -lgtp diff --git a/openggsn.spec.in b/openggsn.spec.in deleted file mode 100644 index f15866e..0000000 --- a/openggsn.spec.in +++ /dev/null @@ -1,87 +0,0 @@ -Summary: Open Source Gateway GPRS Support Node (GGSN) -Name: @PACKAGE@ -Version: @VERSION@ -Release: 1 -URL: http://sourceforge.net/projects/ggsn/ -Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz -License: GPL -Group: System Environment/Daemons -BuildRoot: %{_tmppath}/%{name}-root - -%description -OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile -operators as the interface between the Internet and the rest of the -mobile network infrastructure. The project also provides an SGSN -emulator suitable for GPRS core network testing. - -%prep -%setup -q - -%build - -./configure --prefix=/usr --enable-static-exec - -make - -%install - -make install prefix=$RPM_BUILD_ROOT/usr -strip $RPM_BUILD_ROOT/usr/bin/ggsn -strip $RPM_BUILD_ROOT/usr/bin/sgsnemu - -#Copy ggsn init script in place -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d -install -m755 examples/ggsn.init \ - $RPM_BUILD_ROOT/etc/rc.d/init.d/ggsn - -#Copy ggsn.conf in place -install -m755 examples/ggsn.conf \ - $RPM_BUILD_ROOT/etc/ggsn.conf - -#Copy gsn_restart file in place -mkdir -p $RPM_BUILD_ROOT/var/lib/ggsn -echo "0" > $RPM_BUILD_ROOT/var/lib/ggsn/gsn_restart - -#Clean up unwanted library files -rm -rf $RPM_BUILD_ROOT/usr/include/* -rm -rf $RPM_BUILD_ROOT/usr/lib/* - - -%clean -rm -rf $RPM_BUILD_ROOT -make clean - -%post -/sbin/chkconfig --add ggsn - -%files -%defattr(-,root,root) - -/usr/bin/ggsn -/usr/bin/sgsnemu -/etc/rc.d/init.d/ggsn -%dir /var/lib/ggsn -/var/lib/ggsn/gsn_restart - -%doc AUTHORS COPYING INSTALL NEWS README.md -%doc examples/ggsn.conf -%doc examples/sgsnemu.conf -%doc examples/ggsn.init -%doc examples/firewall -%doc /usr/man/man8/ggsn.8.gz -%doc /usr/man/man8/sgsnemu.8.gz - -%config /etc/ggsn.conf - - -#/usr/lib/libgtp.a -#/usr/lib/libgtp.la -#/usr/lib/libgtp.so -#/usr/lib/libgtp.so.0 -#/usr/lib/libgtp.so.0.0.0 - - - -%changelog -* Mon Jun 30 2003 -- Initial build. diff --git a/osmo-ggsn.spec.in b/osmo-ggsn.spec.in new file mode 100644 index 0000000..9613bca --- /dev/null +++ b/osmo-ggsn.spec.in @@ -0,0 +1,90 @@ +Summary: Osmocom Gateway GPRS Support Node (GGSN) +Name: @PACKAGE@ +Version: @VERSION@ +Release: 1 +URL: https://osmocom.org/projects/openggsn +Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz +License: GPL +Group: System Environment/Daemons +BuildRoot: %{_tmppath}/%{name}-root + +%description +OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +operators as the interface between the Internet and the rest of the +mobile network infrastructure. The project also provides an SGSN +emulator suitable for GPRS core network testing. + +%prep +%setup -q + +%build + +./configure --prefix=/usr --enable-static-exec + +make + +%install + +make install prefix=$RPM_BUILD_ROOT/usr +strip $RPM_BUILD_ROOT/usr/bin/osmo-ggsn +strip $RPM_BUILD_ROOT/usr/bin/sgsnemu + +#Copy osmo-ggsn init script in place +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +install -m755 examples/osmo-ggsn.init \ + $RPM_BUILD_ROOT/etc/rc.d/init.d/osmo-ggsn + +#Copy osmo-ggsn.conf in place +install -m755 examples/osmo-ggsn.cfg \ + $RPM_BUILD_ROOT/etc/osmo-ggsn.cfg + +#Copy gsn_restart file in place +mkdir -p $RPM_BUILD_ROOT/var/lib/osmo-ggsn +echo "0" > $RPM_BUILD_ROOT/var/lib/osmo-ggsn/gsn_restart + +#Clean up unwanted library files +rm -rf $RPM_BUILD_ROOT/usr/include/* +rm -rf $RPM_BUILD_ROOT/usr/lib/* + + +%clean +rm -rf $RPM_BUILD_ROOT +make clean + +%post +/sbin/chkconfig --add osmo-ggsn + +%files +%defattr(-,root,root) + +/usr/bin/osmo-ggsn +/usr/bin/sgsnemu +/etc/rc.d/init.d/osmo-ggsn +%dir /var/lib/osmo-ggsn +/var/lib/osmo-ggsn/gsn_restart + +%doc AUTHORS COPYING INSTALL NEWS README.md +%doc examples/osmo-ggsn.conf +%doc examples/sgsnemu.conf +%doc examples/osmo-ggsn.init +%doc examples/firewall +%doc /usr/man/man8/osmo-ggsn.8.gz +%doc /usr/man/man8/sgsnemu.8.gz + +%config /etc/osmo-ggsn.cfg + + +#/usr/lib/libgtp.a +#/usr/lib/libgtp.la +#/usr/lib/libgtp.so +#/usr/lib/libgtp.so.0 +#/usr/lib/libgtp.so.0.0.0 + + + +%changelog +* Mon Jun 30 2017 +- Update to OsmoGGSN + +* Mon Jun 30 2003 +- Initial build. diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0c1b06c..ee5e55d 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -1,4 +1,4 @@ -# OpenGGSN - Gateway GPRS Support Node +# OsmoGGSN - Gateway GPRS Support Node # Copyright (C) 2002, 2003, 2004 Mondru AB. # # The contents of this file may be used under the terms of the GNU diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index ed1fb93..0157e22 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU -- To view, visit https://gerrit.osmocom.org/3851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:45:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:45:04 +0000 Subject: [PATCH] openggsn[master]: update jenkins.sh to conform with current build environment In-Reply-To: References: Message-ID: update jenkins.sh to conform with current build environment Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c --- M contrib/jenkins.sh 1 file changed, 32 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/55/3855/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 71ba909..f319acb 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,21 +1,39 @@ -#!/bin/sh +#!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +mkdir "$deps" || true +rm -rf "$inst" + +osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -mkdir deps || true -cd deps -osmo-deps.sh libosmocore +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" -cd libosmocore +set +x +echo +echo +echo +echo " =============================== openggsn ===============================" +echo +set -x + +cd "$base" autoreconf --install --force -./configure --prefix=$PWD/../install -$MAKE $PARALLEL_MAKE install - -cd ../../ - -autoreconf --install --force -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck +./configure +$MAKE $PARALLEL_MAKE +$MAKE distcheck -- To view, visit https://gerrit.osmocom.org/3855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:56:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 20:56:36 +0000 Subject: [PATCH] osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3783 to look at the new patch set (#2). separate libosmo-mgcp-client from mgcp server code When osmo-mgw is built --with-mgcp-transcoding, linking the mgcp library also requires linking libgsm, even though e.g. osmo-msc never use it. Separate the MGCP client code from the MGCP server code to avoid this dep. The mgcp client code does use some definitions from mgcp.h and mgcp_common.c. For simplicity, link mgcp_common.c in both libosmo-legacy-mgcp as well as libosmo-mgcp-client. That means it is not possible to link both libosmo-legacy-mgcp and libosmo-mgcp-client in the same binary because of duplicate symbols, but currently that is sufficient. (An alternative would be code dup or yet another libosmo-mgcp-common library.) Add libosmo-mgcp-client to debian packaging. Related: OS#2488 Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 --- M Makefile.am M configure.ac M debian/control M debian/rules M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/mgcp_client/Makefile.am R include/osmocom/mgcp_client/mgcpgw_client.h R include/osmocom/mgcp_client/mgcpgw_client_internal.h A libosmo-mgcp-client.pc.in M src/Makefile.am M src/libosmo-legacy-mgcp/Makefile.am A src/libosmo-mgcp-client/Makefile.am R src/libosmo-mgcp-client/mgcpgw_client.c R src/libosmo-mgcp-client/mgcpgw_client_vty.c M tests/Makefile.am M tests/legacy_mgcp/Makefile.am A tests/mgcp_client/Makefile.am R tests/mgcp_client/mgcpgw_client_test.c R tests/mgcp_client/mgcpgw_client_test.err R tests/mgcp_client/mgcpgw_client_test.ok M tests/testsuite.at 23 files changed, 133 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/83/3783/2 diff --git a/Makefile.am b/Makefile.am index c5c3137..8fb6e6c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,10 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libosmo-legacy-mgcp.pc +pkgconfig_DATA = \ + libosmo-legacy-mgcp.pc \ + libosmo-mgcp-client.pc \ + $(NULL) BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 5482b8c..86c3bc5 100644 --- a/configure.ac +++ b/configure.ac @@ -118,15 +118,19 @@ AC_OUTPUT( libosmo-legacy-mgcp.pc + libosmo-mgcp-client.pc include/Makefile include/osmocom/Makefile include/osmocom/legacy_mgcp/Makefile + include/osmocom/mgcp_client/Makefile src/Makefile src/libosmo-legacy-mgcp/Makefile + src/libosmo-mgcp-client/Makefile src/osmo-bsc_mgcp/Makefile tests/Makefile tests/atlocal tests/legacy_mgcp/Makefile + tests/mgcp_client/Makefile doc/Makefile doc/examples/Makefile contrib/Makefile diff --git a/debian/control b/debian/control index af49dc7..6556370 100644 --- a/debian/control +++ b/debian/control @@ -47,3 +47,25 @@ Multi-Arch: same Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library + +Package: libosmo-mgcp-client0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities + +Package: libosmo-mgcp-client-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities + +Package: libosmo-mgcp-client-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities diff --git a/debian/rules b/debian/rules index ee680cc..8976ede 100755 --- a/debian/rules +++ b/debian/rules @@ -32,3 +32,4 @@ override_dh_strip: dh_strip --dbg-package=osmo-mgw-dbg dh_strip --dbg-package=libosmo-legacy-mgcp-dbg + dh_strip --dbg-package=libosmo-mgcp-client-dbg diff --git a/include/Makefile.am b/include/Makefile.am index 73b1b3e..e2baf41 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,6 +5,6 @@ nobase_include_HEADERS = \ osmocom/legacy_mgcp/mgcp.h \ osmocom/legacy_mgcp/mgcp_internal.h \ - osmocom/legacy_mgcp/mgcpgw_client.h \ osmocom/legacy_mgcp/osmux.h \ + osmocom/mgcp_client/mgcpgw_client.h \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am index 6514436..be9f1ca 100644 --- a/include/osmocom/Makefile.am +++ b/include/osmocom/Makefile.am @@ -1,3 +1,4 @@ SUBDIRS = \ legacy_mgcp \ + mgcp_client \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/Makefile.am b/include/osmocom/legacy_mgcp/Makefile.am index 52f0b5b..4a9550c 100644 --- a/include/osmocom/legacy_mgcp/Makefile.am +++ b/include/osmocom/legacy_mgcp/Makefile.am @@ -1,5 +1,4 @@ noinst_HEADERS = \ - mgcpgw_client_internal.h \ mgcp_transcode.h \ vty.h \ $(NULL) diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am new file mode 100644 index 0000000..224a7dc --- /dev/null +++ b/include/osmocom/mgcp_client/Makefile.am @@ -0,0 +1,3 @@ +noinst_HEADERS = \ + mgcpgw_client_internal.h \ + $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client.h b/include/osmocom/mgcp_client/mgcpgw_client.h similarity index 100% rename from include/osmocom/legacy_mgcp/mgcpgw_client.h rename to include/osmocom/mgcp_client/mgcpgw_client.h diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client_internal.h b/include/osmocom/mgcp_client/mgcpgw_client_internal.h similarity index 100% rename from include/osmocom/legacy_mgcp/mgcpgw_client_internal.h rename to include/osmocom/mgcp_client/mgcpgw_client_internal.h diff --git a/libosmo-mgcp-client.pc.in b/libosmo-mgcp-client.pc.in new file mode 100644 index 0000000..aee86dc --- /dev/null +++ b/libosmo-mgcp-client.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom Media Gateway Control Protocol Client library +Description: C Utility Library +Version: @VERSION@ +Libs: -L${libdir} -losmo-mgcp-client +Cflags: -I${includedir}/ diff --git a/src/Makefile.am b/src/Makefile.am index f47bc00..922bbda 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libosmo-legacy-mgcp \ + libosmo-mgcp-client \ $(NULL) # Programs diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 42f25c0..32902b9 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -41,8 +41,6 @@ mgcp_vty.c \ mgcp_osmux.c \ mgcp_sdp.c \ - mgcpgw_client.c \ - mgcpgw_client_vty.c \ $(NULL) if BUILD_MGCP_TRANSCODING libosmo_legacy_mgcp_la_SOURCES += \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am new file mode 100644 index 0000000..02b9177 --- /dev/null +++ b/src/libosmo-mgcp-client/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_builddir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMONETIF_LIBS) \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +# This is _NOT_ the library release version, it's an API version. +# Please read Chapter 6 "Library interface versions" of the libtool +# documentation before making any modification +MGCP_CLIENT_LIBVERSION=1:0:0 + +lib_LTLIBRARIES = \ + libosmo-mgcp-client.la \ + $(NULL) + +libosmo_mgcp_client_la_SOURCES = \ + mgcpgw_client.c \ + mgcpgw_client_vty.c \ + ../libosmo-legacy-mgcp/mgcp_common.c \ + $(NULL) + +libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client.c b/src/libosmo-mgcp-client/mgcpgw_client.c similarity index 99% rename from src/libosmo-legacy-mgcp/mgcpgw_client.c rename to src/libosmo-mgcp-client/mgcpgw_client.c index 810ba16..7ed4b07 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client.c +++ b/src/libosmo-mgcp-client/mgcpgw_client.c @@ -24,10 +24,10 @@ #include #include -#include #include #include -#include +#include +#include #include #include diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client_vty.c b/src/libosmo-mgcp-client/mgcpgw_client_vty.c similarity index 98% rename from src/libosmo-legacy-mgcp/mgcpgw_client_vty.c rename to src/libosmo-mgcp-client/mgcpgw_client_vty.c index d101ded..034c84c 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client_vty.c +++ b/src/libosmo-mgcp-client/mgcpgw_client_vty.c @@ -28,7 +28,7 @@ #include #include -#include +#include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/Makefile.am b/tests/Makefile.am index f6cb938..ae51f89 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ legacy_mgcp \ + mgcp_client \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/legacy_mgcp/Makefile.am b/tests/legacy_mgcp/Makefile.am index e5f6888..f043124 100644 --- a/tests/legacy_mgcp/Makefile.am +++ b/tests/legacy_mgcp/Makefile.am @@ -20,13 +20,10 @@ EXTRA_DIST = \ mgcp_test.ok \ mgcp_transcoding_test.ok \ - mgcpgw_client_test.ok \ - mgcpgw_client_test.err \ $(NULL) noinst_PROGRAMS = \ mgcp_test \ - mgcpgw_client_test \ $(NULL) if BUILD_MGCP_TRANSCODING noinst_PROGRAMS += \ @@ -61,17 +58,4 @@ $(LIBOSMONETIF_LIBS) \ $(LIBRARY_GSM) \ -lm \ - $(NULL) - -mgcpgw_client_test_SOURCES = \ - mgcpgw_client_test.c \ - $(NULL) - -mgcpgw_client_test_LDADD = \ - $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBRARY_DL) \ - $(LIBOSMONETIF_LIBS) \ - $(LIBRARY_GSM) \ $(NULL) diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am new file mode 100644 index 0000000..2253770 --- /dev/null +++ b/tests/mgcp_client/Makefile.am @@ -0,0 +1,38 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + mgcpgw_client_test.ok \ + mgcpgw_client_test.err \ + $(NULL) + +noinst_PROGRAMS = \ + mgcpgw_client_test \ + $(NULL) + +mgcpgw_client_test_SOURCES = \ + mgcpgw_client_test.c \ + $(NULL) + +mgcpgw_client_test_LDADD = \ + $(top_builddir)/src/libosmo-mgcp-client/libosmo-mgcp-client.la \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBRARY_DL) \ + $(LIBOSMONETIF_LIBS) \ + $(NULL) diff --git a/tests/legacy_mgcp/mgcpgw_client_test.c b/tests/mgcp_client/mgcpgw_client_test.c similarity index 97% rename from tests/legacy_mgcp/mgcpgw_client_test.c rename to tests/mgcp_client/mgcpgw_client_test.c index 51d5272..e90a4ed 100644 --- a/tests/legacy_mgcp/mgcpgw_client_test.c +++ b/tests/mgcp_client/mgcpgw_client_test.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include void *ctx; diff --git a/tests/legacy_mgcp/mgcpgw_client_test.err b/tests/mgcp_client/mgcpgw_client_test.err similarity index 100% rename from tests/legacy_mgcp/mgcpgw_client_test.err rename to tests/mgcp_client/mgcpgw_client_test.err diff --git a/tests/legacy_mgcp/mgcpgw_client_test.ok b/tests/mgcp_client/mgcpgw_client_test.ok similarity index 100% rename from tests/legacy_mgcp/mgcpgw_client_test.ok rename to tests/mgcp_client/mgcpgw_client_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index dd59f2c..37347b3 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -14,9 +14,9 @@ AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcp_transcoding_test], [], [expout], [ignore]) AT_CLEANUP -AT_SETUP([legacy_mgcpgw_client]) -AT_KEYWORDS([legacy_mgcpgw_client]) -cat $abs_srcdir/legacy_mgcp/mgcpgw_client_test.ok > expout -cat $abs_srcdir/legacy_mgcp/mgcpgw_client_test.err > experr -AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcpgw_client_test], [], [expout], [experr]) +AT_SETUP([mgcpgw_client]) +AT_KEYWORDS([mgcpgw_client]) +cat $abs_srcdir/mgcp_client/mgcpgw_client_test.ok > expout +cat $abs_srcdir/mgcp_client/mgcpgw_client_test.err > experr +AT_CHECK([$abs_top_builddir/tests/mgcp_client/mgcpgw_client_test], [], [expout], [experr]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:58:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 20:58:52 +0000 Subject: openggsn[master]: update jenkins.sh to conform with current build environment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:59:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:59:07 +0000 Subject: [MERGED] openggsn[master]: update jenkins.sh to conform with current build environment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update jenkins.sh to conform with current build environment ...................................................................... update jenkins.sh to conform with current build environment Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c --- M contrib/jenkins.sh 1 file changed, 32 insertions(+), 14 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 71ba909..f319acb 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,21 +1,39 @@ -#!/bin/sh +#!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +mkdir "$deps" || true +rm -rf "$inst" + +osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false + verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -mkdir deps || true -cd deps -osmo-deps.sh libosmocore +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" -cd libosmocore +set +x +echo +echo +echo +echo " =============================== openggsn ===============================" +echo +set -x + +cd "$base" autoreconf --install --force -./configure --prefix=$PWD/../install -$MAKE $PARALLEL_MAKE install - -cd ../../ - -autoreconf --install --force -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH $MAKE $PARALLEL_MAKE -PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck +./configure +$MAKE $PARALLEL_MAKE +$MAKE distcheck -- To view, visit https://gerrit.osmocom.org/3855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I999d35cdffbdb61984da15d616f675005aa0688c Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:59:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:59:36 +0000 Subject: openggsn[master]: gtp-kernel: Remove dependency to cmdline.[ch] In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I760f25df609c309eba4d5716f3e23b49320449bf Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:59:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:59:41 +0000 Subject: openggsn[master]: lib/tun: Add missing #include to net/if.h for IFNAMSIZ In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I979867d643c9fa912884fe55105333dbad39ab97 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 20:59:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 20:59:49 +0000 Subject: openggsn[master]: lib/tun: Add 'void *priv' pointer to tun_t In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief43b9b5fab5830fa8e28362c795f88f0b4d353b Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:00:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:00:07 +0000 Subject: openggsn[master]: lib/in46_addr: Add in46a_ntoa() function, similar to inet_nt... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I752b7033a106a74dc219047da5c3a7ad3cd3602e Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:00:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 21:00:11 +0000 Subject: openggsn[master]: lib/in46_addr: Add in46a_ntoa() function, similar to inet_nt... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I752b7033a106a74dc219047da5c3a7ad3cd3602e Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:00:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:00:14 +0000 Subject: openggsn[master]: lib/in46_addr: Add 'struct in46_prefix' to represent addr + ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797d105117e81951732bcfc2cc26a8d00fd69443 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:00:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:00:22 +0000 Subject: openggsn[master]: lib/in46_addr: Avoid ASSERT() when in46a_ntop() is called on... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42d41ec1370b9cc15d372b649d8e1bc78e76af9b Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:00:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:00:32 +0000 Subject: openggsn[master]: lib/ippool: Add back-pointer from pool member to pool In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9042eb85989c5451d7894678eca110dd19e78002 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:00:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:00:51 +0000 Subject: openggsn[master]: lib/ippool: Move ippool_aton() out of ippool_new() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iadf6274e881a9bfc75eb41f9380f5ae2d8c92a0f Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:01:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:01:09 +0000 Subject: openggsn[master]: lib/tun.c: Proper cleanup during tun_new() error paths In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I285be20df76774ac7258b6edb3d4f2d28703757d Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:01:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:01:54 +0000 Subject: openggsn[master]: remove bogus 'version' script In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:02:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:02:30 +0000 Subject: openggsn[master]: Move examples to doc/examples and include them in DIST In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:03:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:03:03 +0000 Subject: osmo-msc[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:03:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:03:30 +0000 Subject: osmo-sgsn[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:03:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:03:49 +0000 Subject: osmo-bsc[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:05:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:05:29 +0000 Subject: libosmo-netif[master]: rtp: return offset in osmo_rtp_snprintf() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10066d73387be96a4e1f3349d700405beb138076 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:02 +0000 Subject: [MERGED] openggsn[master]: lib/tun.c: Proper cleanup during tun_new() error paths In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/tun.c: Proper cleanup during tun_new() error paths ...................................................................... lib/tun.c: Proper cleanup during tun_new() error paths Change-Id: I285be20df76774ac7258b6edb3d4f2d28703757d --- M lib/tun.c 1 file changed, 32 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.c b/lib/tun.c index c4b7d10..6ca9be7 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -748,7 +748,7 @@ /* Open the actual tun device */ if (((*tun)->fd = open("/dev/net/tun", O_RDWR)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "open() failed"); - return -1; + goto err_free; } /* Set device flags. For some weird reason this is also the method @@ -757,8 +757,7 @@ ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); - close((*tun)->fd); - return -1; + goto err_close; } strncpy((*tun)->devname, ifr.ifr_name, IFNAMSIZ); @@ -780,7 +779,7 @@ if ((*tun)->fd < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't find tunnel device"); - return -1; + goto err_free; } snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", devnum); @@ -798,7 +797,7 @@ /* Create a channel to the NET kernel. */ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "socket() failed"); - return -1; + goto err_close; } /* Delete any IP addresses until SIOCDIFADDR fails */ @@ -812,45 +811,53 @@ if ((ip_fd = open("/dev/udp", O_RDWR, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't open /dev/udp"); - return -1; + goto err_free; } if (((*tun)->fd = open("/dev/tun", O_RDWR, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't open /dev/tun"); - return -1; + close(ip_fd); + goto err_free; } /* Assign a new PPA and get its unit number. */ if ((ppa = ioctl((*tun)->fd, TUNNEWPPA, -1)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't assign new interface"); - return -1; + goto sun_close_ip; } if ((if_fd = open("/dev/tun", O_RDWR, 0)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't open /dev/tun (2)"); - return -1; + goto sun_close_ip; } if (ioctl(if_fd, I_PUSH, "ip") < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't push IP module"); - return -1; + goto sun_close_if; } /* Assign ppa according to the unit number returned by tun device */ if (ioctl(if_fd, IF_UNITSEL, (char *)&ppa) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't set PPA %d", ppa); - return -1; + goto sun_close_if; } /* Link the two streams */ if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't link TUN device to IP"); - return -1; + goto sun_close_if; + } + + /* Link the two streams */ + if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, errno, + "Can't link TUN device to IP"); + goto sun_close_if; } close(if_fd); @@ -866,7 +873,7 @@ ioctl(ip_fd, I_PUNLINK, muxid); SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't set multiplexor id"); - return -1; + goto sun_close_ip; } /* if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) @@ -874,10 +881,22 @@ return 0; +sun_close_if: + close(if_fd); +sun_close_ip: + close(ip_fd); + goto err_close; + #else #error "Unknown platform!" #endif +err_close: + close((*tun)->fd); +err_free: + free(*tun); + *tun = NULL; + return -1; } int tun_free(struct tun_t *tun) -- To view, visit https://gerrit.osmocom.org/3843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I285be20df76774ac7258b6edb3d4f2d28703757d Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:02 +0000 Subject: [MERGED] openggsn[master]: lib/ippool: Move ippool_aton() out of ippool_new() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/ippool: Move ippool_aton() out of ippool_new() ...................................................................... lib/ippool: Move ippool_aton() out of ippool_new() we rather pass the in46_prefix directly into ippool_new() Change-Id: Iadf6274e881a9bfc75eb41f9380f5ae2d8c92a0f --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h 3 files changed, 24 insertions(+), 29 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c82f630..7614b92 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -565,23 +565,24 @@ } /* dynip */ + struct in46_prefix i46p; + size_t prefixlen; if (!args_info.dynip_arg) { - if (ippool_new(&ippool, args_info.net_arg, NULL, 1, 0, - IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | - IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to allocate IP pool!"); + if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); exit(1); } } else { - if (ippool_new(&ippool, args_info.dynip_arg, NULL, 1, 0, - IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | - IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to allocate IP pool!"); + if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); exit(1); } } + i46p.prefixlen = prefixlen; + if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); + exit(1); + } /* DNS1 and DNS2 */ memset(&dns1, 0, sizeof(dns1)); diff --git a/lib/ippool.c b/lib/ippool.c index b1b242d..a236fe7 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -185,8 +185,8 @@ } /* Create new address pool */ -int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, - int allowdyn, int allowstat, int flags) +int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const struct in46_prefix *stat, + int flags) { /* Parse only first instance of pool for now */ @@ -200,14 +200,11 @@ int dynsize; unsigned int statsize; - if (!allowdyn) { + if (!dyn || dyn->addr.len == 0) { dynsize = 0; } else { - if (ippool_aton(&addr, &addrprefixlen, dyn, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Failed to parse dynamic pool"); - return -1; - } + addr = dyn->addr; + addrprefixlen = dyn->prefixlen; /* we want to work with /64 prefixes, i.e. allocate /64 prefixes rather * than /128 (single IPv6 addresses) */ if (addr.len == sizeof(struct in6_addr)) @@ -227,18 +224,15 @@ dynsize--; } - if (!allowstat) { + if (!stat || stat->addr.len == 0) { statsize = 0; stataddr.len = 0; stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &stataddrprefixlen, stat, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Failed to parse static range"); - return -1; - } + stataddr = stat->addr; + stataddrprefixlen = stat->prefixlen; - statsize = (1 << (addr.len - addrprefixlen + 1)) -1; + statsize = (1 << (addr.len - stataddrprefixlen + 1)) -1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -251,8 +245,8 @@ return -1; } - (*this)->allowdyn = allowdyn; - (*this)->allowstat = allowstat; + (*this)->allowdyn = dyn ? 1 : 0; + (*this)->allowstat = stat ? 1 : 0; if (stataddr.len > 0) (*this)->stataddr = stataddr; (*this)->stataddrprefixlen = stataddrprefixlen; diff --git a/lib/ippool.h b/lib/ippool.h index 8249b7f..fbac66d 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -71,8 +71,8 @@ extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ -extern int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, - int allowdyn, int allowstat, int flags); +extern int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, + const struct in46_prefix *stat, int flags); /* Delete existing address pool */ extern int ippool_free(struct ippool_t *this); -- To view, visit https://gerrit.osmocom.org/3842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iadf6274e881a9bfc75eb41f9380f5ae2d8c92a0f Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:03 +0000 Subject: [MERGED] openggsn[master]: lib/ippool: Add back-pointer from pool member to pool In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/ippool: Add back-pointer from pool member to pool ...................................................................... lib/ippool: Add back-pointer from pool member to pool This allows us to remove pool members without having to keep a pointer to the pool around. Change-Id: I9042eb85989c5451d7894678eca110dd19e78002 --- M lib/ippool.c M lib/ippool.h 2 files changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/ippool.c b/lib/ippool.c index 1729ec7..b1b242d 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -295,6 +295,7 @@ in46a_inc(&addr); (*this)->member[i].inuse = 0; + (*this)->member[i].pool = *this; /* Insert into list of unused */ (*this)->member[i].prev = (*this)->lastdyn; @@ -315,6 +316,7 @@ struct in46_addr *i6al = &(*this)->member[i].addr; memset(i6al, 0, sizeof(*i6al)); (*this)->member[i].inuse = 0; + (*this)->member[i].pool = *this; /* Insert into list of unused */ (*this)->member[i].prev = (*this)->laststat; diff --git a/lib/ippool.h b/lib/ippool.h index ba92a56..8249b7f 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -56,6 +56,7 @@ struct ippoolm_t { struct in46_addr addr; /* IP address of this member */ + struct ippool_t *pool; /* Pool to which we belong */ int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ -- To view, visit https://gerrit.osmocom.org/3841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9042eb85989c5451d7894678eca110dd19e78002 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:03 +0000 Subject: [MERGED] openggsn[master]: lib/in46_addr: Avoid ASSERT() when in46a_ntop() is called on... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/in46_addr: Avoid ASSERT() when in46a_ntop() is called on uninitialized address ...................................................................... lib/in46_addr: Avoid ASSERT() when in46a_ntop() is called on uninitialized address Change-Id: I42d41ec1370b9cc15d372b649d8e1bc78e76af9b --- M lib/in46_addr.c 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 6864c64..4b5fd64 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -62,7 +62,14 @@ /*! Convenience wrapper around inet_ntop() for \ref in46_addr */ const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) { - int af = in46a_to_af(in); + int af; + + if (!in || in->len == 0) { + strncpy(dst, "UNDEFINED", dst_size); + return dst; + } + + af = in46a_to_af(in); if (af < 0) return NULL; -- To view, visit https://gerrit.osmocom.org/3840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42d41ec1370b9cc15d372b649d8e1bc78e76af9b Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:03 +0000 Subject: [MERGED] openggsn[master]: lib/in46_addr: Add 'struct in46_prefix' to represent addr + ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/in46_addr: Add 'struct in46_prefix' to represent addr + prefix ...................................................................... lib/in46_addr: Add 'struct in46_prefix' to represent addr + prefix Change-Id: I797d105117e81951732bcfc2cc26a8d00fd69443 --- M lib/in46_addr.c M lib/in46_addr.h 2 files changed, 13 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 4e7cbcd..6864c64 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -79,6 +79,13 @@ return addrstr_buf; } +const char *in46p_ntoa(const struct in46_prefix *in46p) +{ + static char addrstr_buf[256]; + snprintf(addrstr_buf, sizeof(addrstr_buf), "%s/%u", in46a_ntoa(&in46p->addr), in46p->prefixlen); + return addrstr_buf; +} + /*! Determine if two in46_addr are equal or not * \returns 1 in case they are equal; 0 otherwise */ int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index 1614c1d..ce2df14 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -14,10 +14,16 @@ }; }; +struct in46_prefix { + struct in46_addr addr; + uint8_t prefixlen; +}; + extern int in46a_to_af(const struct in46_addr *in); extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern const char *in46a_ntoa(const struct in46_addr *in46); +extern const char *in46p_ntoa(const struct in46_prefix *in46p); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); -- To view, visit https://gerrit.osmocom.org/3839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I797d105117e81951732bcfc2cc26a8d00fd69443 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:03 +0000 Subject: [MERGED] openggsn[master]: lib/in46_addr: Add in46a_ntoa() function, similar to inet_nt... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/in46_addr: Add in46a_ntoa() function, similar to inet_ntoa() ...................................................................... lib/in46_addr: Add in46a_ntoa() function, similar to inet_ntoa() Change-Id: I752b7033a106a74dc219047da5c3a7ad3cd3602e --- M lib/in46_addr.c M lib/in46_addr.h 2 files changed, 11 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 8f5cc09..4e7cbcd 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -69,6 +69,16 @@ return inet_ntop(af, (const void *) &in->v4, dst, dst_size); } +/* like inet_ntoa() */ +const char *in46a_ntoa(const struct in46_addr *in46) +{ + static char addrstr_buf[256]; + if (in46a_ntop(in46, addrstr_buf, sizeof(addrstr_buf)) < 0) + return "INVALID"; + else + return addrstr_buf; +} + /*! Determine if two in46_addr are equal or not * \returns 1 in case they are equal; 0 otherwise */ int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index 0afd2b4..1614c1d 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -17,6 +17,7 @@ extern int in46a_to_af(const struct in46_addr *in); extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); +extern const char *in46a_ntoa(const struct in46_addr *in46); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); -- To view, visit https://gerrit.osmocom.org/3838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I752b7033a106a74dc219047da5c3a7ad3cd3602e Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:03 +0000 Subject: [MERGED] openggsn[master]: lib/tun: Add 'void *priv' pointer to tun_t In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/tun: Add 'void *priv' pointer to tun_t ...................................................................... lib/tun: Add 'void *priv' pointer to tun_t This allows the application to attach some private state to the tun device, such as the context from which it was created/allocated Change-Id: Ief43b9b5fab5830fa8e28362c795f88f0b4d353b --- M lib/tun.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.h b/lib/tun.h index 8fa1c61..67ef39d 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -61,6 +61,8 @@ int routes; /* One if we allocated an automatic route */ char devname[IFNAMSIZ]; /* Name of the tun device */ int (*cb_ind) (struct tun_t * tun, void *pack, unsigned len); + /* to be used by libgtp callers/users (to attach their own private state) */ + void *priv; }; extern int tun_new(struct tun_t **tun); -- To view, visit https://gerrit.osmocom.org/3837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief43b9b5fab5830fa8e28362c795f88f0b4d353b Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:04 +0000 Subject: [MERGED] openggsn[master]: lib/tun: Add missing #include to net/if.h for IFNAMSIZ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/tun: Add missing #include to net/if.h for IFNAMSIZ ...................................................................... lib/tun: Add missing #include to net/if.h for IFNAMSIZ Change-Id: I979867d643c9fa912884fe55105333dbad39ab97 --- M lib/tun.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.h b/lib/tun.h index 1cd0767..8fa1c61 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -13,6 +13,8 @@ #ifndef _TUN_H #define _TUN_H +#include + #include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ -- To view, visit https://gerrit.osmocom.org/3836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I979867d643c9fa912884fe55105333dbad39ab97 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:06:04 +0000 Subject: [MERGED] openggsn[master]: gtp-kernel: Remove dependency to cmdline.[ch] In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp-kernel: Remove dependency to cmdline.[ch] ...................................................................... gtp-kernel: Remove dependency to cmdline.[ch] Change-Id: I760f25df609c309eba4d5716f3e23b49320449bf --- M ggsn/ggsn.c M ggsn/gtp-kernel.c M ggsn/gtp-kernel.h 3 files changed, 14 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 1e92956..c82f630 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -710,8 +710,12 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) - goto err; + if (args_info.gtp_linux_given) { + if (gtp_kernel_init(gsn, &net.v4, prefixlen, args_info.net_arg) < 0) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to initialize kernel GTP\n"); + goto err; + } + } gtp_set_cb_data_ind(gsn, encaps_tun); gtp_set_cb_delete_context(gsn, delete_context); diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c index 458ac27..f98586d 100644 --- a/ggsn/gtp-kernel.c +++ b/ggsn/gtp-kernel.c @@ -27,7 +27,6 @@ #include "../lib/syserr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" -#include "cmdline.h" #include #include @@ -80,12 +79,8 @@ #define GTP_DEVNAME "gtp0" int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - size_t prefixlen, - struct gengetopt_args_info *args_info) + size_t prefixlen, const char *net_arg) { - if (!args_info->gtp_linux_given) - return 0; - if (gtp_dev_create(-1, GTP_DEVNAME, gsn->fd0, gsn->fd1u) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "cannot create GTP tunnel device: %s\n", @@ -113,12 +108,12 @@ } DEBUGP(DGGSN, "Setting route to reach %s via %s\n", - args_info->net_arg, GTP_DEVNAME); + net_arg, GTP_DEVNAME); if (gtp_dev_config(GTP_DEVNAME, net, prefixlen) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add route to reach network %s\n", - args_info->net_arg); + net_arg); } /* launch script if it is set to bring up the route to reach @@ -132,7 +127,7 @@ /* eg. /home/ggsn/ipup gtp0 10.0.0.0/8 */ snprintf(cmd, sizeof(cmd), "%s %s %s", - ipup, GTP_DEVNAME, args_info->net_arg); + ipup, GTP_DEVNAME, net_arg); cmd[sizeof(cmd)-1] = '\0'; err = system(cmd); diff --git a/ggsn/gtp-kernel.h b/ggsn/gtp-kernel.h index b3b29e3..34fd7bf 100644 --- a/ggsn/gtp-kernel.h +++ b/ggsn/gtp-kernel.h @@ -8,8 +8,7 @@ #ifdef GTP_KERNEL int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - size_t prefixlen, - struct gengetopt_args_info *args_info); + size_t prefixlen, const char *net_arg); void gtp_kernel_stop(void); int gtp_kernel_tunnel_add(struct pdp_t *pdp); @@ -19,15 +18,10 @@ #else static inline int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - size_t prefixlen, - struct gengetopt_args_info *args_info) + size_t prefixlen, const char *net_arg) { - if (args_info->gtp_linux_given) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "ggsn compiled without GTP kernel support!\n"); - return -1; - } - return 0; + SYS_ERR(DGGSN, LOGL_ERROR, 0, "ggsn compiled without GTP kernel support!\n"); + return -1; } static inline void gtp_kernel_stop(void) {} -- To view, visit https://gerrit.osmocom.org/3835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I760f25df609c309eba4d5716f3e23b49320449bf Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:06:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 21:06:44 +0000 Subject: osmo-msc[master]: --enable-iu by default In-Reply-To: References: Message-ID: Patch Set 1: > I'm not entirely convinced if this is the way to go. Compiling > libosmo-ui takes quite long, and I think the number of users of the > 3G Osmocom stack is still much lower than that of the 2G stack? I assumed we would "always" build with 3G support from now on and it seemed silly to always require --enable-iu (sort of like --enable-bsc in osmo-bsc), but if you see it that way I accept that and we can keep --disable-iu as default. -- To view, visit https://gerrit.osmocom.org/3786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:07:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 21:07:38 +0000 Subject: osmo-sgsn[master]: --enable-iu by default In-Reply-To: References: Message-ID: Patch Set 1: same here, if you prefer we can keep --disable-iu as default -- To view, visit https://gerrit.osmocom.org/3788 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04b07ffead5d5394651d80711d2de06162eeed14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:14:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:14:52 +0000 Subject: [PATCH] openggsn[master]: libgtp: Remove ctrl_handle from gsn_t, replace with private ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3844 to look at the new patch set (#4). libgtp: Remove ctrl_handle from gsn_t, replace with private context The control interface handle never belonged into libgtp in the first place. Commit 727417dd28813c697b4820aef9f54f249e30c4b8 should not have added this to the shared library (used by sgsnemu, osmo-sgsn, ...), but to some private state of the GGSN. Introducing a private context pointer at the same location will keep ABI compatibilty. Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5 --- M ggsn/ggsn.c M gtp/gtp.h 2 files changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/44/3844/4 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 7614b92..d865707 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -148,7 +148,7 @@ snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); - if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { + if (ctrl_cmd_send_trap(gsn->priv, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); return false; } @@ -722,8 +722,8 @@ gtp_set_cb_delete_context(gsn, delete_context); gtp_set_cb_create_context_ind(gsn, create_context_ind); - gsn->ctrl = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); - if (!gsn->ctrl) { + gsn->priv = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); + if (!gsn->priv) { LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); exit(1); } diff --git a/gtp/gtp.h b/gtp/gtp.h index 8f13ed2..7fa9ae7 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -12,8 +12,6 @@ #ifndef _GTP_H #define _GTP_H -#include - #define GTP_MODE_GGSN 1 #define GTP_MODE_SGSN 2 @@ -247,7 +245,7 @@ unsigned char restart_counter; /* Increment on restart. Stored on disk */ char *statedir; /* Disk location for permanent storage */ - struct ctrl_handle *ctrl; /* Control Interface */ + void *priv; /* used by libgtp users to attach their own state) */ struct queue_t *queue_req; /* Request queue */ struct queue_t *queue_resp; /* Response queue */ -- To view, visit https://gerrit.osmocom.org/3844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:16:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:16:31 +0000 Subject: osmo-msc[master]: --enable-iu by default In-Reply-To: References: Message-ID: Patch Set 1: always building with 3G support has some advantages in teerms of nobody easily submitting patches that wouldn't build with Iu enabled. But then on the other hand, I'm still not happy with the many hacks in asn1c/libasn1c and requiring users to install our slightly improved for of another groups ugly fork ... -- To view, visit https://gerrit.osmocom.org/3786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:11 +0000 Subject: openggsn[master]: libgtp: Remove ctrl_handle from gsn_t, replace with private ... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:13 +0000 Subject: [MERGED] openggsn[master]: libgtp: Remove ctrl_handle from gsn_t, replace with private ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: Remove ctrl_handle from gsn_t, replace with private context ...................................................................... libgtp: Remove ctrl_handle from gsn_t, replace with private context The control interface handle never belonged into libgtp in the first place. Commit 727417dd28813c697b4820aef9f54f249e30c4b8 should not have added this to the shared library (used by sgsnemu, osmo-sgsn, ...), but to some private state of the GGSN. Introducing a private context pointer at the same location will keep ABI compatibilty. Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5 --- M ggsn/ggsn.c M gtp/gtp.h 2 files changed, 4 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 7614b92..d865707 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -148,7 +148,7 @@ snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); - if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { + if (ctrl_cmd_send_trap(gsn->priv, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); return false; } @@ -722,8 +722,8 @@ gtp_set_cb_delete_context(gsn, delete_context); gtp_set_cb_create_context_ind(gsn, create_context_ind); - gsn->ctrl = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); - if (!gsn->ctrl) { + gsn->priv = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); + if (!gsn->priv) { LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); exit(1); } diff --git a/gtp/gtp.h b/gtp/gtp.h index 8f13ed2..7fa9ae7 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -12,8 +12,6 @@ #ifndef _GTP_H #define _GTP_H -#include - #define GTP_MODE_GGSN 1 #define GTP_MODE_SGSN 2 @@ -247,7 +245,7 @@ unsigned char restart_counter; /* Increment on restart. Stored on disk */ char *statedir; /* Disk location for permanent storage */ - struct ctrl_handle *ctrl; /* Control Interface */ + void *priv; /* used by libgtp users to attach their own state) */ struct queue_t *queue_req; /* Request queue */ struct queue_t *queue_resp; /* Response queue */ -- To view, visit https://gerrit.osmocom.org/3844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f17516dae3e04114564828a3e5f6e2ea54212a5 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:27 +0000 Subject: [PATCH] openggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3848 to look at the new patch set (#4). Introduce a VTY, factually turning OpenGGSN into an Osmocom program Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 --- M doc/ggsn.8 D examples/ggsn.conf A examples/osmo-ggsn.cfg M ggsn/Makefile.am D ggsn/cmdline.c D ggsn/cmdline.ggo D ggsn/cmdline.h M ggsn/ggsn.c A ggsn/ggsn.h A ggsn/ggsn_vty.c M lib/tun.c M lib/tun.h M sgsnemu/sgsnemu.c 13 files changed, 1,673 insertions(+), 2,177 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/48/3848/4 diff --git a/doc/ggsn.8 b/doc/ggsn.8 index 62d467a..89dcb61b 100644 --- a/doc/ggsn.8 +++ b/doc/ggsn.8 @@ -31,33 +31,13 @@ .B ggsn [ -.BI \-\-fg +.BI \-\-help ] [ -.BI \-\-debug +.BI \-\-daemonize ] [ -.BI \-\-conf " file" +.BI \-\-config-file " file" ] [ -.BI \-\-pidfile " file" -] [ -.BI \-\-statedir " file" -] [ -.BI \-\-listen " host" -] [ -.BI \-\-net " net" -] [ -.BI \-\-ipup " script" -] [ -.BI \-\-ipdown " script" -] [ -.BI \-\-dynip " net" -] [ -.BI \-\-statip " net" -] [ -.BI \-\-pcodns1 " host" -] [ -.BI \-\-pcodns2 " host" -] [ -.BI \-\-timelimit " seconds" +.BI \-\-version ] .SH DESCRIPTION .B ggsn @@ -115,86 +95,17 @@ Print version and exit. .TP -.BI --fg -Run in foreground (default = off) +.BI --daemonize +Run in background as a daemon (default = off) .TP -.BI --debug -Run in debug mode (default = off) - -.TP -.BI --conf " file" +.BI --config-file " file" Read configuration .I file -(default = /etc/ggsn.conf) where each line corresponds to one command -line option, but with the leading '--' removed. Command line options -override the options given in the configuration file. - -.TP -.BI --pidfile " file" -Filename of process id -.I file -(default = /var/run/ggsn.pid) - -.TP -.BI --statedir " path" -.I path -to directory of nonvolatile data (default = /var/lib/ggsn/) - -.TP -.BI --listen " host" -Local interface IP address to use for the Gn/Gp interface. This option -must be specified. For security issues it is not possible to use -INADDR_ANY. - -.TP -.BI --net " net" -Network address of the Gi interface (default = 192.168.0.0/24). The -network address is set during initialisation when -.B ggsn -establishes a tun device for the Gi interface. - -.TP -.BI --ipup " script" -Script executed after the Gi tun network interface has been brought -up. Executed with the following parameters: - -.TP -.BI --ipdown " script" -Script executed after the Gi tun network interface has been taken -down. Executed with the following parameters: - -.TP -.BI --dynip " net" -Dynamic IP address pool. Specifies a pool of dynamic IP addresses. If -this option is omitted the network address specified by the -.BI --net -option is used for dynamic IP address allocation. - -.TP -.BI --pcodns1 " host" -PCO DNS Server 1 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --pcodns2 " host" -PCO DNS Server 2 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --timelimit " seconds" -Exit -.B ggsn -after \fIseconds\fP. Used for debugging. - +(default = ./openggsn.cfg) .SH FILES -.I /etc/ggsn.conf +.I ./openggsn.cfg .RS The configuration file for .B ggsn. @@ -210,7 +121,7 @@ .SH BUGS Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/ggsn/ +.I https://osmocom.org/projects/openggsn .B ggsn has very limited management support. Currently both SNMP as well as @@ -250,6 +161,7 @@ .SH COPYRIGHT Copyright (C) 2002, 2003 by Mondru AB. +Copyright (C) 2017 Harald Welte The contents of this file may be used under the terms of the GNU General Public License Version 2, provided that the above copyright @@ -258,3 +170,4 @@ .SH AUTHORS Jens Jakobsen +Harald Welte diff --git a/examples/ggsn.conf b/examples/ggsn.conf deleted file mode 100644 index 6dcfe44..0000000 --- a/examples/ggsn.conf +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################## -# -# Sample ggsn configuration file -# -############################################################################## - -# TAG: fg -# Include this flag if process is to run in the foreground -# -#fg - -# TAG: debug -# Include this flag to include debug information. -#debug - - -# TAG: conf -# Configuration file to use. This file is the configuration file, -# so changing this parameter in the configuration file does not make -# sense. Use it on the command line instead. - -# TAG: pidfile -# File to store information about the process id of the program. -# The program must have write access to this file/directory. -#pidfile /var/run/ggsn.pid - -# TAG: statedir -# Directory to use for nonvolatile storage. -# The program must have write access to this directory. -#statedir /var/lib/ggsn/ - - -# TAG: listen -# Specifies the local IP address to listen to -#listen 10.0.0.240 - -# TAG: net -# IP network address of external packet data network -# Used to set up network interface. -#net 192.168.0.0/24 - -# TAG: ipup -# Script executed after network interface has been brought up. -# Executed with the following parameters: -#ipup /etc/ggsn/ip-up - -# TAG: ipdown -# Script executed after network interface has been taken down. -# Executed with the following parameters: -#ipdown /etc/ggsn/ip-down - -# TAG: dynip -# Dynamic IP address pool. -# Used for allocation of dynamic IP address when address is not given -# by HLR. -# If this option is not given then the net option is used as a substitute. -#dynip 192.168.0.0/24 - -# TAG: statip -# Use of this tag is currently UNSUPPORTED -# Static IP address pool. -# Used for allocation of static IP address by means of HLR. -#statip 192.168.1.0/24 - -# TAG: pcodns1 -# Protocol configuration option domain name system server 1. -#pcodns1 0.0.0.0 - -# TAG: pcodns2 -# Protocol configuration option domain name system server 2. -#pcodns2 0.0.0.0 - -# TAG: timelimit -# Exit after timelimit seconds. -# Setting timelimit to zero will cause the program not to exit. -#timelimit 0 - -# TAG: apn -# Use of this tag is EXPERIMENTAL -# Access point name to connect to when run in client mode. -#apn internet - -# TAG: qos -# Use of this tag is EXPERIMENTAL -# Requested Quality of Service used when run in client mode. -# 3 bytes corresponding to ???? -#qos 0x0b921f - -# TAG: qos -# Enable GTP datapath through Linux kernel driver gtp.ko (since 4.7). -#gtp-linux - diff --git a/examples/osmo-ggsn.cfg b/examples/osmo-ggsn.cfg new file mode 100644 index 0000000..763e561 --- /dev/null +++ b/examples/osmo-ggsn.cfg @@ -0,0 +1,71 @@ +! +! OpenGGSN (0.94.1-adac) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging print category 0 + logging timestamp 0 + logging level ip info + logging level tun info + logging level ggsn info + logging level sgsn notice + logging level icmp6 notice + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp info + logging level lstats notice + logging level lgsup notice + logging level loap notice + logging level lss7 notice + logging level lsccp notice + logging level lsua notice + logging level lm3ua notice + logging level lmgcp notice +! +stats interval 5 +! +line vty + no login +! +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown + apn inet6 + gtpu-mode tun + tun-device tun6 + type-support v6 + ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2000:0:0:0:0/56 + no shutdown + apn inet46 + gtpu-mode tun + tun-device tun46 + type-support v4v6 + ip prefix dynamic 176.16.46.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.46.0/24 + ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 + no shutdown + default-apn internet + no shutdown ggsn diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index c945f0b..fef12d3 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -2,17 +2,17 @@ AM_LDFLAGS = @EXEC_LDFLAGS@ -AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) + +ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD = @EXEC_LDADD@ -lgtp -lgtpnl -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) -else -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) +ggsn_LDADD += -lgtpnl endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/cmdline.c b/ggsn/cmdline.c deleted file mode 100644 index 31c0744..0000000 --- a/ggsn/cmdline.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* - File autogenerated by gengetopt version 2.22.6 - generated with the following command: - gengetopt -i cmdline.ggo --conf-parser - - The developers of gengetopt consider the fixed text that goes in all - gengetopt output files to be in the public domain: - we make no copyright claims on it. -*/ - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#ifndef FIX_UNUSED -#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ -#endif - -#include - -#include "cmdline.h" - -const char *gengetopt_args_info_purpose = ""; - -const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; - -const char *gengetopt_args_info_versiontext = ""; - -const char *gengetopt_args_info_description = ""; - -const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -f, --fg Run in foreground (default=off)", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file (default=`/etc/ggsn.conf')", - " --pidfile=STRING Filename of process id file\n (default=`/var/run/ggsn.pid')", - " --statedir=STRING Directory of nonvolatile data\n (default=`/var/lib/ggsn/')", - " -l, --listen=STRING Local interface", - " -n, --net=STRING Network (default=`192.168.0.0/24')", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --dynip=STRING Dynamic IP address pool", - " --statip=STRING Static IP address pool", - " --pcodns1=STRING PCO DNS Server 1 (default=`0.0.0.0')", - " --pcodns2=STRING PCO DNS Server 2 (default=`0.0.0.0')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " -a, --apn=STRING Access point name (default=`internet')", - " -q, --qos=INT Requested quality of service (default=`0x0b921f')", - " --logfile=STRING Logfile for errors", - " --loglevel=STRING Global log ldevel (default=`error')", - " -g, --gtp-linux GTP linux kernel support (default=off)", - 0 -}; - -typedef enum {ARG_NO - , ARG_FLAG - , ARG_STRING - , ARG_INT -} cmdline_parser_arg_type; - -static -void clear_given (struct gengetopt_args_info *args_info); -static -void clear_args (struct gengetopt_args_info *args_info); - -static int -cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error); - -struct line_list -{ - char * string_arg; - struct line_list * next; -}; - -static struct line_list *cmd_line_list = 0; -static struct line_list *cmd_line_list_tmp = 0; - -static void -free_cmd_list(void) -{ - /* free the list of a previous call */ - if (cmd_line_list) - { - while (cmd_line_list) { - cmd_line_list_tmp = cmd_line_list; - cmd_line_list = cmd_line_list->next; - free (cmd_line_list_tmp->string_arg); - free (cmd_line_list_tmp); - } - } -} - - -static char * -gengetopt_strdup (const char *s); - -static -void clear_given (struct gengetopt_args_info *args_info) -{ - args_info->help_given = 0 ; - args_info->version_given = 0 ; - args_info->fg_given = 0 ; - args_info->debug_given = 0 ; - args_info->conf_given = 0 ; - args_info->pidfile_given = 0 ; - args_info->statedir_given = 0 ; - args_info->listen_given = 0 ; - args_info->net_given = 0 ; - args_info->ipup_given = 0 ; - args_info->ipdown_given = 0 ; - args_info->dynip_given = 0 ; - args_info->statip_given = 0 ; - args_info->pcodns1_given = 0 ; - args_info->pcodns2_given = 0 ; - args_info->timelimit_given = 0 ; - args_info->apn_given = 0 ; - args_info->qos_given = 0 ; - args_info->logfile_given = 0 ; - args_info->loglevel_given = 0 ; - args_info->gtp_linux_given = 0 ; -} - -static -void clear_args (struct gengetopt_args_info *args_info) -{ - FIX_UNUSED (args_info); - args_info->fg_flag = 0; - args_info->debug_flag = 0; - args_info->conf_arg = gengetopt_strdup ("/etc/ggsn.conf"); - args_info->conf_orig = NULL; - args_info->pidfile_arg = gengetopt_strdup ("/var/run/ggsn.pid"); - args_info->pidfile_orig = NULL; - args_info->statedir_arg = gengetopt_strdup ("/var/lib/ggsn/"); - args_info->statedir_orig = NULL; - args_info->listen_arg = NULL; - args_info->listen_orig = NULL; - args_info->net_arg = gengetopt_strdup ("192.168.0.0/24"); - args_info->net_orig = NULL; - args_info->ipup_arg = NULL; - args_info->ipup_orig = NULL; - args_info->ipdown_arg = NULL; - args_info->ipdown_orig = NULL; - args_info->dynip_arg = NULL; - args_info->dynip_orig = NULL; - args_info->statip_arg = NULL; - args_info->statip_orig = NULL; - args_info->pcodns1_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns1_orig = NULL; - args_info->pcodns2_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns2_orig = NULL; - args_info->timelimit_arg = 0; - args_info->timelimit_orig = NULL; - args_info->apn_arg = gengetopt_strdup ("internet"); - args_info->apn_orig = NULL; - args_info->qos_arg = 0x0b921f; - args_info->qos_orig = NULL; - args_info->logfile_arg = NULL; - args_info->logfile_orig = NULL; - args_info->loglevel_arg = gengetopt_strdup ("error"); - args_info->loglevel_orig = NULL; - args_info->gtp_linux_flag = 0; - -} - -static -void init_args_info(struct gengetopt_args_info *args_info) -{ - - - args_info->help_help = gengetopt_args_info_help[0] ; - args_info->version_help = gengetopt_args_info_help[1] ; - args_info->fg_help = gengetopt_args_info_help[2] ; - args_info->debug_help = gengetopt_args_info_help[3] ; - args_info->conf_help = gengetopt_args_info_help[4] ; - args_info->pidfile_help = gengetopt_args_info_help[5] ; - args_info->statedir_help = gengetopt_args_info_help[6] ; - args_info->listen_help = gengetopt_args_info_help[7] ; - args_info->net_help = gengetopt_args_info_help[8] ; - args_info->ipup_help = gengetopt_args_info_help[9] ; - args_info->ipdown_help = gengetopt_args_info_help[10] ; - args_info->dynip_help = gengetopt_args_info_help[11] ; - args_info->statip_help = gengetopt_args_info_help[12] ; - args_info->pcodns1_help = gengetopt_args_info_help[13] ; - args_info->pcodns2_help = gengetopt_args_info_help[14] ; - args_info->timelimit_help = gengetopt_args_info_help[15] ; - args_info->apn_help = gengetopt_args_info_help[16] ; - args_info->qos_help = gengetopt_args_info_help[17] ; - args_info->logfile_help = gengetopt_args_info_help[18] ; - args_info->loglevel_help = gengetopt_args_info_help[19] ; - args_info->gtp_linux_help = gengetopt_args_info_help[20] ; - -} - -void -cmdline_parser_print_version (void) -{ - printf ("%s %s\n", - (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), - CMDLINE_PARSER_VERSION); - - if (strlen(gengetopt_args_info_versiontext) > 0) - printf("\n%s\n", gengetopt_args_info_versiontext); -} - -static void print_help_common(void) { - cmdline_parser_print_version (); - - if (strlen(gengetopt_args_info_purpose) > 0) - printf("\n%s\n", gengetopt_args_info_purpose); - - if (strlen(gengetopt_args_info_usage) > 0) - printf("\n%s\n", gengetopt_args_info_usage); - - printf("\n"); - - if (strlen(gengetopt_args_info_description) > 0) - printf("%s\n\n", gengetopt_args_info_description); -} - -void -cmdline_parser_print_help (void) -{ - int i = 0; - print_help_common(); - while (gengetopt_args_info_help[i]) - printf("%s\n", gengetopt_args_info_help[i++]); -} - -void -cmdline_parser_init (struct gengetopt_args_info *args_info) -{ - clear_given (args_info); - clear_args (args_info); - init_args_info (args_info); -} - -void -cmdline_parser_params_init(struct cmdline_parser_params *params) -{ - if (params) - { - params->override = 0; - params->initialize = 1; - params->check_required = 1; - params->check_ambiguity = 0; - params->print_errors = 1; - } -} - -struct cmdline_parser_params * -cmdline_parser_params_create(void) -{ - struct cmdline_parser_params *params = - (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); - cmdline_parser_params_init(params); - return params; -} - -static void -free_string_field (char **s) -{ - if (*s) - { - free (*s); - *s = 0; - } -} - - -static void -cmdline_parser_release (struct gengetopt_args_info *args_info) -{ - - free_string_field (&(args_info->conf_arg)); - free_string_field (&(args_info->conf_orig)); - free_string_field (&(args_info->pidfile_arg)); - free_string_field (&(args_info->pidfile_orig)); - free_string_field (&(args_info->statedir_arg)); - free_string_field (&(args_info->statedir_orig)); - free_string_field (&(args_info->listen_arg)); - free_string_field (&(args_info->listen_orig)); - free_string_field (&(args_info->net_arg)); - free_string_field (&(args_info->net_orig)); - free_string_field (&(args_info->ipup_arg)); - free_string_field (&(args_info->ipup_orig)); - free_string_field (&(args_info->ipdown_arg)); - free_string_field (&(args_info->ipdown_orig)); - free_string_field (&(args_info->dynip_arg)); - free_string_field (&(args_info->dynip_orig)); - free_string_field (&(args_info->statip_arg)); - free_string_field (&(args_info->statip_orig)); - free_string_field (&(args_info->pcodns1_arg)); - free_string_field (&(args_info->pcodns1_orig)); - free_string_field (&(args_info->pcodns2_arg)); - free_string_field (&(args_info->pcodns2_orig)); - free_string_field (&(args_info->timelimit_orig)); - free_string_field (&(args_info->apn_arg)); - free_string_field (&(args_info->apn_orig)); - free_string_field (&(args_info->qos_orig)); - free_string_field (&(args_info->logfile_arg)); - free_string_field (&(args_info->logfile_orig)); - free_string_field (&(args_info->loglevel_arg)); - free_string_field (&(args_info->loglevel_orig)); - - - - clear_given (args_info); -} - - -static void -write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) -{ - FIX_UNUSED (values); - if (arg) { - fprintf(outfile, "%s=\"%s\"\n", opt, arg); - } else { - fprintf(outfile, "%s\n", opt); - } -} - - -int -cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) -{ - int i = 0; - - if (!outfile) - { - fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); - return EXIT_FAILURE; - } - - if (args_info->help_given) - write_into_file(outfile, "help", 0, 0 ); - if (args_info->version_given) - write_into_file(outfile, "version", 0, 0 ); - if (args_info->fg_given) - write_into_file(outfile, "fg", 0, 0 ); - if (args_info->debug_given) - write_into_file(outfile, "debug", 0, 0 ); - if (args_info->conf_given) - write_into_file(outfile, "conf", args_info->conf_orig, 0); - if (args_info->pidfile_given) - write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); - if (args_info->statedir_given) - write_into_file(outfile, "statedir", args_info->statedir_orig, 0); - if (args_info->listen_given) - write_into_file(outfile, "listen", args_info->listen_orig, 0); - if (args_info->net_given) - write_into_file(outfile, "net", args_info->net_orig, 0); - if (args_info->ipup_given) - write_into_file(outfile, "ipup", args_info->ipup_orig, 0); - if (args_info->ipdown_given) - write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); - if (args_info->dynip_given) - write_into_file(outfile, "dynip", args_info->dynip_orig, 0); - if (args_info->statip_given) - write_into_file(outfile, "statip", args_info->statip_orig, 0); - if (args_info->pcodns1_given) - write_into_file(outfile, "pcodns1", args_info->pcodns1_orig, 0); - if (args_info->pcodns2_given) - write_into_file(outfile, "pcodns2", args_info->pcodns2_orig, 0); - if (args_info->timelimit_given) - write_into_file(outfile, "timelimit", args_info->timelimit_orig, 0); - if (args_info->apn_given) - write_into_file(outfile, "apn", args_info->apn_orig, 0); - if (args_info->qos_given) - write_into_file(outfile, "qos", args_info->qos_orig, 0); - if (args_info->logfile_given) - write_into_file(outfile, "logfile", args_info->logfile_orig, 0); - if (args_info->loglevel_given) - write_into_file(outfile, "loglevel", args_info->loglevel_orig, 0); - if (args_info->gtp_linux_given) - write_into_file(outfile, "gtp-linux", 0, 0 ); - - - i = EXIT_SUCCESS; - return i; -} - -int -cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) -{ - FILE *outfile; - int i = 0; - - outfile = fopen(filename, "w"); - - if (!outfile) - { - fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - i = cmdline_parser_dump(outfile, args_info); - fclose (outfile); - - return i; -} - -void -cmdline_parser_free (struct gengetopt_args_info *args_info) -{ - cmdline_parser_release (args_info); -} - -/** @brief replacement of strdup, which is not standard */ -char * -gengetopt_strdup (const char *s) -{ - char *result = 0; - if (!s) - return result; - - result = (char*)malloc(strlen(s) + 1); - if (result == (char*)0) - return (char*)0; - strcpy(result, s); - return result; -} - -int -cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) -{ - return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); -} - -int -cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int result; - result = cmdline_parser_internal (argc, argv, args_info, params, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) -{ - int result; - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) -{ - FIX_UNUSED (args_info); - FIX_UNUSED (prog_name); - return EXIT_SUCCESS; -} - - -static char *package_name = 0; - -/** - * @brief updates an option - * @param field the generic pointer to the field to update - * @param orig_field the pointer to the orig field - * @param field_given the pointer to the number of occurrence of this option - * @param prev_given the pointer to the number of occurrence already seen - * @param value the argument for this option (if null no arg was specified) - * @param possible_values the possible values for this option (if specified) - * @param default_value the default value (in case the option only accepts fixed values) - * @param arg_type the type of this option - * @param check_ambiguity @see cmdline_parser_params.check_ambiguity - * @param override @see cmdline_parser_params.override - * @param no_free whether to free a possible previous value - * @param multiple_option whether this is a multiple option - * @param long_opt the corresponding long option - * @param short_opt the corresponding short option (or '-' if none) - * @param additional_error possible further error specification - */ -static -int update_arg(void *field, char **orig_field, - unsigned int *field_given, unsigned int *prev_given, - char *value, const char *possible_values[], - const char *default_value, - cmdline_parser_arg_type arg_type, - int check_ambiguity, int override, - int no_free, int multiple_option, - const char *long_opt, char short_opt, - const char *additional_error) -{ - char *stop_char = 0; - const char *val = value; - int found; - char **string_field; - FIX_UNUSED (field); - - stop_char = 0; - found = 0; - - if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) - { - if (short_opt != '-') - fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", - package_name, long_opt, short_opt, - (additional_error ? additional_error : "")); - else - fprintf (stderr, "%s: `--%s' option given more than once%s\n", - package_name, long_opt, - (additional_error ? additional_error : "")); - return 1; /* failure */ - } - - FIX_UNUSED (default_value); - - if (field_given && *field_given && ! override) - return 0; - if (prev_given) - (*prev_given)++; - if (field_given) - (*field_given)++; - if (possible_values) - val = possible_values[found]; - - switch(arg_type) { - case ARG_FLAG: - *((int *)field) = !*((int *)field); - break; - case ARG_INT: - if (val) *((int *)field) = strtol (val, &stop_char, 0); - break; - case ARG_STRING: - if (val) { - string_field = (char **)field; - if (!no_free && *string_field) - free (*string_field); /* free previous string */ - *string_field = gengetopt_strdup (val); - } - break; - default: - break; - }; - - /* check numeric conversion */ - switch(arg_type) { - case ARG_INT: - if (val && !(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); - return 1; /* failure */ - } - break; - default: - ; - }; - - /* store the original value */ - switch(arg_type) { - case ARG_NO: - case ARG_FLAG: - break; - default: - if (value && orig_field) { - if (no_free) { - *orig_field = value; - } else { - if (*orig_field) - free (*orig_field); /* free previous string */ - *orig_field = gengetopt_strdup (value); - } - } - }; - - return 0; /* OK */ -} - - -int -cmdline_parser_internal ( - int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error) -{ - int c; /* Character of the parsed option. */ - - int error_occurred = 0; - struct gengetopt_args_info local_args_info; - - int override; - int initialize; - int check_required; - int check_ambiguity; - - package_name = argv[0]; - - override = params->override; - initialize = params->initialize; - check_required = params->check_required; - check_ambiguity = params->check_ambiguity; - - if (initialize) - cmdline_parser_init (args_info); - - cmdline_parser_init (&local_args_info); - - optarg = 0; - optind = 0; - opterr = params->print_errors; - optopt = '?'; - - while (1) - { - int option_index = 0; - - static struct option long_options[] = { - { "help", 0, NULL, 'h' }, - { "version", 0, NULL, 'V' }, - { "fg", 0, NULL, 'f' }, - { "debug", 0, NULL, 'd' }, - { "conf", 1, NULL, 'c' }, - { "pidfile", 1, NULL, 0 }, - { "statedir", 1, NULL, 0 }, - { "listen", 1, NULL, 'l' }, - { "net", 1, NULL, 'n' }, - { "ipup", 1, NULL, 0 }, - { "ipdown", 1, NULL, 0 }, - { "dynip", 1, NULL, 0 }, - { "statip", 1, NULL, 0 }, - { "pcodns1", 1, NULL, 0 }, - { "pcodns2", 1, NULL, 0 }, - { "timelimit", 1, NULL, 0 }, - { "apn", 1, NULL, 'a' }, - { "qos", 1, NULL, 'q' }, - { "logfile", 1, NULL, 0 }, - { "loglevel", 1, NULL, 0 }, - { "gtp-linux", 0, NULL, 'g' }, - { 0, 0, 0, 0 } - }; - - c = getopt_long (argc, argv, "hVfdc:l:n:a:q:g", long_options, &option_index); - - if (c == -1) break; /* Exit from `while (1)' loop. */ - - switch (c) - { - case 'h': /* Print help and exit. */ - cmdline_parser_print_help (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'V': /* Print version and exit. */ - cmdline_parser_print_version (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'f': /* Run in foreground. */ - - - if (update_arg((void *)&(args_info->fg_flag), 0, &(args_info->fg_given), - &(local_args_info.fg_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "fg", 'f', - additional_error)) - goto failure; - - break; - case 'd': /* Run in debug mode. */ - - - if (update_arg((void *)&(args_info->debug_flag), 0, &(args_info->debug_given), - &(local_args_info.debug_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "debug", 'd', - additional_error)) - goto failure; - - break; - case 'c': /* Read configuration file. */ - - - if (update_arg( (void *)&(args_info->conf_arg), - &(args_info->conf_orig), &(args_info->conf_given), - &(local_args_info.conf_given), optarg, 0, "/etc/ggsn.conf", ARG_STRING, - check_ambiguity, override, 0, 0, - "conf", 'c', - additional_error)) - goto failure; - - break; - case 'l': /* Local interface. */ - - - if (update_arg( (void *)&(args_info->listen_arg), - &(args_info->listen_orig), &(args_info->listen_given), - &(local_args_info.listen_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "listen", 'l', - additional_error)) - goto failure; - - break; - case 'n': /* Network. */ - - - if (update_arg( (void *)&(args_info->net_arg), - &(args_info->net_orig), &(args_info->net_given), - &(local_args_info.net_given), optarg, 0, "192.168.0.0/24", ARG_STRING, - check_ambiguity, override, 0, 0, - "net", 'n', - additional_error)) - goto failure; - - break; - case 'a': /* Access point name. */ - - - if (update_arg( (void *)&(args_info->apn_arg), - &(args_info->apn_orig), &(args_info->apn_given), - &(local_args_info.apn_given), optarg, 0, "internet", ARG_STRING, - check_ambiguity, override, 0, 0, - "apn", 'a', - additional_error)) - goto failure; - - break; - case 'q': /* Requested quality of service. */ - - - if (update_arg( (void *)&(args_info->qos_arg), - &(args_info->qos_orig), &(args_info->qos_given), - &(local_args_info.qos_given), optarg, 0, "0x0b921f", ARG_INT, - check_ambiguity, override, 0, 0, - "qos", 'q', - additional_error)) - goto failure; - - break; - case 'g': /* GTP linux kernel support. */ - - - if (update_arg((void *)&(args_info->gtp_linux_flag), 0, &(args_info->gtp_linux_given), - &(local_args_info.gtp_linux_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "gtp-linux", 'g', - additional_error)) - goto failure; - - break; - - case 0: /* Long option with no short option */ - /* Filename of process id file. */ - if (strcmp (long_options[option_index].name, "pidfile") == 0) - { - - - if (update_arg( (void *)&(args_info->pidfile_arg), - &(args_info->pidfile_orig), &(args_info->pidfile_given), - &(local_args_info.pidfile_given), optarg, 0, "/var/run/ggsn.pid", ARG_STRING, - check_ambiguity, override, 0, 0, - "pidfile", '-', - additional_error)) - goto failure; - - } - /* Directory of nonvolatile data. */ - else if (strcmp (long_options[option_index].name, "statedir") == 0) - { - - - if (update_arg( (void *)&(args_info->statedir_arg), - &(args_info->statedir_orig), &(args_info->statedir_given), - &(local_args_info.statedir_given), optarg, 0, "/var/lib/ggsn/", ARG_STRING, - check_ambiguity, override, 0, 0, - "statedir", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-up. */ - else if (strcmp (long_options[option_index].name, "ipup") == 0) - { - - - if (update_arg( (void *)&(args_info->ipup_arg), - &(args_info->ipup_orig), &(args_info->ipup_given), - &(local_args_info.ipup_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipup", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-down. */ - else if (strcmp (long_options[option_index].name, "ipdown") == 0) - { - - - if (update_arg( (void *)&(args_info->ipdown_arg), - &(args_info->ipdown_orig), &(args_info->ipdown_given), - &(local_args_info.ipdown_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipdown", '-', - additional_error)) - goto failure; - - } - /* Dynamic IP address pool. */ - else if (strcmp (long_options[option_index].name, "dynip") == 0) - { - - - if (update_arg( (void *)&(args_info->dynip_arg), - &(args_info->dynip_orig), &(args_info->dynip_given), - &(local_args_info.dynip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "dynip", '-', - additional_error)) - goto failure; - - } - /* Static IP address pool. */ - else if (strcmp (long_options[option_index].name, "statip") == 0) - { - - - if (update_arg( (void *)&(args_info->statip_arg), - &(args_info->statip_orig), &(args_info->statip_given), - &(local_args_info.statip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "statip", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 1. */ - else if (strcmp (long_options[option_index].name, "pcodns1") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns1_arg), - &(args_info->pcodns1_orig), &(args_info->pcodns1_given), - &(local_args_info.pcodns1_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns1", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 2. */ - else if (strcmp (long_options[option_index].name, "pcodns2") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns2_arg), - &(args_info->pcodns2_orig), &(args_info->pcodns2_given), - &(local_args_info.pcodns2_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns2", '-', - additional_error)) - goto failure; - - } - /* Exit after timelimit seconds. */ - else if (strcmp (long_options[option_index].name, "timelimit") == 0) - { - - - if (update_arg( (void *)&(args_info->timelimit_arg), - &(args_info->timelimit_orig), &(args_info->timelimit_given), - &(local_args_info.timelimit_given), optarg, 0, "0", ARG_INT, - check_ambiguity, override, 0, 0, - "timelimit", '-', - additional_error)) - goto failure; - - } - /* Logfile for errors. */ - else if (strcmp (long_options[option_index].name, "logfile") == 0) - { - - - if (update_arg( (void *)&(args_info->logfile_arg), - &(args_info->logfile_orig), &(args_info->logfile_given), - &(local_args_info.logfile_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "logfile", '-', - additional_error)) - goto failure; - - } - /* Global log ldevel. */ - else if (strcmp (long_options[option_index].name, "loglevel") == 0) - { - - - if (update_arg( (void *)&(args_info->loglevel_arg), - &(args_info->loglevel_orig), &(args_info->loglevel_given), - &(local_args_info.loglevel_given), optarg, 0, "error", ARG_STRING, - check_ambiguity, override, 0, 0, - "loglevel", '-', - additional_error)) - goto failure; - - } - - break; - case '?': /* Invalid option. */ - /* `getopt_long' already printed an error message. */ - goto failure; - - default: /* bug: option not considered. */ - fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); - abort (); - } /* switch */ - } /* while */ - - - - - cmdline_parser_release (&local_args_info); - - if ( error_occurred ) - return (EXIT_FAILURE); - - return 0; - -failure: - - cmdline_parser_release (&local_args_info); - return (EXIT_FAILURE); -} - -#ifndef CONFIG_FILE_LINE_SIZE -#define CONFIG_FILE_LINE_SIZE 2048 -#endif -#define ADDITIONAL_ERROR " in configuration file " - -#define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) -/* 3 is for "--" and "=" */ - -static int -_cmdline_parser_configfile (const char *filename, int *my_argc) -{ - FILE* file; - char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE+1]; - char linebuf[CONFIG_FILE_LINE_SIZE]; - int line_num = 0; - int result = 0, equal; - char *fopt, *farg; - char *str_index; - size_t len, next_token; - char delimiter; - - if ((file = fopen(filename, "r")) == 0) - { - fprintf (stderr, "%s: Error opening configuration file '%s'\n", - CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) - { - ++line_num; - my_argv[0] = '\0'; - len = strlen(linebuf); - if (len > (CONFIG_FILE_LINE_BUFFER_SIZE-1)) - { - fprintf (stderr, "%s:%s:%d: Line too long in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - - /* find first non-whitespace character in the line */ - next_token = strspn (linebuf, " \t\r\n"); - str_index = linebuf + next_token; - - if ( str_index[0] == '\0' || str_index[0] == '#') - continue; /* empty line or comment line is skipped */ - - fopt = str_index; - - /* truncate fopt at the end of the first non-valid character */ - next_token = strcspn (fopt, " \t\r\n="); - - if (fopt[next_token] == '\0') /* the line is over */ - { - farg = 0; - equal = 0; - goto noarg; - } - - /* remember if equal sign is present */ - equal = (fopt[next_token] == '='); - fopt[next_token++] = '\0'; - - /* advance pointers to the next token after the end of fopt */ - next_token += strspn (fopt + next_token, " \t\r\n"); - - /* check for the presence of equal sign, and if so, skip it */ - if ( !equal ) - if ((equal = (fopt[next_token] == '='))) - { - next_token++; - next_token += strspn (fopt + next_token, " \t\r\n"); - } - str_index += next_token; - - /* find argument */ - farg = str_index; - if ( farg[0] == '\"' || farg[0] == '\'' ) - { /* quoted argument */ - str_index = strchr (++farg, str_index[0] ); /* skip opening quote */ - if (! str_index) - { - fprintf - (stderr, - "%s:%s:%d: unterminated string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - else - { /* read up the remaining part up to a delimiter */ - next_token = strcspn (farg, " \t\r\n#\'\""); - str_index += next_token; - } - - /* truncate farg at the delimiter and store it for further check */ - delimiter = *str_index, *str_index++ = '\0'; - - /* everything but comment is illegal at the end of line */ - if (delimiter != '\0' && delimiter != '#') - { - str_index += strspn(str_index, " \t\r\n"); - if (*str_index != '\0' && *str_index != '#') - { - fprintf - (stderr, - "%s:%s:%d: malformed string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - - noarg: - if (!strcmp(fopt,"include")) { - if (farg && *farg) { - result = _cmdline_parser_configfile(farg, my_argc); - } else { - fprintf(stderr, "%s:%s:%d: include requires a filename argument.\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - } - continue; - } - len = strlen(fopt); - strcat (my_argv, len > 1 ? "--" : "-"); - strcat (my_argv, fopt); - if (len > 1 && ((farg && *farg) || equal)) - strcat (my_argv, "="); - if (farg && *farg) - strcat (my_argv, farg); - ++(*my_argc); - - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(my_argv); - } /* while */ - - if (file) - fclose(file); - return result; -} - -int -cmdline_parser_configfile ( - const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required) -{ - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - return cmdline_parser_config_file (filename, args_info, ¶ms); -} - -int -cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int i, result; - int my_argc = 1; - char **my_argv_arg; - char *additional_error; - - /* store the program name */ - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup (CMDLINE_PARSER_PACKAGE); - - result = _cmdline_parser_configfile(filename, &my_argc); - - if (result != EXIT_FAILURE) { - my_argv_arg = (char **) malloc((my_argc+1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - - my_argv_arg[my_argc] = 0; - - additional_error = (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy (additional_error, ADDITIONAL_ERROR); - strcat (additional_error, filename); - result = - cmdline_parser_internal (my_argc, my_argv_arg, args_info, - params, - additional_error); - - free (additional_error); - free (my_argv_arg); - } - - free_cmd_list(); - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} diff --git a/ggsn/cmdline.ggo b/ggsn/cmdline.ggo deleted file mode 100644 index 7426707..0000000 --- a/ggsn/cmdline.ggo +++ /dev/null @@ -1,38 +0,0 @@ -# OpenGGSN - Gateway GPRS Support Node -# Copyright (C) 2002, 2003, 2004 Mondru AB. -# -# The contents of this file may be used under the terms of the GNU -# General Public License Version 2, provided that the above copyright -# notice and this permission notice is included in all copies or -# substantial portions of the software. -# -# Use "gengetopt --conf-parser < cmdline.ggo" -# to generate cmdline.c and cmdline.h - -option "fg" f "Run in foreground" flag off -option "debug" d "Run in debug mode" flag off - -option "conf" c "Read configuration file" string default="/etc/ggsn.conf" no -option "pidfile" - "Filename of process id file" string default="/var/run/ggsn.pid" no -option "statedir" - "Directory of nonvolatile data" string default="/var/lib/ggsn/" no - -option "listen" l "Local interface" string no -option "net" n "Network" string default="192.168.0.0/24" no -option "ipup" - "Script to run after link-up" string no -option "ipdown" - "Script to run after link-down" string no - -option "dynip" - "Dynamic IP address pool" string no -option "statip" - "Static IP address pool" string no - -option "pcodns1" - "PCO DNS Server 1" string default="0.0.0.0" no -option "pcodns2" - "PCO DNS Server 2" string default="0.0.0.0" no - -option "timelimit" - "Exit after timelimit seconds" int default="0" no - -option "apn" a "Access point name" string default="internet" no -option "qos" q "Requested quality of service" int default="0x0b921f" no -option "logfile" - "Logfile for errors" string no -option "loglevel" - "Global log ldevel" string default="error" no - -option "gtp-linux" g "GTP linux kernel support" flag off - diff --git a/ggsn/cmdline.h b/ggsn/cmdline.h deleted file mode 100644 index 57f5cae..0000000 --- a/ggsn/cmdline.h +++ /dev/null @@ -1,275 +0,0 @@ -/** @file cmdline.h - * @brief The header file for the command line option parser - * generated by GNU Gengetopt version 2.22.6 - * http://www.gnu.org/software/gengetopt. - * DO NOT modify this file, since it can be overwritten - * @author GNU Gengetopt by Lorenzo Bettini */ - -#ifndef CMDLINE_H -#define CMDLINE_H - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include /* for FILE */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef CMDLINE_PARSER_PACKAGE -/** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE -#endif - -#ifndef CMDLINE_PARSER_PACKAGE_NAME -/** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif -#endif - -#ifndef CMDLINE_PARSER_VERSION -/** @brief the program version */ -#define CMDLINE_PARSER_VERSION VERSION -#endif - -/** @brief Where the command line options are stored */ -struct gengetopt_args_info -{ - const char *help_help; /**< @brief Print help and exit help description. */ - const char *version_help; /**< @brief Print version and exit help description. */ - int fg_flag; /**< @brief Run in foreground (default=off). */ - const char *fg_help; /**< @brief Run in foreground help description. */ - int debug_flag; /**< @brief Run in debug mode (default=off). */ - const char *debug_help; /**< @brief Run in debug mode help description. */ - char * conf_arg; /**< @brief Read configuration file (default='/etc/ggsn.conf'). */ - char * conf_orig; /**< @brief Read configuration file original value given at command line. */ - const char *conf_help; /**< @brief Read configuration file help description. */ - char * pidfile_arg; /**< @brief Filename of process id file (default='/var/run/ggsn.pid'). */ - char * pidfile_orig; /**< @brief Filename of process id file original value given at command line. */ - const char *pidfile_help; /**< @brief Filename of process id file help description. */ - char * statedir_arg; /**< @brief Directory of nonvolatile data (default='/var/lib/ggsn/'). */ - char * statedir_orig; /**< @brief Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /**< @brief Directory of nonvolatile data help description. */ - char * listen_arg; /**< @brief Local interface. */ - char * listen_orig; /**< @brief Local interface original value given at command line. */ - const char *listen_help; /**< @brief Local interface help description. */ - char * net_arg; /**< @brief Network (default='192.168.0.0/24'). */ - char * net_orig; /**< @brief Network original value given at command line. */ - const char *net_help; /**< @brief Network help description. */ - char * ipup_arg; /**< @brief Script to run after link-up. */ - char * ipup_orig; /**< @brief Script to run after link-up original value given at command line. */ - const char *ipup_help; /**< @brief Script to run after link-up help description. */ - char * ipdown_arg; /**< @brief Script to run after link-down. */ - char * ipdown_orig; /**< @brief Script to run after link-down original value given at command line. */ - const char *ipdown_help; /**< @brief Script to run after link-down help description. */ - char * dynip_arg; /**< @brief Dynamic IP address pool. */ - char * dynip_orig; /**< @brief Dynamic IP address pool original value given at command line. */ - const char *dynip_help; /**< @brief Dynamic IP address pool help description. */ - char * statip_arg; /**< @brief Static IP address pool. */ - char * statip_orig; /**< @brief Static IP address pool original value given at command line. */ - const char *statip_help; /**< @brief Static IP address pool help description. */ - char * pcodns1_arg; /**< @brief PCO DNS Server 1 (default='0.0.0.0'). */ - char * pcodns1_orig; /**< @brief PCO DNS Server 1 original value given at command line. */ - const char *pcodns1_help; /**< @brief PCO DNS Server 1 help description. */ - char * pcodns2_arg; /**< @brief PCO DNS Server 2 (default='0.0.0.0'). */ - char * pcodns2_orig; /**< @brief PCO DNS Server 2 original value given at command line. */ - const char *pcodns2_help; /**< @brief PCO DNS Server 2 help description. */ - int timelimit_arg; /**< @brief Exit after timelimit seconds (default='0'). */ - char * timelimit_orig; /**< @brief Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /**< @brief Exit after timelimit seconds help description. */ - char * apn_arg; /**< @brief Access point name (default='internet'). */ - char * apn_orig; /**< @brief Access point name original value given at command line. */ - const char *apn_help; /**< @brief Access point name help description. */ - int qos_arg; /**< @brief Requested quality of service (default='0x0b921f'). */ - char * qos_orig; /**< @brief Requested quality of service original value given at command line. */ - const char *qos_help; /**< @brief Requested quality of service help description. */ - char * logfile_arg; /**< @brief Logfile for errors. */ - char * logfile_orig; /**< @brief Logfile for errors original value given at command line. */ - const char *logfile_help; /**< @brief Logfile for errors help description. */ - char * loglevel_arg; /**< @brief Global log ldevel (default='error'). */ - char * loglevel_orig; /**< @brief Global log ldevel original value given at command line. */ - const char *loglevel_help; /**< @brief Global log ldevel help description. */ - int gtp_linux_flag; /**< @brief GTP linux kernel support (default=off). */ - const char *gtp_linux_help; /**< @brief GTP linux kernel support help description. */ - - unsigned int help_given ; /**< @brief Whether help was given. */ - unsigned int version_given ; /**< @brief Whether version was given. */ - unsigned int fg_given ; /**< @brief Whether fg was given. */ - unsigned int debug_given ; /**< @brief Whether debug was given. */ - unsigned int conf_given ; /**< @brief Whether conf was given. */ - unsigned int pidfile_given ; /**< @brief Whether pidfile was given. */ - unsigned int statedir_given ; /**< @brief Whether statedir was given. */ - unsigned int listen_given ; /**< @brief Whether listen was given. */ - unsigned int net_given ; /**< @brief Whether net was given. */ - unsigned int ipup_given ; /**< @brief Whether ipup was given. */ - unsigned int ipdown_given ; /**< @brief Whether ipdown was given. */ - unsigned int dynip_given ; /**< @brief Whether dynip was given. */ - unsigned int statip_given ; /**< @brief Whether statip was given. */ - unsigned int pcodns1_given ; /**< @brief Whether pcodns1 was given. */ - unsigned int pcodns2_given ; /**< @brief Whether pcodns2 was given. */ - unsigned int timelimit_given ; /**< @brief Whether timelimit was given. */ - unsigned int apn_given ; /**< @brief Whether apn was given. */ - unsigned int qos_given ; /**< @brief Whether qos was given. */ - unsigned int logfile_given ; /**< @brief Whether logfile was given. */ - unsigned int loglevel_given ; /**< @brief Whether loglevel was given. */ - unsigned int gtp_linux_given ; /**< @brief Whether gtp-linux was given. */ - -} ; - -/** @brief The additional parameters to pass to parser functions */ -struct cmdline_parser_params -{ - int override; /**< @brief whether to override possibly already present options (default 0) */ - int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ - int check_required; /**< @brief whether to check that all required options were provided (default 1) */ - int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ - int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ -} ; - -/** @brief the purpose string of the program */ -extern const char *gengetopt_args_info_purpose; -/** @brief the usage string of the program */ -extern const char *gengetopt_args_info_usage; -/** @brief the description string of the program */ -extern const char *gengetopt_args_info_description; -/** @brief all the lines making the help output */ -extern const char *gengetopt_args_info_help[]; - -/** - * The command line parser - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser (int argc, char **argv, - struct gengetopt_args_info *args_info); - -/** - * The command line parser (version with additional parameters - deprecated) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_ext() instead - */ -int cmdline_parser2 (int argc, char **argv, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The command line parser (version with additional parameters) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_ext (int argc, char **argv, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Save the contents of the option struct into an already open FILE stream. - * @param outfile the stream where to dump options - * @param args_info the option struct to dump - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_dump(FILE *outfile, - struct gengetopt_args_info *args_info); - -/** - * Save the contents of the option struct into a (text) file. - * This file can be read by the config file parser (if generated by gengetopt) - * @param filename the file where to save - * @param args_info the option struct to save - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_file_save(const char *filename, - struct gengetopt_args_info *args_info); - -/** - * Print the help - */ -void cmdline_parser_print_help(void); -/** - * Print the version - */ -void cmdline_parser_print_version(void); - -/** - * Initializes all the fields a cmdline_parser_params structure - * to their default values - * @param params the structure to initialize - */ -void cmdline_parser_params_init(struct cmdline_parser_params *params); - -/** - * Allocates dynamically a cmdline_parser_params structure and initializes - * all its fields to their default values - * @return the created and initialized cmdline_parser_params structure - */ -struct cmdline_parser_params *cmdline_parser_params_create(void); - -/** - * Initializes the passed gengetopt_args_info structure's fields - * (also set default values for options that have a default) - * @param args_info the structure to initialize - */ -void cmdline_parser_init (struct gengetopt_args_info *args_info); -/** - * Deallocates the string fields of the gengetopt_args_info structure - * (but does not deallocate the structure itself) - * @param args_info the structure to deallocate - */ -void cmdline_parser_free (struct gengetopt_args_info *args_info); - -/** - * The config file parser (deprecated version) - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_config_file() instead - */ -int cmdline_parser_configfile (const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The config file parser - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Checks that all the required options were specified - * @param args_info the structure to check - * @param prog_name the name of the program that will be used to print - * possible errors - * @return - */ -int cmdline_parser_required (struct gengetopt_args_info *args_info, - const char *prog_name); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* CMDLINE_H */ diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d865707..5deff56 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,6 +1,7 @@ /* * OpenGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -19,42 +20,41 @@ #include "../config.h" -#include - #ifdef HAVE_STDINT_H #include #endif +#include #include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include - #include +#include +#include -#include +#include +#include +#include +#include #include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include #include "../lib/tun.h" #include "../lib/ippool.h" @@ -62,82 +62,188 @@ #include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" -#include "cmdline.h" #include "gtp-kernel.h" #include "icmpv6.h" +#include "ggsn.h" -int end = 0; -int maxfd = 0; /* For select() */ +void *tall_ggsn_ctx; -struct in_addr listen_; -struct in46_addr netaddr, destaddr, net; /* Network interface */ -size_t prefixlen; -struct in46_addr dns1, dns2; /* PCO DNS address */ -char *ipup, *ipdown; /* Filename of scripts */ -int debug; /* Print debug output */ -struct ul255_t pco; +static int end = 0; +static int daemonize = 0; +static struct ctrl_handle *g_ctrlh; + struct ul255_t qos; struct ul255_t apn; -struct gsn_t *gsn; /* GSN instance */ -struct tun_t *tun; /* TUN instance */ -struct ippool_t *ippool; /* Pool of IP addresses */ +#define LOGPAPN(level, apn, fmt, args...) \ + LOGP(DGGSN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args) -/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ -void signal_handler(int s) +#define LOGPGGSN(level, ggsn, fmt, args...) \ + LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) + +#define LOGPPDP(level, pdp, fmt, args...) \ + LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); + + +static void pool_close_all_pdp(struct ippool_t *pool) { - DEBUGP(DGGSN, "Received signal %d, exiting.\n", s); - end = 1; -} + unsigned int i; -/* Used to write process ID to file. Assume someone else will delete */ -void log_pid(char *pidfile) -{ - FILE *file; - mode_t oldmask; - - oldmask = umask(022); - file = fopen(pidfile, "w"); - umask(oldmask); - if (!file) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to create process ID file: %s!", pidfile); + if (!pool) return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + struct pdp_t *pdp; + + if (!member->inuse) + continue; + pdp = member->peer; + if (!pdp) + continue; + LOGPPDP(LOGL_DEBUG, pdp, "Sending DELETE PDP CTX due to shutdown\n"); + gtp_delete_context_req(pdp->gsn, pdp, NULL, 1); } - fprintf(file, "%d\n", (int)getpid()); - fclose(file); } -#if defined(__sun__) -int daemon(int nochdir, int noclose) +int apn_stop(struct apn_ctx *apn, bool force) { - int fd; + if (!apn->started) + return 0; - switch (fork()) { - case -1: - return (-1); - case 0: + LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); + /* check if pools have any active PDP contexts and bail out */ + pool_close_all_pdp(apn->v4.pool); + pool_close_all_pdp(apn->v6.pool); + + /* shutdown whatever old state might be left */ + if (apn->tun.tun) { + /* run ip-down script */ + if (apn->tun.cfg.ipdown_script) { + LOGPAPN( LOGL_INFO, apn, "Running %s\n", apn->tun.cfg.ipdown_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipdown_script); + } + /* release tun device */ + LOGPAPN(LOGL_INFO, apn, "Closing TUN device\n"); + osmo_fd_unregister(&apn->tun.fd); + tun_free(apn->tun.tun); + apn->tun.tun = NULL; + } + + if (apn->v4.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv4 pool\n"); + ippool_free(apn->v4.pool); + apn->v4.pool = NULL; + } + if (apn->v6.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv6 pool\n"); + ippool_free(apn->v6.pool); + apn->v6.pool = NULL; + } + + apn->started = false; + return 0; +} + +/* actually start the APN with its current config */ +int apn_start(struct apn_ctx *apn) +{ + if (apn->started) + return 0; + + LOGPAPN(LOGL_INFO, apn, "Starting\n"); + switch (apn->cfg.gtpu_mode) { + case APN_GTPU_MODE_TUN: + LOGPAPN(LOGL_INFO, apn, "Opening TUN device %s\n", apn->tun.cfg.dev_name); + if (tun_new(&apn->tun.tun, apn->tun.cfg.dev_name)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to configure tun device\n"); + return -1; + } + LOGPAPN(LOGL_INFO, apn, "Opened TUN device %s\n", apn->tun.tun->devname); + + /* Register with libosmcoore */ + osmo_fd_setup(&apn->tun.fd, apn->tun.tun->fd, BSC_FD_READ, ggsn_tun_fd_cb, apn, 0); + osmo_fd_register(&apn->tun.fd); + + /* Set TUN library callback */ + tun_set_cb_ind(apn->tun.tun, cb_tun_ind); + + if (apn->v4.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IP address %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v4.cfg.ifconfig_prefix.addr, NULL, + apn->v4.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv4 address %s: %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->v6.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IPv6 address %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL, + apn->v6.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->tun.cfg.ipup_script) { + LOGPAPN(LOGL_INFO, apn, "Running ip-up script %s\n", + apn->tun.cfg.ipup_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipup_script); + } + /* set back-pointer from TUN device to APN */ + apn->tun.tun->priv = apn; + break; + case APN_GTPU_MODE_KERNEL_GTP: + LOGPAPN(LOGL_ERROR, apn, "FIXME: Kernel GTP\n"); +#if 0 + /* use GTP kernel module for data packet encapsulation */ + if (gtp_kernel_init(gsn, &net.v4, prefixlen, net_arg) < 0) + goto err; +#endif break; default: - _exit(0); + LOGPAPN(LOGL_ERROR, apn, "Unknown GTPU Mode %d\n", apn->cfg.gtpu_mode); + return -1; } - if (setsid() == -1) - return (-1); - - if (!nochdir) - chdir("/"); - - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { - dup2(fd, STDIN_FILENO); - dup2(fd, STDOUT_FILENO); - dup2(fd, STDERR_FILENO); - if (fd > 2) - close(fd); + /* Create IPv4 pool */ + if (apn->v4.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", + in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, + &apn->v4.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + apn_stop(apn, false); + return -1; + } } - return (0); + + /* Create IPv6 pool */ + if (apn->v6.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", + in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, + &apn->v6.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + apn_stop(apn, false); + return -1; + } + } + + LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); + apn->started = true; + return 0; } -#endif static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { @@ -148,27 +254,29 @@ snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); - if (ctrl_cmd_send_trap(gsn->priv, var, val) < 0) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); + if (ctrl_cmd_send_trap(g_ctrlh, var, val) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Failed to create and send TRAP %s\n", var); return false; } return true; } -int delete_context(struct pdp_t *pdp) +static int delete_context(struct pdp_t *pdp) { - DEBUGP(DGGSN, "Deleting PDP context\n"); + struct gsn_t *gsn = pdp->gsn; + struct ippoolm_t *ipp = (struct ippoolm_t *)pdp->peer; + + LOGPPDP(LOGL_INFO, pdp, "Deleting PDP context\n"); struct ippoolm_t *member = pdp->peer; if (pdp->peer) { send_trap(gsn, pdp, member, "imsi-rem-ip"); /* TRAP with IP removal */ - ippool_freeip(ippool, (struct ippoolm_t *)pdp->peer); + ippool_freeip(ipp->pool, ipp); } else - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Peer not defined!"); + LOGPPDP(LOGL_ERROR, pdp, "Cannot find/free IP Pool member\n"); if (gtp_kernel_tunnel_del(pdp)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot delete tunnel from kernel: %s\n", + LOGPPDP(LOGL_ERROR, pdp, "Cannot delete tunnel from kernel:%s\n", strerror(errno)); } @@ -236,31 +344,74 @@ return false; } +/* construct an IPCP PCO from up to two given DNS addreses */ +static int build_ipcp_pco(struct msgb *msg, uint8_t id, const struct in46_addr *dns1, + const struct in46_addr *dns2) +{ + uint8_t *len1, *len2; + uint8_t *start = msg->tail; + unsigned int len_appended; + + /* Three byte T16L header */ + msgb_put_u16(msg, 0x8021); /* IPCP */ + len1 = msgb_put(msg, 1); /* Length of contents: delay */ + + msgb_put_u8(msg, 0x02); /* ACK */ + msgb_put_u8(msg, id); /* ID: Needs to match request */ + msgb_put_u8(msg, 0x00); /* Length MSB */ + len2 = msgb_put(msg, 1); /* Length LSB: delay */ + + if (dns1 && dns1->len == 4) { + msgb_put_u8(msg, 0x81); /* DNS1 Tag */ + msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ + msgb_put_u32(msg, dns1->v4.s_addr); + } + + if (dns2 && dns2->len == 4) { + msgb_put_u8(msg, 0x83); /* DNS2 Tag */ + msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ + msgb_put_u32(msg, dns2->v4.s_addr); + } + + /* patch in length values */ + len_appended = msg->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; + + return 0; +} + /* process one PCO request from a MS/UE, putting together the proper responses */ -static void process_pco(struct pdp_t *pdp) +static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + unsigned int i; + + OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ /* FIXME: also check if primary / secondary DNS was requested */ if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { /* FIXME: properly implement this for IPCP */ - uint8_t *cur = msgb_put(msg, pco.l-1); - memcpy(cur, pco.v+1, pco.l-1); + build_ipcp_pco(msg, 0, &apn->v4.cfg.dns[0], &apn->v4.cfg.dns[1]); } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { - if (dns1.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); - if (dns2.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + if (i46a->len != 16) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); + } } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { - if (dns1.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); - if (dns2.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + if (i46a->len != 4) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); + } } if (msgb_length(msg) > 1) { @@ -274,11 +425,29 @@ int create_context_ind(struct pdp_t *pdp) { + static char name_buf[256]; + struct gsn_t *gsn = pdp->gsn; + struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr; struct ippoolm_t *member; + struct apn_ctx *apn; int rc; - DEBUGP(DGGSN, "Received create PDP context request\n"); + osmo_apn_to_str(name_buf, pdp->apn_req.v, pdp->apn_req.l); + + LOGPPDP(LOGL_DEBUG, pdp, "Processing create PDP context request for APN '%s'\n", name_buf); + + /* First find an exact APN name match */ + apn = ggsn_find_apn(ggsn, name_buf); + /* then try default (if any) */ + if (!apn) + apn = ggsn->cfg.default_apn; + if (!apn) { + /* no APN found for what user requested */ + LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_MISSING_APN); + return 0; + } /* FIXME: we manually force all context requests to dynamic here! */ if (pdp->eua.l > 2) @@ -290,21 +459,30 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + LOGPPDP(LOGL_ERROR, pdp, "Cannot decode EUA from MS/SGSN: %s\n", osmo_hexdump(pdp->eua.v, pdp->eua.l)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); return 0; } - rc = ippool_newip(ippool, &member, &addr, 0); - if (rc < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); - gtp_create_context_resp(gsn, pdp, -rc); - return 0; /* Allready in use, or no more available */ - } + if (addr.len == sizeof(struct in_addr)) { + rc = ippool_newip(apn->v4.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + in46a_to_eua(&member->addr, &pdp->eua); - if (addr.len == sizeof(struct in6_addr)) { + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ + if (gtp_kernel_tunnel_add(pdp) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; + } + } else if (addr.len == sizeof(struct in6_addr)) { struct in46_addr tmp; + rc = ippool_newip(apn->v6.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + /* IPv6 doesn't really send the real/allocated address at this point, but just * the link-identifier which the MS shall use for router solicitation */ tmp.len = addr.len; @@ -314,43 +492,46 @@ memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); in46a_to_eua(&tmp, &pdp->eua); } else - in46a_to_eua(&member->addr, &pdp->eua); - pdp->peer = member; - pdp->ipif = tun; /* TODO */ - member->peer = pdp; + OSMO_ASSERT(0); - /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ - if (gtp_kernel_tunnel_add(pdp) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot add tunnel to kernel: %s\n", strerror(errno)); - gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); - return 0; - } + pdp->peer = member; + pdp->ipif = apn->tun.tun; /* TODO */ + member->peer = pdp; if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } - process_pco(pdp); + process_pco(apn, pdp); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ + +err_pool_full: + LOGPPDP(LOGL_ERROR, pdp, "Cannot allocate IP address from pool (full!)\n"); + gtp_create_context_resp(gsn, pdp, -rc); + return 0; /* Already in use, or no more available */ } -/* Callback for receiving messages from tun */ -int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) +/* Internet-originated IP packet, needs to be sent via GTP towards MS */ +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { + struct apn_ctx *apn = tun->priv; struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + struct ippool_t *pool; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + pool = apn->v4.pool; } else if (iph->version == 6) { /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct @@ -358,20 +539,25 @@ * prefix, i.e. the first 8 bytes of the address */ dst.len = 8; dst.v6 = ip6h->ip6_dst; + pool = apn->v6.pool; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); + LOGP(DTUN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } - DEBUGP(DGGSN, "Received packet from tun!\n"); + /* IPv6 packet but no IPv6 pool, or IPv4 packet with no IPv4 pool */ + if (!pool) + return 0; - if (ippool_getip(ippool, &ipm, &dst)) { - DEBUGP(DGGSN, "Received packet with no destination!!!\n"); + DEBUGP(DTUN, "Received packet from tun!\n"); + + if (ippool_getip(pool, &ipm, &dst)) { + DEBUGP(DTUN, "Received packet with no PDP contex!!\n"); return 0; } if (ipm->peer) /* Check if a peer protocol is defined */ - gtp_data_req(gsn, (struct pdp_t *)ipm->peer, pack, len); + gtp_data_req(apn->ggsn->gsn, (struct pdp_t *)ipm->peer, pack, len); return 0; } @@ -380,435 +566,303 @@ .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } }; -int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) +/* MS-originated GTP1-U packet, needs to be sent via TUN device */ +static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + LOGPPDP(LOGL_DEBUG, pdp, "Packet received: forwarding to tun\n"); switch (iph->version) { case 6: /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(gsn, pdp, pack, len); + return handle_router_mcast(pdp->gsn, pdp, pack, len); break; case 4: break; default: - LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", + osmo_hexdump(pack, len)); return -1; } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } +static char *config_file = "openggsn.cfg"; + +/* callback for tun device osmocom select loop integration */ +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct apn_ctx *apn = fd->data; + + OSMO_ASSERT(what & BSC_FD_READ); + + return tun_decaps(apn->tun.tun); +} + +/* callback for libgtp osmocom select loop integration */ +static int ggsn_gtp_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct ggsn_ctx *ggsn = fd->data; + int rc; + + OSMO_ASSERT(what & BSC_FD_READ); + + switch (fd->priv_nr) { + case 0: + rc = gtp_decaps0(ggsn->gsn); + break; + case 1: + rc = gtp_decaps1c(ggsn->gsn); + break; + case 2: + rc = gtp_decaps1u(ggsn->gsn); + break; + default: + OSMO_ASSERT(0); + break; + } + return rc; +} + +static void ggsn_gtp_tmr_start(struct ggsn_ctx *ggsn) +{ + struct timeval next; + + /* Retrieve next retransmission as timeval */ + gtp_retranstimeout(ggsn->gsn, &next); + + /* re-schedule the timer */ + osmo_timer_schedule(&ggsn->gtp_timer, next.tv_sec, next.tv_usec/1000); +} + +/* timer callback for libgtp retransmission and ping */ +static void ggsn_gtp_tmr_cb(void *data) +{ + struct ggsn_ctx *ggsn = data; + + /* do all the retransmissions as needed */ + gtp_retrans(ggsn->gsn); + + ggsn_gtp_tmr_start(ggsn); +} + +/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ +static void signal_handler(int s) +{ + LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); + switch (s) { + case SIGINT: + LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); + end = 1; + break; + case SIGABRT: + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_ggsn_ctx, stderr); + break; + case SIGUSR2: + talloc_report_full(tall_vty_ctx, stderr); + break; + default: + break; + } +} + + +/* Start a given GGSN */ +int ggsn_start(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + int rc; + + if (ggsn->started) + return 0; + + LOGPGGSN(LOGL_INFO, ggsn, "Starting GGSN\n"); + + /* Start libgtp listener */ + if (gtp_new(&ggsn->gsn, ggsn->cfg.state_dir, &ggsn->cfg.listen_addr.v4, GTP_MODE_GGSN)) { + LOGPGGSN(LOGL_ERROR, ggsn, "Failed to create GTP: %s\n", strerror(errno)); + return -1; + } + ggsn->gsn->priv = ggsn; + + /* Register File Descriptors */ + osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); + rc = osmo_fd_register(&ggsn->gtp_fd0); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1c, ggsn->gsn->fd1c, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 1); + rc = osmo_fd_register(&ggsn->gtp_fd1c); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1u, ggsn->gsn->fd1u, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 2); + rc = osmo_fd_register(&ggsn->gtp_fd1u); + OSMO_ASSERT(rc == 0); + + /* Start GTP re-transmission timer */ + osmo_timer_setup(&ggsn->gtp_timer, ggsn_gtp_tmr_cb, ggsn); + + gtp_set_cb_data_ind(ggsn->gsn, encaps_tun); + gtp_set_cb_delete_context(ggsn->gsn, delete_context); + gtp_set_cb_create_context_ind(ggsn->gsn, create_context_ind); + + LOGPGGSN(LOGL_NOTICE, ggsn, "Successfully started\n"); + ggsn->started = true; + + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_start(apn); + + return 0; +} + +/* Stop a given GGSN */ +int ggsn_stop(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + + if (!ggsn->started) + return 0; + + /* iterate over all APNs and stop them */ + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_stop(apn, true); + + osmo_timer_del(&ggsn->gtp_timer); + + osmo_fd_unregister(&ggsn->gtp_fd1u); + osmo_fd_unregister(&ggsn->gtp_fd1c); + osmo_fd_unregister(&ggsn->gtp_fd0); + + if (ggsn->gsn) { + gtp_free(ggsn->gsn); + ggsn->gsn = NULL; + } + + ggsn->started = false; + return 0; +} + +static void print_usage() +{ + printf("Usage: osmo-ggsn [-h] [-D] [-c configfile] [-V]\n"); +} + +static void print_help() +{ + printf( " Some useful help...\n" + " -h --help This help text\n" + " -D --daemonize Fork the process into a background daemon\n" + " -c --config-file filename The config file to use\n" + " -V --version Print the version of OsmoGGSN\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' }, + { "daemonize", 0, 0, 'D' }, + { "config-file", 1, 0, 'c' }, + { "version", 0, 0, 'V' }, + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "hdc:V", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_usage(); + print_help(); + exit(0); + case 'D': + daemonize = 1; + break; + case 'c': + config_file = optarg; + break; + case 'V': + print_version(1); + exit(0); + break; + } + } +} + int main(int argc, char **argv) { - /* gengeopt declarations */ - struct gengetopt_args_info args_info; - - struct hostent *host; + struct ggsn_ctx *ggsn; + int rc; /* Handle keyboard interrupt SIGINT */ - struct sigaction s; - s.sa_handler = (void *)signal_handler; - if ((0 != sigemptyset(&s.sa_mask)) && debug) - printf("sigemptyset failed.\n"); - s.sa_flags = SA_RESETHAND; - if ((sigaction(SIGINT, &s, NULL) != 0) && debug) - printf("Could not register SIGINT signal handler.\n"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + msgb_talloc_ctx_init(tall_ggsn_ctx, 0); - fd_set fds; /* For select() */ - struct timeval idleTime; /* How long to select() */ + signal(SIGINT, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); - int timelimit; /* Number of seconds to be connected */ - int starttime; /* Time program was started */ - + osmo_init_ignore_signals(); osmo_init_logging(&log_info); + osmo_stats_init(tall_ggsn_ctx); - if (cmdline_parser(argc, argv, &args_info) != 0) - exit(1); - if (args_info.debug_flag) { - printf("listen: %s\n", args_info.listen_arg); - if (args_info.conf_arg) - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp_linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); + vty_init(&g_vty_info); + logging_vty_add_cmds(NULL); + osmo_stats_vty_add_cmds(&log_info); + ggsn_vty_init(); + ctrl_vty_init(tall_ggsn_ctx); + + handle_options(argc, argv); + + rate_ctr_init(tall_ggsn_ctx); + + rc = vty_read_config_file(config_file, NULL); + if (rc < 0) { + fprintf(stderr, "Failed to open config file: '%s'\n", config_file); + exit(2); } - /* Try out our new parser */ - - if (cmdline_parser_configfile(args_info.conf_arg, &args_info, 0, 0, 0) - != 0) + rc = telnet_init_dynif(tall_ggsn_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_GGSN); + if (rc < 0) exit(1); - /* Open a log file */ - if (args_info.logfile_arg) { - struct log_target *tgt; - int lvl; - - tgt = log_target_find(LOG_TGT_TYPE_FILE, args_info.logfile_arg); - if (!tgt) { - tgt = log_target_create_file(args_info.logfile_arg); - if (!tgt) { - LOGP(DGGSN, LOGL_ERROR, - "Failed to create logfile: %s\n", - args_info.logfile_arg); - exit(1); - } - log_add_target(tgt); - } - log_set_all_filter(tgt, 1); - log_set_use_color(tgt, 0); - - if (args_info.loglevel_arg) { - lvl = log_parse_level(args_info.loglevel_arg); - log_set_log_level(tgt, lvl); - LOGP(DGGSN, LOGL_NOTICE, - "Set file log level to %s\n", - log_level_str(lvl)); - } - } - - if (args_info.debug_flag) { - printf("cmdline_parser_configfile\n"); - printf("listen: %s\n", args_info.listen_arg); - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp-linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); - } - - /* Handle each option */ - - /* debug */ - debug = args_info.debug_flag; - - /* listen */ - /* Do hostname lookup to translate hostname to IP address */ - /* Any port listening is not possible as a valid address is */ - /* required for create_pdp_context_response messages */ - if (args_info.listen_arg) { - if (!(host = gethostbyname(args_info.listen_arg))) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid listening address: %s!", - args_info.listen_arg); - exit(1); - } else { - memcpy(&listen_.s_addr, host->h_addr, host->h_length); - } - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Listening address must be specified! " - "Please use command line option --listen or " - "edit %s configuration file\n", args_info.conf_arg); + g_ctrlh = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); + if (!g_ctrlh) { + LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); exit(1); } - /* net */ - /* Store net as in_addr net and mask */ - if (args_info.net_arg) { - if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid network address: %s!", - args_info.net_arg); - exit(1); - } - /* default for network + destination address = net + 1 */ - netaddr = net; - in46a_inc(&netaddr); - destaddr = netaddr; - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Network address must be specified: %s!", - args_info.net_arg); - exit(1); - } - - /* dynip */ - struct in46_prefix i46p; - size_t prefixlen; - if (!args_info.dynip_arg) { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } else { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } - i46p.prefixlen = prefixlen; - if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); - exit(1); - } - - /* DNS1 and DNS2 */ - memset(&dns1, 0, sizeof(dns1)); - if (args_info.pcodns1_arg) { - size_t tmp; - if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - memset(&dns2, 0, sizeof(dns2)); - if (args_info.pcodns2_arg) { - size_t tmp; - if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); + if (daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); exit(1); } } - unsigned int cur = 0; - pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[cur++] = 0x80; /* IPCP */ - pco.v[cur++] = 0x21; - pco.v[cur++] = 0xFF; /* Length of contents */ - pco.v[cur++] = 0x02; /* ACK */ - pco.v[cur++] = 0x00; /* ID: Need to match request */ - pco.v[cur++] = 0x00; /* Length */ - pco.v[cur++] = 0xFF; /* overwritten */ - if (dns1.len == 4) { - pco.v[cur++] = 0x81; /* DNS 1 */ - pco.v[cur++] = 2 + dns1.len; - if (dns1.len == 4) - memcpy(&pco.v[cur], &dns1.v4, dns1.len); - else - memcpy(&pco.v[cur], &dns1.v6, dns1.len); - cur += dns1.len; - } - if (dns2.len == 4) { - pco.v[cur++] = 0x83; - pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ - if (dns2.len == 4) - memcpy(&pco.v[cur], &dns2.v4, dns2.len); - else - memcpy(&pco.v[cur], &dns2.v6, dns2.len); - cur += dns2.len; - } - pco.l = cur; - /* patch in length values */ - pco.v[3] = pco.l - 4; - pco.v[7] = pco.l - 4; - - /* ipup */ - ipup = args_info.ipup_arg; - - /* ipdown */ - ipdown = args_info.ipdown_arg; - - /* Timelimit */ - timelimit = args_info.timelimit_arg; - starttime = time(NULL); - +#if 0 /* qos */ qos.l = 3; qos.v[2] = (args_info.qos_arg) & 0xff; qos.v[1] = ((args_info.qos_arg) >> 8) & 0xff; qos.v[0] = ((args_info.qos_arg) >> 16) & 0xff; +#endif - /* apn */ - if (strlen(args_info.apn_arg) > (sizeof(apn.v) - 1)) { - LOGP(DGGSN, LOGL_ERROR, "Invalid APN\n"); - return -1; - } - apn.l = strlen(args_info.apn_arg) + 1; - apn.v[0] = (char)strlen(args_info.apn_arg); - strncpy((char *)&apn.v[1], args_info.apn_arg, sizeof(apn.v) - 1); - - /* foreground */ - /* If flag not given run as a daemon */ - if (!args_info.fg_flag) { - FILE *f; - int rc; - /* Close the standard file descriptors. */ - /* Is this really needed ? */ - f = freopen("/dev/null", "w", stdout); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdout to /dev/null"); - } - f = freopen("/dev/null", "w", stderr); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stderr to /dev/null"); - } - f = freopen("/dev/null", "r", stdin); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdin to /dev/null"); - } - rc = daemon(0, 0); - if (rc != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, rc, - "Could not daemonize"); - exit(1); - } + /* Main select loop */ + while (!end) { + osmo_select_main(0); } - /* pidfile */ - /* This has to be done after we have our final pid */ - if (args_info.pidfile_arg) { - log_pid(args_info.pidfile_arg); - } - - DEBUGP(DGGSN, "gtpclient: Initialising GTP tunnel\n"); - - if (gtp_new(&gsn, args_info.statedir_arg, &listen_, GTP_MODE_GGSN)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create gtp"); - exit(1); - } - if (gsn->fd0 > maxfd) - maxfd = gsn->fd0; - if (gsn->fd1c > maxfd) - maxfd = gsn->fd1c; - if (gsn->fd1u > maxfd) - maxfd = gsn->fd1u; - - /* use GTP kernel module for data packet encapsulation */ - if (args_info.gtp_linux_given) { - if (gtp_kernel_init(gsn, &net.v4, prefixlen, args_info.net_arg) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to initialize kernel GTP\n"); - goto err; - } - } - - gtp_set_cb_data_ind(gsn, encaps_tun); - gtp_set_cb_delete_context(gsn, delete_context); - gtp_set_cb_create_context_ind(gsn, create_context_ind); - - gsn->priv = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); - if (!gsn->priv) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); - exit(1); - } - - /* skip the configuration of the tun0 if we're using the gtp0 device */ - if (gtp_kernel_enabled()) - goto skip_tun; - - /* Create a tunnel interface */ - DEBUGP(DGGSN, "Creating tun interface\n"); - if (tun_new((struct tun_t **)&tun)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create tun"); - exit(1); - } - - DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); - exit(1); - } - - tun_set_cb_ind(tun, cb_tun_ind); - if (tun->fd > maxfd) - maxfd = tun->fd; - - if (ipup) - tun_runscript(tun, ipup); - -skip_tun: - - /******************************************************************/ - /* Main select loop */ - /******************************************************************/ - - while ((((starttime + timelimit) > time(NULL)) || (0 == timelimit)) - && (!end)) { - - FD_ZERO(&fds); - if (tun) - FD_SET(tun->fd, &fds); - FD_SET(gsn->fd0, &fds); - FD_SET(gsn->fd1c, &fds); - FD_SET(gsn->fd1u, &fds); - - gtp_retranstimeout(gsn, &idleTime); - switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) { - case -1: /* errno == EINTR : unblocked signal */ - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "select() returned -1"); - /* On error, select returns without modifying fds */ - FD_ZERO(&fds); - break; - case 0: - /* printf("Select returned 0\n"); */ - gtp_retrans(gsn); /* Only retransmit if nothing else */ - break; - default: - break; - } - - if (tun && tun->fd != -1 && FD_ISSET(tun->fd, &fds) && - tun_decaps(tun) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "TUN read failed (fd)=(%d)", tun->fd); - } - - if (FD_ISSET(gsn->fd0, &fds)) - gtp_decaps0(gsn); - - if (FD_ISSET(gsn->fd1c, &fds)) - gtp_decaps1c(gsn); - - if (FD_ISSET(gsn->fd1u, &fds)) - gtp_decaps1u(gsn); - - osmo_select_main(1); - } -err: - gtp_kernel_stop(); - cmdline_parser_free(&args_info); - ippool_free(ippool); - gtp_free(gsn); - if (tun) - tun_free(tun); + llist_for_each_entry(ggsn, &g_ggsn_list, list) + ggsn_stop(ggsn); return 1; - } diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h new file mode 100644 index 0000000..bab6cf7 --- /dev/null +++ b/ggsn/ggsn.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "../lib/tun.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "../lib/in46_addr.h" +#include "../gtp/gtp.h" + +#define APN_TYPE_IPv4 0x01 /* v4-only */ +#define APN_TYPE_IPv6 0x02 /* v6-only */ +#define APN_TYPE_IPv4v6 0x04 /* v4v6 dual-stack */ + +struct ggsn_ctx; + +struct apn_ctx_ip { + struct { + struct in46_prefix ifconfig_prefix; + struct in46_prefix static_prefix; + struct in46_prefix dynamic_prefix; + /* v4 DNS server names */ + struct in46_addr dns[2]; + } cfg; + + /* v4 address pool */ + struct ippool_t *pool; +}; + +struct apn_name { + struct llist_head list; + char *name; +}; + +enum apn_gtpu_mode { + APN_GTPU_MODE_TUN = 0, /* default */ + APN_GTPU_MODE_KERNEL_GTP, +}; + +struct apn_ctx { + /* list of APNs inside GGSN */ + struct llist_head list; + /* back-pointer to GGSN */ + struct ggsn_ctx *ggsn; + + bool started; + + struct { + /* Primary name */ + char *name; + /* Description string */ + char *description; + /* List of secondary APN names */ + struct llist_head name_list; + /* types supported address types on this APN */ + uint32_t apn_type_mask; + /* GTP-U via TUN device or in Linux kernel */ + enum apn_gtpu_mode gtpu_mode; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* corresponding tun device */ + struct { + struct { + /* name of the network device */ + char *dev_name; + /* ip-up and ip-down script names/paths */ + char *ipup_script; + char *ipdown_script; + } cfg; + struct tun_t *tun; + struct osmo_fd fd; + } tun; + + struct apn_ctx_ip v4; + struct apn_ctx_ip v6; +}; + +struct ggsn_ctx { + /* global list of GGSNs */ + struct llist_head list; + + /* list of APNs in this GGSN */ + struct llist_head apn_list; + + bool started; + + struct { + char *name; + /* Description string */ + char *description; + /* an APN that shall be used as default for any non-matching APN */ + struct apn_ctx *default_apn; + /* ADdress to which we listen for GTP */ + struct in46_addr listen_addr; + /* directory for state file */ + char *state_dir; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* The libgtp (G)GSN instance, i.e. what listens to GTP */ + struct gsn_t *gsn; + + /* osmo-fd for gsn */ + struct osmo_fd gtp_fd0; + struct osmo_fd gtp_fd1c; + struct osmo_fd gtp_fd1u; + + struct osmo_timer_list gtp_timer; +}; + +/* ggsn_vty.c */ +extern struct llist_head g_ggsn_list; +extern struct vty_app_info g_vty_info; +extern int ggsn_vty_init(void); +struct ggsn_ctx *ggsn_find(const char *name); +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name); +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name); +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name); + +/* ggsn.c */ +extern void *tall_ggsn_ctx; +extern int ggsn_start(struct ggsn_ctx *ggsn); +extern int ggsn_stop(struct ggsn_ctx *ggsn); +extern int apn_start(struct apn_ctx *apn); +extern int apn_stop(struct apn_ctx *apn, bool force); diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c new file mode 100644 index 0000000..f23a298 --- /dev/null +++ b/ggsn/ggsn_vty.c @@ -0,0 +1,890 @@ +/* + * (C) 2017 by Harald Welte + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +#include "ggsn.h" + +#define PREFIX_STR "Prefix (Network/Netmask)\n" +#define IFCONFIG_STR "GGSN-based interface configuration\n" +#define GGSN_STR "Gateway GPRS Support NODE (GGSN)\n" + +LLIST_HEAD(g_ggsn_list); + +enum ggsn_vty_node { + GGSN_NODE = _LAST_OSMOVTY_NODE + 1, + APN_NODE, +}; + +struct ggsn_ctx *ggsn_find(const char *name) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + if (!strcmp(ggsn->cfg.name, name)) + return ggsn; + } + return NULL; +} + +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name) +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(name); + if (ggsn) + return ggsn; + + ggsn = talloc_zero(ctx, struct ggsn_ctx); + if (!ggsn) + return NULL; + + ggsn->cfg.name = talloc_strdup(ggsn, name); + ggsn->cfg.state_dir = talloc_strdup(ggsn, "/tmp"); + ggsn->cfg.shutdown = true; + INIT_LLIST_HEAD(&ggsn->apn_list); + + llist_add_tail(&ggsn->list, &g_ggsn_list); + return ggsn; +} + +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn; + + llist_for_each_entry(apn, &ggsn->apn_list, list) { + if (!strcmp(apn->cfg.name, name)) + return apn; + } + return NULL; +} + +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn = ggsn_find_apn(ggsn, name); + if (apn) + return apn; + + apn = talloc_zero(ggsn, struct apn_ctx); + if (!apn) + return NULL; + apn->ggsn = ggsn; + apn->cfg.name = talloc_strdup(apn, name); + apn->cfg.shutdown = true; + INIT_LLIST_HEAD(&apn->cfg.name_list); + + llist_add_tail(&apn->list, &ggsn->apn_list); + return apn; +} + +/* GGSN Node */ + +static struct cmd_node ggsn_node = { + GGSN_NODE, + "%s(config-ggsn)# ", + 1, +}; + +DEFUN(cfg_ggsn, cfg_ggsn_cmd, + "ggsn NAME", + "Configure the Gateway GPRS Support Node\n" "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find_or_create(tall_ggsn_ctx, argv[0]); + if (!ggsn) + return CMD_WARNING; + + vty->node = GGSN_NODE; + vty->index = ggsn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ggsn, cfg_no_ggsn_cmd, + "no ggsn NAME", + NO_STR "Remove the named Gateway GPRS Support Node\n" + "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!ggsn->cfg.shutdown) { + vty_out(vty, "%% GGSN %s is still active, please shutdown first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!llist_empty(&ggsn->apn_list)) { + vty_out(vty, "%% GGSN %s still has APNs configured, please remove first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&ggsn->list); + talloc_free(ggsn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, + "gtp local-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address for the local GTP bind\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_state_dir, cfg_ggsn_state_dir_cmd, + "gtp state-dir PATH", + "GTP Parameters\n" + "Set the directory for the GTP State file\n" + "Local Directory\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + osmo_talloc_replace_string(ggsn, &ggsn->cfg.state_dir, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_apn, cfg_ggsn_apn_cmd, + "apn NAME", "APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_or_create_apn(ggsn, argv[0]); + if (!apn) + return CMD_WARNING; + + vty->node = APN_NODE; + vty->index = apn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_apn, cfg_ggsn_no_apn_cmd, + "no apn NAME", + NO_STR "Remove APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!apn->cfg.shutdown) { + vty_out(vty, "%% APN %s still active, please shutdown first%s", + apn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&apn->list); + talloc_free(apn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_default_apn, cfg_ggsn_default_apn_cmd, + "default-apn NAME", + "Set a default-APN to be used if no other APN matches\n" + "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No APN of name '%s' found%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + ggsn->cfg.default_apn = apn; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_default_apn, cfg_ggsn_no_default_apn_cmd, + "no default-apn", + NO_STR "Remove default-APN to be used if no other APN matches\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + ggsn->cfg.default_apn = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_shutdown, cfg_ggsn_shutdown_cmd, + "shutdown ggsn", + "Put the GGSN in administrative shut-down\n" GGSN_STR) +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (!ggsn->cfg.shutdown) { + if (ggsn_stop(ggsn)) { + vty_out(vty, "%% Failed to shutdown GGSN%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_shutdown, cfg_ggsn_no_shutdown_cmd, + "no shutdown ggsn", + NO_STR GGSN_STR "Remove the GGSN from administrative shut-down\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (ggsn->cfg.shutdown) { + if (ggsn_start(ggsn) < 0) { + vty_out(vty, "%% Failed to start GGSN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + +/* APN Node */ + +static struct cmd_node apn_node = { + APN_NODE, + "%s(config-ggsn-apn)# ", + 1, +}; + +static const struct value_string pdp_type_names[] = { + { APN_TYPE_IPv4, "v4" }, + { APN_TYPE_IPv6, "v6" }, + { APN_TYPE_IPv4v6, "v4v6" }, + { 0, NULL } +}; + +static const struct value_string apn_gtpu_mode_names[] = { + { APN_GTPU_MODE_TUN, "tun" }, + { APN_GTPU_MODE_KERNEL_GTP, "kernel-gtp" }, + { 0, NULL } +}; + + +#define V4V6V46_STRING "IPv4(-only) PDP Type\n" \ + "IPv6(-only) PDP Type\n" \ + "IPv4v6 (dual-stack) PDP Type\n" + +DEFUN(cfg_apn_type_support, cfg_apn_type_support_cmd, + "type-support (v4|v6|v4v6)", + "Enable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask |= type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_type_support, cfg_apn_no_type_support_cmd, + "no type-support (v4|v6|v4v6)", + NO_STR "Disable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask &= ~type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_gtpu_mode, cfg_apn_gtpu_mode_cmd, + "gtpu-mode (tun|kernel-gtp)", + "Set the Mode for this APN (tun or Linux Kernel GTP)\n" + "GTP-U in userspace using TUN device\n" + "GTP-U in kernel using Linux Kernel GTP\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + apn->cfg.gtpu_mode = get_string_value(apn_gtpu_mode_names, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_tun_dev_name, cfg_apn_tun_dev_name_cmd, + "tun-device NAME", + "Configure tun device name\n" + "TUN device name") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.dev_name, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipup_script, cfg_apn_ipup_script_cmd, + "ipup-script PATH", + "Configure name/path of ip-up script\n" + "File/Path name of ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipup_script, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipup_script, cfg_apn_no_ipup_script_cmd, + "no ipup-script", + NO_STR "Disable ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipup_script); + apn->tun.cfg.ipup_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipdown_script, cfg_apn_ipdown_script_cmd, + "ipdown-script PATH", + "Configure name/path of ip-down script\n" + "File/Path name of ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipdown_script, argv[0]); + return CMD_SUCCESS; +} + +/* convert prefix from "A.B.C.D/M" notation to in46_prefix */ +static void str2prefix(struct in46_prefix *pfx, const char *in) +{ + size_t t; + + ippool_aton(&pfx->addr, &t, in, 0); + pfx->prefixlen = t; +} + +DEFUN(cfg_apn_no_ipdown_script, cfg_apn_no_ipdown_script_cmd, + "no ipdown-script", + NO_STR "Disable ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipdown_script); + apn->tun.cfg.ipdown_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_prefix, cfg_apn_ip_prefix_cmd, + "ip prefix (static|dynamic) A.B.C.D/M", + IP_STR PREFIX_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + /* first update our parsed prefix */ + if (!strcmp(argv[0], "static")) + pfx = &apn->v4.cfg.static_prefix; + else + pfx = &apn->v4.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_ifconfig, cfg_apn_ip_ifconfig_cmd, + "ip ifconfig A.B.C.D/M", + IP_STR IFCONFIG_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v4.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ip_ifconfig, cfg_apn_no_ip_ifconfig_cmd, + "no ip ifconfig", + NO_STR IP_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v4.cfg.ifconfig_prefix, 0, sizeof(apn->v4.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_prefix, cfg_apn_ipv6_prefix_cmd, + "ipv6 prefix (static|dynamic) X:X::X:X/M", + IP6_STR PREFIX_STR "IPv6 Address/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + if (!strcmp(argv[0], "static")) + pfx = &apn->v6.cfg.static_prefix; + else + pfx = &apn->v6.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_ifconfig, cfg_apn_ipv6_ifconfig_cmd, + "ipv6 ifconfig X:X::X:X/M", + IP6_STR IFCONFIG_STR "IPv6 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v6.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipv6_ifconfig, cfg_apn_no_ipv6_ifconfig_cmd, + "no ipv6 ifconfig", + NO_STR IP6_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v6.cfg.ifconfig_prefix, 0, sizeof(apn->v6.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +#define DNS_STRINGS "Configure DNS Server\n" "primary/secondary DNS\n" "IP address of DNS Sever\n" + +DEFUN(cfg_apn_ip_dns, cfg_apn_ip_dns_cmd, + "ip dns <0-1> A.B.C.D", + IP_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v4.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_dns, cfg_apn_ipv6_dns_cmd, + "ipv6 dns <0-1> X:X::X:X", + IP6_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v6.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_dns, cfg_apn_no_dns_cmd, + "no (ip|ipv6) dns <0-1>", + NO_STR IP_STR IP6_STR "Disable DNS Server\n" "primary/secondary DNS\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_addr *a; + int idx = atoi(argv[1]); + + if (!strcmp(argv[0], "ip")) + a = &apn->v4.cfg.dns[idx]; + else + a = &apn->v6.cfg.dns[idx]; + + memset(a, 0, sizeof(*a)); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, + "shutdown", + "Put the APN in administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (!apn->cfg.shutdown) { + if (apn_stop(apn, false)) { + vty_out(vty, "%% Failed to Stop APN%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_shutdown, cfg_apn_no_shutdown_cmd, + "no shutdown", + NO_STR "Remove the APN from administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (apn->cfg.shutdown) { + if (apn_start(apn) < 0) { + vty_out(vty, "%% Failed to start APN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + + +static void vty_dump_prefix(struct vty *vty, const char *pre, const struct in46_prefix *pfx) +{ + vty_out(vty, "%s %s%s", pre, in46p_ntoa(pfx), VTY_NEWLINE); +} + +static void config_write_apn(struct vty *vty, struct apn_ctx *apn) +{ + unsigned int i; + + vty_out(vty, " apn %s%s", apn->cfg.name, VTY_NEWLINE); + if (apn->cfg.description) + vty_out(vty, " description %s%s", apn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtpu-mode %s%s", get_value_string(apn_gtpu_mode_names, apn->cfg.gtpu_mode), + VTY_NEWLINE); + if (apn->tun.cfg.dev_name) + vty_out(vty, " tun-device %s%s", apn->tun.cfg.dev_name, VTY_NEWLINE); + if (apn->tun.cfg.ipup_script) + vty_out(vty, " ipup-script %s%s", apn->tun.cfg.ipup_script, VTY_NEWLINE); + if (apn->tun.cfg.ipdown_script) + vty_out(vty, " ipdown-script %s%s", apn->tun.cfg.ipdown_script, VTY_NEWLINE); + + for (i = 0; i < 32; i++) { + if (!(apn->cfg.apn_type_mask & (1 << i))) + continue; + vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), + VTY_NEWLINE); + } + + /* IPv4 prefixes + DNS */ + if (apn->v4.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix static", &apn->v4.cfg.static_prefix); + if (apn->v4.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix dynamic", &apn->v4.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + if (!apn->v4.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v4.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v4.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ip ifconfig ", &apn->v4.cfg.ifconfig_prefix); + + /* IPv6 prefixes + DNS */ + if (apn->v6.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix static", &apn->v6.cfg.static_prefix); + if (apn->v6.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix dynamic", &apn->v6.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + if (!apn->v6.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v6.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); + + /* must be last */ + vty_out(vty, " %sshutdown%s", apn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); +} + +static int config_write_ggsn(struct vty *vty) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + struct apn_ctx *apn; + vty_out(vty, "ggsn %s%s", ggsn->cfg.name, VTY_NEWLINE); + if (ggsn->cfg.description) + vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); + vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + llist_for_each_entry(apn, &ggsn->apn_list, list) + config_write_apn(vty, apn); + if (ggsn->cfg.default_apn) + vty_out(vty, " default-apn %s%s", ggsn->cfg.default_apn->cfg.name, VTY_NEWLINE); + /* must be last */ + vty_out(vty, " %sshutdown ggsn%s", ggsn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); + } + + return 0; +} + +static const char *print_gsnaddr(const struct ul16_t *in) +{ + struct in46_addr in46; + + in46.len = in->l; + OSMO_ASSERT(in->l <= sizeof(in46.v6)); + memcpy(&in46.v6, in->v, in->l); + + return in46a_ntoa(&in46); +} + +static void show_one_pdp(struct vty *vty, struct pdp_t *pdp) +{ + struct in46_addr eua46; + + vty_out(vty, "IMSI: %s, NSAPI: %u, MSISDN: %s%s", imsi_gtp2str(&pdp->imsi), pdp->nsapi, + osmo_hexdump_nospc(pdp->msisdn.v, pdp->msisdn.l), VTY_NEWLINE); + + vty_out(vty, " Control: %s:%08x ", print_gsnaddr(&pdp->gsnlc), pdp->teic_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnrc), pdp->teic_gn, VTY_NEWLINE); + + vty_out(vty, " Data: %s:%08x ", print_gsnaddr(&pdp->gsnlu), pdp->teid_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnru), pdp->teid_gn, VTY_NEWLINE); + + in46a_from_eua(&pdp->eua, &eua46); + vty_out(vty, " End-User Address: %s%s", in46a_ntoa(&eua46), VTY_NEWLINE); +} + +DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, + "show pdp-context imsi IMSI [<0-15>]", + SHOW_STR "Display information on PDP Context\n" + "PDP contexts for given IMSI\n" + "PDP context for given NSAPI\n") +{ + uint64_t imsi = strtoull(argv[0], NULL, 10); + unsigned int nsapi; + struct pdp_t *pdp; + int num_found = 0; + + if (argc > 1) { + nsapi = atoi(argv[1]); + if (pdp_getimsi(&pdp, imsi, nsapi)) { + show_one_pdp(vty, pdp); + num_found++; + } + } else { + for (nsapi = 0; nsapi < PDP_MAXNSAPI; nsapi++) { + if (pdp_getimsi(&pdp, imsi, nsapi)) + continue; + show_one_pdp(vty, pdp); + num_found++; + } + } + if (num_found == 0) { + vty_out(vty, "%% No such PDP context found%s", VTY_NEWLINE); + return CMD_WARNING; + } else + return CMD_SUCCESS; +} + +/* show all (active) PDP contexts within a pool */ +static void ippool_show_pdp_contexts(struct vty *vty, struct ippool_t *pool) +{ + unsigned int i; + + if (!pool) + return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + if (member->inuse == 0) + continue; + show_one_pdp(vty, member->peer); + } +} + +/* show all (active) PDP contexts within an APN */ +static void apn_show_pdp_contexts(struct vty *vty, struct apn_ctx *apn) +{ + ippool_show_pdp_contexts(vty, apn->v4.pool); + ippool_show_pdp_contexts(vty, apn->v6.pool); +} + +DEFUN(show_pdpctx, show_pdpctx_cmd, + "show pdp-context ggsn NAME [apn APN]", + SHOW_STR "Show PDP Context Information\n" + GGSN_STR "GGSN Name\n") // FIXME +{ + struct ggsn_ctx *ggsn; + struct apn_ctx *apn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (argc < 2) { + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_show_pdp_contexts(vty, apn); + } else { + apn = ggsn_find_apn(ggsn, argv[1]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + apn_show_pdp_contexts(vty, apn); + } + + return CMD_SUCCESS; +} + +static void show_apn(struct vty *vty, struct apn_ctx *apn) +{ + vty_out(vty, " APN: %s%s", apn->cfg.name, VTY_NEWLINE); + /* FIXME */ +} + +static void show_one_ggsn(struct vty *vty, struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + vty_out(vty, "GGSN %s: Bound to %s%s", ggsn->cfg.name, in46a_ntoa(&ggsn->cfg.listen_addr), + VTY_NEWLINE); + /* FIXME */ + + llist_for_each_entry(apn, &ggsn->apn_list, list) + show_apn(vty, apn); +} + +DEFUN(show_ggsn, show_ggsn_cmd, + "show ggsn [NAME]", + SHOW_STR "Display information on the GGSN\n") +{ + struct ggsn_ctx *ggsn; + + if (argc == 0) { + llist_for_each_entry(ggsn, &g_ggsn_list, list) + show_one_ggsn(vty, ggsn); + } else { + ggsn = ggsn_find(argv[0]); + if (!ggsn) + return CMD_WARNING; + show_one_ggsn(vty, ggsn); + } + + return CMD_SUCCESS; +} + +int ggsn_vty_init(void) +{ + install_element_ve(&show_pdpctx_cmd); + install_element_ve(&show_pdpctx_imsi_cmd); + install_element_ve(&show_ggsn_cmd); + + install_element(CONFIG_NODE, &cfg_ggsn_cmd); + install_element(CONFIG_NODE, &cfg_no_ggsn_cmd); + install_node(&ggsn_node, config_write_ggsn); + vty_install_default(GGSN_NODE); + install_element(GGSN_NODE, &cfg_description_cmd); + install_element(GGSN_NODE, &cfg_no_description_cmd); + install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); + install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_default_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_default_apn_cmd); + + install_node(&apn_node, NULL); + vty_install_default(APN_NODE); + install_element(APN_NODE, &cfg_description_cmd); + install_element(APN_NODE, &cfg_no_description_cmd); + install_element(APN_NODE, &cfg_apn_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_no_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_gtpu_mode_cmd); + install_element(APN_NODE, &cfg_apn_type_support_cmd); + install_element(APN_NODE, &cfg_apn_no_type_support_cmd); + install_element(APN_NODE, &cfg_apn_tun_dev_name_cmd); + install_element(APN_NODE, &cfg_apn_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_ip_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ip_dns_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_dns_cmd); + install_element(APN_NODE, &cfg_apn_no_dns_cmd); + install_element(APN_NODE, &cfg_apn_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + + return 0; +} + +static int ggsn_vty_is_config_node(struct vty *vty, int node) +{ + switch (node) { + case GGSN_NODE: + case APN_NODE: + return 1; + default: + return 0; + } +} + +static int ggsn_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + case GGSN_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + vty->index_sub = NULL; + break; + case APN_NODE: + vty->node = GGSN_NODE; + { + struct apn_ctx *apn = vty->index; + vty->index = apn->ggsn; + vty->index_sub = &apn->ggsn->cfg.description; + } + break; + } + + return vty->node; +} + +static const char ggsn_copyright[] = + "Copyright (C) 2011-2017 Harald Welte \r\n" + "Copyright (C) 2012-2017 Holger Hans Peter Freyther \r\n" + "Copyright (C) 2012-2017 sysmocom - s.f.m.c. GmbH\r\n" + "Copyright (C) 2002-2005 Mondru AB\r\n" + "License GPLv2: GNU GPL version 2 \r\n" + "This is free software: you are free to change and redistribute it.\r\n" + "There is NO WARRANTY, to the extent permitted by law.\r\n"; + +struct vty_app_info g_vty_info = { + .name = "OpenGGSN", + .version = PACKAGE_VERSION, + .copyright = ggsn_copyright, + .go_parent_cb = ggsn_vty_go_parent, + .is_config_node = ggsn_vty_is_config_node, +}; diff --git a/lib/tun.c b/lib/tun.c index e8368e5..76ac379 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -583,7 +583,7 @@ return tun_route(this, dst, gateway, mask, 1); } -int tun_new(struct tun_t **tun) +int tun_new(struct tun_t **tun, const char *dev_name) { #if defined(__linux__) @@ -615,6 +615,8 @@ /* Set device flags. For some weird reason this is also the method used to obtain the network interface name */ memset(&ifr, 0, sizeof(ifr)); + if (dev_name) + strcpy(ifr.ifr_name, dev_name); ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); diff --git a/lib/tun.h b/lib/tun.h index 67ef39d..50ac806 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -65,7 +65,7 @@ void *priv; }; -extern int tun_new(struct tun_t **tun); +extern int tun_new(struct tun_t **tun, const char *dev_name); extern int tun_free(struct tun_t *tun); extern int tun_decaps(struct tun_t *this); extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1f0b3f9..ed1fb93 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1461,7 +1461,7 @@ if (options.createif) { printf("Setting up interface\n"); /* Create a tunnel interface */ - if (tun_new((struct tun_t **)&tun)) { + if (tun_new((struct tun_t **)&tun, NULL)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Failed to create tun"); exit(1); -- To view, visit https://gerrit.osmocom.org/3848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:27 +0000 Subject: [PATCH] openggsn[master]: Documentation update: Remove NEWS, README.Solaris, update RE... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3849 to look at the new patch set (#4). Documentation update: Remove NEWS, README.Solaris, update README.md * README.Solaris is obsolete and related code has been removed * NEWS file was unmaintained for more than a decade, remove it * Remove "Performance" chapter about 550MHz Athlon * gengetopt is no longer needed for ggsn * remove compilation/installation instructions horribly out of date * command line syntax of 'ggsn' program has changed Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db --- M Makefile.am D NEWS D README.Solaris M README.md 4 files changed, 3 insertions(+), 240 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/49/3849/4 diff --git a/Makefile.am b/Makefile.am index 1d7eaba..517e265 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,6 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris +EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX @RELMAKE@ diff --git a/NEWS b/NEWS deleted file mode 100644 index b1352a5..0000000 --- a/NEWS +++ /dev/null @@ -1,78 +0,0 @@ -OPENGGSN NEWS -============= - -OpenGGSN - Gateway GPRS Support Node -Copyright (C) 2002, 2003, 2004 Mondru AB. - -Version 0.84 -============ - -* Initial MAC OSX support (Thanks to Pekka Nikander) -* Quality assurance and improved error logging (Thanks to Pekka - Nikander and Jonny Winberg) - -Version 0.83 -============ - -* Added selection mode and charging characteristics option to sgsnemu. -* Bug fixes on charging characteristics and PPP PCO length.(Thanks to - Loic Bernable ). -* Improved Solaris support, hash table bugfix and improved logging. - -Version 0.82 -============ - -* Improved Solaris support. -* Routing manipulation and IP address alias capability for FreeBSD. -* Initial Debian port (Thanks to ARAKI Yasuhiro ). - -Version 0.81 -============ - - * Initial FreeBSD port (Thanks to Pavel Andreev ). - * IMSI '1111' bugfix (Thanks to Pavel Andreev ). - -Version 0.8 -=========== - - * Support for compilation under Solaris. - * Iptables firewall script. - * New options for sgsnemu - - -Version 0.7 -=========== - - * Support for GTP1. Currently without support for the secondary pdp - context activation procedure. - * sgsnemu will first attempt to use GTP1. If that fails it will - fallback to using GTP0. - * Standards compliance document. - -Version 0.6 -=========== - - * Improved README file. - * Now uses ioctl instead of ifconfig and route in ggsn and sgsnemu. - * Absolute path to gtp library in ggsn/Makefile.am and ggsn/Makefile.am - * Compiles with gengetopt 2.8 (Thanks to Lorenzo Bettini ) - * sgsnemu is now able to handle several contexts and allocate - interface IP addresses for each context. - * ggsn now supports protocol configuration option DNS - addresses. This allow mobile stations to set up DNS based on - information configured in the ggsn. - * Ping facility in sgsnemu allow testing without the need to route - packets through the tun interface. - * Man pages for ggsn and sgsnemu. - * Sys 5 init script. - * Spec file for building binary RPM packages. - * If not --createif exit after "ping" or "echo" finishes - * If sgsnemu echo failure, exit with code != 0 - - -Version 0.5 -=========== - - * Initial release. See README file for installation and usage - instructions. - diff --git a/README.Solaris b/README.Solaris deleted file mode 100644 index 2ac6dbc..0000000 --- a/README.Solaris +++ /dev/null @@ -1,41 +0,0 @@ -OpenGGSN/Solaris notes -====================== - -Solaris support is experimental, please test and report bugs. The -Solaris port is tested under Solaris 8. - -Compiling ---------- - -You need to edit the following line in ggsn/Makefile.in and -sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -After this you install by the following commands: -./configure -make -make install - - -TUN ---- - -You might or might not need to install the tun driver manually. For -general information about tun see http://vtun.sourceforge.net/tun/ - - -Known problems --------------- - -Currently multiple IP addresses on the same network interface is not -implemented for Solaris. - -Currently routing table manipulation is not implemented for -Solaris. You have to set the routes manually after you start ggsn or -sgsnemu. - diff --git a/README.md b/README.md index 8e4ceae..829adcd 100644 --- a/README.md +++ b/README.md @@ -174,26 +174,6 @@ will fallback to GTPv0. -Performance -=========== - -Two experiments were performed in order to test the performance of -sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of -RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had -100 Mb/s NICs (RTL-8139) and were connected through a crossed patch -cable. Both tests were performed by sending ICMP echo packets from -sgsnemu to the ggsn. - -89.5 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1400 bytes. Transfer time 1.27 sec, no packets lost. - -71.4 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1000 bytes. Transfer time 1.15 sec, no packets lost. - -12,1 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 100 bytes. Transfer time 0.84 sec, no packets lost. - - Required software ================= @@ -209,19 +189,12 @@ Alternatively you can execute "modprobe tun" on the commandline. -For Solaris the tun driver needs to be installed manually. For general -information about tun see http://vtun.sourceforge.net/tun/ - Gengetopt --------- Gengetopt is required if you want to change the options defined in the cmdline.ggo source file. You need at least gengetopt version 2.8. If you are just going to compile the programs you don't need gengetopt. - -To use gengetopt for the ggsn do the following: -cd ggsn -gengetopt < cmdline.ggo --conf-parser To use gengetopt for the sgsnemu do the following: cd sgsnemu @@ -234,98 +207,7 @@ Compilation and Installation ============================ - -Setting up autotools --------------------- - -You do not need to perform this step if you are only going to compile -the package: - -1. Get version from somewhere: Script to extract version from configure.in -2. Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config -3. Run autoscan and copy configure.scan to configure.in -4. Add/edit the following lines in configure.in: - - AC_INIT(openggsn, 0.70, jj at openggsn.org) - - AC_CONFIG_SRCDIR([gtp/gtp.c]) - - AM_CONFIG_HEADER([config.h]) - - AC_PROG_LIBTOOL - - AM_PROG_LIBTOOL - - AM_INIT_AUTOMAKE() -5. libtoolize --automake --copy - (ads copy of ltmain.sh) -6. aclocal -7. autoheader -8. automake --add-missing --copy - (Ads copy of mkinstalldirs missing, install-sh, depcomp) -9. automake -10. autoconf - -The above will initialise the project to the current version of -autotools (As installed in RedHat 8.0). See -http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 -for details on autotools. - - -Checking out from CVS ---------------------- - -To download the latest source code from anonymous CVS: - -cvs -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn login -cvs -z3 -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Or to download from developer CVS: - -export CVS_RSH=ssh -cvs -z3 -d:ext:developername at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Both the above sets of commands creates a new directory called openggsn. - - -Compilation and installation ----------------------------- - -If compiling under Solaris you need to edit the following line in -ggsn/Makefile.in and sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -Note that the above is not necessary on other platforms. Compilation -and installation is performed by the following steps: - - 1. ./configure - 2. make clean - 3. cd gtp - 4. make - 5. make install (as root) - 6. cd .. - (Step 3 to 6 you only need to run the first time to install libgtp) - 7. make - 8. make install (as root) - 9. Add /usr/local/lib to /etc/ld.so.conf -10. run ldconfig - -(Steps 9 and 10 are not required as path to libgtp is included in Makefile) - -Documentation can be converted to html by issuing: - - 1. txt2html -pm -tf README > README.html - 2. txt2html -pm -tf NEWS > NEWS.html - 3. man2htm ggsn.8 > ggsn.html - 4. man2htm sgsnemu.8 > sgsnemu.html - - -Installation from binary ------------------------- - -1. rpm -i openggsn-.rpm - -This will install binaries, man pages, configuration files as well as -a Sys V init script for the ggsn. +Please refer to the project homepage Running ggsn @@ -337,7 +219,7 @@ Start the ggsn as root using the command: -ggsn -c examples/ggsn.conf --fg -l 10.0.0.40 --net 192.168.0.0/24 --dynip 192.168.0.0/24 +ggsn -c examples/ggsn.conf First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is -- To view, visit https://gerrit.osmocom.org/3849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:27 +0000 Subject: [PATCH] openggsn[master]: ggsn: Handle SIGTERM like SIGINT and terminate In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3850 to look at the new patch set (#4). ggsn: Handle SIGTERM like SIGINT and terminate Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/50/3850/4 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5deff56..e6fc117 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -655,6 +655,7 @@ LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); switch (s) { case SIGINT: + case SIGTERM: LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); end = 1; break; @@ -801,11 +802,12 @@ struct ggsn_ctx *ggsn; int rc; - /* Handle keyboard interrupt SIGINT */ tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); + /* Handle keyboard interrupt SIGINT */ signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:27 +0000 Subject: [PATCH] openggsn[master]: Rename OpenGGSN to OsmoGGSN In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3851 to look at the new patch set (#4). Rename OpenGGSN to OsmoGGSN Osmocom has maintained this program since about 7 years now, while the original author / copyright holder has completely disappeared. With the introduction of Osmocom-style CTRL and VTY interfaces, the way how the program is used and configured has substantially changed. In order to avoid confusion in terms of configuration file format etc, let's rename it to OsmoGGSN. Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d --- M .gitignore M AUTHORS M README.FreeBSD M README.MacOSX M README.md M configure.ac M debian/changelog M debian/control M debian/copyright D debian/openggsn.examples A debian/osmo-ggsn.examples R debian/osmo-ggsn.init R debian/osmo-ggsn.install M debian/rules M doc/Compliance.html M doc/Makefile.am R doc/osmo-ggsn.8 M doc/sgsnemu.8 D examples/ggsn.init A examples/osmo-ggsn.init M ggsn/Makefile.am M ggsn/ggsn.c M ggsn/ggsn_vty.c M gtp/gtp.c M gtp/gtp.h M gtp/gtpie.c M gtp/gtpie.h M gtp/pdp.c M gtp/pdp.h M gtp/queue.c M gtp/queue.h M libgtp.pc.in D openggsn.spec.in A osmo-ggsn.spec.in M sgsnemu/cmdline.ggo M sgsnemu/sgsnemu.c 36 files changed, 316 insertions(+), 302 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/51/3851/4 diff --git a/.gitignore b/.gitignore index 111fa98..6885cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,13 +15,13 @@ libtool ltmain.sh missing -openggsn.spec +osmo-ggsn.spec stamp-h1 doc/Makefile.in ggsn/Makefile.in gtp/Makefile.in sgsnemu/Makefile.in -debian/openggsn/ +debian/osmo-ggsn/ debian/*.debhelper debian/libgtp/ debian/*.log @@ -33,7 +33,7 @@ debian/files debian/libgtp-dev/ libgtp.pc -ggsn/ggsn +ggsn/osmo-ggsn m4/ *.swp *.o diff --git a/AUTHORS b/AUTHORS index 5f10990..cba1896 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -OpenGGSN - Gateway GPRS Support Node +OsmoGGSN - Osmocom Gateway GPRS Support Node, based on OpenGGSN Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen Copyright (C) 2010-2017 Harald Welte Copyright (C) 2012-2016 Holger Hans Peter Freyther diff --git a/README.FreeBSD b/README.FreeBSD index b5cc66d..2f4bce5 100644 --- a/README.FreeBSD +++ b/README.FreeBSD @@ -1,4 +1,4 @@ -OpenGGSN/FreeBSD notes +OsmoGGSN/FreeBSD notes FreeBSD support is experimental, please test and report bugs. The FreeBSD port is tested on FreeBSD 4.x, but may also work on 5.x series. diff --git a/README.MacOSX b/README.MacOSX index 0a904cd..a8c4776 100644 --- a/README.MacOSX +++ b/README.MacOSX @@ -1,4 +1,4 @@ -OpenGGSN/Mac OS X notes +OsmoGGSN/Mac OS X notes Mac OS X support is experimental, please test and report bugs. The Mac OS X port is tested on Mac OS X 10.3.5, but may also work on diff --git a/README.md b/README.md index 829adcd..42613cf 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -OpenGGSN - Open Source GGSN +OsmoGGSN - Open Source GGSN =========================== This repository contains a C-language implementation of a GGSN (Gateway GPRS Support Node), a core network element of ETSI/3GPP cellular networks such as GPRS, EDGE, UMTS or HSPA. -OpenGGSN is part of the [Osmocom](https://osmocom.org/) Open Source +OsmoGGSN is part of the [Osmocom](https://osmocom.org/) Open Source Mobile Communications projects, even thogh it was previously developed by Mondru AB. @@ -18,11 +18,11 @@ GIT Repository -------------- -You can clone from the official libosmocore.git repository using +You can clone from the official osmo-ggsn.git repository using - git clone git://git.osmocom.org/openggsn.git + git clone git://git.osmocom.org/osmo-ggsn.git -There is a cgit interface at http://git.osmocom.org/openggsn/ +There is a cgit interface at http://git.osmocom.org/osmo-ggsn/ Documentation ------------- @@ -34,7 +34,7 @@ Mailing List ------------ -Discussions related to openggsn are happening on the +Discussions related to OsmoGGSN are happening on the osmocom-net-gprs at lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/osmocom-net-gprs for subscription options and the list archive. @@ -54,10 +54,8 @@ https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details -The current patch queue for OpenGGSN can be seen at -https://gerrit.osmocom.org/#/q/project:openggsn+status:open -OPENGGSN README -=============== +The current patch queue for OsmoGGSN can be seen at +https://gerrit.osmocom.org/#/q/project:osmo-ggsn+status:open QuickStart @@ -67,7 +65,7 @@ ------------ *Linux* -OpenGGSN was originally developed and tested using Redhat 8.0 and 9.0 +OsmoGGSN was originally developed and tested using Redhat 8.0 and 9.0 and is these days mostly developed on Debian GNU/Linux. It should run also on other Linux distributions as well as FreeBSD, but this is untested. Compilation on Solaris 2.8 has also been verified. @@ -84,7 +82,7 @@ Installation from binary ------------------------ -OpenGGSN is built for common versions of Debian and Ubuntu as part of +OsmoGGSN is built for common versions of Debian and Ubuntu as part of the [Osmocom Nightly Builds](https://osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds) project. If you don't want to do development, it is suggested to simply use those binary packages, rather than building yourself from source. @@ -141,13 +139,13 @@ Features ======== -OpenGGSN is an open source implementation of GPRS Support Nodes +OsmoGGSN is an open source implementation of GPRS Support Nodes (GSNs). It implements the GPRS tunneling protocol (GTP) version 0 and version 1. -OpenGGSN provides 3 components: +OsmoGGSN provides 3 components: * gtplib - * ggsn + * osmo-ggsn * sgsnemu *gtplib* @@ -157,8 +155,8 @@ 29.060). At the moment no interface documentation is available for download. -*ggsn* -The ggsn implements a Gateway GPRS Support Node. The GGSN is a small +*osmo-ggsn* +The osmo-ggsn implements a Gateway GPRS Support Node. The GGSN is a small application which is provided in order to test and demonstrate the use of gtplib. It is fully compliant to the 3GPP standards, but lacks important functionality such as charging and management. Use this @@ -180,7 +178,7 @@ Tun --- -Both ggsn and sgsnemu uses the tun package. You need at least tun +Both osmo-ggsn and sgsnemu uses the tun package. You need at least tun version 1.1. With Linux tun is normally included from kernel version 2.4.7. To configure automatic loading: @@ -210,16 +208,16 @@ Please refer to the project homepage -Running ggsn -============ +Running osmo-ggsn +================= -Use ggsn -h for a list of available options. All options available on +Use osmo-ggsn -h for a list of available options. All options available on the command line can also be given in a configuration file. See -examples/ggsn.conf for the format of this file. +examples/osmo-ggsn.cfg for the format of this file. -Start the ggsn as root using the command: +Start osmo-ggsn as root using the command: -ggsn -c examples/ggsn.conf +osmo-ggsn -c examples/osmo-ggsn.cfg First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is @@ -248,9 +246,9 @@ echo 1 > /proc/sys/net/ipv4/ip_forward If you installed using a binary RPM package it is possible to start -ggsn by using the Sys 5 script: +osmo-ggsn by using the Sys 5 script: -/etc/init.d/ggsn start +/etc/init.d/osmo-ggsn start Running sgsnemu @@ -285,7 +283,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1823]: GTP: gtp_newgsn() started + OsmoGGSN[1823]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request @@ -321,7 +319,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1838]: GTP: gtp_newgsn() started + OsmoGGSN[1838]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request diff --git a/configure.ac b/configure.ac index 9d3a8e4..e6b84fa 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) +AC_INIT(osmo-ggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) AC_CONFIG_SRCDIR([gtp/gtp.c]) AM_CONFIG_HEADER([config.h]) #AC_CONFIG_HEADER([config.h]) @@ -149,9 +149,9 @@ sgsnemu/Makefile tests/Makefile libgtp.pc - openggsn.spec]) + osmo-ggsn.spec]) AC_OUTPUT echo " -openggsn Configuration: +osmo-ggsn Configuration: GTP Linux kernel support: ${enable_gtp_linux}" diff --git a/debian/changelog b/debian/changelog index 357cc01..7c82dbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-ggsn (0.94.0) UNRELEASED; urgency=medium + + * Transition to OsmoGGSN + + -- Harald Welte Tue, 05 Sep 2017 09:34:20 +0200 + openggsn (0.94.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] diff --git a/debian/control b/debian/control index 4e5b168..bed17e2 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: openggsn +Source: osmo-ggsn Maintainer: Harald Welte Section: net Priority: optional @@ -9,16 +9,16 @@ dh-autoreconf, libosmocore-dev (>= 0.8.0) Standards-Version: 3.9.6 -Vcs-Browser: http://ggsn.git.sourceforge.net/git/gitweb.cgi?p=ggsn/ggsn;a=summary -Vcs-Git: git://ggsn.git.sourceforge.net/gitroot/ggsn/ggsn +Vcs-Browser: http://git.osmocom.org/osmo-ggsn/ +Vcs-Git: git://git.osmocom.org/osmo-ggsn Homepage: https://projects.osmocom.org/projects/openggsn -Package: openggsn +Package: osmo-ggsn Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Gateway GPRS Support Node (GGSN) - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +Description: Osmocom Gateway GPRS Support Node (GGSN) + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -29,11 +29,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Description: library implementing the GTP protocol between SGSN and GGSN - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . - This library is part of openggsn and implements the GTP protocol between + This library is part of OsmoGGSN and implements the GTP protocol between SGSN (Serving GPRS support node) and GGSN. Package: libgtp-dev @@ -43,17 +43,17 @@ Depends: ${misc:Depends}, libgtp1 (= ${binary:Version}) Description: Development files for libgtp - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . The library libgtp implements the GTP protocol between SGSN and GGSN and this package contains the development files for this library. -Package: openggsn-dbg +Package: osmo-ggsn-dbg Section: debug Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), openggsn (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same -Description: Debug symbols for OpenGGSN +Description: Debug symbols for OsmoGGSN diff --git a/debian/copyright b/debian/copyright index b3339d9..a6507bd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,11 +1,13 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: openggsn -Source: http://sourceforge.net/projects/ggsn/ +Upstream-Name: osmo-ggsn +Source: https://osmocom.org/projects/openggsn Files: * -Copyright: 2002 Jens Jakobsen - 2002-2004 Mondru AB - 2010-2011 Harald Welte +Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen +Copyright (C) 2010-2017 Harald Welte +Copyright (C) 2012-2016 Holger Hans Peter Freyther +Copyright (C) 2014-2016 Pablo Neira Ayuso +Copyright (C) 2014-2016 sysmocom - s.f.m.c. GmbH License: GPL-2 Files: lib/getopt.c @@ -15,7 +17,7 @@ License: LGPL-2.1+ Files: debian/* -Copyright: 2010-2015 Harald Welte +Copyright: 2010-2017 Harald Welte 2016 Ruben Undheim License: GPL-2 diff --git a/debian/openggsn.examples b/debian/openggsn.examples deleted file mode 100644 index 1fa82f3..0000000 --- a/debian/openggsn.examples +++ /dev/null @@ -1,2 +0,0 @@ -examples/ggsn.conf -examples/sgsnemu.conf diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples new file mode 100644 index 0000000..3898d26 --- /dev/null +++ b/debian/osmo-ggsn.examples @@ -0,0 +1,2 @@ +examples/osmo-ggsn.conf +examples/sgsnemu.conf diff --git a/debian/openggsn.init b/debian/osmo-ggsn.init similarity index 91% rename from debian/openggsn.init rename to debian/osmo-ggsn.init index d4fcb18..6fe1b87 100755 --- a/debian/openggsn.init +++ b/debian/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 2 3 4 5 @@ -13,18 +13,18 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" +DESC="OsmoGGSN Gateway GPRS Support Node" NAME=ggsn -DAEMON=/usr/bin/ggsn +DAEMON=/usr/bin/osmo-ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/openggsn +SCRIPTNAME=/etc/init.d/osmo-ggsn # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present -[ -r /etc/default/openggsn ] && . /etc/default/openggsn +[ -r /etc/default/osmo-ggsn ] && . /etc/default/osmo-ggsn # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -46,13 +46,13 @@ || return 1 # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn fi # Check for GTP restart counter - if [ ! -f /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart + if [ ! -f /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart fi start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ diff --git a/debian/openggsn.install b/debian/osmo-ggsn.install similarity index 67% rename from debian/openggsn.install rename to debian/osmo-ggsn.install index 4b301e1..522a3d1 100644 --- a/debian/openggsn.install +++ b/debian/osmo-ggsn.install @@ -1,3 +1,3 @@ -/usr/bin/ggsn +/usr/bin/osmo-ggsn /usr/bin/sgsnemu /usr/share/man/man8/* diff --git a/debian/rules b/debian/rules index aa95e28..6f27da9 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,7 @@ dh $@ --with autoreconf override_dh_strip: - dh_strip --dbg-package=openggsn-dbg + dh_strip --dbg-package=osmo-ggsn-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version diff --git a/doc/Compliance.html b/doc/Compliance.html index f33bc6f..4c2fc3a 100644 --- a/doc/Compliance.html +++ b/doc/Compliance.html @@ -7,7 +7,7 @@

Protocol Compliance List

-OpenGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the following tables the support of each individual message type is detailed. The numbers before each feature indicates the relevant section in the standard.
diff --git a/doc/Makefile.am b/doc/Makefile.am index 43b00d0..7e2246c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -man_MANS = ggsn.8 sgsnemu.8 +man_MANS = osmo-ggsn.8 sgsnemu.8 man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) diff --git a/doc/ggsn.8 b/doc/osmo-ggsn.8 similarity index 89% rename from doc/ggsn.8 rename to doc/osmo-ggsn.8 index 89dcb61b..b9f928f 100644 --- a/doc/ggsn.8 +++ b/doc/osmo-ggsn.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -12,24 +12,24 @@ .\" * .\" * Contributor(s): .\" * -.\" Manual page for ggsn +.\" Manual page for osmo-ggsn .\" SH section heading .\" SS subsection heading .\" LP paragraph .\" IP indented paragraph .\" TP hanging label -.TH ggsn 8 "July 2003" +.TH osmo-ggsn 8 "August 2017" .SH NAME -ggsn \- Gateway GPRS Support Node. +osmo-ggsn \- Gateway GPRS Support Node. .SH SYNOPSIS -.B ggsn +.B osmo-ggsn \-\-help -.B ggsn +.B osmo-ggsn \-\-version -.B ggsn +.B osmo-ggsn [ .BI \-\-help ] [ @@ -40,9 +40,9 @@ .BI \-\-version ] .SH DESCRIPTION -.B ggsn +.B osmo-ggsn is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Gateway GPRS Support Node. It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -62,14 +62,14 @@ The other interface can be thought of as the uplink interface, and interfaces the GGSN to an external data network. Gi is most often an interface to the Internet. -.B ggsn +.B osmo-ggsn uses the .B TUN/TAP driver for the Gi interface. A tun network interface is established when the -.B ggsn +.B osmo-ggsn is started. -.B ggsn +.B osmo-ggsn will accept incoming connections from mobile stations through the radio access network and the SGSN. When a connection request is received the ggsn will allocate a dynamic IP address for the mobile @@ -79,7 +79,7 @@ framework. Typically -.B ggsn +.B osmo-ggsn will be deployed with two Ethernet interfaces. One for the Gn/Gp interface, and one for the Gi interface. Policy routing and firewall rules should be used in order to separate Gi traffic from Gn/Gp @@ -105,25 +105,25 @@ (default = ./openggsn.cfg) .SH FILES -.I ./openggsn.cfg +.I ./osmo-ggsn.cfg .RS The configuration file for -.B ggsn. +.B osmo-ggsn. .RE -.I /var/run/ggsn.pid +.I /var/run/osmo-ggsn.pid .RS Process ID file. .RE -.I /var/lib/ggsn +.I /var/lib/osmo-ggsn .RS Directory holding nonvolatile data. .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at +Report all bugs to the OsmoGGSN bug tracking list at .I https://osmocom.org/projects/openggsn -.B ggsn +.B osmo-ggsn has very limited management support. Currently both SNMP as well as billing mechanisms are missing. @@ -135,13 +135,13 @@ .LP Besides the long options documented in this man page -.B ggsn +.B osmo-ggsn also accepts a number of short options with the same functionality. Use -.B ggsn --help +.B osmo-ggsn --help for a full list of all the available options. The TUN/TAP driver is required for proper operation of -.B ggsn. +.B osmo-ggsn. For linux kernels later than 2.4.7 the TUN/TAP driver is included in the kernel, but typically needs to be loaded manually with .B modprobe tun. For automatic loading the line @@ -152,7 +152,7 @@ .I http://vtun.sourceforge.net/tun/ for information on how to install and configure the tun driver. -.B ggsn +.B osmo-ggsn uses the GPRS Tunneling Protocol (GTP) as specified by the Third Generation Partnership Project (3GPP). 3GPP protocols specifications can be found at diff --git a/doc/sgsnemu.8 b/doc/sgsnemu.8 index af8f3ff..197bd5d 100644 --- a/doc/sgsnemu.8 +++ b/doc/sgsnemu.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -90,7 +90,7 @@ .SH DESCRIPTION .B sgsnemu is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Serving GPRS Support Node (SGSN) emulator. It can be used for testing Gateway GPRS Support Nodes (GGSNs), GPRS core networks as well as GPRS roaming connections. @@ -348,8 +348,8 @@ .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/sgsnemu/ +Report all bugs to the OsmoGGSN bug tracking list at +.I http://osmocom.org/projects/openggsn/issues .SH "SEE ALSO" diff --git a/examples/ggsn.init b/examples/ggsn.init deleted file mode 100644 index 7d9689a..0000000 --- a/examples/ggsn.init +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# ggsn This shell script takes care of starting and stopping -# ggsn. -# -# chkconfig: - 65 35 -# description: ggsn is a Gateway GPRS Support Node. - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -if [ -f /etc/sysconfig/ggsn ]; then - . /etc/sysconfig/ggsn -fi - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -f /usr/bin/ggsn ] || exit 0 -[ -f /etc/ggsn.conf ] || exit 0 - -RETVAL=0 -prog="ggsn" - -start() { - # Start daemons. - echo -n $"Starting $prog: " - - # Load tun module - /sbin/modprobe tun >/dev/null 2>&1 - - # Enable routing of packets: WARNING!!! - # Users should enable this explicitly - # echo 1 > /proc/sys/net/ipv4/ip_forward - - # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn - fi - - # Check for GTP restart counter - if [ ! -d /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart - fi - - - daemon /usr/bin/ggsn - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ggsn - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n $"Shutting down $prog: " - killproc ggsn - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ggsn /var/run/ggsn.pid - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/ggsn ] ; then - stop - start - RETVAL=$? - fi - ;; - status) - status ggsn - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL - diff --git a/examples/osmo-ggsn.init b/examples/osmo-ggsn.init new file mode 100644 index 0000000..2deb378 --- /dev/null +++ b/examples/osmo-ggsn.init @@ -0,0 +1,97 @@ +#!/bin/sh +# +# osmo-ggsn This shell script takes care of starting and stopping +# osmo-ggsn. +# +# chkconfig: - 65 35 +# description: osmo-ggsn is a Gateway GPRS Support Node. + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +if [ -f /etc/sysconfig/osmo-ggsn ]; then + . /etc/sysconfig/osmo-ggsn +fi + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -f /usr/bin/osmo-ggsn ] || exit 0 +[ -f /etc/osmo-ggsn.cfg ] || exit 0 + +RETVAL=0 +prog="osmo-ggsn" + +start() { + # Start daemons. + echo -n $"Starting $prog: " + + # Load tun module + /sbin/modprobe tun >/dev/null 2>&1 + + # Enable routing of packets: WARNING!!! + # Users should enable this explicitly + # echo 1 > /proc/sys/net/ipv4/ip_forward + + # Check for runtime directory of nonvolatile data + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn + fi + + # Check for GTP restart counter + if [ ! -d /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart + fi + + + daemon /usr/bin/osmo-ggsn + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/osmo-ggsn + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n $"Shutting down $prog: " + killproc osmo-ggsn + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f /var/lock/subsys/osmo-ggsn /var/run/osmo-ggsn.pid + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/osmo-ggsn ] ; then + stop + start + RETVAL=$? + fi + ;; + status) + status osmo-ggsn + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL + diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index fef12d3..8a468a9 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -1,19 +1,19 @@ -bin_PROGRAMS = ggsn +bin_PROGRAMS = osmo-ggsn AM_LDFLAGS = @EXEC_LDFLAGS@ AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) +osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD += -lgtpnl +osmo_ggsn_LDADD += -lgtpnl endif -ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a +osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL -ggsn_SOURCES += gtp-kernel.c +osmo_ggsn_SOURCES += gtp-kernel.c endif diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index e6fc117..5e85180 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte * @@ -590,7 +590,7 @@ return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } -static char *config_file = "openggsn.cfg"; +static char *config_file = "osmo-ggsn.cfg"; /* callback for tun device osmocom select loop integration */ static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) @@ -802,7 +802,7 @@ struct ggsn_ctx *ggsn; int rc; - tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "OsmoGGSN"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); /* Handle keyboard interrupt SIGINT */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index f23a298..4a3e753 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -882,7 +882,7 @@ "There is NO WARRANTY, to the extent permitted by law.\r\n"; struct vty_app_info g_vty_info = { - .name = "OpenGGSN", + .name = "OsmoGGSN", .version = PACKAGE_VERSION, .copyright = ggsn_copyright, .go_parent_cb = ggsn_vty_go_parent, diff --git a/gtp/gtp.c b/gtp/gtp.c index 87ab075..27a07b1 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1,6 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2010-2011, 2016-2017 Harald Welte + * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/gtp.h b/gtp/gtp.h index 7fa9ae7..b40c6df 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.c b/gtp/gtpie.c index c8db449..0744370 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.h b/gtp/gtpie.h index fb8598e..9fe7943 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/pdp.c b/gtp/pdp.c index c576a4e..ff9c681 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/pdp.h b/gtp/pdp.h index c51e9e2..cb98920 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.c b/gtp/queue.c index fbfa1ec..82cd7b4 100644 --- a/gtp/queue.c +++ b/gtp/queue.c @@ -1,7 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2011 Harald Welte + * Copyright (C) 2016 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.h b/gtp/queue.h index 556b6ef..2e253dd 100644 --- a/gtp/queue.h +++ b/gtp/queue.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/libgtp.pc.in b/libgtp.pc.in index 2201608..e6048e9 100644 --- a/libgtp.pc.in +++ b/libgtp.pc.in @@ -3,7 +3,7 @@ libdir=@libdir@ includedir=@includedir@ -Name: OpenGGSN STP Library +Name: OsmoGGSN GTP Library Description: C Utility Library Version: @VERSION@ Libs: -L${libdir} -lgtp diff --git a/openggsn.spec.in b/openggsn.spec.in deleted file mode 100644 index f15866e..0000000 --- a/openggsn.spec.in +++ /dev/null @@ -1,87 +0,0 @@ -Summary: Open Source Gateway GPRS Support Node (GGSN) -Name: @PACKAGE@ -Version: @VERSION@ -Release: 1 -URL: http://sourceforge.net/projects/ggsn/ -Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz -License: GPL -Group: System Environment/Daemons -BuildRoot: %{_tmppath}/%{name}-root - -%description -OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile -operators as the interface between the Internet and the rest of the -mobile network infrastructure. The project also provides an SGSN -emulator suitable for GPRS core network testing. - -%prep -%setup -q - -%build - -./configure --prefix=/usr --enable-static-exec - -make - -%install - -make install prefix=$RPM_BUILD_ROOT/usr -strip $RPM_BUILD_ROOT/usr/bin/ggsn -strip $RPM_BUILD_ROOT/usr/bin/sgsnemu - -#Copy ggsn init script in place -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d -install -m755 examples/ggsn.init \ - $RPM_BUILD_ROOT/etc/rc.d/init.d/ggsn - -#Copy ggsn.conf in place -install -m755 examples/ggsn.conf \ - $RPM_BUILD_ROOT/etc/ggsn.conf - -#Copy gsn_restart file in place -mkdir -p $RPM_BUILD_ROOT/var/lib/ggsn -echo "0" > $RPM_BUILD_ROOT/var/lib/ggsn/gsn_restart - -#Clean up unwanted library files -rm -rf $RPM_BUILD_ROOT/usr/include/* -rm -rf $RPM_BUILD_ROOT/usr/lib/* - - -%clean -rm -rf $RPM_BUILD_ROOT -make clean - -%post -/sbin/chkconfig --add ggsn - -%files -%defattr(-,root,root) - -/usr/bin/ggsn -/usr/bin/sgsnemu -/etc/rc.d/init.d/ggsn -%dir /var/lib/ggsn -/var/lib/ggsn/gsn_restart - -%doc AUTHORS COPYING INSTALL NEWS README.md -%doc examples/ggsn.conf -%doc examples/sgsnemu.conf -%doc examples/ggsn.init -%doc examples/firewall -%doc /usr/man/man8/ggsn.8.gz -%doc /usr/man/man8/sgsnemu.8.gz - -%config /etc/ggsn.conf - - -#/usr/lib/libgtp.a -#/usr/lib/libgtp.la -#/usr/lib/libgtp.so -#/usr/lib/libgtp.so.0 -#/usr/lib/libgtp.so.0.0.0 - - - -%changelog -* Mon Jun 30 2003 -- Initial build. diff --git a/osmo-ggsn.spec.in b/osmo-ggsn.spec.in new file mode 100644 index 0000000..9613bca --- /dev/null +++ b/osmo-ggsn.spec.in @@ -0,0 +1,90 @@ +Summary: Osmocom Gateway GPRS Support Node (GGSN) +Name: @PACKAGE@ +Version: @VERSION@ +Release: 1 +URL: https://osmocom.org/projects/openggsn +Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz +License: GPL +Group: System Environment/Daemons +BuildRoot: %{_tmppath}/%{name}-root + +%description +OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +operators as the interface between the Internet and the rest of the +mobile network infrastructure. The project also provides an SGSN +emulator suitable for GPRS core network testing. + +%prep +%setup -q + +%build + +./configure --prefix=/usr --enable-static-exec + +make + +%install + +make install prefix=$RPM_BUILD_ROOT/usr +strip $RPM_BUILD_ROOT/usr/bin/osmo-ggsn +strip $RPM_BUILD_ROOT/usr/bin/sgsnemu + +#Copy osmo-ggsn init script in place +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +install -m755 examples/osmo-ggsn.init \ + $RPM_BUILD_ROOT/etc/rc.d/init.d/osmo-ggsn + +#Copy osmo-ggsn.conf in place +install -m755 examples/osmo-ggsn.cfg \ + $RPM_BUILD_ROOT/etc/osmo-ggsn.cfg + +#Copy gsn_restart file in place +mkdir -p $RPM_BUILD_ROOT/var/lib/osmo-ggsn +echo "0" > $RPM_BUILD_ROOT/var/lib/osmo-ggsn/gsn_restart + +#Clean up unwanted library files +rm -rf $RPM_BUILD_ROOT/usr/include/* +rm -rf $RPM_BUILD_ROOT/usr/lib/* + + +%clean +rm -rf $RPM_BUILD_ROOT +make clean + +%post +/sbin/chkconfig --add osmo-ggsn + +%files +%defattr(-,root,root) + +/usr/bin/osmo-ggsn +/usr/bin/sgsnemu +/etc/rc.d/init.d/osmo-ggsn +%dir /var/lib/osmo-ggsn +/var/lib/osmo-ggsn/gsn_restart + +%doc AUTHORS COPYING INSTALL NEWS README.md +%doc examples/osmo-ggsn.conf +%doc examples/sgsnemu.conf +%doc examples/osmo-ggsn.init +%doc examples/firewall +%doc /usr/man/man8/osmo-ggsn.8.gz +%doc /usr/man/man8/sgsnemu.8.gz + +%config /etc/osmo-ggsn.cfg + + +#/usr/lib/libgtp.a +#/usr/lib/libgtp.la +#/usr/lib/libgtp.so +#/usr/lib/libgtp.so.0 +#/usr/lib/libgtp.so.0.0.0 + + + +%changelog +* Mon Jun 30 2017 +- Update to OsmoGGSN + +* Mon Jun 30 2003 +- Initial build. diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0c1b06c..ee5e55d 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -1,4 +1,4 @@ -# OpenGGSN - Gateway GPRS Support Node +# OsmoGGSN - Gateway GPRS Support Node # Copyright (C) 2002, 2003, 2004 Mondru AB. # # The contents of this file may be used under the terms of the GNU diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index ed1fb93..0157e22 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU -- To view, visit https://gerrit.osmocom.org/3851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:27 +0000 Subject: [PATCH] openggsn[master]: remove bogus 'version' script In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3852 to look at the new patch set (#4). remove bogus 'version' script Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 --- D version 1 file changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/52/3852/4 diff --git a/version b/version deleted file mode 100755 index ba4d6a5..0000000 --- a/version +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Little shell script to grab current version number from configure.in -# -# $Id: version,v 1.3 2003/01/28 22:39:30 jjako Exp $ - -VER=`grep AC_INIT configure.in | awk -F'[(),]' '{print $3}'` -if [ "$1" == "-VERSION" ] -then - echo $VER | awk -F'.' '{print $1}' - exit -fi -if [ "$1" == "-PATCHLEVEL" ] -then - echo $VER | awk -F'.' '{print $2}' - exit -fi -if [ "$1" == "-SUBLEVEL" ] -then - echo $VER | awk -F'.' '{print $3}' - exit -fi -echo $VER -exit -- To view, visit https://gerrit.osmocom.org/3852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:27 +0000 Subject: [PATCH] openggsn[master]: Move examples to doc/examples and include them in DIST In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3853 to look at the new patch set (#5). Move examples to doc/examples and include them in DIST Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 --- M configure.ac R contrib/osmo-ggsn.init M debian/osmo-ggsn.examples M doc/Makefile.am A doc/examples/Makefile.am R doc/examples/firewall R doc/examples/osmo-ggsn.cfg R doc/examples/sgsnemu.conf 8 files changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/53/3853/5 diff --git a/configure.ac b/configure.ac index e6b84fa..2b9343d 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,7 @@ AC_CONFIG_FILES([Makefile doc/Makefile + doc/examples/Makefile ggsn/Makefile gtp/Makefile lib/Makefile diff --git a/examples/osmo-ggsn.init b/contrib/osmo-ggsn.init similarity index 100% rename from examples/osmo-ggsn.init rename to contrib/osmo-ggsn.init diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples index 3898d26..775b9cd 100644 --- a/debian/osmo-ggsn.examples +++ b/debian/osmo-ggsn.examples @@ -1,2 +1,2 @@ -examples/osmo-ggsn.conf -examples/sgsnemu.conf +doc/examples/osmo-ggsn.conf +doc/examples/sgsnemu.conf diff --git a/doc/Makefile.am b/doc/Makefile.am index 7e2246c..46c634e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,5 +2,6 @@ man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) - - +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..530c3fa --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,22 @@ +CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,' + +dist-hook: + for f in $$($(CFG_FILES)); do \ + j="$(distdir)/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +install-data-hook: + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +uninstall-hook: + @$(PRE_UNINSTALL) + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + $(RM) $$j; \ + done diff --git a/examples/firewall b/doc/examples/firewall similarity index 100% rename from examples/firewall rename to doc/examples/firewall diff --git a/examples/osmo-ggsn.cfg b/doc/examples/osmo-ggsn.cfg similarity index 100% rename from examples/osmo-ggsn.cfg rename to doc/examples/osmo-ggsn.cfg diff --git a/examples/sgsnemu.conf b/doc/examples/sgsnemu.conf similarity index 100% rename from examples/sgsnemu.conf rename to doc/examples/sgsnemu.conf -- To view, visit https://gerrit.osmocom.org/3853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:17:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:17:27 +0000 Subject: [PATCH] openggsn[master]: ggsn: Add ability to specify local IP addresses for GTP-C an... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3854 to look at the new patch set (#5). ggsn: Add ability to specify local IP addresses for GTP-C and GTP-U In case the GGSN is behind some kind of DNAT, the public GTP-C and GTP-U IP addresses as exposed inside the GTP payload information elements are different from the (internal, behind-nat) IP address to which it listens/binds. Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 50 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/54/3854/5 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5e85180..8e9f694 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -691,6 +691,14 @@ } ggsn->gsn->priv = ggsn; + /* patch in different addresses to use (in case we're behind NAT, the listen + * address is different from what we advertise externally) */ + if (ggsn->cfg.gtpc_addr.v4.s_addr) + ggsn->gsn->gsnc = ggsn->cfg.gtpc_addr.v4; + + if (ggsn->cfg.gtpu_addr.v4.s_addr) + ggsn->gsn->gsnu = ggsn->cfg.gtpu_addr.v4; + /* Register File Descriptors */ osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); rc = osmo_fd_register(&ggsn->gtp_fd0); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index bab6cf7..2dd963c 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -99,6 +99,10 @@ struct apn_ctx *default_apn; /* ADdress to which we listen for GTP */ struct in46_addr listen_addr; + /* Local GTP-C address advertised in GTP */ + struct in46_addr gtpc_addr; + /* Local GTP-U address advertised in GTP */ + struct in46_addr gtpu_addr; /* directory for state file */ char *state_dir; /* administratively shut-down (true) or not (false) */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 4a3e753..d7bd9a7 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -165,8 +165,8 @@ return CMD_SUCCESS; } -DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, - "gtp local-ip A.B.C.D", +DEFUN(cfg_ggsn_bind_ip, cfg_ggsn_bind_ip_cmd, + "gtp bind-ip A.B.C.D", "GTP Parameters\n" "Set the IP address for the local GTP bind\n" "IPv4 Address\n") @@ -175,6 +175,34 @@ size_t t; ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpc_ip, cfg_ggsn_gtpc_ip_cmd, + "gtp control-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-C messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpc_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpu_ip, cfg_ggsn_gtpu_ip_cmd, + "gtp user-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-U messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpu_addr, &t, argv[0], 0); return CMD_SUCCESS; } @@ -633,7 +661,11 @@ if (ggsn->cfg.description) vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); - vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + vty_out(vty, " gtp bind-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpc_addr.v4.s_addr) + vty_out(vty, " gtp control-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpc_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpu_addr.v4.s_addr) + vty_out(vty, " gtp user-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpu_addr), VTY_NEWLINE); llist_for_each_entry(apn, &ggsn->apn_list, list) config_write_apn(vty, apn); if (ggsn->cfg.default_apn) @@ -806,7 +838,9 @@ install_element(GGSN_NODE, &cfg_no_description_cmd); install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); - install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_bind_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpc_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpu_ip_cmd); install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); -- To view, visit https://gerrit.osmocom.org/3854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:20:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 21:20:43 +0000 Subject: osmo-bsc[master]: Move channel state assignment to macro In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (2 comments) https://gerrit.osmocom.org/#/c/3828/2//COMMIT_MSG Commit Message: Line 12: through this macro. "and log only when the state has changed" https://gerrit.osmocom.org/#/c/3828/2/include/openbsc/abis_rsl.h File include/openbsc/abis_rsl.h: Line 37: #define LCHAN_SET_ST(lch_, st_) \ (would even have been acceptable to name the macro exactly like the function was named, making the patch smaller. We did something like that for osmo_fsm_*, for example.) -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:21:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:21:34 +0000 Subject: openggsn[master]: libgtp: Add back-reference to gsn from pdp context In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:21:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:21:41 +0000 Subject: openggsn[master]: Remove __sun__ code that is unmaintained In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6b8179259bacade52c39f96e688f828eff164ac Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:21:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:21:50 +0000 Subject: openggsn[master]: lib/tun: Mark internal helper functions 'static' In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a8a89abb0080a39a153e9d3864c17b29aa193c Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:22:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:22:57 +0000 Subject: openggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 actually, I suggest to keep this on hold as it introduces user-visible changes. All patches from this one upwards should only be merged once we have created a new osmo-ggsn.git repository and related gerrit/jenkins integration. The old repository can then contain a big fat README that it is deprected and unmaintained, and people should migrate to OsmoGGSN. -- To view, visit https://gerrit.osmocom.org/3848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:23:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:23:08 +0000 Subject: [MERGED] openggsn[master]: libgtp: Add back-reference to gsn from pdp context In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: Add back-reference to gsn from pdp context ...................................................................... libgtp: Add back-reference to gsn from pdp context This is required once one wants to support multiple GSNs in a single application. WARNING: This breaks ABI compatibility, LIBVERSION must be adjusted Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2 --- M gtp/gtp.c M gtp/pdp.h 2 files changed, 11 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index a3f6eb2..87ab075 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -90,7 +90,11 @@ int gtp_newpdp(struct gsn_t *gsn, struct pdp_t **pdp, uint64_t imsi, uint8_t nsapi) { - return pdp_newpdp(pdp, imsi, nsapi, NULL); + int rc; + rc = pdp_newpdp(pdp, imsi, nsapi, NULL); + if (!rc && *pdp) + (*pdp)->gsn = gsn; + return rc; } int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp) @@ -1570,6 +1574,8 @@ } pdp_newpdp(&pdp, pdp->imsi, pdp->nsapi, pdp); + if (pdp) + pdp->gsn = gsn; /* Callback function to validata login */ if (gsn->cb_create_context_ind != 0) diff --git a/gtp/pdp.h b/gtp/pdp.h index 432f1df..c51e9e2 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -12,6 +12,8 @@ #ifndef _PDP_H #define _PDP_H +struct gsn_t; + #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ @@ -221,6 +223,8 @@ /* to be used by libgtp callers/users (to attach their own private state) */ void *priv; + + struct gsn_t *gsn; }; /* functions related to pdp_t management */ -- To view, visit https://gerrit.osmocom.org/3845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68ae49a765828fa681054c68bf7f5e74dbe48ad2 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:23:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:23:12 +0000 Subject: [MERGED] openggsn[master]: Remove __sun__ code that is unmaintained In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove __sun__ code that is unmaintained ...................................................................... Remove __sun__ code that is unmaintained We haven nobody maintaining this platform, let's remove it. In fact, only Linux and FreeBSD are part of the jenkins build tests, so even Apple/MacOS is up for disposal. However, as it's more popular, let's keep the code. Change-Id: Id6b8179259bacade52c39f96e688f828eff164ac --- M lib/tun.c M sgsnemu/sgsnemu.c 2 files changed, 0 insertions(+), 264 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.c b/lib/tun.c index 6ca9be7..32d4b27 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -53,13 +53,6 @@ #elif defined (__APPLE__) #include -#elif defined (__sun__) -#include -#include -#include -#include -/*#include "sun_if_tun.h"*/ - #else #error "Unknown platform!" #endif @@ -111,102 +104,6 @@ close(fd); return 0; } - -/* Currently unused -int tun_addroute2(struct tun_t *this, - struct in_addr *dst, - struct in_addr *gateway, - struct in_addr *mask) { - - struct { - struct nlmsghdr n; - struct rtmsg r; - char buf[TUN_NLBUFSIZE]; - } req; - - struct sockaddr_nl local; - int addr_len; - int fd; - int status; - struct sockaddr_nl nladdr; - struct iovec iov; - struct msghdr msg; - - memset(&req, 0, sizeof(req)); - req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); - req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE; - req.n.nlmsg_type = RTM_NEWROUTE; - req.r.rtm_family = AF_INET; - req.r.rtm_table = RT_TABLE_MAIN; - req.r.rtm_protocol = RTPROT_BOOT; - req.r.rtm_scope = RT_SCOPE_UNIVERSE; - req.r.rtm_type = RTN_UNICAST; - tun_nlattr(&req.n, sizeof(req), RTA_DST, dst, 4); - tun_nlattr(&req.n, sizeof(req), RTA_GATEWAY, gateway, 4); - - if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "socket() failed"); - return -1; - } - - memset(&local, 0, sizeof(local)); - local.nl_family = AF_NETLINK; - local.nl_groups = 0; - - if (bind(fd, (struct sockaddr*)&local, sizeof(local)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "bind() failed"); - close(fd); - return -1; - } - - addr_len = sizeof(local); - if (getsockname(fd, (struct sockaddr*)&local, &addr_len) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "getsockname() failed"); - close(fd); - return -1; - } - - if (addr_len != sizeof(local)) { - SYS_ERR(DTUN, LOGL_ERROR, 0, - "Wrong address length %d", addr_len); - close(fd); - return -1; - } - - if (local.nl_family != AF_NETLINK) { - SYS_ERR(DTUN, LOGL_ERROR, 0, - "Wrong address family %d", local.nl_family); - close(fd); - return -1; - } - - iov.iov_base = (void*)&req.n; - iov.iov_len = req.n.nlmsg_len; - - msg.msg_name = (void*)&nladdr; - msg.msg_namelen = sizeof(nladdr), - msg.msg_iov = &iov; - msg.msg_iovlen = 1; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - - memset(&nladdr, 0, sizeof(nladdr)); - nladdr.nl_family = AF_NETLINK; - nladdr.nl_pid = 0; - nladdr.nl_groups = 0; - - req.n.nlmsg_seq = 0; - req.n.nlmsg_flags |= NLM_F_ACK; - - status = sendmsg(fd, &msg, 0); * TODO: Error check * - close(fd); - return 0; -} -*/ int tun_addaddr(struct tun_t *this, struct in_addr *addr, @@ -373,17 +270,6 @@ this->addrs++; return 0; -#elif defined (__sun__) - - if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr4(this, addr, dstaddr, netmask); - - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Setting multiple addresses not possible on Solaris"); - return -1; - -#else -#error "Unknown platform!" #endif } @@ -455,12 +341,6 @@ #elif defined(__FreeBSD__) || defined (__APPLE__) ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = netmask->s_addr; - -#elif defined(__sun__) - ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = - netmask->s_addr; -#else -#error "Unknown platform!" #endif if (ioctl(fd, SIOCSIFNETMASK, (void *)&ifr) < 0) { @@ -593,8 +473,6 @@ struct in_addr *gateway, struct in_addr *mask, int delete) { - /* TODO: Learn how to set routing table on sun */ - #if defined(__linux__) struct rtentry r; @@ -687,14 +565,6 @@ } close(fd); return 0; - -#elif defined(__sun__) - SYS_ERR(DTUN, LOGL_NOTICE, errno, - "Could not set up routing on Solaris. Please add route manually."); - return 0; - -#else -#error "Unknown platform!" #endif } @@ -724,15 +594,6 @@ int devnum; struct ifaliasreq areq; int fd; - -#elif defined(__sun__) - int if_fd, ppa = -1; - static int ip_fd = 0; - int muxid; - struct ifreq ifr; - -#else -#error "Unknown platform!" #endif if (!(*tun = calloc(1, sizeof(struct tun_t)))) { @@ -805,90 +666,6 @@ close(fd); return 0; - -#elif defined(__sun__) - - if ((ip_fd = open("/dev/udp", O_RDWR, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't open /dev/udp"); - goto err_free; - } - - if (((*tun)->fd = open("/dev/tun", O_RDWR, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't open /dev/tun"); - close(ip_fd); - goto err_free; - } - - /* Assign a new PPA and get its unit number. */ - if ((ppa = ioctl((*tun)->fd, TUNNEWPPA, -1)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't assign new interface"); - goto sun_close_ip; - } - - if ((if_fd = open("/dev/tun", O_RDWR, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't open /dev/tun (2)"); - goto sun_close_ip; - } - if (ioctl(if_fd, I_PUSH, "ip") < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't push IP module"); - goto sun_close_if; - } - - /* Assign ppa according to the unit number returned by tun device */ - if (ioctl(if_fd, IF_UNITSEL, (char *)&ppa) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "Can't set PPA %d", - ppa); - goto sun_close_if; - } - - /* Link the two streams */ - if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't link TUN device to IP"); - goto sun_close_if; - } - - /* Link the two streams */ - if ((muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't link TUN device to IP"); - goto sun_close_if; - } - - close(if_fd); - - snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", ppa); - (*tun)->devname[sizeof((*tun)->devname)] = 0; - - memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, (*tun)->devname); - ifr.ifr_ip_muxid = muxid; - - if (ioctl(ip_fd, SIOCSIFMUXID, &ifr) < 0) { - ioctl(ip_fd, I_PUNLINK, muxid); - SYS_ERR(DTUN, LOGL_ERROR, errno, - "Can't set multiplexor id"); - goto sun_close_ip; - } - - /* if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) - msg (M_ERR, "Set file descriptor to non-blocking failed"); */ - - return 0; - -sun_close_if: - close(if_fd); -sun_close_ip: - close(ip_fd); - goto err_close; - -#else -#error "Unknown platform!" #endif err_close: @@ -925,9 +702,6 @@ int tun_decaps(struct tun_t *this) { - -#if defined(__linux__) || defined (__FreeBSD__) || defined (__APPLE__) - unsigned char buffer[PACKET_MAX]; int status; @@ -940,44 +714,11 @@ return this->cb_ind(this, buffer, status); return 0; - -#elif defined (__sun__) - - unsigned char buffer[PACKET_MAX]; - struct strbuf sbuf; - int f = 0; - - sbuf.maxlen = PACKET_MAX; - sbuf.buf = buffer; - if (getmsg(this->fd, NULL, &sbuf, &f) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "getmsg() failed"); - return -1; - } - - if (this->cb_ind) - return this->cb_ind(this, buffer, sbuf.len); - - return 0; - -#endif - } int tun_encaps(struct tun_t *tun, void *pack, unsigned len) { - -#if defined(__linux__) || defined (__FreeBSD__) || defined (__APPLE__) - return write(tun->fd, pack, len); - -#elif defined (__sun__) - - struct strbuf sbuf; - sbuf.len = len; - sbuf.buf = pack; - return putmsg(tun->fd, NULL, &sbuf, 0); - -#endif } int tun_runscript(struct tun_t *tun, char *script) diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 8c9cfd3..1f0b3f9 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -870,13 +870,8 @@ exit(1); } options.net.s_addr = in46.v4.s_addr; -#if defined (__sun__) - options.netaddrs_addr = htonl(ntohl(options.net.s_addr) + 1); - options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); -#else options.netaddr.s_addr = options.net.s_addr; options.destaddr.s_addr = options.net.s_addr; -#endif } else { options.net.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/3846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6b8179259bacade52c39f96e688f828eff164ac Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:23:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:23:14 +0000 Subject: [MERGED] openggsn[master]: lib/tun: Mark internal helper functions 'static' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/tun: Mark internal helper functions 'static' ...................................................................... lib/tun: Mark internal helper functions 'static' Change-Id: I53a8a89abb0080a39a153e9d3864c17b29aa193c --- M lib/tun.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.c b/lib/tun.c index 32d4b27..e8368e5 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -67,7 +67,7 @@ #include -int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) +static int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { int len = RTA_LENGTH(dlen); int alen = NLMSG_ALIGN(n->nlmsg_len); @@ -82,7 +82,7 @@ } #endif -int tun_sifflags(struct tun_t *this, int flags) +static int tun_sifflags(struct tun_t *this, int flags) { struct ifreq ifr; int fd; @@ -468,7 +468,7 @@ } } -int tun_route(struct tun_t *this, +static int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) { -- To view, visit https://gerrit.osmocom.org/3847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53a8a89abb0080a39a153e9d3864c17b29aa193c Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:23:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 21:23:19 +0000 Subject: osmo-bts[master]: OML: print actual type of report sent to BSC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3829/1/src/common/oml.c File src/common/oml.c: Line 76: LOGP(DOML, LOGL_NOTICE, "Sending %s to BSC: ", get_value_string(abis_mm_event_cause_names, cause_value)); the function is called "tx_failure", shouldn't the all caps "FAILURE" remain in the log? anyway +2 for logging the cause name. -- To view, visit https://gerrit.osmocom.org/3829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:48:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 21:48:47 +0000 Subject: [PATCH] osmo-msc[master]: jenkins: drop unused build matrix vars, always --enable-smpp Message-ID: Review at https://gerrit.osmocom.org/3856 jenkins: drop unused build matrix vars, always --enable-smpp Change-Id: I24fbc756e79bbf25fc37dbf9b2c573972e712c7e --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/56/3856/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index a7313c5..284679d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -47,11 +47,11 @@ cd "$base" autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure --enable-smpp $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-smpp $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24fbc756e79bbf25fc37dbf9b2c573972e712c7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:49:21 +0000 Subject: [PATCH] osmo-ggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... Message-ID: Review at https://gerrit.osmocom.org/3857 Introduce a VTY, factually turning OpenGGSN into an Osmocom program Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 --- M doc/ggsn.8 D examples/ggsn.conf A examples/osmo-ggsn.cfg M ggsn/Makefile.am D ggsn/cmdline.c D ggsn/cmdline.ggo D ggsn/cmdline.h M ggsn/ggsn.c A ggsn/ggsn.h A ggsn/ggsn_vty.c M lib/tun.c M lib/tun.h M sgsnemu/sgsnemu.c 13 files changed, 1,673 insertions(+), 2,177 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/57/3857/1 diff --git a/doc/ggsn.8 b/doc/ggsn.8 index 62d467a..89dcb61b 100644 --- a/doc/ggsn.8 +++ b/doc/ggsn.8 @@ -31,33 +31,13 @@ .B ggsn [ -.BI \-\-fg +.BI \-\-help ] [ -.BI \-\-debug +.BI \-\-daemonize ] [ -.BI \-\-conf " file" +.BI \-\-config-file " file" ] [ -.BI \-\-pidfile " file" -] [ -.BI \-\-statedir " file" -] [ -.BI \-\-listen " host" -] [ -.BI \-\-net " net" -] [ -.BI \-\-ipup " script" -] [ -.BI \-\-ipdown " script" -] [ -.BI \-\-dynip " net" -] [ -.BI \-\-statip " net" -] [ -.BI \-\-pcodns1 " host" -] [ -.BI \-\-pcodns2 " host" -] [ -.BI \-\-timelimit " seconds" +.BI \-\-version ] .SH DESCRIPTION .B ggsn @@ -115,86 +95,17 @@ Print version and exit. .TP -.BI --fg -Run in foreground (default = off) +.BI --daemonize +Run in background as a daemon (default = off) .TP -.BI --debug -Run in debug mode (default = off) - -.TP -.BI --conf " file" +.BI --config-file " file" Read configuration .I file -(default = /etc/ggsn.conf) where each line corresponds to one command -line option, but with the leading '--' removed. Command line options -override the options given in the configuration file. - -.TP -.BI --pidfile " file" -Filename of process id -.I file -(default = /var/run/ggsn.pid) - -.TP -.BI --statedir " path" -.I path -to directory of nonvolatile data (default = /var/lib/ggsn/) - -.TP -.BI --listen " host" -Local interface IP address to use for the Gn/Gp interface. This option -must be specified. For security issues it is not possible to use -INADDR_ANY. - -.TP -.BI --net " net" -Network address of the Gi interface (default = 192.168.0.0/24). The -network address is set during initialisation when -.B ggsn -establishes a tun device for the Gi interface. - -.TP -.BI --ipup " script" -Script executed after the Gi tun network interface has been brought -up. Executed with the following parameters: - -.TP -.BI --ipdown " script" -Script executed after the Gi tun network interface has been taken -down. Executed with the following parameters: - -.TP -.BI --dynip " net" -Dynamic IP address pool. Specifies a pool of dynamic IP addresses. If -this option is omitted the network address specified by the -.BI --net -option is used for dynamic IP address allocation. - -.TP -.BI --pcodns1 " host" -PCO DNS Server 1 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --pcodns2 " host" -PCO DNS Server 2 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --timelimit " seconds" -Exit -.B ggsn -after \fIseconds\fP. Used for debugging. - +(default = ./openggsn.cfg) .SH FILES -.I /etc/ggsn.conf +.I ./openggsn.cfg .RS The configuration file for .B ggsn. @@ -210,7 +121,7 @@ .SH BUGS Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/ggsn/ +.I https://osmocom.org/projects/openggsn .B ggsn has very limited management support. Currently both SNMP as well as @@ -250,6 +161,7 @@ .SH COPYRIGHT Copyright (C) 2002, 2003 by Mondru AB. +Copyright (C) 2017 Harald Welte The contents of this file may be used under the terms of the GNU General Public License Version 2, provided that the above copyright @@ -258,3 +170,4 @@ .SH AUTHORS Jens Jakobsen +Harald Welte diff --git a/examples/ggsn.conf b/examples/ggsn.conf deleted file mode 100644 index 6dcfe44..0000000 --- a/examples/ggsn.conf +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################## -# -# Sample ggsn configuration file -# -############################################################################## - -# TAG: fg -# Include this flag if process is to run in the foreground -# -#fg - -# TAG: debug -# Include this flag to include debug information. -#debug - - -# TAG: conf -# Configuration file to use. This file is the configuration file, -# so changing this parameter in the configuration file does not make -# sense. Use it on the command line instead. - -# TAG: pidfile -# File to store information about the process id of the program. -# The program must have write access to this file/directory. -#pidfile /var/run/ggsn.pid - -# TAG: statedir -# Directory to use for nonvolatile storage. -# The program must have write access to this directory. -#statedir /var/lib/ggsn/ - - -# TAG: listen -# Specifies the local IP address to listen to -#listen 10.0.0.240 - -# TAG: net -# IP network address of external packet data network -# Used to set up network interface. -#net 192.168.0.0/24 - -# TAG: ipup -# Script executed after network interface has been brought up. -# Executed with the following parameters: -#ipup /etc/ggsn/ip-up - -# TAG: ipdown -# Script executed after network interface has been taken down. -# Executed with the following parameters: -#ipdown /etc/ggsn/ip-down - -# TAG: dynip -# Dynamic IP address pool. -# Used for allocation of dynamic IP address when address is not given -# by HLR. -# If this option is not given then the net option is used as a substitute. -#dynip 192.168.0.0/24 - -# TAG: statip -# Use of this tag is currently UNSUPPORTED -# Static IP address pool. -# Used for allocation of static IP address by means of HLR. -#statip 192.168.1.0/24 - -# TAG: pcodns1 -# Protocol configuration option domain name system server 1. -#pcodns1 0.0.0.0 - -# TAG: pcodns2 -# Protocol configuration option domain name system server 2. -#pcodns2 0.0.0.0 - -# TAG: timelimit -# Exit after timelimit seconds. -# Setting timelimit to zero will cause the program not to exit. -#timelimit 0 - -# TAG: apn -# Use of this tag is EXPERIMENTAL -# Access point name to connect to when run in client mode. -#apn internet - -# TAG: qos -# Use of this tag is EXPERIMENTAL -# Requested Quality of Service used when run in client mode. -# 3 bytes corresponding to ???? -#qos 0x0b921f - -# TAG: qos -# Enable GTP datapath through Linux kernel driver gtp.ko (since 4.7). -#gtp-linux - diff --git a/examples/osmo-ggsn.cfg b/examples/osmo-ggsn.cfg new file mode 100644 index 0000000..763e561 --- /dev/null +++ b/examples/osmo-ggsn.cfg @@ -0,0 +1,71 @@ +! +! OpenGGSN (0.94.1-adac) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging print category 0 + logging timestamp 0 + logging level ip info + logging level tun info + logging level ggsn info + logging level sgsn notice + logging level icmp6 notice + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp info + logging level lstats notice + logging level lgsup notice + logging level loap notice + logging level lss7 notice + logging level lsccp notice + logging level lsua notice + logging level lm3ua notice + logging level lmgcp notice +! +stats interval 5 +! +line vty + no login +! +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown + apn inet6 + gtpu-mode tun + tun-device tun6 + type-support v6 + ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2000:0:0:0:0/56 + no shutdown + apn inet46 + gtpu-mode tun + tun-device tun46 + type-support v4v6 + ip prefix dynamic 176.16.46.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.46.0/24 + ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 + no shutdown + default-apn internet + no shutdown ggsn diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index c945f0b..fef12d3 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -2,17 +2,17 @@ AM_LDFLAGS = @EXEC_LDFLAGS@ -AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) + +ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD = @EXEC_LDADD@ -lgtp -lgtpnl -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) -else -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) +ggsn_LDADD += -lgtpnl endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/cmdline.c b/ggsn/cmdline.c deleted file mode 100644 index 31c0744..0000000 --- a/ggsn/cmdline.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* - File autogenerated by gengetopt version 2.22.6 - generated with the following command: - gengetopt -i cmdline.ggo --conf-parser - - The developers of gengetopt consider the fixed text that goes in all - gengetopt output files to be in the public domain: - we make no copyright claims on it. -*/ - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#ifndef FIX_UNUSED -#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ -#endif - -#include - -#include "cmdline.h" - -const char *gengetopt_args_info_purpose = ""; - -const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; - -const char *gengetopt_args_info_versiontext = ""; - -const char *gengetopt_args_info_description = ""; - -const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -f, --fg Run in foreground (default=off)", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file (default=`/etc/ggsn.conf')", - " --pidfile=STRING Filename of process id file\n (default=`/var/run/ggsn.pid')", - " --statedir=STRING Directory of nonvolatile data\n (default=`/var/lib/ggsn/')", - " -l, --listen=STRING Local interface", - " -n, --net=STRING Network (default=`192.168.0.0/24')", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --dynip=STRING Dynamic IP address pool", - " --statip=STRING Static IP address pool", - " --pcodns1=STRING PCO DNS Server 1 (default=`0.0.0.0')", - " --pcodns2=STRING PCO DNS Server 2 (default=`0.0.0.0')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " -a, --apn=STRING Access point name (default=`internet')", - " -q, --qos=INT Requested quality of service (default=`0x0b921f')", - " --logfile=STRING Logfile for errors", - " --loglevel=STRING Global log ldevel (default=`error')", - " -g, --gtp-linux GTP linux kernel support (default=off)", - 0 -}; - -typedef enum {ARG_NO - , ARG_FLAG - , ARG_STRING - , ARG_INT -} cmdline_parser_arg_type; - -static -void clear_given (struct gengetopt_args_info *args_info); -static -void clear_args (struct gengetopt_args_info *args_info); - -static int -cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error); - -struct line_list -{ - char * string_arg; - struct line_list * next; -}; - -static struct line_list *cmd_line_list = 0; -static struct line_list *cmd_line_list_tmp = 0; - -static void -free_cmd_list(void) -{ - /* free the list of a previous call */ - if (cmd_line_list) - { - while (cmd_line_list) { - cmd_line_list_tmp = cmd_line_list; - cmd_line_list = cmd_line_list->next; - free (cmd_line_list_tmp->string_arg); - free (cmd_line_list_tmp); - } - } -} - - -static char * -gengetopt_strdup (const char *s); - -static -void clear_given (struct gengetopt_args_info *args_info) -{ - args_info->help_given = 0 ; - args_info->version_given = 0 ; - args_info->fg_given = 0 ; - args_info->debug_given = 0 ; - args_info->conf_given = 0 ; - args_info->pidfile_given = 0 ; - args_info->statedir_given = 0 ; - args_info->listen_given = 0 ; - args_info->net_given = 0 ; - args_info->ipup_given = 0 ; - args_info->ipdown_given = 0 ; - args_info->dynip_given = 0 ; - args_info->statip_given = 0 ; - args_info->pcodns1_given = 0 ; - args_info->pcodns2_given = 0 ; - args_info->timelimit_given = 0 ; - args_info->apn_given = 0 ; - args_info->qos_given = 0 ; - args_info->logfile_given = 0 ; - args_info->loglevel_given = 0 ; - args_info->gtp_linux_given = 0 ; -} - -static -void clear_args (struct gengetopt_args_info *args_info) -{ - FIX_UNUSED (args_info); - args_info->fg_flag = 0; - args_info->debug_flag = 0; - args_info->conf_arg = gengetopt_strdup ("/etc/ggsn.conf"); - args_info->conf_orig = NULL; - args_info->pidfile_arg = gengetopt_strdup ("/var/run/ggsn.pid"); - args_info->pidfile_orig = NULL; - args_info->statedir_arg = gengetopt_strdup ("/var/lib/ggsn/"); - args_info->statedir_orig = NULL; - args_info->listen_arg = NULL; - args_info->listen_orig = NULL; - args_info->net_arg = gengetopt_strdup ("192.168.0.0/24"); - args_info->net_orig = NULL; - args_info->ipup_arg = NULL; - args_info->ipup_orig = NULL; - args_info->ipdown_arg = NULL; - args_info->ipdown_orig = NULL; - args_info->dynip_arg = NULL; - args_info->dynip_orig = NULL; - args_info->statip_arg = NULL; - args_info->statip_orig = NULL; - args_info->pcodns1_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns1_orig = NULL; - args_info->pcodns2_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns2_orig = NULL; - args_info->timelimit_arg = 0; - args_info->timelimit_orig = NULL; - args_info->apn_arg = gengetopt_strdup ("internet"); - args_info->apn_orig = NULL; - args_info->qos_arg = 0x0b921f; - args_info->qos_orig = NULL; - args_info->logfile_arg = NULL; - args_info->logfile_orig = NULL; - args_info->loglevel_arg = gengetopt_strdup ("error"); - args_info->loglevel_orig = NULL; - args_info->gtp_linux_flag = 0; - -} - -static -void init_args_info(struct gengetopt_args_info *args_info) -{ - - - args_info->help_help = gengetopt_args_info_help[0] ; - args_info->version_help = gengetopt_args_info_help[1] ; - args_info->fg_help = gengetopt_args_info_help[2] ; - args_info->debug_help = gengetopt_args_info_help[3] ; - args_info->conf_help = gengetopt_args_info_help[4] ; - args_info->pidfile_help = gengetopt_args_info_help[5] ; - args_info->statedir_help = gengetopt_args_info_help[6] ; - args_info->listen_help = gengetopt_args_info_help[7] ; - args_info->net_help = gengetopt_args_info_help[8] ; - args_info->ipup_help = gengetopt_args_info_help[9] ; - args_info->ipdown_help = gengetopt_args_info_help[10] ; - args_info->dynip_help = gengetopt_args_info_help[11] ; - args_info->statip_help = gengetopt_args_info_help[12] ; - args_info->pcodns1_help = gengetopt_args_info_help[13] ; - args_info->pcodns2_help = gengetopt_args_info_help[14] ; - args_info->timelimit_help = gengetopt_args_info_help[15] ; - args_info->apn_help = gengetopt_args_info_help[16] ; - args_info->qos_help = gengetopt_args_info_help[17] ; - args_info->logfile_help = gengetopt_args_info_help[18] ; - args_info->loglevel_help = gengetopt_args_info_help[19] ; - args_info->gtp_linux_help = gengetopt_args_info_help[20] ; - -} - -void -cmdline_parser_print_version (void) -{ - printf ("%s %s\n", - (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), - CMDLINE_PARSER_VERSION); - - if (strlen(gengetopt_args_info_versiontext) > 0) - printf("\n%s\n", gengetopt_args_info_versiontext); -} - -static void print_help_common(void) { - cmdline_parser_print_version (); - - if (strlen(gengetopt_args_info_purpose) > 0) - printf("\n%s\n", gengetopt_args_info_purpose); - - if (strlen(gengetopt_args_info_usage) > 0) - printf("\n%s\n", gengetopt_args_info_usage); - - printf("\n"); - - if (strlen(gengetopt_args_info_description) > 0) - printf("%s\n\n", gengetopt_args_info_description); -} - -void -cmdline_parser_print_help (void) -{ - int i = 0; - print_help_common(); - while (gengetopt_args_info_help[i]) - printf("%s\n", gengetopt_args_info_help[i++]); -} - -void -cmdline_parser_init (struct gengetopt_args_info *args_info) -{ - clear_given (args_info); - clear_args (args_info); - init_args_info (args_info); -} - -void -cmdline_parser_params_init(struct cmdline_parser_params *params) -{ - if (params) - { - params->override = 0; - params->initialize = 1; - params->check_required = 1; - params->check_ambiguity = 0; - params->print_errors = 1; - } -} - -struct cmdline_parser_params * -cmdline_parser_params_create(void) -{ - struct cmdline_parser_params *params = - (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); - cmdline_parser_params_init(params); - return params; -} - -static void -free_string_field (char **s) -{ - if (*s) - { - free (*s); - *s = 0; - } -} - - -static void -cmdline_parser_release (struct gengetopt_args_info *args_info) -{ - - free_string_field (&(args_info->conf_arg)); - free_string_field (&(args_info->conf_orig)); - free_string_field (&(args_info->pidfile_arg)); - free_string_field (&(args_info->pidfile_orig)); - free_string_field (&(args_info->statedir_arg)); - free_string_field (&(args_info->statedir_orig)); - free_string_field (&(args_info->listen_arg)); - free_string_field (&(args_info->listen_orig)); - free_string_field (&(args_info->net_arg)); - free_string_field (&(args_info->net_orig)); - free_string_field (&(args_info->ipup_arg)); - free_string_field (&(args_info->ipup_orig)); - free_string_field (&(args_info->ipdown_arg)); - free_string_field (&(args_info->ipdown_orig)); - free_string_field (&(args_info->dynip_arg)); - free_string_field (&(args_info->dynip_orig)); - free_string_field (&(args_info->statip_arg)); - free_string_field (&(args_info->statip_orig)); - free_string_field (&(args_info->pcodns1_arg)); - free_string_field (&(args_info->pcodns1_orig)); - free_string_field (&(args_info->pcodns2_arg)); - free_string_field (&(args_info->pcodns2_orig)); - free_string_field (&(args_info->timelimit_orig)); - free_string_field (&(args_info->apn_arg)); - free_string_field (&(args_info->apn_orig)); - free_string_field (&(args_info->qos_orig)); - free_string_field (&(args_info->logfile_arg)); - free_string_field (&(args_info->logfile_orig)); - free_string_field (&(args_info->loglevel_arg)); - free_string_field (&(args_info->loglevel_orig)); - - - - clear_given (args_info); -} - - -static void -write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) -{ - FIX_UNUSED (values); - if (arg) { - fprintf(outfile, "%s=\"%s\"\n", opt, arg); - } else { - fprintf(outfile, "%s\n", opt); - } -} - - -int -cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) -{ - int i = 0; - - if (!outfile) - { - fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); - return EXIT_FAILURE; - } - - if (args_info->help_given) - write_into_file(outfile, "help", 0, 0 ); - if (args_info->version_given) - write_into_file(outfile, "version", 0, 0 ); - if (args_info->fg_given) - write_into_file(outfile, "fg", 0, 0 ); - if (args_info->debug_given) - write_into_file(outfile, "debug", 0, 0 ); - if (args_info->conf_given) - write_into_file(outfile, "conf", args_info->conf_orig, 0); - if (args_info->pidfile_given) - write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); - if (args_info->statedir_given) - write_into_file(outfile, "statedir", args_info->statedir_orig, 0); - if (args_info->listen_given) - write_into_file(outfile, "listen", args_info->listen_orig, 0); - if (args_info->net_given) - write_into_file(outfile, "net", args_info->net_orig, 0); - if (args_info->ipup_given) - write_into_file(outfile, "ipup", args_info->ipup_orig, 0); - if (args_info->ipdown_given) - write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); - if (args_info->dynip_given) - write_into_file(outfile, "dynip", args_info->dynip_orig, 0); - if (args_info->statip_given) - write_into_file(outfile, "statip", args_info->statip_orig, 0); - if (args_info->pcodns1_given) - write_into_file(outfile, "pcodns1", args_info->pcodns1_orig, 0); - if (args_info->pcodns2_given) - write_into_file(outfile, "pcodns2", args_info->pcodns2_orig, 0); - if (args_info->timelimit_given) - write_into_file(outfile, "timelimit", args_info->timelimit_orig, 0); - if (args_info->apn_given) - write_into_file(outfile, "apn", args_info->apn_orig, 0); - if (args_info->qos_given) - write_into_file(outfile, "qos", args_info->qos_orig, 0); - if (args_info->logfile_given) - write_into_file(outfile, "logfile", args_info->logfile_orig, 0); - if (args_info->loglevel_given) - write_into_file(outfile, "loglevel", args_info->loglevel_orig, 0); - if (args_info->gtp_linux_given) - write_into_file(outfile, "gtp-linux", 0, 0 ); - - - i = EXIT_SUCCESS; - return i; -} - -int -cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) -{ - FILE *outfile; - int i = 0; - - outfile = fopen(filename, "w"); - - if (!outfile) - { - fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - i = cmdline_parser_dump(outfile, args_info); - fclose (outfile); - - return i; -} - -void -cmdline_parser_free (struct gengetopt_args_info *args_info) -{ - cmdline_parser_release (args_info); -} - -/** @brief replacement of strdup, which is not standard */ -char * -gengetopt_strdup (const char *s) -{ - char *result = 0; - if (!s) - return result; - - result = (char*)malloc(strlen(s) + 1); - if (result == (char*)0) - return (char*)0; - strcpy(result, s); - return result; -} - -int -cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) -{ - return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); -} - -int -cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int result; - result = cmdline_parser_internal (argc, argv, args_info, params, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) -{ - int result; - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) -{ - FIX_UNUSED (args_info); - FIX_UNUSED (prog_name); - return EXIT_SUCCESS; -} - - -static char *package_name = 0; - -/** - * @brief updates an option - * @param field the generic pointer to the field to update - * @param orig_field the pointer to the orig field - * @param field_given the pointer to the number of occurrence of this option - * @param prev_given the pointer to the number of occurrence already seen - * @param value the argument for this option (if null no arg was specified) - * @param possible_values the possible values for this option (if specified) - * @param default_value the default value (in case the option only accepts fixed values) - * @param arg_type the type of this option - * @param check_ambiguity @see cmdline_parser_params.check_ambiguity - * @param override @see cmdline_parser_params.override - * @param no_free whether to free a possible previous value - * @param multiple_option whether this is a multiple option - * @param long_opt the corresponding long option - * @param short_opt the corresponding short option (or '-' if none) - * @param additional_error possible further error specification - */ -static -int update_arg(void *field, char **orig_field, - unsigned int *field_given, unsigned int *prev_given, - char *value, const char *possible_values[], - const char *default_value, - cmdline_parser_arg_type arg_type, - int check_ambiguity, int override, - int no_free, int multiple_option, - const char *long_opt, char short_opt, - const char *additional_error) -{ - char *stop_char = 0; - const char *val = value; - int found; - char **string_field; - FIX_UNUSED (field); - - stop_char = 0; - found = 0; - - if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) - { - if (short_opt != '-') - fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", - package_name, long_opt, short_opt, - (additional_error ? additional_error : "")); - else - fprintf (stderr, "%s: `--%s' option given more than once%s\n", - package_name, long_opt, - (additional_error ? additional_error : "")); - return 1; /* failure */ - } - - FIX_UNUSED (default_value); - - if (field_given && *field_given && ! override) - return 0; - if (prev_given) - (*prev_given)++; - if (field_given) - (*field_given)++; - if (possible_values) - val = possible_values[found]; - - switch(arg_type) { - case ARG_FLAG: - *((int *)field) = !*((int *)field); - break; - case ARG_INT: - if (val) *((int *)field) = strtol (val, &stop_char, 0); - break; - case ARG_STRING: - if (val) { - string_field = (char **)field; - if (!no_free && *string_field) - free (*string_field); /* free previous string */ - *string_field = gengetopt_strdup (val); - } - break; - default: - break; - }; - - /* check numeric conversion */ - switch(arg_type) { - case ARG_INT: - if (val && !(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); - return 1; /* failure */ - } - break; - default: - ; - }; - - /* store the original value */ - switch(arg_type) { - case ARG_NO: - case ARG_FLAG: - break; - default: - if (value && orig_field) { - if (no_free) { - *orig_field = value; - } else { - if (*orig_field) - free (*orig_field); /* free previous string */ - *orig_field = gengetopt_strdup (value); - } - } - }; - - return 0; /* OK */ -} - - -int -cmdline_parser_internal ( - int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error) -{ - int c; /* Character of the parsed option. */ - - int error_occurred = 0; - struct gengetopt_args_info local_args_info; - - int override; - int initialize; - int check_required; - int check_ambiguity; - - package_name = argv[0]; - - override = params->override; - initialize = params->initialize; - check_required = params->check_required; - check_ambiguity = params->check_ambiguity; - - if (initialize) - cmdline_parser_init (args_info); - - cmdline_parser_init (&local_args_info); - - optarg = 0; - optind = 0; - opterr = params->print_errors; - optopt = '?'; - - while (1) - { - int option_index = 0; - - static struct option long_options[] = { - { "help", 0, NULL, 'h' }, - { "version", 0, NULL, 'V' }, - { "fg", 0, NULL, 'f' }, - { "debug", 0, NULL, 'd' }, - { "conf", 1, NULL, 'c' }, - { "pidfile", 1, NULL, 0 }, - { "statedir", 1, NULL, 0 }, - { "listen", 1, NULL, 'l' }, - { "net", 1, NULL, 'n' }, - { "ipup", 1, NULL, 0 }, - { "ipdown", 1, NULL, 0 }, - { "dynip", 1, NULL, 0 }, - { "statip", 1, NULL, 0 }, - { "pcodns1", 1, NULL, 0 }, - { "pcodns2", 1, NULL, 0 }, - { "timelimit", 1, NULL, 0 }, - { "apn", 1, NULL, 'a' }, - { "qos", 1, NULL, 'q' }, - { "logfile", 1, NULL, 0 }, - { "loglevel", 1, NULL, 0 }, - { "gtp-linux", 0, NULL, 'g' }, - { 0, 0, 0, 0 } - }; - - c = getopt_long (argc, argv, "hVfdc:l:n:a:q:g", long_options, &option_index); - - if (c == -1) break; /* Exit from `while (1)' loop. */ - - switch (c) - { - case 'h': /* Print help and exit. */ - cmdline_parser_print_help (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'V': /* Print version and exit. */ - cmdline_parser_print_version (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'f': /* Run in foreground. */ - - - if (update_arg((void *)&(args_info->fg_flag), 0, &(args_info->fg_given), - &(local_args_info.fg_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "fg", 'f', - additional_error)) - goto failure; - - break; - case 'd': /* Run in debug mode. */ - - - if (update_arg((void *)&(args_info->debug_flag), 0, &(args_info->debug_given), - &(local_args_info.debug_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "debug", 'd', - additional_error)) - goto failure; - - break; - case 'c': /* Read configuration file. */ - - - if (update_arg( (void *)&(args_info->conf_arg), - &(args_info->conf_orig), &(args_info->conf_given), - &(local_args_info.conf_given), optarg, 0, "/etc/ggsn.conf", ARG_STRING, - check_ambiguity, override, 0, 0, - "conf", 'c', - additional_error)) - goto failure; - - break; - case 'l': /* Local interface. */ - - - if (update_arg( (void *)&(args_info->listen_arg), - &(args_info->listen_orig), &(args_info->listen_given), - &(local_args_info.listen_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "listen", 'l', - additional_error)) - goto failure; - - break; - case 'n': /* Network. */ - - - if (update_arg( (void *)&(args_info->net_arg), - &(args_info->net_orig), &(args_info->net_given), - &(local_args_info.net_given), optarg, 0, "192.168.0.0/24", ARG_STRING, - check_ambiguity, override, 0, 0, - "net", 'n', - additional_error)) - goto failure; - - break; - case 'a': /* Access point name. */ - - - if (update_arg( (void *)&(args_info->apn_arg), - &(args_info->apn_orig), &(args_info->apn_given), - &(local_args_info.apn_given), optarg, 0, "internet", ARG_STRING, - check_ambiguity, override, 0, 0, - "apn", 'a', - additional_error)) - goto failure; - - break; - case 'q': /* Requested quality of service. */ - - - if (update_arg( (void *)&(args_info->qos_arg), - &(args_info->qos_orig), &(args_info->qos_given), - &(local_args_info.qos_given), optarg, 0, "0x0b921f", ARG_INT, - check_ambiguity, override, 0, 0, - "qos", 'q', - additional_error)) - goto failure; - - break; - case 'g': /* GTP linux kernel support. */ - - - if (update_arg((void *)&(args_info->gtp_linux_flag), 0, &(args_info->gtp_linux_given), - &(local_args_info.gtp_linux_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "gtp-linux", 'g', - additional_error)) - goto failure; - - break; - - case 0: /* Long option with no short option */ - /* Filename of process id file. */ - if (strcmp (long_options[option_index].name, "pidfile") == 0) - { - - - if (update_arg( (void *)&(args_info->pidfile_arg), - &(args_info->pidfile_orig), &(args_info->pidfile_given), - &(local_args_info.pidfile_given), optarg, 0, "/var/run/ggsn.pid", ARG_STRING, - check_ambiguity, override, 0, 0, - "pidfile", '-', - additional_error)) - goto failure; - - } - /* Directory of nonvolatile data. */ - else if (strcmp (long_options[option_index].name, "statedir") == 0) - { - - - if (update_arg( (void *)&(args_info->statedir_arg), - &(args_info->statedir_orig), &(args_info->statedir_given), - &(local_args_info.statedir_given), optarg, 0, "/var/lib/ggsn/", ARG_STRING, - check_ambiguity, override, 0, 0, - "statedir", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-up. */ - else if (strcmp (long_options[option_index].name, "ipup") == 0) - { - - - if (update_arg( (void *)&(args_info->ipup_arg), - &(args_info->ipup_orig), &(args_info->ipup_given), - &(local_args_info.ipup_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipup", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-down. */ - else if (strcmp (long_options[option_index].name, "ipdown") == 0) - { - - - if (update_arg( (void *)&(args_info->ipdown_arg), - &(args_info->ipdown_orig), &(args_info->ipdown_given), - &(local_args_info.ipdown_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipdown", '-', - additional_error)) - goto failure; - - } - /* Dynamic IP address pool. */ - else if (strcmp (long_options[option_index].name, "dynip") == 0) - { - - - if (update_arg( (void *)&(args_info->dynip_arg), - &(args_info->dynip_orig), &(args_info->dynip_given), - &(local_args_info.dynip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "dynip", '-', - additional_error)) - goto failure; - - } - /* Static IP address pool. */ - else if (strcmp (long_options[option_index].name, "statip") == 0) - { - - - if (update_arg( (void *)&(args_info->statip_arg), - &(args_info->statip_orig), &(args_info->statip_given), - &(local_args_info.statip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "statip", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 1. */ - else if (strcmp (long_options[option_index].name, "pcodns1") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns1_arg), - &(args_info->pcodns1_orig), &(args_info->pcodns1_given), - &(local_args_info.pcodns1_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns1", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 2. */ - else if (strcmp (long_options[option_index].name, "pcodns2") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns2_arg), - &(args_info->pcodns2_orig), &(args_info->pcodns2_given), - &(local_args_info.pcodns2_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns2", '-', - additional_error)) - goto failure; - - } - /* Exit after timelimit seconds. */ - else if (strcmp (long_options[option_index].name, "timelimit") == 0) - { - - - if (update_arg( (void *)&(args_info->timelimit_arg), - &(args_info->timelimit_orig), &(args_info->timelimit_given), - &(local_args_info.timelimit_given), optarg, 0, "0", ARG_INT, - check_ambiguity, override, 0, 0, - "timelimit", '-', - additional_error)) - goto failure; - - } - /* Logfile for errors. */ - else if (strcmp (long_options[option_index].name, "logfile") == 0) - { - - - if (update_arg( (void *)&(args_info->logfile_arg), - &(args_info->logfile_orig), &(args_info->logfile_given), - &(local_args_info.logfile_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "logfile", '-', - additional_error)) - goto failure; - - } - /* Global log ldevel. */ - else if (strcmp (long_options[option_index].name, "loglevel") == 0) - { - - - if (update_arg( (void *)&(args_info->loglevel_arg), - &(args_info->loglevel_orig), &(args_info->loglevel_given), - &(local_args_info.loglevel_given), optarg, 0, "error", ARG_STRING, - check_ambiguity, override, 0, 0, - "loglevel", '-', - additional_error)) - goto failure; - - } - - break; - case '?': /* Invalid option. */ - /* `getopt_long' already printed an error message. */ - goto failure; - - default: /* bug: option not considered. */ - fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); - abort (); - } /* switch */ - } /* while */ - - - - - cmdline_parser_release (&local_args_info); - - if ( error_occurred ) - return (EXIT_FAILURE); - - return 0; - -failure: - - cmdline_parser_release (&local_args_info); - return (EXIT_FAILURE); -} - -#ifndef CONFIG_FILE_LINE_SIZE -#define CONFIG_FILE_LINE_SIZE 2048 -#endif -#define ADDITIONAL_ERROR " in configuration file " - -#define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) -/* 3 is for "--" and "=" */ - -static int -_cmdline_parser_configfile (const char *filename, int *my_argc) -{ - FILE* file; - char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE+1]; - char linebuf[CONFIG_FILE_LINE_SIZE]; - int line_num = 0; - int result = 0, equal; - char *fopt, *farg; - char *str_index; - size_t len, next_token; - char delimiter; - - if ((file = fopen(filename, "r")) == 0) - { - fprintf (stderr, "%s: Error opening configuration file '%s'\n", - CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) - { - ++line_num; - my_argv[0] = '\0'; - len = strlen(linebuf); - if (len > (CONFIG_FILE_LINE_BUFFER_SIZE-1)) - { - fprintf (stderr, "%s:%s:%d: Line too long in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - - /* find first non-whitespace character in the line */ - next_token = strspn (linebuf, " \t\r\n"); - str_index = linebuf + next_token; - - if ( str_index[0] == '\0' || str_index[0] == '#') - continue; /* empty line or comment line is skipped */ - - fopt = str_index; - - /* truncate fopt at the end of the first non-valid character */ - next_token = strcspn (fopt, " \t\r\n="); - - if (fopt[next_token] == '\0') /* the line is over */ - { - farg = 0; - equal = 0; - goto noarg; - } - - /* remember if equal sign is present */ - equal = (fopt[next_token] == '='); - fopt[next_token++] = '\0'; - - /* advance pointers to the next token after the end of fopt */ - next_token += strspn (fopt + next_token, " \t\r\n"); - - /* check for the presence of equal sign, and if so, skip it */ - if ( !equal ) - if ((equal = (fopt[next_token] == '='))) - { - next_token++; - next_token += strspn (fopt + next_token, " \t\r\n"); - } - str_index += next_token; - - /* find argument */ - farg = str_index; - if ( farg[0] == '\"' || farg[0] == '\'' ) - { /* quoted argument */ - str_index = strchr (++farg, str_index[0] ); /* skip opening quote */ - if (! str_index) - { - fprintf - (stderr, - "%s:%s:%d: unterminated string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - else - { /* read up the remaining part up to a delimiter */ - next_token = strcspn (farg, " \t\r\n#\'\""); - str_index += next_token; - } - - /* truncate farg at the delimiter and store it for further check */ - delimiter = *str_index, *str_index++ = '\0'; - - /* everything but comment is illegal at the end of line */ - if (delimiter != '\0' && delimiter != '#') - { - str_index += strspn(str_index, " \t\r\n"); - if (*str_index != '\0' && *str_index != '#') - { - fprintf - (stderr, - "%s:%s:%d: malformed string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - - noarg: - if (!strcmp(fopt,"include")) { - if (farg && *farg) { - result = _cmdline_parser_configfile(farg, my_argc); - } else { - fprintf(stderr, "%s:%s:%d: include requires a filename argument.\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - } - continue; - } - len = strlen(fopt); - strcat (my_argv, len > 1 ? "--" : "-"); - strcat (my_argv, fopt); - if (len > 1 && ((farg && *farg) || equal)) - strcat (my_argv, "="); - if (farg && *farg) - strcat (my_argv, farg); - ++(*my_argc); - - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(my_argv); - } /* while */ - - if (file) - fclose(file); - return result; -} - -int -cmdline_parser_configfile ( - const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required) -{ - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - return cmdline_parser_config_file (filename, args_info, ¶ms); -} - -int -cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int i, result; - int my_argc = 1; - char **my_argv_arg; - char *additional_error; - - /* store the program name */ - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup (CMDLINE_PARSER_PACKAGE); - - result = _cmdline_parser_configfile(filename, &my_argc); - - if (result != EXIT_FAILURE) { - my_argv_arg = (char **) malloc((my_argc+1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - - my_argv_arg[my_argc] = 0; - - additional_error = (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy (additional_error, ADDITIONAL_ERROR); - strcat (additional_error, filename); - result = - cmdline_parser_internal (my_argc, my_argv_arg, args_info, - params, - additional_error); - - free (additional_error); - free (my_argv_arg); - } - - free_cmd_list(); - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} diff --git a/ggsn/cmdline.ggo b/ggsn/cmdline.ggo deleted file mode 100644 index 7426707..0000000 --- a/ggsn/cmdline.ggo +++ /dev/null @@ -1,38 +0,0 @@ -# OpenGGSN - Gateway GPRS Support Node -# Copyright (C) 2002, 2003, 2004 Mondru AB. -# -# The contents of this file may be used under the terms of the GNU -# General Public License Version 2, provided that the above copyright -# notice and this permission notice is included in all copies or -# substantial portions of the software. -# -# Use "gengetopt --conf-parser < cmdline.ggo" -# to generate cmdline.c and cmdline.h - -option "fg" f "Run in foreground" flag off -option "debug" d "Run in debug mode" flag off - -option "conf" c "Read configuration file" string default="/etc/ggsn.conf" no -option "pidfile" - "Filename of process id file" string default="/var/run/ggsn.pid" no -option "statedir" - "Directory of nonvolatile data" string default="/var/lib/ggsn/" no - -option "listen" l "Local interface" string no -option "net" n "Network" string default="192.168.0.0/24" no -option "ipup" - "Script to run after link-up" string no -option "ipdown" - "Script to run after link-down" string no - -option "dynip" - "Dynamic IP address pool" string no -option "statip" - "Static IP address pool" string no - -option "pcodns1" - "PCO DNS Server 1" string default="0.0.0.0" no -option "pcodns2" - "PCO DNS Server 2" string default="0.0.0.0" no - -option "timelimit" - "Exit after timelimit seconds" int default="0" no - -option "apn" a "Access point name" string default="internet" no -option "qos" q "Requested quality of service" int default="0x0b921f" no -option "logfile" - "Logfile for errors" string no -option "loglevel" - "Global log ldevel" string default="error" no - -option "gtp-linux" g "GTP linux kernel support" flag off - diff --git a/ggsn/cmdline.h b/ggsn/cmdline.h deleted file mode 100644 index 57f5cae..0000000 --- a/ggsn/cmdline.h +++ /dev/null @@ -1,275 +0,0 @@ -/** @file cmdline.h - * @brief The header file for the command line option parser - * generated by GNU Gengetopt version 2.22.6 - * http://www.gnu.org/software/gengetopt. - * DO NOT modify this file, since it can be overwritten - * @author GNU Gengetopt by Lorenzo Bettini */ - -#ifndef CMDLINE_H -#define CMDLINE_H - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include /* for FILE */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef CMDLINE_PARSER_PACKAGE -/** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE -#endif - -#ifndef CMDLINE_PARSER_PACKAGE_NAME -/** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif -#endif - -#ifndef CMDLINE_PARSER_VERSION -/** @brief the program version */ -#define CMDLINE_PARSER_VERSION VERSION -#endif - -/** @brief Where the command line options are stored */ -struct gengetopt_args_info -{ - const char *help_help; /**< @brief Print help and exit help description. */ - const char *version_help; /**< @brief Print version and exit help description. */ - int fg_flag; /**< @brief Run in foreground (default=off). */ - const char *fg_help; /**< @brief Run in foreground help description. */ - int debug_flag; /**< @brief Run in debug mode (default=off). */ - const char *debug_help; /**< @brief Run in debug mode help description. */ - char * conf_arg; /**< @brief Read configuration file (default='/etc/ggsn.conf'). */ - char * conf_orig; /**< @brief Read configuration file original value given at command line. */ - const char *conf_help; /**< @brief Read configuration file help description. */ - char * pidfile_arg; /**< @brief Filename of process id file (default='/var/run/ggsn.pid'). */ - char * pidfile_orig; /**< @brief Filename of process id file original value given at command line. */ - const char *pidfile_help; /**< @brief Filename of process id file help description. */ - char * statedir_arg; /**< @brief Directory of nonvolatile data (default='/var/lib/ggsn/'). */ - char * statedir_orig; /**< @brief Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /**< @brief Directory of nonvolatile data help description. */ - char * listen_arg; /**< @brief Local interface. */ - char * listen_orig; /**< @brief Local interface original value given at command line. */ - const char *listen_help; /**< @brief Local interface help description. */ - char * net_arg; /**< @brief Network (default='192.168.0.0/24'). */ - char * net_orig; /**< @brief Network original value given at command line. */ - const char *net_help; /**< @brief Network help description. */ - char * ipup_arg; /**< @brief Script to run after link-up. */ - char * ipup_orig; /**< @brief Script to run after link-up original value given at command line. */ - const char *ipup_help; /**< @brief Script to run after link-up help description. */ - char * ipdown_arg; /**< @brief Script to run after link-down. */ - char * ipdown_orig; /**< @brief Script to run after link-down original value given at command line. */ - const char *ipdown_help; /**< @brief Script to run after link-down help description. */ - char * dynip_arg; /**< @brief Dynamic IP address pool. */ - char * dynip_orig; /**< @brief Dynamic IP address pool original value given at command line. */ - const char *dynip_help; /**< @brief Dynamic IP address pool help description. */ - char * statip_arg; /**< @brief Static IP address pool. */ - char * statip_orig; /**< @brief Static IP address pool original value given at command line. */ - const char *statip_help; /**< @brief Static IP address pool help description. */ - char * pcodns1_arg; /**< @brief PCO DNS Server 1 (default='0.0.0.0'). */ - char * pcodns1_orig; /**< @brief PCO DNS Server 1 original value given at command line. */ - const char *pcodns1_help; /**< @brief PCO DNS Server 1 help description. */ - char * pcodns2_arg; /**< @brief PCO DNS Server 2 (default='0.0.0.0'). */ - char * pcodns2_orig; /**< @brief PCO DNS Server 2 original value given at command line. */ - const char *pcodns2_help; /**< @brief PCO DNS Server 2 help description. */ - int timelimit_arg; /**< @brief Exit after timelimit seconds (default='0'). */ - char * timelimit_orig; /**< @brief Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /**< @brief Exit after timelimit seconds help description. */ - char * apn_arg; /**< @brief Access point name (default='internet'). */ - char * apn_orig; /**< @brief Access point name original value given at command line. */ - const char *apn_help; /**< @brief Access point name help description. */ - int qos_arg; /**< @brief Requested quality of service (default='0x0b921f'). */ - char * qos_orig; /**< @brief Requested quality of service original value given at command line. */ - const char *qos_help; /**< @brief Requested quality of service help description. */ - char * logfile_arg; /**< @brief Logfile for errors. */ - char * logfile_orig; /**< @brief Logfile for errors original value given at command line. */ - const char *logfile_help; /**< @brief Logfile for errors help description. */ - char * loglevel_arg; /**< @brief Global log ldevel (default='error'). */ - char * loglevel_orig; /**< @brief Global log ldevel original value given at command line. */ - const char *loglevel_help; /**< @brief Global log ldevel help description. */ - int gtp_linux_flag; /**< @brief GTP linux kernel support (default=off). */ - const char *gtp_linux_help; /**< @brief GTP linux kernel support help description. */ - - unsigned int help_given ; /**< @brief Whether help was given. */ - unsigned int version_given ; /**< @brief Whether version was given. */ - unsigned int fg_given ; /**< @brief Whether fg was given. */ - unsigned int debug_given ; /**< @brief Whether debug was given. */ - unsigned int conf_given ; /**< @brief Whether conf was given. */ - unsigned int pidfile_given ; /**< @brief Whether pidfile was given. */ - unsigned int statedir_given ; /**< @brief Whether statedir was given. */ - unsigned int listen_given ; /**< @brief Whether listen was given. */ - unsigned int net_given ; /**< @brief Whether net was given. */ - unsigned int ipup_given ; /**< @brief Whether ipup was given. */ - unsigned int ipdown_given ; /**< @brief Whether ipdown was given. */ - unsigned int dynip_given ; /**< @brief Whether dynip was given. */ - unsigned int statip_given ; /**< @brief Whether statip was given. */ - unsigned int pcodns1_given ; /**< @brief Whether pcodns1 was given. */ - unsigned int pcodns2_given ; /**< @brief Whether pcodns2 was given. */ - unsigned int timelimit_given ; /**< @brief Whether timelimit was given. */ - unsigned int apn_given ; /**< @brief Whether apn was given. */ - unsigned int qos_given ; /**< @brief Whether qos was given. */ - unsigned int logfile_given ; /**< @brief Whether logfile was given. */ - unsigned int loglevel_given ; /**< @brief Whether loglevel was given. */ - unsigned int gtp_linux_given ; /**< @brief Whether gtp-linux was given. */ - -} ; - -/** @brief The additional parameters to pass to parser functions */ -struct cmdline_parser_params -{ - int override; /**< @brief whether to override possibly already present options (default 0) */ - int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ - int check_required; /**< @brief whether to check that all required options were provided (default 1) */ - int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ - int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ -} ; - -/** @brief the purpose string of the program */ -extern const char *gengetopt_args_info_purpose; -/** @brief the usage string of the program */ -extern const char *gengetopt_args_info_usage; -/** @brief the description string of the program */ -extern const char *gengetopt_args_info_description; -/** @brief all the lines making the help output */ -extern const char *gengetopt_args_info_help[]; - -/** - * The command line parser - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser (int argc, char **argv, - struct gengetopt_args_info *args_info); - -/** - * The command line parser (version with additional parameters - deprecated) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_ext() instead - */ -int cmdline_parser2 (int argc, char **argv, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The command line parser (version with additional parameters) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_ext (int argc, char **argv, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Save the contents of the option struct into an already open FILE stream. - * @param outfile the stream where to dump options - * @param args_info the option struct to dump - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_dump(FILE *outfile, - struct gengetopt_args_info *args_info); - -/** - * Save the contents of the option struct into a (text) file. - * This file can be read by the config file parser (if generated by gengetopt) - * @param filename the file where to save - * @param args_info the option struct to save - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_file_save(const char *filename, - struct gengetopt_args_info *args_info); - -/** - * Print the help - */ -void cmdline_parser_print_help(void); -/** - * Print the version - */ -void cmdline_parser_print_version(void); - -/** - * Initializes all the fields a cmdline_parser_params structure - * to their default values - * @param params the structure to initialize - */ -void cmdline_parser_params_init(struct cmdline_parser_params *params); - -/** - * Allocates dynamically a cmdline_parser_params structure and initializes - * all its fields to their default values - * @return the created and initialized cmdline_parser_params structure - */ -struct cmdline_parser_params *cmdline_parser_params_create(void); - -/** - * Initializes the passed gengetopt_args_info structure's fields - * (also set default values for options that have a default) - * @param args_info the structure to initialize - */ -void cmdline_parser_init (struct gengetopt_args_info *args_info); -/** - * Deallocates the string fields of the gengetopt_args_info structure - * (but does not deallocate the structure itself) - * @param args_info the structure to deallocate - */ -void cmdline_parser_free (struct gengetopt_args_info *args_info); - -/** - * The config file parser (deprecated version) - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_config_file() instead - */ -int cmdline_parser_configfile (const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The config file parser - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Checks that all the required options were specified - * @param args_info the structure to check - * @param prog_name the name of the program that will be used to print - * possible errors - * @return - */ -int cmdline_parser_required (struct gengetopt_args_info *args_info, - const char *prog_name); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* CMDLINE_H */ diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d865707..5deff56 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,6 +1,7 @@ /* * OpenGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -19,42 +20,41 @@ #include "../config.h" -#include - #ifdef HAVE_STDINT_H #include #endif +#include #include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include - #include +#include +#include -#include +#include +#include +#include +#include #include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include #include "../lib/tun.h" #include "../lib/ippool.h" @@ -62,82 +62,188 @@ #include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" -#include "cmdline.h" #include "gtp-kernel.h" #include "icmpv6.h" +#include "ggsn.h" -int end = 0; -int maxfd = 0; /* For select() */ +void *tall_ggsn_ctx; -struct in_addr listen_; -struct in46_addr netaddr, destaddr, net; /* Network interface */ -size_t prefixlen; -struct in46_addr dns1, dns2; /* PCO DNS address */ -char *ipup, *ipdown; /* Filename of scripts */ -int debug; /* Print debug output */ -struct ul255_t pco; +static int end = 0; +static int daemonize = 0; +static struct ctrl_handle *g_ctrlh; + struct ul255_t qos; struct ul255_t apn; -struct gsn_t *gsn; /* GSN instance */ -struct tun_t *tun; /* TUN instance */ -struct ippool_t *ippool; /* Pool of IP addresses */ +#define LOGPAPN(level, apn, fmt, args...) \ + LOGP(DGGSN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args) -/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ -void signal_handler(int s) +#define LOGPGGSN(level, ggsn, fmt, args...) \ + LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) + +#define LOGPPDP(level, pdp, fmt, args...) \ + LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); + + +static void pool_close_all_pdp(struct ippool_t *pool) { - DEBUGP(DGGSN, "Received signal %d, exiting.\n", s); - end = 1; -} + unsigned int i; -/* Used to write process ID to file. Assume someone else will delete */ -void log_pid(char *pidfile) -{ - FILE *file; - mode_t oldmask; - - oldmask = umask(022); - file = fopen(pidfile, "w"); - umask(oldmask); - if (!file) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to create process ID file: %s!", pidfile); + if (!pool) return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + struct pdp_t *pdp; + + if (!member->inuse) + continue; + pdp = member->peer; + if (!pdp) + continue; + LOGPPDP(LOGL_DEBUG, pdp, "Sending DELETE PDP CTX due to shutdown\n"); + gtp_delete_context_req(pdp->gsn, pdp, NULL, 1); } - fprintf(file, "%d\n", (int)getpid()); - fclose(file); } -#if defined(__sun__) -int daemon(int nochdir, int noclose) +int apn_stop(struct apn_ctx *apn, bool force) { - int fd; + if (!apn->started) + return 0; - switch (fork()) { - case -1: - return (-1); - case 0: + LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); + /* check if pools have any active PDP contexts and bail out */ + pool_close_all_pdp(apn->v4.pool); + pool_close_all_pdp(apn->v6.pool); + + /* shutdown whatever old state might be left */ + if (apn->tun.tun) { + /* run ip-down script */ + if (apn->tun.cfg.ipdown_script) { + LOGPAPN( LOGL_INFO, apn, "Running %s\n", apn->tun.cfg.ipdown_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipdown_script); + } + /* release tun device */ + LOGPAPN(LOGL_INFO, apn, "Closing TUN device\n"); + osmo_fd_unregister(&apn->tun.fd); + tun_free(apn->tun.tun); + apn->tun.tun = NULL; + } + + if (apn->v4.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv4 pool\n"); + ippool_free(apn->v4.pool); + apn->v4.pool = NULL; + } + if (apn->v6.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv6 pool\n"); + ippool_free(apn->v6.pool); + apn->v6.pool = NULL; + } + + apn->started = false; + return 0; +} + +/* actually start the APN with its current config */ +int apn_start(struct apn_ctx *apn) +{ + if (apn->started) + return 0; + + LOGPAPN(LOGL_INFO, apn, "Starting\n"); + switch (apn->cfg.gtpu_mode) { + case APN_GTPU_MODE_TUN: + LOGPAPN(LOGL_INFO, apn, "Opening TUN device %s\n", apn->tun.cfg.dev_name); + if (tun_new(&apn->tun.tun, apn->tun.cfg.dev_name)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to configure tun device\n"); + return -1; + } + LOGPAPN(LOGL_INFO, apn, "Opened TUN device %s\n", apn->tun.tun->devname); + + /* Register with libosmcoore */ + osmo_fd_setup(&apn->tun.fd, apn->tun.tun->fd, BSC_FD_READ, ggsn_tun_fd_cb, apn, 0); + osmo_fd_register(&apn->tun.fd); + + /* Set TUN library callback */ + tun_set_cb_ind(apn->tun.tun, cb_tun_ind); + + if (apn->v4.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IP address %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v4.cfg.ifconfig_prefix.addr, NULL, + apn->v4.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv4 address %s: %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->v6.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IPv6 address %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL, + apn->v6.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->tun.cfg.ipup_script) { + LOGPAPN(LOGL_INFO, apn, "Running ip-up script %s\n", + apn->tun.cfg.ipup_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipup_script); + } + /* set back-pointer from TUN device to APN */ + apn->tun.tun->priv = apn; + break; + case APN_GTPU_MODE_KERNEL_GTP: + LOGPAPN(LOGL_ERROR, apn, "FIXME: Kernel GTP\n"); +#if 0 + /* use GTP kernel module for data packet encapsulation */ + if (gtp_kernel_init(gsn, &net.v4, prefixlen, net_arg) < 0) + goto err; +#endif break; default: - _exit(0); + LOGPAPN(LOGL_ERROR, apn, "Unknown GTPU Mode %d\n", apn->cfg.gtpu_mode); + return -1; } - if (setsid() == -1) - return (-1); - - if (!nochdir) - chdir("/"); - - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { - dup2(fd, STDIN_FILENO); - dup2(fd, STDOUT_FILENO); - dup2(fd, STDERR_FILENO); - if (fd > 2) - close(fd); + /* Create IPv4 pool */ + if (apn->v4.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", + in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, + &apn->v4.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + apn_stop(apn, false); + return -1; + } } - return (0); + + /* Create IPv6 pool */ + if (apn->v6.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", + in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, + &apn->v6.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + apn_stop(apn, false); + return -1; + } + } + + LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); + apn->started = true; + return 0; } -#endif static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { @@ -148,27 +254,29 @@ snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); - if (ctrl_cmd_send_trap(gsn->priv, var, val) < 0) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); + if (ctrl_cmd_send_trap(g_ctrlh, var, val) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Failed to create and send TRAP %s\n", var); return false; } return true; } -int delete_context(struct pdp_t *pdp) +static int delete_context(struct pdp_t *pdp) { - DEBUGP(DGGSN, "Deleting PDP context\n"); + struct gsn_t *gsn = pdp->gsn; + struct ippoolm_t *ipp = (struct ippoolm_t *)pdp->peer; + + LOGPPDP(LOGL_INFO, pdp, "Deleting PDP context\n"); struct ippoolm_t *member = pdp->peer; if (pdp->peer) { send_trap(gsn, pdp, member, "imsi-rem-ip"); /* TRAP with IP removal */ - ippool_freeip(ippool, (struct ippoolm_t *)pdp->peer); + ippool_freeip(ipp->pool, ipp); } else - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Peer not defined!"); + LOGPPDP(LOGL_ERROR, pdp, "Cannot find/free IP Pool member\n"); if (gtp_kernel_tunnel_del(pdp)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot delete tunnel from kernel: %s\n", + LOGPPDP(LOGL_ERROR, pdp, "Cannot delete tunnel from kernel:%s\n", strerror(errno)); } @@ -236,31 +344,74 @@ return false; } +/* construct an IPCP PCO from up to two given DNS addreses */ +static int build_ipcp_pco(struct msgb *msg, uint8_t id, const struct in46_addr *dns1, + const struct in46_addr *dns2) +{ + uint8_t *len1, *len2; + uint8_t *start = msg->tail; + unsigned int len_appended; + + /* Three byte T16L header */ + msgb_put_u16(msg, 0x8021); /* IPCP */ + len1 = msgb_put(msg, 1); /* Length of contents: delay */ + + msgb_put_u8(msg, 0x02); /* ACK */ + msgb_put_u8(msg, id); /* ID: Needs to match request */ + msgb_put_u8(msg, 0x00); /* Length MSB */ + len2 = msgb_put(msg, 1); /* Length LSB: delay */ + + if (dns1 && dns1->len == 4) { + msgb_put_u8(msg, 0x81); /* DNS1 Tag */ + msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ + msgb_put_u32(msg, dns1->v4.s_addr); + } + + if (dns2 && dns2->len == 4) { + msgb_put_u8(msg, 0x83); /* DNS2 Tag */ + msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ + msgb_put_u32(msg, dns2->v4.s_addr); + } + + /* patch in length values */ + len_appended = msg->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; + + return 0; +} + /* process one PCO request from a MS/UE, putting together the proper responses */ -static void process_pco(struct pdp_t *pdp) +static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + unsigned int i; + + OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ /* FIXME: also check if primary / secondary DNS was requested */ if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { /* FIXME: properly implement this for IPCP */ - uint8_t *cur = msgb_put(msg, pco.l-1); - memcpy(cur, pco.v+1, pco.l-1); + build_ipcp_pco(msg, 0, &apn->v4.cfg.dns[0], &apn->v4.cfg.dns[1]); } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { - if (dns1.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); - if (dns2.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + if (i46a->len != 16) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); + } } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { - if (dns1.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); - if (dns2.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + if (i46a->len != 4) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); + } } if (msgb_length(msg) > 1) { @@ -274,11 +425,29 @@ int create_context_ind(struct pdp_t *pdp) { + static char name_buf[256]; + struct gsn_t *gsn = pdp->gsn; + struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr; struct ippoolm_t *member; + struct apn_ctx *apn; int rc; - DEBUGP(DGGSN, "Received create PDP context request\n"); + osmo_apn_to_str(name_buf, pdp->apn_req.v, pdp->apn_req.l); + + LOGPPDP(LOGL_DEBUG, pdp, "Processing create PDP context request for APN '%s'\n", name_buf); + + /* First find an exact APN name match */ + apn = ggsn_find_apn(ggsn, name_buf); + /* then try default (if any) */ + if (!apn) + apn = ggsn->cfg.default_apn; + if (!apn) { + /* no APN found for what user requested */ + LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_MISSING_APN); + return 0; + } /* FIXME: we manually force all context requests to dynamic here! */ if (pdp->eua.l > 2) @@ -290,21 +459,30 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + LOGPPDP(LOGL_ERROR, pdp, "Cannot decode EUA from MS/SGSN: %s\n", osmo_hexdump(pdp->eua.v, pdp->eua.l)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); return 0; } - rc = ippool_newip(ippool, &member, &addr, 0); - if (rc < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); - gtp_create_context_resp(gsn, pdp, -rc); - return 0; /* Allready in use, or no more available */ - } + if (addr.len == sizeof(struct in_addr)) { + rc = ippool_newip(apn->v4.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + in46a_to_eua(&member->addr, &pdp->eua); - if (addr.len == sizeof(struct in6_addr)) { + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ + if (gtp_kernel_tunnel_add(pdp) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; + } + } else if (addr.len == sizeof(struct in6_addr)) { struct in46_addr tmp; + rc = ippool_newip(apn->v6.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + /* IPv6 doesn't really send the real/allocated address at this point, but just * the link-identifier which the MS shall use for router solicitation */ tmp.len = addr.len; @@ -314,43 +492,46 @@ memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); in46a_to_eua(&tmp, &pdp->eua); } else - in46a_to_eua(&member->addr, &pdp->eua); - pdp->peer = member; - pdp->ipif = tun; /* TODO */ - member->peer = pdp; + OSMO_ASSERT(0); - /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ - if (gtp_kernel_tunnel_add(pdp) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot add tunnel to kernel: %s\n", strerror(errno)); - gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); - return 0; - } + pdp->peer = member; + pdp->ipif = apn->tun.tun; /* TODO */ + member->peer = pdp; if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } - process_pco(pdp); + process_pco(apn, pdp); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ + +err_pool_full: + LOGPPDP(LOGL_ERROR, pdp, "Cannot allocate IP address from pool (full!)\n"); + gtp_create_context_resp(gsn, pdp, -rc); + return 0; /* Already in use, or no more available */ } -/* Callback for receiving messages from tun */ -int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) +/* Internet-originated IP packet, needs to be sent via GTP towards MS */ +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { + struct apn_ctx *apn = tun->priv; struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + struct ippool_t *pool; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + pool = apn->v4.pool; } else if (iph->version == 6) { /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct @@ -358,20 +539,25 @@ * prefix, i.e. the first 8 bytes of the address */ dst.len = 8; dst.v6 = ip6h->ip6_dst; + pool = apn->v6.pool; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); + LOGP(DTUN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } - DEBUGP(DGGSN, "Received packet from tun!\n"); + /* IPv6 packet but no IPv6 pool, or IPv4 packet with no IPv4 pool */ + if (!pool) + return 0; - if (ippool_getip(ippool, &ipm, &dst)) { - DEBUGP(DGGSN, "Received packet with no destination!!!\n"); + DEBUGP(DTUN, "Received packet from tun!\n"); + + if (ippool_getip(pool, &ipm, &dst)) { + DEBUGP(DTUN, "Received packet with no PDP contex!!\n"); return 0; } if (ipm->peer) /* Check if a peer protocol is defined */ - gtp_data_req(gsn, (struct pdp_t *)ipm->peer, pack, len); + gtp_data_req(apn->ggsn->gsn, (struct pdp_t *)ipm->peer, pack, len); return 0; } @@ -380,435 +566,303 @@ .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } }; -int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) +/* MS-originated GTP1-U packet, needs to be sent via TUN device */ +static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + LOGPPDP(LOGL_DEBUG, pdp, "Packet received: forwarding to tun\n"); switch (iph->version) { case 6: /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(gsn, pdp, pack, len); + return handle_router_mcast(pdp->gsn, pdp, pack, len); break; case 4: break; default: - LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", + osmo_hexdump(pack, len)); return -1; } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } +static char *config_file = "openggsn.cfg"; + +/* callback for tun device osmocom select loop integration */ +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct apn_ctx *apn = fd->data; + + OSMO_ASSERT(what & BSC_FD_READ); + + return tun_decaps(apn->tun.tun); +} + +/* callback for libgtp osmocom select loop integration */ +static int ggsn_gtp_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct ggsn_ctx *ggsn = fd->data; + int rc; + + OSMO_ASSERT(what & BSC_FD_READ); + + switch (fd->priv_nr) { + case 0: + rc = gtp_decaps0(ggsn->gsn); + break; + case 1: + rc = gtp_decaps1c(ggsn->gsn); + break; + case 2: + rc = gtp_decaps1u(ggsn->gsn); + break; + default: + OSMO_ASSERT(0); + break; + } + return rc; +} + +static void ggsn_gtp_tmr_start(struct ggsn_ctx *ggsn) +{ + struct timeval next; + + /* Retrieve next retransmission as timeval */ + gtp_retranstimeout(ggsn->gsn, &next); + + /* re-schedule the timer */ + osmo_timer_schedule(&ggsn->gtp_timer, next.tv_sec, next.tv_usec/1000); +} + +/* timer callback for libgtp retransmission and ping */ +static void ggsn_gtp_tmr_cb(void *data) +{ + struct ggsn_ctx *ggsn = data; + + /* do all the retransmissions as needed */ + gtp_retrans(ggsn->gsn); + + ggsn_gtp_tmr_start(ggsn); +} + +/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ +static void signal_handler(int s) +{ + LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); + switch (s) { + case SIGINT: + LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); + end = 1; + break; + case SIGABRT: + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_ggsn_ctx, stderr); + break; + case SIGUSR2: + talloc_report_full(tall_vty_ctx, stderr); + break; + default: + break; + } +} + + +/* Start a given GGSN */ +int ggsn_start(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + int rc; + + if (ggsn->started) + return 0; + + LOGPGGSN(LOGL_INFO, ggsn, "Starting GGSN\n"); + + /* Start libgtp listener */ + if (gtp_new(&ggsn->gsn, ggsn->cfg.state_dir, &ggsn->cfg.listen_addr.v4, GTP_MODE_GGSN)) { + LOGPGGSN(LOGL_ERROR, ggsn, "Failed to create GTP: %s\n", strerror(errno)); + return -1; + } + ggsn->gsn->priv = ggsn; + + /* Register File Descriptors */ + osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); + rc = osmo_fd_register(&ggsn->gtp_fd0); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1c, ggsn->gsn->fd1c, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 1); + rc = osmo_fd_register(&ggsn->gtp_fd1c); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1u, ggsn->gsn->fd1u, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 2); + rc = osmo_fd_register(&ggsn->gtp_fd1u); + OSMO_ASSERT(rc == 0); + + /* Start GTP re-transmission timer */ + osmo_timer_setup(&ggsn->gtp_timer, ggsn_gtp_tmr_cb, ggsn); + + gtp_set_cb_data_ind(ggsn->gsn, encaps_tun); + gtp_set_cb_delete_context(ggsn->gsn, delete_context); + gtp_set_cb_create_context_ind(ggsn->gsn, create_context_ind); + + LOGPGGSN(LOGL_NOTICE, ggsn, "Successfully started\n"); + ggsn->started = true; + + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_start(apn); + + return 0; +} + +/* Stop a given GGSN */ +int ggsn_stop(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + + if (!ggsn->started) + return 0; + + /* iterate over all APNs and stop them */ + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_stop(apn, true); + + osmo_timer_del(&ggsn->gtp_timer); + + osmo_fd_unregister(&ggsn->gtp_fd1u); + osmo_fd_unregister(&ggsn->gtp_fd1c); + osmo_fd_unregister(&ggsn->gtp_fd0); + + if (ggsn->gsn) { + gtp_free(ggsn->gsn); + ggsn->gsn = NULL; + } + + ggsn->started = false; + return 0; +} + +static void print_usage() +{ + printf("Usage: osmo-ggsn [-h] [-D] [-c configfile] [-V]\n"); +} + +static void print_help() +{ + printf( " Some useful help...\n" + " -h --help This help text\n" + " -D --daemonize Fork the process into a background daemon\n" + " -c --config-file filename The config file to use\n" + " -V --version Print the version of OsmoGGSN\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' }, + { "daemonize", 0, 0, 'D' }, + { "config-file", 1, 0, 'c' }, + { "version", 0, 0, 'V' }, + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "hdc:V", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_usage(); + print_help(); + exit(0); + case 'D': + daemonize = 1; + break; + case 'c': + config_file = optarg; + break; + case 'V': + print_version(1); + exit(0); + break; + } + } +} + int main(int argc, char **argv) { - /* gengeopt declarations */ - struct gengetopt_args_info args_info; - - struct hostent *host; + struct ggsn_ctx *ggsn; + int rc; /* Handle keyboard interrupt SIGINT */ - struct sigaction s; - s.sa_handler = (void *)signal_handler; - if ((0 != sigemptyset(&s.sa_mask)) && debug) - printf("sigemptyset failed.\n"); - s.sa_flags = SA_RESETHAND; - if ((sigaction(SIGINT, &s, NULL) != 0) && debug) - printf("Could not register SIGINT signal handler.\n"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + msgb_talloc_ctx_init(tall_ggsn_ctx, 0); - fd_set fds; /* For select() */ - struct timeval idleTime; /* How long to select() */ + signal(SIGINT, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); - int timelimit; /* Number of seconds to be connected */ - int starttime; /* Time program was started */ - + osmo_init_ignore_signals(); osmo_init_logging(&log_info); + osmo_stats_init(tall_ggsn_ctx); - if (cmdline_parser(argc, argv, &args_info) != 0) - exit(1); - if (args_info.debug_flag) { - printf("listen: %s\n", args_info.listen_arg); - if (args_info.conf_arg) - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp_linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); + vty_init(&g_vty_info); + logging_vty_add_cmds(NULL); + osmo_stats_vty_add_cmds(&log_info); + ggsn_vty_init(); + ctrl_vty_init(tall_ggsn_ctx); + + handle_options(argc, argv); + + rate_ctr_init(tall_ggsn_ctx); + + rc = vty_read_config_file(config_file, NULL); + if (rc < 0) { + fprintf(stderr, "Failed to open config file: '%s'\n", config_file); + exit(2); } - /* Try out our new parser */ - - if (cmdline_parser_configfile(args_info.conf_arg, &args_info, 0, 0, 0) - != 0) + rc = telnet_init_dynif(tall_ggsn_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_GGSN); + if (rc < 0) exit(1); - /* Open a log file */ - if (args_info.logfile_arg) { - struct log_target *tgt; - int lvl; - - tgt = log_target_find(LOG_TGT_TYPE_FILE, args_info.logfile_arg); - if (!tgt) { - tgt = log_target_create_file(args_info.logfile_arg); - if (!tgt) { - LOGP(DGGSN, LOGL_ERROR, - "Failed to create logfile: %s\n", - args_info.logfile_arg); - exit(1); - } - log_add_target(tgt); - } - log_set_all_filter(tgt, 1); - log_set_use_color(tgt, 0); - - if (args_info.loglevel_arg) { - lvl = log_parse_level(args_info.loglevel_arg); - log_set_log_level(tgt, lvl); - LOGP(DGGSN, LOGL_NOTICE, - "Set file log level to %s\n", - log_level_str(lvl)); - } - } - - if (args_info.debug_flag) { - printf("cmdline_parser_configfile\n"); - printf("listen: %s\n", args_info.listen_arg); - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp-linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); - } - - /* Handle each option */ - - /* debug */ - debug = args_info.debug_flag; - - /* listen */ - /* Do hostname lookup to translate hostname to IP address */ - /* Any port listening is not possible as a valid address is */ - /* required for create_pdp_context_response messages */ - if (args_info.listen_arg) { - if (!(host = gethostbyname(args_info.listen_arg))) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid listening address: %s!", - args_info.listen_arg); - exit(1); - } else { - memcpy(&listen_.s_addr, host->h_addr, host->h_length); - } - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Listening address must be specified! " - "Please use command line option --listen or " - "edit %s configuration file\n", args_info.conf_arg); + g_ctrlh = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); + if (!g_ctrlh) { + LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); exit(1); } - /* net */ - /* Store net as in_addr net and mask */ - if (args_info.net_arg) { - if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid network address: %s!", - args_info.net_arg); - exit(1); - } - /* default for network + destination address = net + 1 */ - netaddr = net; - in46a_inc(&netaddr); - destaddr = netaddr; - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Network address must be specified: %s!", - args_info.net_arg); - exit(1); - } - - /* dynip */ - struct in46_prefix i46p; - size_t prefixlen; - if (!args_info.dynip_arg) { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } else { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } - i46p.prefixlen = prefixlen; - if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); - exit(1); - } - - /* DNS1 and DNS2 */ - memset(&dns1, 0, sizeof(dns1)); - if (args_info.pcodns1_arg) { - size_t tmp; - if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - memset(&dns2, 0, sizeof(dns2)); - if (args_info.pcodns2_arg) { - size_t tmp; - if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); + if (daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); exit(1); } } - unsigned int cur = 0; - pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[cur++] = 0x80; /* IPCP */ - pco.v[cur++] = 0x21; - pco.v[cur++] = 0xFF; /* Length of contents */ - pco.v[cur++] = 0x02; /* ACK */ - pco.v[cur++] = 0x00; /* ID: Need to match request */ - pco.v[cur++] = 0x00; /* Length */ - pco.v[cur++] = 0xFF; /* overwritten */ - if (dns1.len == 4) { - pco.v[cur++] = 0x81; /* DNS 1 */ - pco.v[cur++] = 2 + dns1.len; - if (dns1.len == 4) - memcpy(&pco.v[cur], &dns1.v4, dns1.len); - else - memcpy(&pco.v[cur], &dns1.v6, dns1.len); - cur += dns1.len; - } - if (dns2.len == 4) { - pco.v[cur++] = 0x83; - pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ - if (dns2.len == 4) - memcpy(&pco.v[cur], &dns2.v4, dns2.len); - else - memcpy(&pco.v[cur], &dns2.v6, dns2.len); - cur += dns2.len; - } - pco.l = cur; - /* patch in length values */ - pco.v[3] = pco.l - 4; - pco.v[7] = pco.l - 4; - - /* ipup */ - ipup = args_info.ipup_arg; - - /* ipdown */ - ipdown = args_info.ipdown_arg; - - /* Timelimit */ - timelimit = args_info.timelimit_arg; - starttime = time(NULL); - +#if 0 /* qos */ qos.l = 3; qos.v[2] = (args_info.qos_arg) & 0xff; qos.v[1] = ((args_info.qos_arg) >> 8) & 0xff; qos.v[0] = ((args_info.qos_arg) >> 16) & 0xff; +#endif - /* apn */ - if (strlen(args_info.apn_arg) > (sizeof(apn.v) - 1)) { - LOGP(DGGSN, LOGL_ERROR, "Invalid APN\n"); - return -1; - } - apn.l = strlen(args_info.apn_arg) + 1; - apn.v[0] = (char)strlen(args_info.apn_arg); - strncpy((char *)&apn.v[1], args_info.apn_arg, sizeof(apn.v) - 1); - - /* foreground */ - /* If flag not given run as a daemon */ - if (!args_info.fg_flag) { - FILE *f; - int rc; - /* Close the standard file descriptors. */ - /* Is this really needed ? */ - f = freopen("/dev/null", "w", stdout); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdout to /dev/null"); - } - f = freopen("/dev/null", "w", stderr); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stderr to /dev/null"); - } - f = freopen("/dev/null", "r", stdin); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdin to /dev/null"); - } - rc = daemon(0, 0); - if (rc != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, rc, - "Could not daemonize"); - exit(1); - } + /* Main select loop */ + while (!end) { + osmo_select_main(0); } - /* pidfile */ - /* This has to be done after we have our final pid */ - if (args_info.pidfile_arg) { - log_pid(args_info.pidfile_arg); - } - - DEBUGP(DGGSN, "gtpclient: Initialising GTP tunnel\n"); - - if (gtp_new(&gsn, args_info.statedir_arg, &listen_, GTP_MODE_GGSN)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create gtp"); - exit(1); - } - if (gsn->fd0 > maxfd) - maxfd = gsn->fd0; - if (gsn->fd1c > maxfd) - maxfd = gsn->fd1c; - if (gsn->fd1u > maxfd) - maxfd = gsn->fd1u; - - /* use GTP kernel module for data packet encapsulation */ - if (args_info.gtp_linux_given) { - if (gtp_kernel_init(gsn, &net.v4, prefixlen, args_info.net_arg) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to initialize kernel GTP\n"); - goto err; - } - } - - gtp_set_cb_data_ind(gsn, encaps_tun); - gtp_set_cb_delete_context(gsn, delete_context); - gtp_set_cb_create_context_ind(gsn, create_context_ind); - - gsn->priv = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); - if (!gsn->priv) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); - exit(1); - } - - /* skip the configuration of the tun0 if we're using the gtp0 device */ - if (gtp_kernel_enabled()) - goto skip_tun; - - /* Create a tunnel interface */ - DEBUGP(DGGSN, "Creating tun interface\n"); - if (tun_new((struct tun_t **)&tun)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create tun"); - exit(1); - } - - DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); - exit(1); - } - - tun_set_cb_ind(tun, cb_tun_ind); - if (tun->fd > maxfd) - maxfd = tun->fd; - - if (ipup) - tun_runscript(tun, ipup); - -skip_tun: - - /******************************************************************/ - /* Main select loop */ - /******************************************************************/ - - while ((((starttime + timelimit) > time(NULL)) || (0 == timelimit)) - && (!end)) { - - FD_ZERO(&fds); - if (tun) - FD_SET(tun->fd, &fds); - FD_SET(gsn->fd0, &fds); - FD_SET(gsn->fd1c, &fds); - FD_SET(gsn->fd1u, &fds); - - gtp_retranstimeout(gsn, &idleTime); - switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) { - case -1: /* errno == EINTR : unblocked signal */ - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "select() returned -1"); - /* On error, select returns without modifying fds */ - FD_ZERO(&fds); - break; - case 0: - /* printf("Select returned 0\n"); */ - gtp_retrans(gsn); /* Only retransmit if nothing else */ - break; - default: - break; - } - - if (tun && tun->fd != -1 && FD_ISSET(tun->fd, &fds) && - tun_decaps(tun) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "TUN read failed (fd)=(%d)", tun->fd); - } - - if (FD_ISSET(gsn->fd0, &fds)) - gtp_decaps0(gsn); - - if (FD_ISSET(gsn->fd1c, &fds)) - gtp_decaps1c(gsn); - - if (FD_ISSET(gsn->fd1u, &fds)) - gtp_decaps1u(gsn); - - osmo_select_main(1); - } -err: - gtp_kernel_stop(); - cmdline_parser_free(&args_info); - ippool_free(ippool); - gtp_free(gsn); - if (tun) - tun_free(tun); + llist_for_each_entry(ggsn, &g_ggsn_list, list) + ggsn_stop(ggsn); return 1; - } diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h new file mode 100644 index 0000000..bab6cf7 --- /dev/null +++ b/ggsn/ggsn.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "../lib/tun.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "../lib/in46_addr.h" +#include "../gtp/gtp.h" + +#define APN_TYPE_IPv4 0x01 /* v4-only */ +#define APN_TYPE_IPv6 0x02 /* v6-only */ +#define APN_TYPE_IPv4v6 0x04 /* v4v6 dual-stack */ + +struct ggsn_ctx; + +struct apn_ctx_ip { + struct { + struct in46_prefix ifconfig_prefix; + struct in46_prefix static_prefix; + struct in46_prefix dynamic_prefix; + /* v4 DNS server names */ + struct in46_addr dns[2]; + } cfg; + + /* v4 address pool */ + struct ippool_t *pool; +}; + +struct apn_name { + struct llist_head list; + char *name; +}; + +enum apn_gtpu_mode { + APN_GTPU_MODE_TUN = 0, /* default */ + APN_GTPU_MODE_KERNEL_GTP, +}; + +struct apn_ctx { + /* list of APNs inside GGSN */ + struct llist_head list; + /* back-pointer to GGSN */ + struct ggsn_ctx *ggsn; + + bool started; + + struct { + /* Primary name */ + char *name; + /* Description string */ + char *description; + /* List of secondary APN names */ + struct llist_head name_list; + /* types supported address types on this APN */ + uint32_t apn_type_mask; + /* GTP-U via TUN device or in Linux kernel */ + enum apn_gtpu_mode gtpu_mode; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* corresponding tun device */ + struct { + struct { + /* name of the network device */ + char *dev_name; + /* ip-up and ip-down script names/paths */ + char *ipup_script; + char *ipdown_script; + } cfg; + struct tun_t *tun; + struct osmo_fd fd; + } tun; + + struct apn_ctx_ip v4; + struct apn_ctx_ip v6; +}; + +struct ggsn_ctx { + /* global list of GGSNs */ + struct llist_head list; + + /* list of APNs in this GGSN */ + struct llist_head apn_list; + + bool started; + + struct { + char *name; + /* Description string */ + char *description; + /* an APN that shall be used as default for any non-matching APN */ + struct apn_ctx *default_apn; + /* ADdress to which we listen for GTP */ + struct in46_addr listen_addr; + /* directory for state file */ + char *state_dir; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* The libgtp (G)GSN instance, i.e. what listens to GTP */ + struct gsn_t *gsn; + + /* osmo-fd for gsn */ + struct osmo_fd gtp_fd0; + struct osmo_fd gtp_fd1c; + struct osmo_fd gtp_fd1u; + + struct osmo_timer_list gtp_timer; +}; + +/* ggsn_vty.c */ +extern struct llist_head g_ggsn_list; +extern struct vty_app_info g_vty_info; +extern int ggsn_vty_init(void); +struct ggsn_ctx *ggsn_find(const char *name); +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name); +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name); +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name); + +/* ggsn.c */ +extern void *tall_ggsn_ctx; +extern int ggsn_start(struct ggsn_ctx *ggsn); +extern int ggsn_stop(struct ggsn_ctx *ggsn); +extern int apn_start(struct apn_ctx *apn); +extern int apn_stop(struct apn_ctx *apn, bool force); diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c new file mode 100644 index 0000000..f23a298 --- /dev/null +++ b/ggsn/ggsn_vty.c @@ -0,0 +1,890 @@ +/* + * (C) 2017 by Harald Welte + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +#include "ggsn.h" + +#define PREFIX_STR "Prefix (Network/Netmask)\n" +#define IFCONFIG_STR "GGSN-based interface configuration\n" +#define GGSN_STR "Gateway GPRS Support NODE (GGSN)\n" + +LLIST_HEAD(g_ggsn_list); + +enum ggsn_vty_node { + GGSN_NODE = _LAST_OSMOVTY_NODE + 1, + APN_NODE, +}; + +struct ggsn_ctx *ggsn_find(const char *name) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + if (!strcmp(ggsn->cfg.name, name)) + return ggsn; + } + return NULL; +} + +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name) +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(name); + if (ggsn) + return ggsn; + + ggsn = talloc_zero(ctx, struct ggsn_ctx); + if (!ggsn) + return NULL; + + ggsn->cfg.name = talloc_strdup(ggsn, name); + ggsn->cfg.state_dir = talloc_strdup(ggsn, "/tmp"); + ggsn->cfg.shutdown = true; + INIT_LLIST_HEAD(&ggsn->apn_list); + + llist_add_tail(&ggsn->list, &g_ggsn_list); + return ggsn; +} + +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn; + + llist_for_each_entry(apn, &ggsn->apn_list, list) { + if (!strcmp(apn->cfg.name, name)) + return apn; + } + return NULL; +} + +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn = ggsn_find_apn(ggsn, name); + if (apn) + return apn; + + apn = talloc_zero(ggsn, struct apn_ctx); + if (!apn) + return NULL; + apn->ggsn = ggsn; + apn->cfg.name = talloc_strdup(apn, name); + apn->cfg.shutdown = true; + INIT_LLIST_HEAD(&apn->cfg.name_list); + + llist_add_tail(&apn->list, &ggsn->apn_list); + return apn; +} + +/* GGSN Node */ + +static struct cmd_node ggsn_node = { + GGSN_NODE, + "%s(config-ggsn)# ", + 1, +}; + +DEFUN(cfg_ggsn, cfg_ggsn_cmd, + "ggsn NAME", + "Configure the Gateway GPRS Support Node\n" "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find_or_create(tall_ggsn_ctx, argv[0]); + if (!ggsn) + return CMD_WARNING; + + vty->node = GGSN_NODE; + vty->index = ggsn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ggsn, cfg_no_ggsn_cmd, + "no ggsn NAME", + NO_STR "Remove the named Gateway GPRS Support Node\n" + "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!ggsn->cfg.shutdown) { + vty_out(vty, "%% GGSN %s is still active, please shutdown first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!llist_empty(&ggsn->apn_list)) { + vty_out(vty, "%% GGSN %s still has APNs configured, please remove first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&ggsn->list); + talloc_free(ggsn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, + "gtp local-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address for the local GTP bind\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_state_dir, cfg_ggsn_state_dir_cmd, + "gtp state-dir PATH", + "GTP Parameters\n" + "Set the directory for the GTP State file\n" + "Local Directory\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + osmo_talloc_replace_string(ggsn, &ggsn->cfg.state_dir, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_apn, cfg_ggsn_apn_cmd, + "apn NAME", "APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_or_create_apn(ggsn, argv[0]); + if (!apn) + return CMD_WARNING; + + vty->node = APN_NODE; + vty->index = apn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_apn, cfg_ggsn_no_apn_cmd, + "no apn NAME", + NO_STR "Remove APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!apn->cfg.shutdown) { + vty_out(vty, "%% APN %s still active, please shutdown first%s", + apn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&apn->list); + talloc_free(apn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_default_apn, cfg_ggsn_default_apn_cmd, + "default-apn NAME", + "Set a default-APN to be used if no other APN matches\n" + "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No APN of name '%s' found%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + ggsn->cfg.default_apn = apn; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_default_apn, cfg_ggsn_no_default_apn_cmd, + "no default-apn", + NO_STR "Remove default-APN to be used if no other APN matches\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + ggsn->cfg.default_apn = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_shutdown, cfg_ggsn_shutdown_cmd, + "shutdown ggsn", + "Put the GGSN in administrative shut-down\n" GGSN_STR) +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (!ggsn->cfg.shutdown) { + if (ggsn_stop(ggsn)) { + vty_out(vty, "%% Failed to shutdown GGSN%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_shutdown, cfg_ggsn_no_shutdown_cmd, + "no shutdown ggsn", + NO_STR GGSN_STR "Remove the GGSN from administrative shut-down\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (ggsn->cfg.shutdown) { + if (ggsn_start(ggsn) < 0) { + vty_out(vty, "%% Failed to start GGSN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + +/* APN Node */ + +static struct cmd_node apn_node = { + APN_NODE, + "%s(config-ggsn-apn)# ", + 1, +}; + +static const struct value_string pdp_type_names[] = { + { APN_TYPE_IPv4, "v4" }, + { APN_TYPE_IPv6, "v6" }, + { APN_TYPE_IPv4v6, "v4v6" }, + { 0, NULL } +}; + +static const struct value_string apn_gtpu_mode_names[] = { + { APN_GTPU_MODE_TUN, "tun" }, + { APN_GTPU_MODE_KERNEL_GTP, "kernel-gtp" }, + { 0, NULL } +}; + + +#define V4V6V46_STRING "IPv4(-only) PDP Type\n" \ + "IPv6(-only) PDP Type\n" \ + "IPv4v6 (dual-stack) PDP Type\n" + +DEFUN(cfg_apn_type_support, cfg_apn_type_support_cmd, + "type-support (v4|v6|v4v6)", + "Enable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask |= type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_type_support, cfg_apn_no_type_support_cmd, + "no type-support (v4|v6|v4v6)", + NO_STR "Disable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask &= ~type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_gtpu_mode, cfg_apn_gtpu_mode_cmd, + "gtpu-mode (tun|kernel-gtp)", + "Set the Mode for this APN (tun or Linux Kernel GTP)\n" + "GTP-U in userspace using TUN device\n" + "GTP-U in kernel using Linux Kernel GTP\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + apn->cfg.gtpu_mode = get_string_value(apn_gtpu_mode_names, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_tun_dev_name, cfg_apn_tun_dev_name_cmd, + "tun-device NAME", + "Configure tun device name\n" + "TUN device name") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.dev_name, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipup_script, cfg_apn_ipup_script_cmd, + "ipup-script PATH", + "Configure name/path of ip-up script\n" + "File/Path name of ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipup_script, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipup_script, cfg_apn_no_ipup_script_cmd, + "no ipup-script", + NO_STR "Disable ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipup_script); + apn->tun.cfg.ipup_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipdown_script, cfg_apn_ipdown_script_cmd, + "ipdown-script PATH", + "Configure name/path of ip-down script\n" + "File/Path name of ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipdown_script, argv[0]); + return CMD_SUCCESS; +} + +/* convert prefix from "A.B.C.D/M" notation to in46_prefix */ +static void str2prefix(struct in46_prefix *pfx, const char *in) +{ + size_t t; + + ippool_aton(&pfx->addr, &t, in, 0); + pfx->prefixlen = t; +} + +DEFUN(cfg_apn_no_ipdown_script, cfg_apn_no_ipdown_script_cmd, + "no ipdown-script", + NO_STR "Disable ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipdown_script); + apn->tun.cfg.ipdown_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_prefix, cfg_apn_ip_prefix_cmd, + "ip prefix (static|dynamic) A.B.C.D/M", + IP_STR PREFIX_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + /* first update our parsed prefix */ + if (!strcmp(argv[0], "static")) + pfx = &apn->v4.cfg.static_prefix; + else + pfx = &apn->v4.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_ifconfig, cfg_apn_ip_ifconfig_cmd, + "ip ifconfig A.B.C.D/M", + IP_STR IFCONFIG_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v4.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ip_ifconfig, cfg_apn_no_ip_ifconfig_cmd, + "no ip ifconfig", + NO_STR IP_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v4.cfg.ifconfig_prefix, 0, sizeof(apn->v4.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_prefix, cfg_apn_ipv6_prefix_cmd, + "ipv6 prefix (static|dynamic) X:X::X:X/M", + IP6_STR PREFIX_STR "IPv6 Address/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + if (!strcmp(argv[0], "static")) + pfx = &apn->v6.cfg.static_prefix; + else + pfx = &apn->v6.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_ifconfig, cfg_apn_ipv6_ifconfig_cmd, + "ipv6 ifconfig X:X::X:X/M", + IP6_STR IFCONFIG_STR "IPv6 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v6.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipv6_ifconfig, cfg_apn_no_ipv6_ifconfig_cmd, + "no ipv6 ifconfig", + NO_STR IP6_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v6.cfg.ifconfig_prefix, 0, sizeof(apn->v6.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +#define DNS_STRINGS "Configure DNS Server\n" "primary/secondary DNS\n" "IP address of DNS Sever\n" + +DEFUN(cfg_apn_ip_dns, cfg_apn_ip_dns_cmd, + "ip dns <0-1> A.B.C.D", + IP_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v4.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_dns, cfg_apn_ipv6_dns_cmd, + "ipv6 dns <0-1> X:X::X:X", + IP6_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v6.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_dns, cfg_apn_no_dns_cmd, + "no (ip|ipv6) dns <0-1>", + NO_STR IP_STR IP6_STR "Disable DNS Server\n" "primary/secondary DNS\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_addr *a; + int idx = atoi(argv[1]); + + if (!strcmp(argv[0], "ip")) + a = &apn->v4.cfg.dns[idx]; + else + a = &apn->v6.cfg.dns[idx]; + + memset(a, 0, sizeof(*a)); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, + "shutdown", + "Put the APN in administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (!apn->cfg.shutdown) { + if (apn_stop(apn, false)) { + vty_out(vty, "%% Failed to Stop APN%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_shutdown, cfg_apn_no_shutdown_cmd, + "no shutdown", + NO_STR "Remove the APN from administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (apn->cfg.shutdown) { + if (apn_start(apn) < 0) { + vty_out(vty, "%% Failed to start APN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + + +static void vty_dump_prefix(struct vty *vty, const char *pre, const struct in46_prefix *pfx) +{ + vty_out(vty, "%s %s%s", pre, in46p_ntoa(pfx), VTY_NEWLINE); +} + +static void config_write_apn(struct vty *vty, struct apn_ctx *apn) +{ + unsigned int i; + + vty_out(vty, " apn %s%s", apn->cfg.name, VTY_NEWLINE); + if (apn->cfg.description) + vty_out(vty, " description %s%s", apn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtpu-mode %s%s", get_value_string(apn_gtpu_mode_names, apn->cfg.gtpu_mode), + VTY_NEWLINE); + if (apn->tun.cfg.dev_name) + vty_out(vty, " tun-device %s%s", apn->tun.cfg.dev_name, VTY_NEWLINE); + if (apn->tun.cfg.ipup_script) + vty_out(vty, " ipup-script %s%s", apn->tun.cfg.ipup_script, VTY_NEWLINE); + if (apn->tun.cfg.ipdown_script) + vty_out(vty, " ipdown-script %s%s", apn->tun.cfg.ipdown_script, VTY_NEWLINE); + + for (i = 0; i < 32; i++) { + if (!(apn->cfg.apn_type_mask & (1 << i))) + continue; + vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), + VTY_NEWLINE); + } + + /* IPv4 prefixes + DNS */ + if (apn->v4.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix static", &apn->v4.cfg.static_prefix); + if (apn->v4.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix dynamic", &apn->v4.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + if (!apn->v4.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v4.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v4.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ip ifconfig ", &apn->v4.cfg.ifconfig_prefix); + + /* IPv6 prefixes + DNS */ + if (apn->v6.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix static", &apn->v6.cfg.static_prefix); + if (apn->v6.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix dynamic", &apn->v6.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + if (!apn->v6.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v6.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); + + /* must be last */ + vty_out(vty, " %sshutdown%s", apn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); +} + +static int config_write_ggsn(struct vty *vty) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + struct apn_ctx *apn; + vty_out(vty, "ggsn %s%s", ggsn->cfg.name, VTY_NEWLINE); + if (ggsn->cfg.description) + vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); + vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + llist_for_each_entry(apn, &ggsn->apn_list, list) + config_write_apn(vty, apn); + if (ggsn->cfg.default_apn) + vty_out(vty, " default-apn %s%s", ggsn->cfg.default_apn->cfg.name, VTY_NEWLINE); + /* must be last */ + vty_out(vty, " %sshutdown ggsn%s", ggsn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); + } + + return 0; +} + +static const char *print_gsnaddr(const struct ul16_t *in) +{ + struct in46_addr in46; + + in46.len = in->l; + OSMO_ASSERT(in->l <= sizeof(in46.v6)); + memcpy(&in46.v6, in->v, in->l); + + return in46a_ntoa(&in46); +} + +static void show_one_pdp(struct vty *vty, struct pdp_t *pdp) +{ + struct in46_addr eua46; + + vty_out(vty, "IMSI: %s, NSAPI: %u, MSISDN: %s%s", imsi_gtp2str(&pdp->imsi), pdp->nsapi, + osmo_hexdump_nospc(pdp->msisdn.v, pdp->msisdn.l), VTY_NEWLINE); + + vty_out(vty, " Control: %s:%08x ", print_gsnaddr(&pdp->gsnlc), pdp->teic_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnrc), pdp->teic_gn, VTY_NEWLINE); + + vty_out(vty, " Data: %s:%08x ", print_gsnaddr(&pdp->gsnlu), pdp->teid_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnru), pdp->teid_gn, VTY_NEWLINE); + + in46a_from_eua(&pdp->eua, &eua46); + vty_out(vty, " End-User Address: %s%s", in46a_ntoa(&eua46), VTY_NEWLINE); +} + +DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, + "show pdp-context imsi IMSI [<0-15>]", + SHOW_STR "Display information on PDP Context\n" + "PDP contexts for given IMSI\n" + "PDP context for given NSAPI\n") +{ + uint64_t imsi = strtoull(argv[0], NULL, 10); + unsigned int nsapi; + struct pdp_t *pdp; + int num_found = 0; + + if (argc > 1) { + nsapi = atoi(argv[1]); + if (pdp_getimsi(&pdp, imsi, nsapi)) { + show_one_pdp(vty, pdp); + num_found++; + } + } else { + for (nsapi = 0; nsapi < PDP_MAXNSAPI; nsapi++) { + if (pdp_getimsi(&pdp, imsi, nsapi)) + continue; + show_one_pdp(vty, pdp); + num_found++; + } + } + if (num_found == 0) { + vty_out(vty, "%% No such PDP context found%s", VTY_NEWLINE); + return CMD_WARNING; + } else + return CMD_SUCCESS; +} + +/* show all (active) PDP contexts within a pool */ +static void ippool_show_pdp_contexts(struct vty *vty, struct ippool_t *pool) +{ + unsigned int i; + + if (!pool) + return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + if (member->inuse == 0) + continue; + show_one_pdp(vty, member->peer); + } +} + +/* show all (active) PDP contexts within an APN */ +static void apn_show_pdp_contexts(struct vty *vty, struct apn_ctx *apn) +{ + ippool_show_pdp_contexts(vty, apn->v4.pool); + ippool_show_pdp_contexts(vty, apn->v6.pool); +} + +DEFUN(show_pdpctx, show_pdpctx_cmd, + "show pdp-context ggsn NAME [apn APN]", + SHOW_STR "Show PDP Context Information\n" + GGSN_STR "GGSN Name\n") // FIXME +{ + struct ggsn_ctx *ggsn; + struct apn_ctx *apn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (argc < 2) { + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_show_pdp_contexts(vty, apn); + } else { + apn = ggsn_find_apn(ggsn, argv[1]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + apn_show_pdp_contexts(vty, apn); + } + + return CMD_SUCCESS; +} + +static void show_apn(struct vty *vty, struct apn_ctx *apn) +{ + vty_out(vty, " APN: %s%s", apn->cfg.name, VTY_NEWLINE); + /* FIXME */ +} + +static void show_one_ggsn(struct vty *vty, struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + vty_out(vty, "GGSN %s: Bound to %s%s", ggsn->cfg.name, in46a_ntoa(&ggsn->cfg.listen_addr), + VTY_NEWLINE); + /* FIXME */ + + llist_for_each_entry(apn, &ggsn->apn_list, list) + show_apn(vty, apn); +} + +DEFUN(show_ggsn, show_ggsn_cmd, + "show ggsn [NAME]", + SHOW_STR "Display information on the GGSN\n") +{ + struct ggsn_ctx *ggsn; + + if (argc == 0) { + llist_for_each_entry(ggsn, &g_ggsn_list, list) + show_one_ggsn(vty, ggsn); + } else { + ggsn = ggsn_find(argv[0]); + if (!ggsn) + return CMD_WARNING; + show_one_ggsn(vty, ggsn); + } + + return CMD_SUCCESS; +} + +int ggsn_vty_init(void) +{ + install_element_ve(&show_pdpctx_cmd); + install_element_ve(&show_pdpctx_imsi_cmd); + install_element_ve(&show_ggsn_cmd); + + install_element(CONFIG_NODE, &cfg_ggsn_cmd); + install_element(CONFIG_NODE, &cfg_no_ggsn_cmd); + install_node(&ggsn_node, config_write_ggsn); + vty_install_default(GGSN_NODE); + install_element(GGSN_NODE, &cfg_description_cmd); + install_element(GGSN_NODE, &cfg_no_description_cmd); + install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); + install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_default_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_default_apn_cmd); + + install_node(&apn_node, NULL); + vty_install_default(APN_NODE); + install_element(APN_NODE, &cfg_description_cmd); + install_element(APN_NODE, &cfg_no_description_cmd); + install_element(APN_NODE, &cfg_apn_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_no_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_gtpu_mode_cmd); + install_element(APN_NODE, &cfg_apn_type_support_cmd); + install_element(APN_NODE, &cfg_apn_no_type_support_cmd); + install_element(APN_NODE, &cfg_apn_tun_dev_name_cmd); + install_element(APN_NODE, &cfg_apn_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_ip_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ip_dns_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_dns_cmd); + install_element(APN_NODE, &cfg_apn_no_dns_cmd); + install_element(APN_NODE, &cfg_apn_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + + return 0; +} + +static int ggsn_vty_is_config_node(struct vty *vty, int node) +{ + switch (node) { + case GGSN_NODE: + case APN_NODE: + return 1; + default: + return 0; + } +} + +static int ggsn_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + case GGSN_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + vty->index_sub = NULL; + break; + case APN_NODE: + vty->node = GGSN_NODE; + { + struct apn_ctx *apn = vty->index; + vty->index = apn->ggsn; + vty->index_sub = &apn->ggsn->cfg.description; + } + break; + } + + return vty->node; +} + +static const char ggsn_copyright[] = + "Copyright (C) 2011-2017 Harald Welte \r\n" + "Copyright (C) 2012-2017 Holger Hans Peter Freyther \r\n" + "Copyright (C) 2012-2017 sysmocom - s.f.m.c. GmbH\r\n" + "Copyright (C) 2002-2005 Mondru AB\r\n" + "License GPLv2: GNU GPL version 2 \r\n" + "This is free software: you are free to change and redistribute it.\r\n" + "There is NO WARRANTY, to the extent permitted by law.\r\n"; + +struct vty_app_info g_vty_info = { + .name = "OpenGGSN", + .version = PACKAGE_VERSION, + .copyright = ggsn_copyright, + .go_parent_cb = ggsn_vty_go_parent, + .is_config_node = ggsn_vty_is_config_node, +}; diff --git a/lib/tun.c b/lib/tun.c index e8368e5..76ac379 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -583,7 +583,7 @@ return tun_route(this, dst, gateway, mask, 1); } -int tun_new(struct tun_t **tun) +int tun_new(struct tun_t **tun, const char *dev_name) { #if defined(__linux__) @@ -615,6 +615,8 @@ /* Set device flags. For some weird reason this is also the method used to obtain the network interface name */ memset(&ifr, 0, sizeof(ifr)); + if (dev_name) + strcpy(ifr.ifr_name, dev_name); ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); diff --git a/lib/tun.h b/lib/tun.h index 67ef39d..50ac806 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -65,7 +65,7 @@ void *priv; }; -extern int tun_new(struct tun_t **tun); +extern int tun_new(struct tun_t **tun, const char *dev_name); extern int tun_free(struct tun_t *tun); extern int tun_decaps(struct tun_t *this); extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1f0b3f9..ed1fb93 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1461,7 +1461,7 @@ if (options.createif) { printf("Setting up interface\n"); /* Create a tunnel interface */ - if (tun_new((struct tun_t **)&tun)) { + if (tun_new((struct tun_t **)&tun, NULL)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Failed to create tun"); exit(1); -- To view, visit https://gerrit.osmocom.org/3857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:49:21 +0000 Subject: [PATCH] osmo-ggsn[master]: Documentation update: Remove NEWS, README.Solaris, update RE... Message-ID: Review at https://gerrit.osmocom.org/3858 Documentation update: Remove NEWS, README.Solaris, update README.md * README.Solaris is obsolete and related code has been removed * NEWS file was unmaintained for more than a decade, remove it * Remove "Performance" chapter about 550MHz Athlon * gengetopt is no longer needed for ggsn * remove compilation/installation instructions horribly out of date * command line syntax of 'ggsn' program has changed Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db --- M Makefile.am D NEWS D README.Solaris M README.md 4 files changed, 3 insertions(+), 240 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/58/3858/1 diff --git a/Makefile.am b/Makefile.am index 1d7eaba..517e265 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,6 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris +EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX @RELMAKE@ diff --git a/NEWS b/NEWS deleted file mode 100644 index b1352a5..0000000 --- a/NEWS +++ /dev/null @@ -1,78 +0,0 @@ -OPENGGSN NEWS -============= - -OpenGGSN - Gateway GPRS Support Node -Copyright (C) 2002, 2003, 2004 Mondru AB. - -Version 0.84 -============ - -* Initial MAC OSX support (Thanks to Pekka Nikander) -* Quality assurance and improved error logging (Thanks to Pekka - Nikander and Jonny Winberg) - -Version 0.83 -============ - -* Added selection mode and charging characteristics option to sgsnemu. -* Bug fixes on charging characteristics and PPP PCO length.(Thanks to - Loic Bernable ). -* Improved Solaris support, hash table bugfix and improved logging. - -Version 0.82 -============ - -* Improved Solaris support. -* Routing manipulation and IP address alias capability for FreeBSD. -* Initial Debian port (Thanks to ARAKI Yasuhiro ). - -Version 0.81 -============ - - * Initial FreeBSD port (Thanks to Pavel Andreev ). - * IMSI '1111' bugfix (Thanks to Pavel Andreev ). - -Version 0.8 -=========== - - * Support for compilation under Solaris. - * Iptables firewall script. - * New options for sgsnemu - - -Version 0.7 -=========== - - * Support for GTP1. Currently without support for the secondary pdp - context activation procedure. - * sgsnemu will first attempt to use GTP1. If that fails it will - fallback to using GTP0. - * Standards compliance document. - -Version 0.6 -=========== - - * Improved README file. - * Now uses ioctl instead of ifconfig and route in ggsn and sgsnemu. - * Absolute path to gtp library in ggsn/Makefile.am and ggsn/Makefile.am - * Compiles with gengetopt 2.8 (Thanks to Lorenzo Bettini ) - * sgsnemu is now able to handle several contexts and allocate - interface IP addresses for each context. - * ggsn now supports protocol configuration option DNS - addresses. This allow mobile stations to set up DNS based on - information configured in the ggsn. - * Ping facility in sgsnemu allow testing without the need to route - packets through the tun interface. - * Man pages for ggsn and sgsnemu. - * Sys 5 init script. - * Spec file for building binary RPM packages. - * If not --createif exit after "ping" or "echo" finishes - * If sgsnemu echo failure, exit with code != 0 - - -Version 0.5 -=========== - - * Initial release. See README file for installation and usage - instructions. - diff --git a/README.Solaris b/README.Solaris deleted file mode 100644 index 2ac6dbc..0000000 --- a/README.Solaris +++ /dev/null @@ -1,41 +0,0 @@ -OpenGGSN/Solaris notes -====================== - -Solaris support is experimental, please test and report bugs. The -Solaris port is tested under Solaris 8. - -Compiling ---------- - -You need to edit the following line in ggsn/Makefile.in and -sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -After this you install by the following commands: -./configure -make -make install - - -TUN ---- - -You might or might not need to install the tun driver manually. For -general information about tun see http://vtun.sourceforge.net/tun/ - - -Known problems --------------- - -Currently multiple IP addresses on the same network interface is not -implemented for Solaris. - -Currently routing table manipulation is not implemented for -Solaris. You have to set the routes manually after you start ggsn or -sgsnemu. - diff --git a/README.md b/README.md index 8e4ceae..829adcd 100644 --- a/README.md +++ b/README.md @@ -174,26 +174,6 @@ will fallback to GTPv0. -Performance -=========== - -Two experiments were performed in order to test the performance of -sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of -RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had -100 Mb/s NICs (RTL-8139) and were connected through a crossed patch -cable. Both tests were performed by sending ICMP echo packets from -sgsnemu to the ggsn. - -89.5 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1400 bytes. Transfer time 1.27 sec, no packets lost. - -71.4 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1000 bytes. Transfer time 1.15 sec, no packets lost. - -12,1 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 100 bytes. Transfer time 0.84 sec, no packets lost. - - Required software ================= @@ -209,19 +189,12 @@ Alternatively you can execute "modprobe tun" on the commandline. -For Solaris the tun driver needs to be installed manually. For general -information about tun see http://vtun.sourceforge.net/tun/ - Gengetopt --------- Gengetopt is required if you want to change the options defined in the cmdline.ggo source file. You need at least gengetopt version 2.8. If you are just going to compile the programs you don't need gengetopt. - -To use gengetopt for the ggsn do the following: -cd ggsn -gengetopt < cmdline.ggo --conf-parser To use gengetopt for the sgsnemu do the following: cd sgsnemu @@ -234,98 +207,7 @@ Compilation and Installation ============================ - -Setting up autotools --------------------- - -You do not need to perform this step if you are only going to compile -the package: - -1. Get version from somewhere: Script to extract version from configure.in -2. Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config -3. Run autoscan and copy configure.scan to configure.in -4. Add/edit the following lines in configure.in: - - AC_INIT(openggsn, 0.70, jj at openggsn.org) - - AC_CONFIG_SRCDIR([gtp/gtp.c]) - - AM_CONFIG_HEADER([config.h]) - - AC_PROG_LIBTOOL - - AM_PROG_LIBTOOL - - AM_INIT_AUTOMAKE() -5. libtoolize --automake --copy - (ads copy of ltmain.sh) -6. aclocal -7. autoheader -8. automake --add-missing --copy - (Ads copy of mkinstalldirs missing, install-sh, depcomp) -9. automake -10. autoconf - -The above will initialise the project to the current version of -autotools (As installed in RedHat 8.0). See -http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 -for details on autotools. - - -Checking out from CVS ---------------------- - -To download the latest source code from anonymous CVS: - -cvs -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn login -cvs -z3 -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Or to download from developer CVS: - -export CVS_RSH=ssh -cvs -z3 -d:ext:developername at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Both the above sets of commands creates a new directory called openggsn. - - -Compilation and installation ----------------------------- - -If compiling under Solaris you need to edit the following line in -ggsn/Makefile.in and sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -Note that the above is not necessary on other platforms. Compilation -and installation is performed by the following steps: - - 1. ./configure - 2. make clean - 3. cd gtp - 4. make - 5. make install (as root) - 6. cd .. - (Step 3 to 6 you only need to run the first time to install libgtp) - 7. make - 8. make install (as root) - 9. Add /usr/local/lib to /etc/ld.so.conf -10. run ldconfig - -(Steps 9 and 10 are not required as path to libgtp is included in Makefile) - -Documentation can be converted to html by issuing: - - 1. txt2html -pm -tf README > README.html - 2. txt2html -pm -tf NEWS > NEWS.html - 3. man2htm ggsn.8 > ggsn.html - 4. man2htm sgsnemu.8 > sgsnemu.html - - -Installation from binary ------------------------- - -1. rpm -i openggsn-.rpm - -This will install binaries, man pages, configuration files as well as -a Sys V init script for the ggsn. +Please refer to the project homepage Running ggsn @@ -337,7 +219,7 @@ Start the ggsn as root using the command: -ggsn -c examples/ggsn.conf --fg -l 10.0.0.40 --net 192.168.0.0/24 --dynip 192.168.0.0/24 +ggsn -c examples/ggsn.conf First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is -- To view, visit https://gerrit.osmocom.org/3858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:49:21 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Handle SIGTERM like SIGINT and terminate Message-ID: Review at https://gerrit.osmocom.org/3859 ggsn: Handle SIGTERM like SIGINT and terminate Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/59/3859/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5deff56..e6fc117 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -655,6 +655,7 @@ LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); switch (s) { case SIGINT: + case SIGTERM: LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); end = 1; break; @@ -801,11 +802,12 @@ struct ggsn_ctx *ggsn; int rc; - /* Handle keyboard interrupt SIGINT */ tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); + /* Handle keyboard interrupt SIGINT */ signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:49:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:49:22 +0000 Subject: [PATCH] osmo-ggsn[master]: Rename OpenGGSN to OsmoGGSN Message-ID: Review at https://gerrit.osmocom.org/3860 Rename OpenGGSN to OsmoGGSN Osmocom has maintained this program since about 7 years now, while the original author / copyright holder has completely disappeared. With the introduction of Osmocom-style CTRL and VTY interfaces, the way how the program is used and configured has substantially changed. In order to avoid confusion in terms of configuration file format etc, let's rename it to OsmoGGSN. Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d --- M .gitignore M AUTHORS M README.FreeBSD M README.MacOSX M README.md M configure.ac M debian/changelog M debian/control M debian/copyright D debian/openggsn.examples A debian/osmo-ggsn.examples R debian/osmo-ggsn.init R debian/osmo-ggsn.install M debian/rules M doc/Compliance.html M doc/Makefile.am R doc/osmo-ggsn.8 M doc/sgsnemu.8 D examples/ggsn.init A examples/osmo-ggsn.init M ggsn/Makefile.am M ggsn/ggsn.c M ggsn/ggsn_vty.c M gtp/gtp.c M gtp/gtp.h M gtp/gtpie.c M gtp/gtpie.h M gtp/pdp.c M gtp/pdp.h M gtp/queue.c M gtp/queue.h M libgtp.pc.in D openggsn.spec.in A osmo-ggsn.spec.in M sgsnemu/cmdline.ggo M sgsnemu/sgsnemu.c 36 files changed, 316 insertions(+), 302 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/60/3860/1 diff --git a/.gitignore b/.gitignore index 111fa98..6885cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,13 +15,13 @@ libtool ltmain.sh missing -openggsn.spec +osmo-ggsn.spec stamp-h1 doc/Makefile.in ggsn/Makefile.in gtp/Makefile.in sgsnemu/Makefile.in -debian/openggsn/ +debian/osmo-ggsn/ debian/*.debhelper debian/libgtp/ debian/*.log @@ -33,7 +33,7 @@ debian/files debian/libgtp-dev/ libgtp.pc -ggsn/ggsn +ggsn/osmo-ggsn m4/ *.swp *.o diff --git a/AUTHORS b/AUTHORS index 5f10990..cba1896 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -OpenGGSN - Gateway GPRS Support Node +OsmoGGSN - Osmocom Gateway GPRS Support Node, based on OpenGGSN Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen Copyright (C) 2010-2017 Harald Welte Copyright (C) 2012-2016 Holger Hans Peter Freyther diff --git a/README.FreeBSD b/README.FreeBSD index b5cc66d..2f4bce5 100644 --- a/README.FreeBSD +++ b/README.FreeBSD @@ -1,4 +1,4 @@ -OpenGGSN/FreeBSD notes +OsmoGGSN/FreeBSD notes FreeBSD support is experimental, please test and report bugs. The FreeBSD port is tested on FreeBSD 4.x, but may also work on 5.x series. diff --git a/README.MacOSX b/README.MacOSX index 0a904cd..a8c4776 100644 --- a/README.MacOSX +++ b/README.MacOSX @@ -1,4 +1,4 @@ -OpenGGSN/Mac OS X notes +OsmoGGSN/Mac OS X notes Mac OS X support is experimental, please test and report bugs. The Mac OS X port is tested on Mac OS X 10.3.5, but may also work on diff --git a/README.md b/README.md index 829adcd..42613cf 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -OpenGGSN - Open Source GGSN +OsmoGGSN - Open Source GGSN =========================== This repository contains a C-language implementation of a GGSN (Gateway GPRS Support Node), a core network element of ETSI/3GPP cellular networks such as GPRS, EDGE, UMTS or HSPA. -OpenGGSN is part of the [Osmocom](https://osmocom.org/) Open Source +OsmoGGSN is part of the [Osmocom](https://osmocom.org/) Open Source Mobile Communications projects, even thogh it was previously developed by Mondru AB. @@ -18,11 +18,11 @@ GIT Repository -------------- -You can clone from the official libosmocore.git repository using +You can clone from the official osmo-ggsn.git repository using - git clone git://git.osmocom.org/openggsn.git + git clone git://git.osmocom.org/osmo-ggsn.git -There is a cgit interface at http://git.osmocom.org/openggsn/ +There is a cgit interface at http://git.osmocom.org/osmo-ggsn/ Documentation ------------- @@ -34,7 +34,7 @@ Mailing List ------------ -Discussions related to openggsn are happening on the +Discussions related to OsmoGGSN are happening on the osmocom-net-gprs at lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/osmocom-net-gprs for subscription options and the list archive. @@ -54,10 +54,8 @@ https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details -The current patch queue for OpenGGSN can be seen at -https://gerrit.osmocom.org/#/q/project:openggsn+status:open -OPENGGSN README -=============== +The current patch queue for OsmoGGSN can be seen at +https://gerrit.osmocom.org/#/q/project:osmo-ggsn+status:open QuickStart @@ -67,7 +65,7 @@ ------------ *Linux* -OpenGGSN was originally developed and tested using Redhat 8.0 and 9.0 +OsmoGGSN was originally developed and tested using Redhat 8.0 and 9.0 and is these days mostly developed on Debian GNU/Linux. It should run also on other Linux distributions as well as FreeBSD, but this is untested. Compilation on Solaris 2.8 has also been verified. @@ -84,7 +82,7 @@ Installation from binary ------------------------ -OpenGGSN is built for common versions of Debian and Ubuntu as part of +OsmoGGSN is built for common versions of Debian and Ubuntu as part of the [Osmocom Nightly Builds](https://osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds) project. If you don't want to do development, it is suggested to simply use those binary packages, rather than building yourself from source. @@ -141,13 +139,13 @@ Features ======== -OpenGGSN is an open source implementation of GPRS Support Nodes +OsmoGGSN is an open source implementation of GPRS Support Nodes (GSNs). It implements the GPRS tunneling protocol (GTP) version 0 and version 1. -OpenGGSN provides 3 components: +OsmoGGSN provides 3 components: * gtplib - * ggsn + * osmo-ggsn * sgsnemu *gtplib* @@ -157,8 +155,8 @@ 29.060). At the moment no interface documentation is available for download. -*ggsn* -The ggsn implements a Gateway GPRS Support Node. The GGSN is a small +*osmo-ggsn* +The osmo-ggsn implements a Gateway GPRS Support Node. The GGSN is a small application which is provided in order to test and demonstrate the use of gtplib. It is fully compliant to the 3GPP standards, but lacks important functionality such as charging and management. Use this @@ -180,7 +178,7 @@ Tun --- -Both ggsn and sgsnemu uses the tun package. You need at least tun +Both osmo-ggsn and sgsnemu uses the tun package. You need at least tun version 1.1. With Linux tun is normally included from kernel version 2.4.7. To configure automatic loading: @@ -210,16 +208,16 @@ Please refer to the project homepage -Running ggsn -============ +Running osmo-ggsn +================= -Use ggsn -h for a list of available options. All options available on +Use osmo-ggsn -h for a list of available options. All options available on the command line can also be given in a configuration file. See -examples/ggsn.conf for the format of this file. +examples/osmo-ggsn.cfg for the format of this file. -Start the ggsn as root using the command: +Start osmo-ggsn as root using the command: -ggsn -c examples/ggsn.conf +osmo-ggsn -c examples/osmo-ggsn.cfg First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is @@ -248,9 +246,9 @@ echo 1 > /proc/sys/net/ipv4/ip_forward If you installed using a binary RPM package it is possible to start -ggsn by using the Sys 5 script: +osmo-ggsn by using the Sys 5 script: -/etc/init.d/ggsn start +/etc/init.d/osmo-ggsn start Running sgsnemu @@ -285,7 +283,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1823]: GTP: gtp_newgsn() started + OsmoGGSN[1823]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request @@ -321,7 +319,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1838]: GTP: gtp_newgsn() started + OsmoGGSN[1838]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request diff --git a/configure.ac b/configure.ac index 9d3a8e4..e6b84fa 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) +AC_INIT(osmo-ggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) AC_CONFIG_SRCDIR([gtp/gtp.c]) AM_CONFIG_HEADER([config.h]) #AC_CONFIG_HEADER([config.h]) @@ -149,9 +149,9 @@ sgsnemu/Makefile tests/Makefile libgtp.pc - openggsn.spec]) + osmo-ggsn.spec]) AC_OUTPUT echo " -openggsn Configuration: +osmo-ggsn Configuration: GTP Linux kernel support: ${enable_gtp_linux}" diff --git a/debian/changelog b/debian/changelog index 357cc01..7c82dbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-ggsn (0.94.0) UNRELEASED; urgency=medium + + * Transition to OsmoGGSN + + -- Harald Welte Tue, 05 Sep 2017 09:34:20 +0200 + openggsn (0.94.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] diff --git a/debian/control b/debian/control index 4e5b168..bed17e2 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: openggsn +Source: osmo-ggsn Maintainer: Harald Welte Section: net Priority: optional @@ -9,16 +9,16 @@ dh-autoreconf, libosmocore-dev (>= 0.8.0) Standards-Version: 3.9.6 -Vcs-Browser: http://ggsn.git.sourceforge.net/git/gitweb.cgi?p=ggsn/ggsn;a=summary -Vcs-Git: git://ggsn.git.sourceforge.net/gitroot/ggsn/ggsn +Vcs-Browser: http://git.osmocom.org/osmo-ggsn/ +Vcs-Git: git://git.osmocom.org/osmo-ggsn Homepage: https://projects.osmocom.org/projects/openggsn -Package: openggsn +Package: osmo-ggsn Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Gateway GPRS Support Node (GGSN) - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +Description: Osmocom Gateway GPRS Support Node (GGSN) + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -29,11 +29,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Description: library implementing the GTP protocol between SGSN and GGSN - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . - This library is part of openggsn and implements the GTP protocol between + This library is part of OsmoGGSN and implements the GTP protocol between SGSN (Serving GPRS support node) and GGSN. Package: libgtp-dev @@ -43,17 +43,17 @@ Depends: ${misc:Depends}, libgtp1 (= ${binary:Version}) Description: Development files for libgtp - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . The library libgtp implements the GTP protocol between SGSN and GGSN and this package contains the development files for this library. -Package: openggsn-dbg +Package: osmo-ggsn-dbg Section: debug Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), openggsn (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same -Description: Debug symbols for OpenGGSN +Description: Debug symbols for OsmoGGSN diff --git a/debian/copyright b/debian/copyright index b3339d9..a6507bd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,11 +1,13 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: openggsn -Source: http://sourceforge.net/projects/ggsn/ +Upstream-Name: osmo-ggsn +Source: https://osmocom.org/projects/openggsn Files: * -Copyright: 2002 Jens Jakobsen - 2002-2004 Mondru AB - 2010-2011 Harald Welte +Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen +Copyright (C) 2010-2017 Harald Welte +Copyright (C) 2012-2016 Holger Hans Peter Freyther +Copyright (C) 2014-2016 Pablo Neira Ayuso +Copyright (C) 2014-2016 sysmocom - s.f.m.c. GmbH License: GPL-2 Files: lib/getopt.c @@ -15,7 +17,7 @@ License: LGPL-2.1+ Files: debian/* -Copyright: 2010-2015 Harald Welte +Copyright: 2010-2017 Harald Welte 2016 Ruben Undheim License: GPL-2 diff --git a/debian/openggsn.examples b/debian/openggsn.examples deleted file mode 100644 index 1fa82f3..0000000 --- a/debian/openggsn.examples +++ /dev/null @@ -1,2 +0,0 @@ -examples/ggsn.conf -examples/sgsnemu.conf diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples new file mode 100644 index 0000000..3898d26 --- /dev/null +++ b/debian/osmo-ggsn.examples @@ -0,0 +1,2 @@ +examples/osmo-ggsn.conf +examples/sgsnemu.conf diff --git a/debian/openggsn.init b/debian/osmo-ggsn.init similarity index 91% rename from debian/openggsn.init rename to debian/osmo-ggsn.init index d4fcb18..6fe1b87 100755 --- a/debian/openggsn.init +++ b/debian/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 2 3 4 5 @@ -13,18 +13,18 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" +DESC="OsmoGGSN Gateway GPRS Support Node" NAME=ggsn -DAEMON=/usr/bin/ggsn +DAEMON=/usr/bin/osmo-ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/openggsn +SCRIPTNAME=/etc/init.d/osmo-ggsn # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present -[ -r /etc/default/openggsn ] && . /etc/default/openggsn +[ -r /etc/default/osmo-ggsn ] && . /etc/default/osmo-ggsn # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -46,13 +46,13 @@ || return 1 # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn fi # Check for GTP restart counter - if [ ! -f /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart + if [ ! -f /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart fi start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ diff --git a/debian/openggsn.install b/debian/osmo-ggsn.install similarity index 67% rename from debian/openggsn.install rename to debian/osmo-ggsn.install index 4b301e1..522a3d1 100644 --- a/debian/openggsn.install +++ b/debian/osmo-ggsn.install @@ -1,3 +1,3 @@ -/usr/bin/ggsn +/usr/bin/osmo-ggsn /usr/bin/sgsnemu /usr/share/man/man8/* diff --git a/debian/rules b/debian/rules index aa95e28..6f27da9 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,7 @@ dh $@ --with autoreconf override_dh_strip: - dh_strip --dbg-package=openggsn-dbg + dh_strip --dbg-package=osmo-ggsn-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version diff --git a/doc/Compliance.html b/doc/Compliance.html index f33bc6f..4c2fc3a 100644 --- a/doc/Compliance.html +++ b/doc/Compliance.html @@ -7,7 +7,7 @@

Protocol Compliance List

-OpenGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the following tables the support of each individual message type is detailed. The numbers before each feature indicates the relevant section in the standard.
diff --git a/doc/Makefile.am b/doc/Makefile.am index 43b00d0..7e2246c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -man_MANS = ggsn.8 sgsnemu.8 +man_MANS = osmo-ggsn.8 sgsnemu.8 man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) diff --git a/doc/ggsn.8 b/doc/osmo-ggsn.8 similarity index 89% rename from doc/ggsn.8 rename to doc/osmo-ggsn.8 index 89dcb61b..b9f928f 100644 --- a/doc/ggsn.8 +++ b/doc/osmo-ggsn.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -12,24 +12,24 @@ .\" * .\" * Contributor(s): .\" * -.\" Manual page for ggsn +.\" Manual page for osmo-ggsn .\" SH section heading .\" SS subsection heading .\" LP paragraph .\" IP indented paragraph .\" TP hanging label -.TH ggsn 8 "July 2003" +.TH osmo-ggsn 8 "August 2017" .SH NAME -ggsn \- Gateway GPRS Support Node. +osmo-ggsn \- Gateway GPRS Support Node. .SH SYNOPSIS -.B ggsn +.B osmo-ggsn \-\-help -.B ggsn +.B osmo-ggsn \-\-version -.B ggsn +.B osmo-ggsn [ .BI \-\-help ] [ @@ -40,9 +40,9 @@ .BI \-\-version ] .SH DESCRIPTION -.B ggsn +.B osmo-ggsn is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Gateway GPRS Support Node. It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -62,14 +62,14 @@ The other interface can be thought of as the uplink interface, and interfaces the GGSN to an external data network. Gi is most often an interface to the Internet. -.B ggsn +.B osmo-ggsn uses the .B TUN/TAP driver for the Gi interface. A tun network interface is established when the -.B ggsn +.B osmo-ggsn is started. -.B ggsn +.B osmo-ggsn will accept incoming connections from mobile stations through the radio access network and the SGSN. When a connection request is received the ggsn will allocate a dynamic IP address for the mobile @@ -79,7 +79,7 @@ framework. Typically -.B ggsn +.B osmo-ggsn will be deployed with two Ethernet interfaces. One for the Gn/Gp interface, and one for the Gi interface. Policy routing and firewall rules should be used in order to separate Gi traffic from Gn/Gp @@ -105,25 +105,25 @@ (default = ./openggsn.cfg) .SH FILES -.I ./openggsn.cfg +.I ./osmo-ggsn.cfg .RS The configuration file for -.B ggsn. +.B osmo-ggsn. .RE -.I /var/run/ggsn.pid +.I /var/run/osmo-ggsn.pid .RS Process ID file. .RE -.I /var/lib/ggsn +.I /var/lib/osmo-ggsn .RS Directory holding nonvolatile data. .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at +Report all bugs to the OsmoGGSN bug tracking list at .I https://osmocom.org/projects/openggsn -.B ggsn +.B osmo-ggsn has very limited management support. Currently both SNMP as well as billing mechanisms are missing. @@ -135,13 +135,13 @@ .LP Besides the long options documented in this man page -.B ggsn +.B osmo-ggsn also accepts a number of short options with the same functionality. Use -.B ggsn --help +.B osmo-ggsn --help for a full list of all the available options. The TUN/TAP driver is required for proper operation of -.B ggsn. +.B osmo-ggsn. For linux kernels later than 2.4.7 the TUN/TAP driver is included in the kernel, but typically needs to be loaded manually with .B modprobe tun. For automatic loading the line @@ -152,7 +152,7 @@ .I http://vtun.sourceforge.net/tun/ for information on how to install and configure the tun driver. -.B ggsn +.B osmo-ggsn uses the GPRS Tunneling Protocol (GTP) as specified by the Third Generation Partnership Project (3GPP). 3GPP protocols specifications can be found at diff --git a/doc/sgsnemu.8 b/doc/sgsnemu.8 index af8f3ff..197bd5d 100644 --- a/doc/sgsnemu.8 +++ b/doc/sgsnemu.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -90,7 +90,7 @@ .SH DESCRIPTION .B sgsnemu is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Serving GPRS Support Node (SGSN) emulator. It can be used for testing Gateway GPRS Support Nodes (GGSNs), GPRS core networks as well as GPRS roaming connections. @@ -348,8 +348,8 @@ .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/sgsnemu/ +Report all bugs to the OsmoGGSN bug tracking list at +.I http://osmocom.org/projects/openggsn/issues .SH "SEE ALSO" diff --git a/examples/ggsn.init b/examples/ggsn.init deleted file mode 100644 index 7d9689a..0000000 --- a/examples/ggsn.init +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# ggsn This shell script takes care of starting and stopping -# ggsn. -# -# chkconfig: - 65 35 -# description: ggsn is a Gateway GPRS Support Node. - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -if [ -f /etc/sysconfig/ggsn ]; then - . /etc/sysconfig/ggsn -fi - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -f /usr/bin/ggsn ] || exit 0 -[ -f /etc/ggsn.conf ] || exit 0 - -RETVAL=0 -prog="ggsn" - -start() { - # Start daemons. - echo -n $"Starting $prog: " - - # Load tun module - /sbin/modprobe tun >/dev/null 2>&1 - - # Enable routing of packets: WARNING!!! - # Users should enable this explicitly - # echo 1 > /proc/sys/net/ipv4/ip_forward - - # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn - fi - - # Check for GTP restart counter - if [ ! -d /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart - fi - - - daemon /usr/bin/ggsn - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ggsn - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n $"Shutting down $prog: " - killproc ggsn - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ggsn /var/run/ggsn.pid - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/ggsn ] ; then - stop - start - RETVAL=$? - fi - ;; - status) - status ggsn - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL - diff --git a/examples/osmo-ggsn.init b/examples/osmo-ggsn.init new file mode 100644 index 0000000..2deb378 --- /dev/null +++ b/examples/osmo-ggsn.init @@ -0,0 +1,97 @@ +#!/bin/sh +# +# osmo-ggsn This shell script takes care of starting and stopping +# osmo-ggsn. +# +# chkconfig: - 65 35 +# description: osmo-ggsn is a Gateway GPRS Support Node. + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +if [ -f /etc/sysconfig/osmo-ggsn ]; then + . /etc/sysconfig/osmo-ggsn +fi + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -f /usr/bin/osmo-ggsn ] || exit 0 +[ -f /etc/osmo-ggsn.cfg ] || exit 0 + +RETVAL=0 +prog="osmo-ggsn" + +start() { + # Start daemons. + echo -n $"Starting $prog: " + + # Load tun module + /sbin/modprobe tun >/dev/null 2>&1 + + # Enable routing of packets: WARNING!!! + # Users should enable this explicitly + # echo 1 > /proc/sys/net/ipv4/ip_forward + + # Check for runtime directory of nonvolatile data + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn + fi + + # Check for GTP restart counter + if [ ! -d /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart + fi + + + daemon /usr/bin/osmo-ggsn + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/osmo-ggsn + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n $"Shutting down $prog: " + killproc osmo-ggsn + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f /var/lock/subsys/osmo-ggsn /var/run/osmo-ggsn.pid + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/osmo-ggsn ] ; then + stop + start + RETVAL=$? + fi + ;; + status) + status osmo-ggsn + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL + diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index fef12d3..8a468a9 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -1,19 +1,19 @@ -bin_PROGRAMS = ggsn +bin_PROGRAMS = osmo-ggsn AM_LDFLAGS = @EXEC_LDFLAGS@ AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) +osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD += -lgtpnl +osmo_ggsn_LDADD += -lgtpnl endif -ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a +osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL -ggsn_SOURCES += gtp-kernel.c +osmo_ggsn_SOURCES += gtp-kernel.c endif diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index e6fc117..5e85180 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte * @@ -590,7 +590,7 @@ return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } -static char *config_file = "openggsn.cfg"; +static char *config_file = "osmo-ggsn.cfg"; /* callback for tun device osmocom select loop integration */ static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) @@ -802,7 +802,7 @@ struct ggsn_ctx *ggsn; int rc; - tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "OsmoGGSN"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); /* Handle keyboard interrupt SIGINT */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index f23a298..4a3e753 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -882,7 +882,7 @@ "There is NO WARRANTY, to the extent permitted by law.\r\n"; struct vty_app_info g_vty_info = { - .name = "OpenGGSN", + .name = "OsmoGGSN", .version = PACKAGE_VERSION, .copyright = ggsn_copyright, .go_parent_cb = ggsn_vty_go_parent, diff --git a/gtp/gtp.c b/gtp/gtp.c index 87ab075..27a07b1 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1,6 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2010-2011, 2016-2017 Harald Welte + * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/gtp.h b/gtp/gtp.h index 7fa9ae7..b40c6df 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.c b/gtp/gtpie.c index c8db449..0744370 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.h b/gtp/gtpie.h index fb8598e..9fe7943 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/pdp.c b/gtp/pdp.c index c576a4e..ff9c681 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/pdp.h b/gtp/pdp.h index c51e9e2..cb98920 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.c b/gtp/queue.c index fbfa1ec..82cd7b4 100644 --- a/gtp/queue.c +++ b/gtp/queue.c @@ -1,7 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2011 Harald Welte + * Copyright (C) 2016 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.h b/gtp/queue.h index 556b6ef..2e253dd 100644 --- a/gtp/queue.h +++ b/gtp/queue.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/libgtp.pc.in b/libgtp.pc.in index 2201608..e6048e9 100644 --- a/libgtp.pc.in +++ b/libgtp.pc.in @@ -3,7 +3,7 @@ libdir=@libdir@ includedir=@includedir@ -Name: OpenGGSN STP Library +Name: OsmoGGSN GTP Library Description: C Utility Library Version: @VERSION@ Libs: -L${libdir} -lgtp diff --git a/openggsn.spec.in b/openggsn.spec.in deleted file mode 100644 index f15866e..0000000 --- a/openggsn.spec.in +++ /dev/null @@ -1,87 +0,0 @@ -Summary: Open Source Gateway GPRS Support Node (GGSN) -Name: @PACKAGE@ -Version: @VERSION@ -Release: 1 -URL: http://sourceforge.net/projects/ggsn/ -Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz -License: GPL -Group: System Environment/Daemons -BuildRoot: %{_tmppath}/%{name}-root - -%description -OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile -operators as the interface between the Internet and the rest of the -mobile network infrastructure. The project also provides an SGSN -emulator suitable for GPRS core network testing. - -%prep -%setup -q - -%build - -./configure --prefix=/usr --enable-static-exec - -make - -%install - -make install prefix=$RPM_BUILD_ROOT/usr -strip $RPM_BUILD_ROOT/usr/bin/ggsn -strip $RPM_BUILD_ROOT/usr/bin/sgsnemu - -#Copy ggsn init script in place -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d -install -m755 examples/ggsn.init \ - $RPM_BUILD_ROOT/etc/rc.d/init.d/ggsn - -#Copy ggsn.conf in place -install -m755 examples/ggsn.conf \ - $RPM_BUILD_ROOT/etc/ggsn.conf - -#Copy gsn_restart file in place -mkdir -p $RPM_BUILD_ROOT/var/lib/ggsn -echo "0" > $RPM_BUILD_ROOT/var/lib/ggsn/gsn_restart - -#Clean up unwanted library files -rm -rf $RPM_BUILD_ROOT/usr/include/* -rm -rf $RPM_BUILD_ROOT/usr/lib/* - - -%clean -rm -rf $RPM_BUILD_ROOT -make clean - -%post -/sbin/chkconfig --add ggsn - -%files -%defattr(-,root,root) - -/usr/bin/ggsn -/usr/bin/sgsnemu -/etc/rc.d/init.d/ggsn -%dir /var/lib/ggsn -/var/lib/ggsn/gsn_restart - -%doc AUTHORS COPYING INSTALL NEWS README.md -%doc examples/ggsn.conf -%doc examples/sgsnemu.conf -%doc examples/ggsn.init -%doc examples/firewall -%doc /usr/man/man8/ggsn.8.gz -%doc /usr/man/man8/sgsnemu.8.gz - -%config /etc/ggsn.conf - - -#/usr/lib/libgtp.a -#/usr/lib/libgtp.la -#/usr/lib/libgtp.so -#/usr/lib/libgtp.so.0 -#/usr/lib/libgtp.so.0.0.0 - - - -%changelog -* Mon Jun 30 2003 -- Initial build. diff --git a/osmo-ggsn.spec.in b/osmo-ggsn.spec.in new file mode 100644 index 0000000..9613bca --- /dev/null +++ b/osmo-ggsn.spec.in @@ -0,0 +1,90 @@ +Summary: Osmocom Gateway GPRS Support Node (GGSN) +Name: @PACKAGE@ +Version: @VERSION@ +Release: 1 +URL: https://osmocom.org/projects/openggsn +Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz +License: GPL +Group: System Environment/Daemons +BuildRoot: %{_tmppath}/%{name}-root + +%description +OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +operators as the interface between the Internet and the rest of the +mobile network infrastructure. The project also provides an SGSN +emulator suitable for GPRS core network testing. + +%prep +%setup -q + +%build + +./configure --prefix=/usr --enable-static-exec + +make + +%install + +make install prefix=$RPM_BUILD_ROOT/usr +strip $RPM_BUILD_ROOT/usr/bin/osmo-ggsn +strip $RPM_BUILD_ROOT/usr/bin/sgsnemu + +#Copy osmo-ggsn init script in place +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +install -m755 examples/osmo-ggsn.init \ + $RPM_BUILD_ROOT/etc/rc.d/init.d/osmo-ggsn + +#Copy osmo-ggsn.conf in place +install -m755 examples/osmo-ggsn.cfg \ + $RPM_BUILD_ROOT/etc/osmo-ggsn.cfg + +#Copy gsn_restart file in place +mkdir -p $RPM_BUILD_ROOT/var/lib/osmo-ggsn +echo "0" > $RPM_BUILD_ROOT/var/lib/osmo-ggsn/gsn_restart + +#Clean up unwanted library files +rm -rf $RPM_BUILD_ROOT/usr/include/* +rm -rf $RPM_BUILD_ROOT/usr/lib/* + + +%clean +rm -rf $RPM_BUILD_ROOT +make clean + +%post +/sbin/chkconfig --add osmo-ggsn + +%files +%defattr(-,root,root) + +/usr/bin/osmo-ggsn +/usr/bin/sgsnemu +/etc/rc.d/init.d/osmo-ggsn +%dir /var/lib/osmo-ggsn +/var/lib/osmo-ggsn/gsn_restart + +%doc AUTHORS COPYING INSTALL NEWS README.md +%doc examples/osmo-ggsn.conf +%doc examples/sgsnemu.conf +%doc examples/osmo-ggsn.init +%doc examples/firewall +%doc /usr/man/man8/osmo-ggsn.8.gz +%doc /usr/man/man8/sgsnemu.8.gz + +%config /etc/osmo-ggsn.cfg + + +#/usr/lib/libgtp.a +#/usr/lib/libgtp.la +#/usr/lib/libgtp.so +#/usr/lib/libgtp.so.0 +#/usr/lib/libgtp.so.0.0.0 + + + +%changelog +* Mon Jun 30 2017 +- Update to OsmoGGSN + +* Mon Jun 30 2003 +- Initial build. diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0c1b06c..ee5e55d 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -1,4 +1,4 @@ -# OpenGGSN - Gateway GPRS Support Node +# OsmoGGSN - Gateway GPRS Support Node # Copyright (C) 2002, 2003, 2004 Mondru AB. # # The contents of this file may be used under the terms of the GNU diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index ed1fb93..0157e22 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU -- To view, visit https://gerrit.osmocom.org/3860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:49:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:49:22 +0000 Subject: [PATCH] osmo-ggsn[master]: remove bogus 'version' script Message-ID: Review at https://gerrit.osmocom.org/3861 remove bogus 'version' script Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 --- D version 1 file changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/3861/1 diff --git a/version b/version deleted file mode 100755 index ba4d6a5..0000000 --- a/version +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Little shell script to grab current version number from configure.in -# -# $Id: version,v 1.3 2003/01/28 22:39:30 jjako Exp $ - -VER=`grep AC_INIT configure.in | awk -F'[(),]' '{print $3}'` -if [ "$1" == "-VERSION" ] -then - echo $VER | awk -F'.' '{print $1}' - exit -fi -if [ "$1" == "-PATCHLEVEL" ] -then - echo $VER | awk -F'.' '{print $2}' - exit -fi -if [ "$1" == "-SUBLEVEL" ] -then - echo $VER | awk -F'.' '{print $3}' - exit -fi -echo $VER -exit -- To view, visit https://gerrit.osmocom.org/3861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:49:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:49:22 +0000 Subject: [PATCH] osmo-ggsn[master]: Move examples to doc/examples and include them in DIST Message-ID: Review at https://gerrit.osmocom.org/3862 Move examples to doc/examples and include them in DIST Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 --- M configure.ac R contrib/osmo-ggsn.init M debian/osmo-ggsn.examples M doc/Makefile.am A doc/examples/Makefile.am R doc/examples/firewall R doc/examples/osmo-ggsn.cfg R doc/examples/sgsnemu.conf 8 files changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/62/3862/1 diff --git a/configure.ac b/configure.ac index e6b84fa..2b9343d 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,7 @@ AC_CONFIG_FILES([Makefile doc/Makefile + doc/examples/Makefile ggsn/Makefile gtp/Makefile lib/Makefile diff --git a/examples/osmo-ggsn.init b/contrib/osmo-ggsn.init similarity index 100% rename from examples/osmo-ggsn.init rename to contrib/osmo-ggsn.init diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples index 3898d26..775b9cd 100644 --- a/debian/osmo-ggsn.examples +++ b/debian/osmo-ggsn.examples @@ -1,2 +1,2 @@ -examples/osmo-ggsn.conf -examples/sgsnemu.conf +doc/examples/osmo-ggsn.conf +doc/examples/sgsnemu.conf diff --git a/doc/Makefile.am b/doc/Makefile.am index 7e2246c..46c634e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,5 +2,6 @@ man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) - - +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..530c3fa --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,22 @@ +CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,' + +dist-hook: + for f in $$($(CFG_FILES)); do \ + j="$(distdir)/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +install-data-hook: + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +uninstall-hook: + @$(PRE_UNINSTALL) + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + $(RM) $$j; \ + done diff --git a/examples/firewall b/doc/examples/firewall similarity index 100% rename from examples/firewall rename to doc/examples/firewall diff --git a/examples/osmo-ggsn.cfg b/doc/examples/osmo-ggsn.cfg similarity index 100% rename from examples/osmo-ggsn.cfg rename to doc/examples/osmo-ggsn.cfg diff --git a/examples/sgsnemu.conf b/doc/examples/sgsnemu.conf similarity index 100% rename from examples/sgsnemu.conf rename to doc/examples/sgsnemu.conf -- To view, visit https://gerrit.osmocom.org/3862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:49:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:49:22 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Add ability to specify local IP addresses for GTP-C an... Message-ID: Review at https://gerrit.osmocom.org/3863 ggsn: Add ability to specify local IP addresses for GTP-C and GTP-U In case the GGSN is behind some kind of DNAT, the public GTP-C and GTP-U IP addresses as exposed inside the GTP payload information elements are different from the (internal, behind-nat) IP address to which it listens/binds. Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 50 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/63/3863/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5e85180..8e9f694 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -691,6 +691,14 @@ } ggsn->gsn->priv = ggsn; + /* patch in different addresses to use (in case we're behind NAT, the listen + * address is different from what we advertise externally) */ + if (ggsn->cfg.gtpc_addr.v4.s_addr) + ggsn->gsn->gsnc = ggsn->cfg.gtpc_addr.v4; + + if (ggsn->cfg.gtpu_addr.v4.s_addr) + ggsn->gsn->gsnu = ggsn->cfg.gtpu_addr.v4; + /* Register File Descriptors */ osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); rc = osmo_fd_register(&ggsn->gtp_fd0); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index bab6cf7..2dd963c 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -99,6 +99,10 @@ struct apn_ctx *default_apn; /* ADdress to which we listen for GTP */ struct in46_addr listen_addr; + /* Local GTP-C address advertised in GTP */ + struct in46_addr gtpc_addr; + /* Local GTP-U address advertised in GTP */ + struct in46_addr gtpu_addr; /* directory for state file */ char *state_dir; /* administratively shut-down (true) or not (false) */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 4a3e753..d7bd9a7 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -165,8 +165,8 @@ return CMD_SUCCESS; } -DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, - "gtp local-ip A.B.C.D", +DEFUN(cfg_ggsn_bind_ip, cfg_ggsn_bind_ip_cmd, + "gtp bind-ip A.B.C.D", "GTP Parameters\n" "Set the IP address for the local GTP bind\n" "IPv4 Address\n") @@ -175,6 +175,34 @@ size_t t; ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpc_ip, cfg_ggsn_gtpc_ip_cmd, + "gtp control-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-C messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpc_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpu_ip, cfg_ggsn_gtpu_ip_cmd, + "gtp user-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-U messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpu_addr, &t, argv[0], 0); return CMD_SUCCESS; } @@ -633,7 +661,11 @@ if (ggsn->cfg.description) vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); - vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + vty_out(vty, " gtp bind-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpc_addr.v4.s_addr) + vty_out(vty, " gtp control-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpc_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpu_addr.v4.s_addr) + vty_out(vty, " gtp user-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpu_addr), VTY_NEWLINE); llist_for_each_entry(apn, &ggsn->apn_list, list) config_write_apn(vty, apn); if (ggsn->cfg.default_apn) @@ -806,7 +838,9 @@ install_element(GGSN_NODE, &cfg_no_description_cmd); install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); - install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_bind_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpc_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpu_ip_cmd); install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); -- To view, visit https://gerrit.osmocom.org/3863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:50:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:50:23 +0000 Subject: [ABANDON] openggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Introduce a VTY, factually turning OpenGGSN into an Osmocom program ...................................................................... Abandoned merge in osmo-ggsn.git -- To view, visit https://gerrit.osmocom.org/3848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:50:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:50:31 +0000 Subject: [ABANDON] openggsn[master]: Documentation update: Remove NEWS, README.Solaris, update RE... In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Documentation update: Remove NEWS, README.Solaris, update README.md ...................................................................... Abandoned merge in osmo-ggsn.git -- To view, visit https://gerrit.osmocom.org/3849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:50:36 +0000 Subject: [ABANDON] openggsn[master]: ggsn: Handle SIGTERM like SIGINT and terminate In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: ggsn: Handle SIGTERM like SIGINT and terminate ...................................................................... Abandoned merge in osmo-ggsn.git -- To view, visit https://gerrit.osmocom.org/3850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:50:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:50:39 +0000 Subject: [ABANDON] openggsn[master]: Rename OpenGGSN to OsmoGGSN In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Rename OpenGGSN to OsmoGGSN ...................................................................... Abandoned merge in osmo-ggsn.git -- To view, visit https://gerrit.osmocom.org/3851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:50:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:50:53 +0000 Subject: [ABANDON] openggsn[master]: remove bogus 'version' script In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: remove bogus 'version' script ...................................................................... Abandoned merge in osmo-ggsn.git -- To view, visit https://gerrit.osmocom.org/3852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:50:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:50:57 +0000 Subject: [ABANDON] openggsn[master]: Move examples to doc/examples and include them in DIST In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Move examples to doc/examples and include them in DIST ...................................................................... Abandoned merge in osmo-ggsn.git -- To view, visit https://gerrit.osmocom.org/3853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 21:51:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 5 Sep 2017 21:51:01 +0000 Subject: [ABANDON] openggsn[master]: ggsn: Add ability to specify local IP addresses for GTP-C an... In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: ggsn: Add ability to specify local IP addresses for GTP-C and GTP-U ...................................................................... Abandoned merge in osmo-ggsn.git -- To view, visit https://gerrit.osmocom.org/3854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 5 22:18:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 22:18:46 +0000 Subject: osmo-msc[master]: jenkins: drop unused build matrix vars, always --enable-smpp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24fbc756e79bbf25fc37dbf9b2c573972e712c7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 5 22:18:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 5 Sep 2017 22:18:48 +0000 Subject: [MERGED] osmo-msc[master]: jenkins: drop unused build matrix vars, always --enable-smpp In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: drop unused build matrix vars, always --enable-smpp ...................................................................... jenkins: drop unused build matrix vars, always --enable-smpp Change-Id: I24fbc756e79bbf25fc37dbf9b2c573972e712c7e --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index a7313c5..284679d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -47,11 +47,11 @@ cd "$base" autoreconf --install --force -./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests +./configure --enable-smpp $IU --enable-vty-tests --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" \ - DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \ + DISTCHECK_CONFIGURE_FLAGS="--enable-smpp $IU --enable-vty-tests --enable-external-tests" \ $MAKE distcheck \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24fbc756e79bbf25fc37dbf9b2c573972e712c7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:17:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:17:26 +0000 Subject: [PATCH] osmo-ggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3857 to look at the new patch set (#2). Introduce a VTY, factually turning OpenGGSN into an Osmocom program Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 --- M doc/ggsn.8 D examples/ggsn.conf A examples/osmo-ggsn.cfg M ggsn/Makefile.am D ggsn/cmdline.c D ggsn/cmdline.ggo D ggsn/cmdline.h M ggsn/ggsn.c A ggsn/ggsn.h A ggsn/ggsn_vty.c M lib/tun.c M lib/tun.h M sgsnemu/sgsnemu.c 13 files changed, 1,675 insertions(+), 2,177 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/57/3857/2 diff --git a/doc/ggsn.8 b/doc/ggsn.8 index 62d467a..89dcb61b 100644 --- a/doc/ggsn.8 +++ b/doc/ggsn.8 @@ -31,33 +31,13 @@ .B ggsn [ -.BI \-\-fg +.BI \-\-help ] [ -.BI \-\-debug +.BI \-\-daemonize ] [ -.BI \-\-conf " file" +.BI \-\-config-file " file" ] [ -.BI \-\-pidfile " file" -] [ -.BI \-\-statedir " file" -] [ -.BI \-\-listen " host" -] [ -.BI \-\-net " net" -] [ -.BI \-\-ipup " script" -] [ -.BI \-\-ipdown " script" -] [ -.BI \-\-dynip " net" -] [ -.BI \-\-statip " net" -] [ -.BI \-\-pcodns1 " host" -] [ -.BI \-\-pcodns2 " host" -] [ -.BI \-\-timelimit " seconds" +.BI \-\-version ] .SH DESCRIPTION .B ggsn @@ -115,86 +95,17 @@ Print version and exit. .TP -.BI --fg -Run in foreground (default = off) +.BI --daemonize +Run in background as a daemon (default = off) .TP -.BI --debug -Run in debug mode (default = off) - -.TP -.BI --conf " file" +.BI --config-file " file" Read configuration .I file -(default = /etc/ggsn.conf) where each line corresponds to one command -line option, but with the leading '--' removed. Command line options -override the options given in the configuration file. - -.TP -.BI --pidfile " file" -Filename of process id -.I file -(default = /var/run/ggsn.pid) - -.TP -.BI --statedir " path" -.I path -to directory of nonvolatile data (default = /var/lib/ggsn/) - -.TP -.BI --listen " host" -Local interface IP address to use for the Gn/Gp interface. This option -must be specified. For security issues it is not possible to use -INADDR_ANY. - -.TP -.BI --net " net" -Network address of the Gi interface (default = 192.168.0.0/24). The -network address is set during initialisation when -.B ggsn -establishes a tun device for the Gi interface. - -.TP -.BI --ipup " script" -Script executed after the Gi tun network interface has been brought -up. Executed with the following parameters: - -.TP -.BI --ipdown " script" -Script executed after the Gi tun network interface has been taken -down. Executed with the following parameters: - -.TP -.BI --dynip " net" -Dynamic IP address pool. Specifies a pool of dynamic IP addresses. If -this option is omitted the network address specified by the -.BI --net -option is used for dynamic IP address allocation. - -.TP -.BI --pcodns1 " host" -PCO DNS Server 1 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --pcodns2 " host" -PCO DNS Server 2 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --timelimit " seconds" -Exit -.B ggsn -after \fIseconds\fP. Used for debugging. - +(default = ./openggsn.cfg) .SH FILES -.I /etc/ggsn.conf +.I ./openggsn.cfg .RS The configuration file for .B ggsn. @@ -210,7 +121,7 @@ .SH BUGS Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/ggsn/ +.I https://osmocom.org/projects/openggsn .B ggsn has very limited management support. Currently both SNMP as well as @@ -250,6 +161,7 @@ .SH COPYRIGHT Copyright (C) 2002, 2003 by Mondru AB. +Copyright (C) 2017 Harald Welte The contents of this file may be used under the terms of the GNU General Public License Version 2, provided that the above copyright @@ -258,3 +170,4 @@ .SH AUTHORS Jens Jakobsen +Harald Welte diff --git a/examples/ggsn.conf b/examples/ggsn.conf deleted file mode 100644 index 6dcfe44..0000000 --- a/examples/ggsn.conf +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################## -# -# Sample ggsn configuration file -# -############################################################################## - -# TAG: fg -# Include this flag if process is to run in the foreground -# -#fg - -# TAG: debug -# Include this flag to include debug information. -#debug - - -# TAG: conf -# Configuration file to use. This file is the configuration file, -# so changing this parameter in the configuration file does not make -# sense. Use it on the command line instead. - -# TAG: pidfile -# File to store information about the process id of the program. -# The program must have write access to this file/directory. -#pidfile /var/run/ggsn.pid - -# TAG: statedir -# Directory to use for nonvolatile storage. -# The program must have write access to this directory. -#statedir /var/lib/ggsn/ - - -# TAG: listen -# Specifies the local IP address to listen to -#listen 10.0.0.240 - -# TAG: net -# IP network address of external packet data network -# Used to set up network interface. -#net 192.168.0.0/24 - -# TAG: ipup -# Script executed after network interface has been brought up. -# Executed with the following parameters: -#ipup /etc/ggsn/ip-up - -# TAG: ipdown -# Script executed after network interface has been taken down. -# Executed with the following parameters: -#ipdown /etc/ggsn/ip-down - -# TAG: dynip -# Dynamic IP address pool. -# Used for allocation of dynamic IP address when address is not given -# by HLR. -# If this option is not given then the net option is used as a substitute. -#dynip 192.168.0.0/24 - -# TAG: statip -# Use of this tag is currently UNSUPPORTED -# Static IP address pool. -# Used for allocation of static IP address by means of HLR. -#statip 192.168.1.0/24 - -# TAG: pcodns1 -# Protocol configuration option domain name system server 1. -#pcodns1 0.0.0.0 - -# TAG: pcodns2 -# Protocol configuration option domain name system server 2. -#pcodns2 0.0.0.0 - -# TAG: timelimit -# Exit after timelimit seconds. -# Setting timelimit to zero will cause the program not to exit. -#timelimit 0 - -# TAG: apn -# Use of this tag is EXPERIMENTAL -# Access point name to connect to when run in client mode. -#apn internet - -# TAG: qos -# Use of this tag is EXPERIMENTAL -# Requested Quality of Service used when run in client mode. -# 3 bytes corresponding to ???? -#qos 0x0b921f - -# TAG: qos -# Enable GTP datapath through Linux kernel driver gtp.ko (since 4.7). -#gtp-linux - diff --git a/examples/osmo-ggsn.cfg b/examples/osmo-ggsn.cfg new file mode 100644 index 0000000..763e561 --- /dev/null +++ b/examples/osmo-ggsn.cfg @@ -0,0 +1,71 @@ +! +! OpenGGSN (0.94.1-adac) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging print category 0 + logging timestamp 0 + logging level ip info + logging level tun info + logging level ggsn info + logging level sgsn notice + logging level icmp6 notice + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp info + logging level lstats notice + logging level lgsup notice + logging level loap notice + logging level lss7 notice + logging level lsccp notice + logging level lsua notice + logging level lm3ua notice + logging level lmgcp notice +! +stats interval 5 +! +line vty + no login +! +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown + apn inet6 + gtpu-mode tun + tun-device tun6 + type-support v6 + ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2000:0:0:0:0/56 + no shutdown + apn inet46 + gtpu-mode tun + tun-device tun46 + type-support v4v6 + ip prefix dynamic 176.16.46.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.46.0/24 + ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 + no shutdown + default-apn internet + no shutdown ggsn diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index c945f0b..fef12d3 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -2,17 +2,17 @@ AM_LDFLAGS = @EXEC_LDFLAGS@ -AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) + +ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD = @EXEC_LDADD@ -lgtp -lgtpnl -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) -else -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) +ggsn_LDADD += -lgtpnl endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/cmdline.c b/ggsn/cmdline.c deleted file mode 100644 index 31c0744..0000000 --- a/ggsn/cmdline.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* - File autogenerated by gengetopt version 2.22.6 - generated with the following command: - gengetopt -i cmdline.ggo --conf-parser - - The developers of gengetopt consider the fixed text that goes in all - gengetopt output files to be in the public domain: - we make no copyright claims on it. -*/ - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#ifndef FIX_UNUSED -#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ -#endif - -#include - -#include "cmdline.h" - -const char *gengetopt_args_info_purpose = ""; - -const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; - -const char *gengetopt_args_info_versiontext = ""; - -const char *gengetopt_args_info_description = ""; - -const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -f, --fg Run in foreground (default=off)", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file (default=`/etc/ggsn.conf')", - " --pidfile=STRING Filename of process id file\n (default=`/var/run/ggsn.pid')", - " --statedir=STRING Directory of nonvolatile data\n (default=`/var/lib/ggsn/')", - " -l, --listen=STRING Local interface", - " -n, --net=STRING Network (default=`192.168.0.0/24')", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --dynip=STRING Dynamic IP address pool", - " --statip=STRING Static IP address pool", - " --pcodns1=STRING PCO DNS Server 1 (default=`0.0.0.0')", - " --pcodns2=STRING PCO DNS Server 2 (default=`0.0.0.0')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " -a, --apn=STRING Access point name (default=`internet')", - " -q, --qos=INT Requested quality of service (default=`0x0b921f')", - " --logfile=STRING Logfile for errors", - " --loglevel=STRING Global log ldevel (default=`error')", - " -g, --gtp-linux GTP linux kernel support (default=off)", - 0 -}; - -typedef enum {ARG_NO - , ARG_FLAG - , ARG_STRING - , ARG_INT -} cmdline_parser_arg_type; - -static -void clear_given (struct gengetopt_args_info *args_info); -static -void clear_args (struct gengetopt_args_info *args_info); - -static int -cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error); - -struct line_list -{ - char * string_arg; - struct line_list * next; -}; - -static struct line_list *cmd_line_list = 0; -static struct line_list *cmd_line_list_tmp = 0; - -static void -free_cmd_list(void) -{ - /* free the list of a previous call */ - if (cmd_line_list) - { - while (cmd_line_list) { - cmd_line_list_tmp = cmd_line_list; - cmd_line_list = cmd_line_list->next; - free (cmd_line_list_tmp->string_arg); - free (cmd_line_list_tmp); - } - } -} - - -static char * -gengetopt_strdup (const char *s); - -static -void clear_given (struct gengetopt_args_info *args_info) -{ - args_info->help_given = 0 ; - args_info->version_given = 0 ; - args_info->fg_given = 0 ; - args_info->debug_given = 0 ; - args_info->conf_given = 0 ; - args_info->pidfile_given = 0 ; - args_info->statedir_given = 0 ; - args_info->listen_given = 0 ; - args_info->net_given = 0 ; - args_info->ipup_given = 0 ; - args_info->ipdown_given = 0 ; - args_info->dynip_given = 0 ; - args_info->statip_given = 0 ; - args_info->pcodns1_given = 0 ; - args_info->pcodns2_given = 0 ; - args_info->timelimit_given = 0 ; - args_info->apn_given = 0 ; - args_info->qos_given = 0 ; - args_info->logfile_given = 0 ; - args_info->loglevel_given = 0 ; - args_info->gtp_linux_given = 0 ; -} - -static -void clear_args (struct gengetopt_args_info *args_info) -{ - FIX_UNUSED (args_info); - args_info->fg_flag = 0; - args_info->debug_flag = 0; - args_info->conf_arg = gengetopt_strdup ("/etc/ggsn.conf"); - args_info->conf_orig = NULL; - args_info->pidfile_arg = gengetopt_strdup ("/var/run/ggsn.pid"); - args_info->pidfile_orig = NULL; - args_info->statedir_arg = gengetopt_strdup ("/var/lib/ggsn/"); - args_info->statedir_orig = NULL; - args_info->listen_arg = NULL; - args_info->listen_orig = NULL; - args_info->net_arg = gengetopt_strdup ("192.168.0.0/24"); - args_info->net_orig = NULL; - args_info->ipup_arg = NULL; - args_info->ipup_orig = NULL; - args_info->ipdown_arg = NULL; - args_info->ipdown_orig = NULL; - args_info->dynip_arg = NULL; - args_info->dynip_orig = NULL; - args_info->statip_arg = NULL; - args_info->statip_orig = NULL; - args_info->pcodns1_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns1_orig = NULL; - args_info->pcodns2_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns2_orig = NULL; - args_info->timelimit_arg = 0; - args_info->timelimit_orig = NULL; - args_info->apn_arg = gengetopt_strdup ("internet"); - args_info->apn_orig = NULL; - args_info->qos_arg = 0x0b921f; - args_info->qos_orig = NULL; - args_info->logfile_arg = NULL; - args_info->logfile_orig = NULL; - args_info->loglevel_arg = gengetopt_strdup ("error"); - args_info->loglevel_orig = NULL; - args_info->gtp_linux_flag = 0; - -} - -static -void init_args_info(struct gengetopt_args_info *args_info) -{ - - - args_info->help_help = gengetopt_args_info_help[0] ; - args_info->version_help = gengetopt_args_info_help[1] ; - args_info->fg_help = gengetopt_args_info_help[2] ; - args_info->debug_help = gengetopt_args_info_help[3] ; - args_info->conf_help = gengetopt_args_info_help[4] ; - args_info->pidfile_help = gengetopt_args_info_help[5] ; - args_info->statedir_help = gengetopt_args_info_help[6] ; - args_info->listen_help = gengetopt_args_info_help[7] ; - args_info->net_help = gengetopt_args_info_help[8] ; - args_info->ipup_help = gengetopt_args_info_help[9] ; - args_info->ipdown_help = gengetopt_args_info_help[10] ; - args_info->dynip_help = gengetopt_args_info_help[11] ; - args_info->statip_help = gengetopt_args_info_help[12] ; - args_info->pcodns1_help = gengetopt_args_info_help[13] ; - args_info->pcodns2_help = gengetopt_args_info_help[14] ; - args_info->timelimit_help = gengetopt_args_info_help[15] ; - args_info->apn_help = gengetopt_args_info_help[16] ; - args_info->qos_help = gengetopt_args_info_help[17] ; - args_info->logfile_help = gengetopt_args_info_help[18] ; - args_info->loglevel_help = gengetopt_args_info_help[19] ; - args_info->gtp_linux_help = gengetopt_args_info_help[20] ; - -} - -void -cmdline_parser_print_version (void) -{ - printf ("%s %s\n", - (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), - CMDLINE_PARSER_VERSION); - - if (strlen(gengetopt_args_info_versiontext) > 0) - printf("\n%s\n", gengetopt_args_info_versiontext); -} - -static void print_help_common(void) { - cmdline_parser_print_version (); - - if (strlen(gengetopt_args_info_purpose) > 0) - printf("\n%s\n", gengetopt_args_info_purpose); - - if (strlen(gengetopt_args_info_usage) > 0) - printf("\n%s\n", gengetopt_args_info_usage); - - printf("\n"); - - if (strlen(gengetopt_args_info_description) > 0) - printf("%s\n\n", gengetopt_args_info_description); -} - -void -cmdline_parser_print_help (void) -{ - int i = 0; - print_help_common(); - while (gengetopt_args_info_help[i]) - printf("%s\n", gengetopt_args_info_help[i++]); -} - -void -cmdline_parser_init (struct gengetopt_args_info *args_info) -{ - clear_given (args_info); - clear_args (args_info); - init_args_info (args_info); -} - -void -cmdline_parser_params_init(struct cmdline_parser_params *params) -{ - if (params) - { - params->override = 0; - params->initialize = 1; - params->check_required = 1; - params->check_ambiguity = 0; - params->print_errors = 1; - } -} - -struct cmdline_parser_params * -cmdline_parser_params_create(void) -{ - struct cmdline_parser_params *params = - (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); - cmdline_parser_params_init(params); - return params; -} - -static void -free_string_field (char **s) -{ - if (*s) - { - free (*s); - *s = 0; - } -} - - -static void -cmdline_parser_release (struct gengetopt_args_info *args_info) -{ - - free_string_field (&(args_info->conf_arg)); - free_string_field (&(args_info->conf_orig)); - free_string_field (&(args_info->pidfile_arg)); - free_string_field (&(args_info->pidfile_orig)); - free_string_field (&(args_info->statedir_arg)); - free_string_field (&(args_info->statedir_orig)); - free_string_field (&(args_info->listen_arg)); - free_string_field (&(args_info->listen_orig)); - free_string_field (&(args_info->net_arg)); - free_string_field (&(args_info->net_orig)); - free_string_field (&(args_info->ipup_arg)); - free_string_field (&(args_info->ipup_orig)); - free_string_field (&(args_info->ipdown_arg)); - free_string_field (&(args_info->ipdown_orig)); - free_string_field (&(args_info->dynip_arg)); - free_string_field (&(args_info->dynip_orig)); - free_string_field (&(args_info->statip_arg)); - free_string_field (&(args_info->statip_orig)); - free_string_field (&(args_info->pcodns1_arg)); - free_string_field (&(args_info->pcodns1_orig)); - free_string_field (&(args_info->pcodns2_arg)); - free_string_field (&(args_info->pcodns2_orig)); - free_string_field (&(args_info->timelimit_orig)); - free_string_field (&(args_info->apn_arg)); - free_string_field (&(args_info->apn_orig)); - free_string_field (&(args_info->qos_orig)); - free_string_field (&(args_info->logfile_arg)); - free_string_field (&(args_info->logfile_orig)); - free_string_field (&(args_info->loglevel_arg)); - free_string_field (&(args_info->loglevel_orig)); - - - - clear_given (args_info); -} - - -static void -write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) -{ - FIX_UNUSED (values); - if (arg) { - fprintf(outfile, "%s=\"%s\"\n", opt, arg); - } else { - fprintf(outfile, "%s\n", opt); - } -} - - -int -cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) -{ - int i = 0; - - if (!outfile) - { - fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); - return EXIT_FAILURE; - } - - if (args_info->help_given) - write_into_file(outfile, "help", 0, 0 ); - if (args_info->version_given) - write_into_file(outfile, "version", 0, 0 ); - if (args_info->fg_given) - write_into_file(outfile, "fg", 0, 0 ); - if (args_info->debug_given) - write_into_file(outfile, "debug", 0, 0 ); - if (args_info->conf_given) - write_into_file(outfile, "conf", args_info->conf_orig, 0); - if (args_info->pidfile_given) - write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); - if (args_info->statedir_given) - write_into_file(outfile, "statedir", args_info->statedir_orig, 0); - if (args_info->listen_given) - write_into_file(outfile, "listen", args_info->listen_orig, 0); - if (args_info->net_given) - write_into_file(outfile, "net", args_info->net_orig, 0); - if (args_info->ipup_given) - write_into_file(outfile, "ipup", args_info->ipup_orig, 0); - if (args_info->ipdown_given) - write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); - if (args_info->dynip_given) - write_into_file(outfile, "dynip", args_info->dynip_orig, 0); - if (args_info->statip_given) - write_into_file(outfile, "statip", args_info->statip_orig, 0); - if (args_info->pcodns1_given) - write_into_file(outfile, "pcodns1", args_info->pcodns1_orig, 0); - if (args_info->pcodns2_given) - write_into_file(outfile, "pcodns2", args_info->pcodns2_orig, 0); - if (args_info->timelimit_given) - write_into_file(outfile, "timelimit", args_info->timelimit_orig, 0); - if (args_info->apn_given) - write_into_file(outfile, "apn", args_info->apn_orig, 0); - if (args_info->qos_given) - write_into_file(outfile, "qos", args_info->qos_orig, 0); - if (args_info->logfile_given) - write_into_file(outfile, "logfile", args_info->logfile_orig, 0); - if (args_info->loglevel_given) - write_into_file(outfile, "loglevel", args_info->loglevel_orig, 0); - if (args_info->gtp_linux_given) - write_into_file(outfile, "gtp-linux", 0, 0 ); - - - i = EXIT_SUCCESS; - return i; -} - -int -cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) -{ - FILE *outfile; - int i = 0; - - outfile = fopen(filename, "w"); - - if (!outfile) - { - fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - i = cmdline_parser_dump(outfile, args_info); - fclose (outfile); - - return i; -} - -void -cmdline_parser_free (struct gengetopt_args_info *args_info) -{ - cmdline_parser_release (args_info); -} - -/** @brief replacement of strdup, which is not standard */ -char * -gengetopt_strdup (const char *s) -{ - char *result = 0; - if (!s) - return result; - - result = (char*)malloc(strlen(s) + 1); - if (result == (char*)0) - return (char*)0; - strcpy(result, s); - return result; -} - -int -cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) -{ - return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); -} - -int -cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int result; - result = cmdline_parser_internal (argc, argv, args_info, params, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) -{ - int result; - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) -{ - FIX_UNUSED (args_info); - FIX_UNUSED (prog_name); - return EXIT_SUCCESS; -} - - -static char *package_name = 0; - -/** - * @brief updates an option - * @param field the generic pointer to the field to update - * @param orig_field the pointer to the orig field - * @param field_given the pointer to the number of occurrence of this option - * @param prev_given the pointer to the number of occurrence already seen - * @param value the argument for this option (if null no arg was specified) - * @param possible_values the possible values for this option (if specified) - * @param default_value the default value (in case the option only accepts fixed values) - * @param arg_type the type of this option - * @param check_ambiguity @see cmdline_parser_params.check_ambiguity - * @param override @see cmdline_parser_params.override - * @param no_free whether to free a possible previous value - * @param multiple_option whether this is a multiple option - * @param long_opt the corresponding long option - * @param short_opt the corresponding short option (or '-' if none) - * @param additional_error possible further error specification - */ -static -int update_arg(void *field, char **orig_field, - unsigned int *field_given, unsigned int *prev_given, - char *value, const char *possible_values[], - const char *default_value, - cmdline_parser_arg_type arg_type, - int check_ambiguity, int override, - int no_free, int multiple_option, - const char *long_opt, char short_opt, - const char *additional_error) -{ - char *stop_char = 0; - const char *val = value; - int found; - char **string_field; - FIX_UNUSED (field); - - stop_char = 0; - found = 0; - - if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) - { - if (short_opt != '-') - fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", - package_name, long_opt, short_opt, - (additional_error ? additional_error : "")); - else - fprintf (stderr, "%s: `--%s' option given more than once%s\n", - package_name, long_opt, - (additional_error ? additional_error : "")); - return 1; /* failure */ - } - - FIX_UNUSED (default_value); - - if (field_given && *field_given && ! override) - return 0; - if (prev_given) - (*prev_given)++; - if (field_given) - (*field_given)++; - if (possible_values) - val = possible_values[found]; - - switch(arg_type) { - case ARG_FLAG: - *((int *)field) = !*((int *)field); - break; - case ARG_INT: - if (val) *((int *)field) = strtol (val, &stop_char, 0); - break; - case ARG_STRING: - if (val) { - string_field = (char **)field; - if (!no_free && *string_field) - free (*string_field); /* free previous string */ - *string_field = gengetopt_strdup (val); - } - break; - default: - break; - }; - - /* check numeric conversion */ - switch(arg_type) { - case ARG_INT: - if (val && !(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); - return 1; /* failure */ - } - break; - default: - ; - }; - - /* store the original value */ - switch(arg_type) { - case ARG_NO: - case ARG_FLAG: - break; - default: - if (value && orig_field) { - if (no_free) { - *orig_field = value; - } else { - if (*orig_field) - free (*orig_field); /* free previous string */ - *orig_field = gengetopt_strdup (value); - } - } - }; - - return 0; /* OK */ -} - - -int -cmdline_parser_internal ( - int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error) -{ - int c; /* Character of the parsed option. */ - - int error_occurred = 0; - struct gengetopt_args_info local_args_info; - - int override; - int initialize; - int check_required; - int check_ambiguity; - - package_name = argv[0]; - - override = params->override; - initialize = params->initialize; - check_required = params->check_required; - check_ambiguity = params->check_ambiguity; - - if (initialize) - cmdline_parser_init (args_info); - - cmdline_parser_init (&local_args_info); - - optarg = 0; - optind = 0; - opterr = params->print_errors; - optopt = '?'; - - while (1) - { - int option_index = 0; - - static struct option long_options[] = { - { "help", 0, NULL, 'h' }, - { "version", 0, NULL, 'V' }, - { "fg", 0, NULL, 'f' }, - { "debug", 0, NULL, 'd' }, - { "conf", 1, NULL, 'c' }, - { "pidfile", 1, NULL, 0 }, - { "statedir", 1, NULL, 0 }, - { "listen", 1, NULL, 'l' }, - { "net", 1, NULL, 'n' }, - { "ipup", 1, NULL, 0 }, - { "ipdown", 1, NULL, 0 }, - { "dynip", 1, NULL, 0 }, - { "statip", 1, NULL, 0 }, - { "pcodns1", 1, NULL, 0 }, - { "pcodns2", 1, NULL, 0 }, - { "timelimit", 1, NULL, 0 }, - { "apn", 1, NULL, 'a' }, - { "qos", 1, NULL, 'q' }, - { "logfile", 1, NULL, 0 }, - { "loglevel", 1, NULL, 0 }, - { "gtp-linux", 0, NULL, 'g' }, - { 0, 0, 0, 0 } - }; - - c = getopt_long (argc, argv, "hVfdc:l:n:a:q:g", long_options, &option_index); - - if (c == -1) break; /* Exit from `while (1)' loop. */ - - switch (c) - { - case 'h': /* Print help and exit. */ - cmdline_parser_print_help (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'V': /* Print version and exit. */ - cmdline_parser_print_version (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'f': /* Run in foreground. */ - - - if (update_arg((void *)&(args_info->fg_flag), 0, &(args_info->fg_given), - &(local_args_info.fg_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "fg", 'f', - additional_error)) - goto failure; - - break; - case 'd': /* Run in debug mode. */ - - - if (update_arg((void *)&(args_info->debug_flag), 0, &(args_info->debug_given), - &(local_args_info.debug_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "debug", 'd', - additional_error)) - goto failure; - - break; - case 'c': /* Read configuration file. */ - - - if (update_arg( (void *)&(args_info->conf_arg), - &(args_info->conf_orig), &(args_info->conf_given), - &(local_args_info.conf_given), optarg, 0, "/etc/ggsn.conf", ARG_STRING, - check_ambiguity, override, 0, 0, - "conf", 'c', - additional_error)) - goto failure; - - break; - case 'l': /* Local interface. */ - - - if (update_arg( (void *)&(args_info->listen_arg), - &(args_info->listen_orig), &(args_info->listen_given), - &(local_args_info.listen_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "listen", 'l', - additional_error)) - goto failure; - - break; - case 'n': /* Network. */ - - - if (update_arg( (void *)&(args_info->net_arg), - &(args_info->net_orig), &(args_info->net_given), - &(local_args_info.net_given), optarg, 0, "192.168.0.0/24", ARG_STRING, - check_ambiguity, override, 0, 0, - "net", 'n', - additional_error)) - goto failure; - - break; - case 'a': /* Access point name. */ - - - if (update_arg( (void *)&(args_info->apn_arg), - &(args_info->apn_orig), &(args_info->apn_given), - &(local_args_info.apn_given), optarg, 0, "internet", ARG_STRING, - check_ambiguity, override, 0, 0, - "apn", 'a', - additional_error)) - goto failure; - - break; - case 'q': /* Requested quality of service. */ - - - if (update_arg( (void *)&(args_info->qos_arg), - &(args_info->qos_orig), &(args_info->qos_given), - &(local_args_info.qos_given), optarg, 0, "0x0b921f", ARG_INT, - check_ambiguity, override, 0, 0, - "qos", 'q', - additional_error)) - goto failure; - - break; - case 'g': /* GTP linux kernel support. */ - - - if (update_arg((void *)&(args_info->gtp_linux_flag), 0, &(args_info->gtp_linux_given), - &(local_args_info.gtp_linux_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "gtp-linux", 'g', - additional_error)) - goto failure; - - break; - - case 0: /* Long option with no short option */ - /* Filename of process id file. */ - if (strcmp (long_options[option_index].name, "pidfile") == 0) - { - - - if (update_arg( (void *)&(args_info->pidfile_arg), - &(args_info->pidfile_orig), &(args_info->pidfile_given), - &(local_args_info.pidfile_given), optarg, 0, "/var/run/ggsn.pid", ARG_STRING, - check_ambiguity, override, 0, 0, - "pidfile", '-', - additional_error)) - goto failure; - - } - /* Directory of nonvolatile data. */ - else if (strcmp (long_options[option_index].name, "statedir") == 0) - { - - - if (update_arg( (void *)&(args_info->statedir_arg), - &(args_info->statedir_orig), &(args_info->statedir_given), - &(local_args_info.statedir_given), optarg, 0, "/var/lib/ggsn/", ARG_STRING, - check_ambiguity, override, 0, 0, - "statedir", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-up. */ - else if (strcmp (long_options[option_index].name, "ipup") == 0) - { - - - if (update_arg( (void *)&(args_info->ipup_arg), - &(args_info->ipup_orig), &(args_info->ipup_given), - &(local_args_info.ipup_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipup", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-down. */ - else if (strcmp (long_options[option_index].name, "ipdown") == 0) - { - - - if (update_arg( (void *)&(args_info->ipdown_arg), - &(args_info->ipdown_orig), &(args_info->ipdown_given), - &(local_args_info.ipdown_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipdown", '-', - additional_error)) - goto failure; - - } - /* Dynamic IP address pool. */ - else if (strcmp (long_options[option_index].name, "dynip") == 0) - { - - - if (update_arg( (void *)&(args_info->dynip_arg), - &(args_info->dynip_orig), &(args_info->dynip_given), - &(local_args_info.dynip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "dynip", '-', - additional_error)) - goto failure; - - } - /* Static IP address pool. */ - else if (strcmp (long_options[option_index].name, "statip") == 0) - { - - - if (update_arg( (void *)&(args_info->statip_arg), - &(args_info->statip_orig), &(args_info->statip_given), - &(local_args_info.statip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "statip", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 1. */ - else if (strcmp (long_options[option_index].name, "pcodns1") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns1_arg), - &(args_info->pcodns1_orig), &(args_info->pcodns1_given), - &(local_args_info.pcodns1_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns1", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 2. */ - else if (strcmp (long_options[option_index].name, "pcodns2") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns2_arg), - &(args_info->pcodns2_orig), &(args_info->pcodns2_given), - &(local_args_info.pcodns2_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns2", '-', - additional_error)) - goto failure; - - } - /* Exit after timelimit seconds. */ - else if (strcmp (long_options[option_index].name, "timelimit") == 0) - { - - - if (update_arg( (void *)&(args_info->timelimit_arg), - &(args_info->timelimit_orig), &(args_info->timelimit_given), - &(local_args_info.timelimit_given), optarg, 0, "0", ARG_INT, - check_ambiguity, override, 0, 0, - "timelimit", '-', - additional_error)) - goto failure; - - } - /* Logfile for errors. */ - else if (strcmp (long_options[option_index].name, "logfile") == 0) - { - - - if (update_arg( (void *)&(args_info->logfile_arg), - &(args_info->logfile_orig), &(args_info->logfile_given), - &(local_args_info.logfile_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "logfile", '-', - additional_error)) - goto failure; - - } - /* Global log ldevel. */ - else if (strcmp (long_options[option_index].name, "loglevel") == 0) - { - - - if (update_arg( (void *)&(args_info->loglevel_arg), - &(args_info->loglevel_orig), &(args_info->loglevel_given), - &(local_args_info.loglevel_given), optarg, 0, "error", ARG_STRING, - check_ambiguity, override, 0, 0, - "loglevel", '-', - additional_error)) - goto failure; - - } - - break; - case '?': /* Invalid option. */ - /* `getopt_long' already printed an error message. */ - goto failure; - - default: /* bug: option not considered. */ - fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); - abort (); - } /* switch */ - } /* while */ - - - - - cmdline_parser_release (&local_args_info); - - if ( error_occurred ) - return (EXIT_FAILURE); - - return 0; - -failure: - - cmdline_parser_release (&local_args_info); - return (EXIT_FAILURE); -} - -#ifndef CONFIG_FILE_LINE_SIZE -#define CONFIG_FILE_LINE_SIZE 2048 -#endif -#define ADDITIONAL_ERROR " in configuration file " - -#define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) -/* 3 is for "--" and "=" */ - -static int -_cmdline_parser_configfile (const char *filename, int *my_argc) -{ - FILE* file; - char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE+1]; - char linebuf[CONFIG_FILE_LINE_SIZE]; - int line_num = 0; - int result = 0, equal; - char *fopt, *farg; - char *str_index; - size_t len, next_token; - char delimiter; - - if ((file = fopen(filename, "r")) == 0) - { - fprintf (stderr, "%s: Error opening configuration file '%s'\n", - CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) - { - ++line_num; - my_argv[0] = '\0'; - len = strlen(linebuf); - if (len > (CONFIG_FILE_LINE_BUFFER_SIZE-1)) - { - fprintf (stderr, "%s:%s:%d: Line too long in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - - /* find first non-whitespace character in the line */ - next_token = strspn (linebuf, " \t\r\n"); - str_index = linebuf + next_token; - - if ( str_index[0] == '\0' || str_index[0] == '#') - continue; /* empty line or comment line is skipped */ - - fopt = str_index; - - /* truncate fopt at the end of the first non-valid character */ - next_token = strcspn (fopt, " \t\r\n="); - - if (fopt[next_token] == '\0') /* the line is over */ - { - farg = 0; - equal = 0; - goto noarg; - } - - /* remember if equal sign is present */ - equal = (fopt[next_token] == '='); - fopt[next_token++] = '\0'; - - /* advance pointers to the next token after the end of fopt */ - next_token += strspn (fopt + next_token, " \t\r\n"); - - /* check for the presence of equal sign, and if so, skip it */ - if ( !equal ) - if ((equal = (fopt[next_token] == '='))) - { - next_token++; - next_token += strspn (fopt + next_token, " \t\r\n"); - } - str_index += next_token; - - /* find argument */ - farg = str_index; - if ( farg[0] == '\"' || farg[0] == '\'' ) - { /* quoted argument */ - str_index = strchr (++farg, str_index[0] ); /* skip opening quote */ - if (! str_index) - { - fprintf - (stderr, - "%s:%s:%d: unterminated string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - else - { /* read up the remaining part up to a delimiter */ - next_token = strcspn (farg, " \t\r\n#\'\""); - str_index += next_token; - } - - /* truncate farg at the delimiter and store it for further check */ - delimiter = *str_index, *str_index++ = '\0'; - - /* everything but comment is illegal at the end of line */ - if (delimiter != '\0' && delimiter != '#') - { - str_index += strspn(str_index, " \t\r\n"); - if (*str_index != '\0' && *str_index != '#') - { - fprintf - (stderr, - "%s:%s:%d: malformed string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - - noarg: - if (!strcmp(fopt,"include")) { - if (farg && *farg) { - result = _cmdline_parser_configfile(farg, my_argc); - } else { - fprintf(stderr, "%s:%s:%d: include requires a filename argument.\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - } - continue; - } - len = strlen(fopt); - strcat (my_argv, len > 1 ? "--" : "-"); - strcat (my_argv, fopt); - if (len > 1 && ((farg && *farg) || equal)) - strcat (my_argv, "="); - if (farg && *farg) - strcat (my_argv, farg); - ++(*my_argc); - - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(my_argv); - } /* while */ - - if (file) - fclose(file); - return result; -} - -int -cmdline_parser_configfile ( - const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required) -{ - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - return cmdline_parser_config_file (filename, args_info, ¶ms); -} - -int -cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int i, result; - int my_argc = 1; - char **my_argv_arg; - char *additional_error; - - /* store the program name */ - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup (CMDLINE_PARSER_PACKAGE); - - result = _cmdline_parser_configfile(filename, &my_argc); - - if (result != EXIT_FAILURE) { - my_argv_arg = (char **) malloc((my_argc+1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - - my_argv_arg[my_argc] = 0; - - additional_error = (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy (additional_error, ADDITIONAL_ERROR); - strcat (additional_error, filename); - result = - cmdline_parser_internal (my_argc, my_argv_arg, args_info, - params, - additional_error); - - free (additional_error); - free (my_argv_arg); - } - - free_cmd_list(); - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} diff --git a/ggsn/cmdline.ggo b/ggsn/cmdline.ggo deleted file mode 100644 index 7426707..0000000 --- a/ggsn/cmdline.ggo +++ /dev/null @@ -1,38 +0,0 @@ -# OpenGGSN - Gateway GPRS Support Node -# Copyright (C) 2002, 2003, 2004 Mondru AB. -# -# The contents of this file may be used under the terms of the GNU -# General Public License Version 2, provided that the above copyright -# notice and this permission notice is included in all copies or -# substantial portions of the software. -# -# Use "gengetopt --conf-parser < cmdline.ggo" -# to generate cmdline.c and cmdline.h - -option "fg" f "Run in foreground" flag off -option "debug" d "Run in debug mode" flag off - -option "conf" c "Read configuration file" string default="/etc/ggsn.conf" no -option "pidfile" - "Filename of process id file" string default="/var/run/ggsn.pid" no -option "statedir" - "Directory of nonvolatile data" string default="/var/lib/ggsn/" no - -option "listen" l "Local interface" string no -option "net" n "Network" string default="192.168.0.0/24" no -option "ipup" - "Script to run after link-up" string no -option "ipdown" - "Script to run after link-down" string no - -option "dynip" - "Dynamic IP address pool" string no -option "statip" - "Static IP address pool" string no - -option "pcodns1" - "PCO DNS Server 1" string default="0.0.0.0" no -option "pcodns2" - "PCO DNS Server 2" string default="0.0.0.0" no - -option "timelimit" - "Exit after timelimit seconds" int default="0" no - -option "apn" a "Access point name" string default="internet" no -option "qos" q "Requested quality of service" int default="0x0b921f" no -option "logfile" - "Logfile for errors" string no -option "loglevel" - "Global log ldevel" string default="error" no - -option "gtp-linux" g "GTP linux kernel support" flag off - diff --git a/ggsn/cmdline.h b/ggsn/cmdline.h deleted file mode 100644 index 57f5cae..0000000 --- a/ggsn/cmdline.h +++ /dev/null @@ -1,275 +0,0 @@ -/** @file cmdline.h - * @brief The header file for the command line option parser - * generated by GNU Gengetopt version 2.22.6 - * http://www.gnu.org/software/gengetopt. - * DO NOT modify this file, since it can be overwritten - * @author GNU Gengetopt by Lorenzo Bettini */ - -#ifndef CMDLINE_H -#define CMDLINE_H - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include /* for FILE */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef CMDLINE_PARSER_PACKAGE -/** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE -#endif - -#ifndef CMDLINE_PARSER_PACKAGE_NAME -/** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif -#endif - -#ifndef CMDLINE_PARSER_VERSION -/** @brief the program version */ -#define CMDLINE_PARSER_VERSION VERSION -#endif - -/** @brief Where the command line options are stored */ -struct gengetopt_args_info -{ - const char *help_help; /**< @brief Print help and exit help description. */ - const char *version_help; /**< @brief Print version and exit help description. */ - int fg_flag; /**< @brief Run in foreground (default=off). */ - const char *fg_help; /**< @brief Run in foreground help description. */ - int debug_flag; /**< @brief Run in debug mode (default=off). */ - const char *debug_help; /**< @brief Run in debug mode help description. */ - char * conf_arg; /**< @brief Read configuration file (default='/etc/ggsn.conf'). */ - char * conf_orig; /**< @brief Read configuration file original value given at command line. */ - const char *conf_help; /**< @brief Read configuration file help description. */ - char * pidfile_arg; /**< @brief Filename of process id file (default='/var/run/ggsn.pid'). */ - char * pidfile_orig; /**< @brief Filename of process id file original value given at command line. */ - const char *pidfile_help; /**< @brief Filename of process id file help description. */ - char * statedir_arg; /**< @brief Directory of nonvolatile data (default='/var/lib/ggsn/'). */ - char * statedir_orig; /**< @brief Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /**< @brief Directory of nonvolatile data help description. */ - char * listen_arg; /**< @brief Local interface. */ - char * listen_orig; /**< @brief Local interface original value given at command line. */ - const char *listen_help; /**< @brief Local interface help description. */ - char * net_arg; /**< @brief Network (default='192.168.0.0/24'). */ - char * net_orig; /**< @brief Network original value given at command line. */ - const char *net_help; /**< @brief Network help description. */ - char * ipup_arg; /**< @brief Script to run after link-up. */ - char * ipup_orig; /**< @brief Script to run after link-up original value given at command line. */ - const char *ipup_help; /**< @brief Script to run after link-up help description. */ - char * ipdown_arg; /**< @brief Script to run after link-down. */ - char * ipdown_orig; /**< @brief Script to run after link-down original value given at command line. */ - const char *ipdown_help; /**< @brief Script to run after link-down help description. */ - char * dynip_arg; /**< @brief Dynamic IP address pool. */ - char * dynip_orig; /**< @brief Dynamic IP address pool original value given at command line. */ - const char *dynip_help; /**< @brief Dynamic IP address pool help description. */ - char * statip_arg; /**< @brief Static IP address pool. */ - char * statip_orig; /**< @brief Static IP address pool original value given at command line. */ - const char *statip_help; /**< @brief Static IP address pool help description. */ - char * pcodns1_arg; /**< @brief PCO DNS Server 1 (default='0.0.0.0'). */ - char * pcodns1_orig; /**< @brief PCO DNS Server 1 original value given at command line. */ - const char *pcodns1_help; /**< @brief PCO DNS Server 1 help description. */ - char * pcodns2_arg; /**< @brief PCO DNS Server 2 (default='0.0.0.0'). */ - char * pcodns2_orig; /**< @brief PCO DNS Server 2 original value given at command line. */ - const char *pcodns2_help; /**< @brief PCO DNS Server 2 help description. */ - int timelimit_arg; /**< @brief Exit after timelimit seconds (default='0'). */ - char * timelimit_orig; /**< @brief Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /**< @brief Exit after timelimit seconds help description. */ - char * apn_arg; /**< @brief Access point name (default='internet'). */ - char * apn_orig; /**< @brief Access point name original value given at command line. */ - const char *apn_help; /**< @brief Access point name help description. */ - int qos_arg; /**< @brief Requested quality of service (default='0x0b921f'). */ - char * qos_orig; /**< @brief Requested quality of service original value given at command line. */ - const char *qos_help; /**< @brief Requested quality of service help description. */ - char * logfile_arg; /**< @brief Logfile for errors. */ - char * logfile_orig; /**< @brief Logfile for errors original value given at command line. */ - const char *logfile_help; /**< @brief Logfile for errors help description. */ - char * loglevel_arg; /**< @brief Global log ldevel (default='error'). */ - char * loglevel_orig; /**< @brief Global log ldevel original value given at command line. */ - const char *loglevel_help; /**< @brief Global log ldevel help description. */ - int gtp_linux_flag; /**< @brief GTP linux kernel support (default=off). */ - const char *gtp_linux_help; /**< @brief GTP linux kernel support help description. */ - - unsigned int help_given ; /**< @brief Whether help was given. */ - unsigned int version_given ; /**< @brief Whether version was given. */ - unsigned int fg_given ; /**< @brief Whether fg was given. */ - unsigned int debug_given ; /**< @brief Whether debug was given. */ - unsigned int conf_given ; /**< @brief Whether conf was given. */ - unsigned int pidfile_given ; /**< @brief Whether pidfile was given. */ - unsigned int statedir_given ; /**< @brief Whether statedir was given. */ - unsigned int listen_given ; /**< @brief Whether listen was given. */ - unsigned int net_given ; /**< @brief Whether net was given. */ - unsigned int ipup_given ; /**< @brief Whether ipup was given. */ - unsigned int ipdown_given ; /**< @brief Whether ipdown was given. */ - unsigned int dynip_given ; /**< @brief Whether dynip was given. */ - unsigned int statip_given ; /**< @brief Whether statip was given. */ - unsigned int pcodns1_given ; /**< @brief Whether pcodns1 was given. */ - unsigned int pcodns2_given ; /**< @brief Whether pcodns2 was given. */ - unsigned int timelimit_given ; /**< @brief Whether timelimit was given. */ - unsigned int apn_given ; /**< @brief Whether apn was given. */ - unsigned int qos_given ; /**< @brief Whether qos was given. */ - unsigned int logfile_given ; /**< @brief Whether logfile was given. */ - unsigned int loglevel_given ; /**< @brief Whether loglevel was given. */ - unsigned int gtp_linux_given ; /**< @brief Whether gtp-linux was given. */ - -} ; - -/** @brief The additional parameters to pass to parser functions */ -struct cmdline_parser_params -{ - int override; /**< @brief whether to override possibly already present options (default 0) */ - int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ - int check_required; /**< @brief whether to check that all required options were provided (default 1) */ - int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ - int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ -} ; - -/** @brief the purpose string of the program */ -extern const char *gengetopt_args_info_purpose; -/** @brief the usage string of the program */ -extern const char *gengetopt_args_info_usage; -/** @brief the description string of the program */ -extern const char *gengetopt_args_info_description; -/** @brief all the lines making the help output */ -extern const char *gengetopt_args_info_help[]; - -/** - * The command line parser - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser (int argc, char **argv, - struct gengetopt_args_info *args_info); - -/** - * The command line parser (version with additional parameters - deprecated) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_ext() instead - */ -int cmdline_parser2 (int argc, char **argv, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The command line parser (version with additional parameters) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_ext (int argc, char **argv, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Save the contents of the option struct into an already open FILE stream. - * @param outfile the stream where to dump options - * @param args_info the option struct to dump - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_dump(FILE *outfile, - struct gengetopt_args_info *args_info); - -/** - * Save the contents of the option struct into a (text) file. - * This file can be read by the config file parser (if generated by gengetopt) - * @param filename the file where to save - * @param args_info the option struct to save - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_file_save(const char *filename, - struct gengetopt_args_info *args_info); - -/** - * Print the help - */ -void cmdline_parser_print_help(void); -/** - * Print the version - */ -void cmdline_parser_print_version(void); - -/** - * Initializes all the fields a cmdline_parser_params structure - * to their default values - * @param params the structure to initialize - */ -void cmdline_parser_params_init(struct cmdline_parser_params *params); - -/** - * Allocates dynamically a cmdline_parser_params structure and initializes - * all its fields to their default values - * @return the created and initialized cmdline_parser_params structure - */ -struct cmdline_parser_params *cmdline_parser_params_create(void); - -/** - * Initializes the passed gengetopt_args_info structure's fields - * (also set default values for options that have a default) - * @param args_info the structure to initialize - */ -void cmdline_parser_init (struct gengetopt_args_info *args_info); -/** - * Deallocates the string fields of the gengetopt_args_info structure - * (but does not deallocate the structure itself) - * @param args_info the structure to deallocate - */ -void cmdline_parser_free (struct gengetopt_args_info *args_info); - -/** - * The config file parser (deprecated version) - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_config_file() instead - */ -int cmdline_parser_configfile (const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The config file parser - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Checks that all the required options were specified - * @param args_info the structure to check - * @param prog_name the name of the program that will be used to print - * possible errors - * @return - */ -int cmdline_parser_required (struct gengetopt_args_info *args_info, - const char *prog_name); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* CMDLINE_H */ diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d865707..2bf3d7e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,6 +1,7 @@ /* * OpenGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -19,42 +20,43 @@ #include "../config.h" -#include - #ifdef HAVE_STDINT_H #include #endif +#include #include -#include #include #include #include #include +#include +#include +#include #include -#include +#include + +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - +#include #include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include #include "../lib/tun.h" #include "../lib/ippool.h" @@ -62,82 +64,188 @@ #include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" -#include "cmdline.h" #include "gtp-kernel.h" #include "icmpv6.h" +#include "ggsn.h" -int end = 0; -int maxfd = 0; /* For select() */ +void *tall_ggsn_ctx; -struct in_addr listen_; -struct in46_addr netaddr, destaddr, net; /* Network interface */ -size_t prefixlen; -struct in46_addr dns1, dns2; /* PCO DNS address */ -char *ipup, *ipdown; /* Filename of scripts */ -int debug; /* Print debug output */ -struct ul255_t pco; +static int end = 0; +static int daemonize = 0; +static struct ctrl_handle *g_ctrlh; + struct ul255_t qos; struct ul255_t apn; -struct gsn_t *gsn; /* GSN instance */ -struct tun_t *tun; /* TUN instance */ -struct ippool_t *ippool; /* Pool of IP addresses */ +#define LOGPAPN(level, apn, fmt, args...) \ + LOGP(DGGSN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args) -/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ -void signal_handler(int s) +#define LOGPGGSN(level, ggsn, fmt, args...) \ + LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) + +#define LOGPPDP(level, pdp, fmt, args...) \ + LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); + + +static void pool_close_all_pdp(struct ippool_t *pool) { - DEBUGP(DGGSN, "Received signal %d, exiting.\n", s); - end = 1; -} + unsigned int i; -/* Used to write process ID to file. Assume someone else will delete */ -void log_pid(char *pidfile) -{ - FILE *file; - mode_t oldmask; - - oldmask = umask(022); - file = fopen(pidfile, "w"); - umask(oldmask); - if (!file) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to create process ID file: %s!", pidfile); + if (!pool) return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + struct pdp_t *pdp; + + if (!member->inuse) + continue; + pdp = member->peer; + if (!pdp) + continue; + LOGPPDP(LOGL_DEBUG, pdp, "Sending DELETE PDP CTX due to shutdown\n"); + gtp_delete_context_req(pdp->gsn, pdp, NULL, 1); } - fprintf(file, "%d\n", (int)getpid()); - fclose(file); } -#if defined(__sun__) -int daemon(int nochdir, int noclose) +int apn_stop(struct apn_ctx *apn, bool force) { - int fd; + if (!apn->started) + return 0; - switch (fork()) { - case -1: - return (-1); - case 0: + LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); + /* check if pools have any active PDP contexts and bail out */ + pool_close_all_pdp(apn->v4.pool); + pool_close_all_pdp(apn->v6.pool); + + /* shutdown whatever old state might be left */ + if (apn->tun.tun) { + /* run ip-down script */ + if (apn->tun.cfg.ipdown_script) { + LOGPAPN( LOGL_INFO, apn, "Running %s\n", apn->tun.cfg.ipdown_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipdown_script); + } + /* release tun device */ + LOGPAPN(LOGL_INFO, apn, "Closing TUN device\n"); + osmo_fd_unregister(&apn->tun.fd); + tun_free(apn->tun.tun); + apn->tun.tun = NULL; + } + + if (apn->v4.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv4 pool\n"); + ippool_free(apn->v4.pool); + apn->v4.pool = NULL; + } + if (apn->v6.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv6 pool\n"); + ippool_free(apn->v6.pool); + apn->v6.pool = NULL; + } + + apn->started = false; + return 0; +} + +/* actually start the APN with its current config */ +int apn_start(struct apn_ctx *apn) +{ + if (apn->started) + return 0; + + LOGPAPN(LOGL_INFO, apn, "Starting\n"); + switch (apn->cfg.gtpu_mode) { + case APN_GTPU_MODE_TUN: + LOGPAPN(LOGL_INFO, apn, "Opening TUN device %s\n", apn->tun.cfg.dev_name); + if (tun_new(&apn->tun.tun, apn->tun.cfg.dev_name)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to configure tun device\n"); + return -1; + } + LOGPAPN(LOGL_INFO, apn, "Opened TUN device %s\n", apn->tun.tun->devname); + + /* Register with libosmcoore */ + osmo_fd_setup(&apn->tun.fd, apn->tun.tun->fd, BSC_FD_READ, ggsn_tun_fd_cb, apn, 0); + osmo_fd_register(&apn->tun.fd); + + /* Set TUN library callback */ + tun_set_cb_ind(apn->tun.tun, cb_tun_ind); + + if (apn->v4.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IP address %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v4.cfg.ifconfig_prefix.addr, NULL, + apn->v4.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv4 address %s: %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->v6.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IPv6 address %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL, + apn->v6.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->tun.cfg.ipup_script) { + LOGPAPN(LOGL_INFO, apn, "Running ip-up script %s\n", + apn->tun.cfg.ipup_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipup_script); + } + /* set back-pointer from TUN device to APN */ + apn->tun.tun->priv = apn; + break; + case APN_GTPU_MODE_KERNEL_GTP: + LOGPAPN(LOGL_ERROR, apn, "FIXME: Kernel GTP\n"); +#if 0 + /* use GTP kernel module for data packet encapsulation */ + if (gtp_kernel_init(gsn, &net.v4, prefixlen, net_arg) < 0) + goto err; +#endif break; default: - _exit(0); + LOGPAPN(LOGL_ERROR, apn, "Unknown GTPU Mode %d\n", apn->cfg.gtpu_mode); + return -1; } - if (setsid() == -1) - return (-1); - - if (!nochdir) - chdir("/"); - - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { - dup2(fd, STDIN_FILENO); - dup2(fd, STDOUT_FILENO); - dup2(fd, STDERR_FILENO); - if (fd > 2) - close(fd); + /* Create IPv4 pool */ + if (apn->v4.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", + in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, + &apn->v4.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + apn_stop(apn, false); + return -1; + } } - return (0); + + /* Create IPv6 pool */ + if (apn->v6.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", + in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, + &apn->v6.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + apn_stop(apn, false); + return -1; + } + } + + LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); + apn->started = true; + return 0; } -#endif static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { @@ -148,27 +256,29 @@ snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); - if (ctrl_cmd_send_trap(gsn->priv, var, val) < 0) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); + if (ctrl_cmd_send_trap(g_ctrlh, var, val) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Failed to create and send TRAP %s\n", var); return false; } return true; } -int delete_context(struct pdp_t *pdp) +static int delete_context(struct pdp_t *pdp) { - DEBUGP(DGGSN, "Deleting PDP context\n"); + struct gsn_t *gsn = pdp->gsn; + struct ippoolm_t *ipp = (struct ippoolm_t *)pdp->peer; + + LOGPPDP(LOGL_INFO, pdp, "Deleting PDP context\n"); struct ippoolm_t *member = pdp->peer; if (pdp->peer) { send_trap(gsn, pdp, member, "imsi-rem-ip"); /* TRAP with IP removal */ - ippool_freeip(ippool, (struct ippoolm_t *)pdp->peer); + ippool_freeip(ipp->pool, ipp); } else - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Peer not defined!"); + LOGPPDP(LOGL_ERROR, pdp, "Cannot find/free IP Pool member\n"); if (gtp_kernel_tunnel_del(pdp)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot delete tunnel from kernel: %s\n", + LOGPPDP(LOGL_ERROR, pdp, "Cannot delete tunnel from kernel:%s\n", strerror(errno)); } @@ -236,31 +346,74 @@ return false; } +/* construct an IPCP PCO from up to two given DNS addreses */ +static int build_ipcp_pco(struct msgb *msg, uint8_t id, const struct in46_addr *dns1, + const struct in46_addr *dns2) +{ + uint8_t *len1, *len2; + uint8_t *start = msg->tail; + unsigned int len_appended; + + /* Three byte T16L header */ + msgb_put_u16(msg, 0x8021); /* IPCP */ + len1 = msgb_put(msg, 1); /* Length of contents: delay */ + + msgb_put_u8(msg, 0x02); /* ACK */ + msgb_put_u8(msg, id); /* ID: Needs to match request */ + msgb_put_u8(msg, 0x00); /* Length MSB */ + len2 = msgb_put(msg, 1); /* Length LSB: delay */ + + if (dns1 && dns1->len == 4) { + msgb_put_u8(msg, 0x81); /* DNS1 Tag */ + msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ + msgb_put_u32(msg, dns1->v4.s_addr); + } + + if (dns2 && dns2->len == 4) { + msgb_put_u8(msg, 0x83); /* DNS2 Tag */ + msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ + msgb_put_u32(msg, dns2->v4.s_addr); + } + + /* patch in length values */ + len_appended = msg->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; + + return 0; +} + /* process one PCO request from a MS/UE, putting together the proper responses */ -static void process_pco(struct pdp_t *pdp) +static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + unsigned int i; + + OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ /* FIXME: also check if primary / secondary DNS was requested */ if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { /* FIXME: properly implement this for IPCP */ - uint8_t *cur = msgb_put(msg, pco.l-1); - memcpy(cur, pco.v+1, pco.l-1); + build_ipcp_pco(msg, 0, &apn->v4.cfg.dns[0], &apn->v4.cfg.dns[1]); } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { - if (dns1.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); - if (dns2.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + if (i46a->len != 16) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); + } } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { - if (dns1.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); - if (dns2.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + if (i46a->len != 4) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); + } } if (msgb_length(msg) > 1) { @@ -274,11 +427,29 @@ int create_context_ind(struct pdp_t *pdp) { + static char name_buf[256]; + struct gsn_t *gsn = pdp->gsn; + struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr; struct ippoolm_t *member; + struct apn_ctx *apn; int rc; - DEBUGP(DGGSN, "Received create PDP context request\n"); + osmo_apn_to_str(name_buf, pdp->apn_req.v, pdp->apn_req.l); + + LOGPPDP(LOGL_DEBUG, pdp, "Processing create PDP context request for APN '%s'\n", name_buf); + + /* First find an exact APN name match */ + apn = ggsn_find_apn(ggsn, name_buf); + /* then try default (if any) */ + if (!apn) + apn = ggsn->cfg.default_apn; + if (!apn) { + /* no APN found for what user requested */ + LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_MISSING_APN); + return 0; + } /* FIXME: we manually force all context requests to dynamic here! */ if (pdp->eua.l > 2) @@ -290,21 +461,30 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + LOGPPDP(LOGL_ERROR, pdp, "Cannot decode EUA from MS/SGSN: %s\n", osmo_hexdump(pdp->eua.v, pdp->eua.l)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); return 0; } - rc = ippool_newip(ippool, &member, &addr, 0); - if (rc < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); - gtp_create_context_resp(gsn, pdp, -rc); - return 0; /* Allready in use, or no more available */ - } + if (addr.len == sizeof(struct in_addr)) { + rc = ippool_newip(apn->v4.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + in46a_to_eua(&member->addr, &pdp->eua); - if (addr.len == sizeof(struct in6_addr)) { + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ + if (gtp_kernel_tunnel_add(pdp) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; + } + } else if (addr.len == sizeof(struct in6_addr)) { struct in46_addr tmp; + rc = ippool_newip(apn->v6.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + /* IPv6 doesn't really send the real/allocated address at this point, but just * the link-identifier which the MS shall use for router solicitation */ tmp.len = addr.len; @@ -314,43 +494,46 @@ memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); in46a_to_eua(&tmp, &pdp->eua); } else - in46a_to_eua(&member->addr, &pdp->eua); - pdp->peer = member; - pdp->ipif = tun; /* TODO */ - member->peer = pdp; + OSMO_ASSERT(0); - /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ - if (gtp_kernel_tunnel_add(pdp) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot add tunnel to kernel: %s\n", strerror(errno)); - gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); - return 0; - } + pdp->peer = member; + pdp->ipif = apn->tun.tun; /* TODO */ + member->peer = pdp; if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } - process_pco(pdp); + process_pco(apn, pdp); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ + +err_pool_full: + LOGPPDP(LOGL_ERROR, pdp, "Cannot allocate IP address from pool (full!)\n"); + gtp_create_context_resp(gsn, pdp, -rc); + return 0; /* Already in use, or no more available */ } -/* Callback for receiving messages from tun */ -int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) +/* Internet-originated IP packet, needs to be sent via GTP towards MS */ +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { + struct apn_ctx *apn = tun->priv; struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + struct ippool_t *pool; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + pool = apn->v4.pool; } else if (iph->version == 6) { /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct @@ -358,20 +541,25 @@ * prefix, i.e. the first 8 bytes of the address */ dst.len = 8; dst.v6 = ip6h->ip6_dst; + pool = apn->v6.pool; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); + LOGP(DTUN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } - DEBUGP(DGGSN, "Received packet from tun!\n"); + /* IPv6 packet but no IPv6 pool, or IPv4 packet with no IPv4 pool */ + if (!pool) + return 0; - if (ippool_getip(ippool, &ipm, &dst)) { - DEBUGP(DGGSN, "Received packet with no destination!!!\n"); + DEBUGP(DTUN, "Received packet from tun!\n"); + + if (ippool_getip(pool, &ipm, &dst)) { + DEBUGP(DTUN, "Received packet with no PDP contex!!\n"); return 0; } if (ipm->peer) /* Check if a peer protocol is defined */ - gtp_data_req(gsn, (struct pdp_t *)ipm->peer, pack, len); + gtp_data_req(apn->ggsn->gsn, (struct pdp_t *)ipm->peer, pack, len); return 0; } @@ -380,435 +568,303 @@ .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } }; -int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) +/* MS-originated GTP1-U packet, needs to be sent via TUN device */ +static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + LOGPPDP(LOGL_DEBUG, pdp, "Packet received: forwarding to tun\n"); switch (iph->version) { case 6: /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(gsn, pdp, pack, len); + return handle_router_mcast(pdp->gsn, pdp, pack, len); break; case 4: break; default: - LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", + osmo_hexdump(pack, len)); return -1; } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } +static char *config_file = "openggsn.cfg"; + +/* callback for tun device osmocom select loop integration */ +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct apn_ctx *apn = fd->data; + + OSMO_ASSERT(what & BSC_FD_READ); + + return tun_decaps(apn->tun.tun); +} + +/* callback for libgtp osmocom select loop integration */ +static int ggsn_gtp_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct ggsn_ctx *ggsn = fd->data; + int rc; + + OSMO_ASSERT(what & BSC_FD_READ); + + switch (fd->priv_nr) { + case 0: + rc = gtp_decaps0(ggsn->gsn); + break; + case 1: + rc = gtp_decaps1c(ggsn->gsn); + break; + case 2: + rc = gtp_decaps1u(ggsn->gsn); + break; + default: + OSMO_ASSERT(0); + break; + } + return rc; +} + +static void ggsn_gtp_tmr_start(struct ggsn_ctx *ggsn) +{ + struct timeval next; + + /* Retrieve next retransmission as timeval */ + gtp_retranstimeout(ggsn->gsn, &next); + + /* re-schedule the timer */ + osmo_timer_schedule(&ggsn->gtp_timer, next.tv_sec, next.tv_usec/1000); +} + +/* timer callback for libgtp retransmission and ping */ +static void ggsn_gtp_tmr_cb(void *data) +{ + struct ggsn_ctx *ggsn = data; + + /* do all the retransmissions as needed */ + gtp_retrans(ggsn->gsn); + + ggsn_gtp_tmr_start(ggsn); +} + +/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ +static void signal_handler(int s) +{ + LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); + switch (s) { + case SIGINT: + LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); + end = 1; + break; + case SIGABRT: + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_ggsn_ctx, stderr); + break; + case SIGUSR2: + talloc_report_full(tall_vty_ctx, stderr); + break; + default: + break; + } +} + + +/* Start a given GGSN */ +int ggsn_start(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + int rc; + + if (ggsn->started) + return 0; + + LOGPGGSN(LOGL_INFO, ggsn, "Starting GGSN\n"); + + /* Start libgtp listener */ + if (gtp_new(&ggsn->gsn, ggsn->cfg.state_dir, &ggsn->cfg.listen_addr.v4, GTP_MODE_GGSN)) { + LOGPGGSN(LOGL_ERROR, ggsn, "Failed to create GTP: %s\n", strerror(errno)); + return -1; + } + ggsn->gsn->priv = ggsn; + + /* Register File Descriptors */ + osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); + rc = osmo_fd_register(&ggsn->gtp_fd0); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1c, ggsn->gsn->fd1c, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 1); + rc = osmo_fd_register(&ggsn->gtp_fd1c); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1u, ggsn->gsn->fd1u, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 2); + rc = osmo_fd_register(&ggsn->gtp_fd1u); + OSMO_ASSERT(rc == 0); + + /* Start GTP re-transmission timer */ + osmo_timer_setup(&ggsn->gtp_timer, ggsn_gtp_tmr_cb, ggsn); + + gtp_set_cb_data_ind(ggsn->gsn, encaps_tun); + gtp_set_cb_delete_context(ggsn->gsn, delete_context); + gtp_set_cb_create_context_ind(ggsn->gsn, create_context_ind); + + LOGPGGSN(LOGL_NOTICE, ggsn, "Successfully started\n"); + ggsn->started = true; + + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_start(apn); + + return 0; +} + +/* Stop a given GGSN */ +int ggsn_stop(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + + if (!ggsn->started) + return 0; + + /* iterate over all APNs and stop them */ + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_stop(apn, true); + + osmo_timer_del(&ggsn->gtp_timer); + + osmo_fd_unregister(&ggsn->gtp_fd1u); + osmo_fd_unregister(&ggsn->gtp_fd1c); + osmo_fd_unregister(&ggsn->gtp_fd0); + + if (ggsn->gsn) { + gtp_free(ggsn->gsn); + ggsn->gsn = NULL; + } + + ggsn->started = false; + return 0; +} + +static void print_usage() +{ + printf("Usage: osmo-ggsn [-h] [-D] [-c configfile] [-V]\n"); +} + +static void print_help() +{ + printf( " Some useful help...\n" + " -h --help This help text\n" + " -D --daemonize Fork the process into a background daemon\n" + " -c --config-file filename The config file to use\n" + " -V --version Print the version of OsmoGGSN\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' }, + { "daemonize", 0, 0, 'D' }, + { "config-file", 1, 0, 'c' }, + { "version", 0, 0, 'V' }, + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "hdc:V", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_usage(); + print_help(); + exit(0); + case 'D': + daemonize = 1; + break; + case 'c': + config_file = optarg; + break; + case 'V': + print_version(1); + exit(0); + break; + } + } +} + int main(int argc, char **argv) { - /* gengeopt declarations */ - struct gengetopt_args_info args_info; - - struct hostent *host; + struct ggsn_ctx *ggsn; + int rc; /* Handle keyboard interrupt SIGINT */ - struct sigaction s; - s.sa_handler = (void *)signal_handler; - if ((0 != sigemptyset(&s.sa_mask)) && debug) - printf("sigemptyset failed.\n"); - s.sa_flags = SA_RESETHAND; - if ((sigaction(SIGINT, &s, NULL) != 0) && debug) - printf("Could not register SIGINT signal handler.\n"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + msgb_talloc_ctx_init(tall_ggsn_ctx, 0); - fd_set fds; /* For select() */ - struct timeval idleTime; /* How long to select() */ + signal(SIGINT, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); - int timelimit; /* Number of seconds to be connected */ - int starttime; /* Time program was started */ - + osmo_init_ignore_signals(); osmo_init_logging(&log_info); + osmo_stats_init(tall_ggsn_ctx); - if (cmdline_parser(argc, argv, &args_info) != 0) - exit(1); - if (args_info.debug_flag) { - printf("listen: %s\n", args_info.listen_arg); - if (args_info.conf_arg) - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp_linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); + vty_init(&g_vty_info); + logging_vty_add_cmds(NULL); + osmo_stats_vty_add_cmds(&log_info); + ggsn_vty_init(); + ctrl_vty_init(tall_ggsn_ctx); + + handle_options(argc, argv); + + rate_ctr_init(tall_ggsn_ctx); + + rc = vty_read_config_file(config_file, NULL); + if (rc < 0) { + fprintf(stderr, "Failed to open config file: '%s'\n", config_file); + exit(2); } - /* Try out our new parser */ - - if (cmdline_parser_configfile(args_info.conf_arg, &args_info, 0, 0, 0) - != 0) + rc = telnet_init_dynif(tall_ggsn_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_GGSN); + if (rc < 0) exit(1); - /* Open a log file */ - if (args_info.logfile_arg) { - struct log_target *tgt; - int lvl; - - tgt = log_target_find(LOG_TGT_TYPE_FILE, args_info.logfile_arg); - if (!tgt) { - tgt = log_target_create_file(args_info.logfile_arg); - if (!tgt) { - LOGP(DGGSN, LOGL_ERROR, - "Failed to create logfile: %s\n", - args_info.logfile_arg); - exit(1); - } - log_add_target(tgt); - } - log_set_all_filter(tgt, 1); - log_set_use_color(tgt, 0); - - if (args_info.loglevel_arg) { - lvl = log_parse_level(args_info.loglevel_arg); - log_set_log_level(tgt, lvl); - LOGP(DGGSN, LOGL_NOTICE, - "Set file log level to %s\n", - log_level_str(lvl)); - } - } - - if (args_info.debug_flag) { - printf("cmdline_parser_configfile\n"); - printf("listen: %s\n", args_info.listen_arg); - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp-linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); - } - - /* Handle each option */ - - /* debug */ - debug = args_info.debug_flag; - - /* listen */ - /* Do hostname lookup to translate hostname to IP address */ - /* Any port listening is not possible as a valid address is */ - /* required for create_pdp_context_response messages */ - if (args_info.listen_arg) { - if (!(host = gethostbyname(args_info.listen_arg))) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid listening address: %s!", - args_info.listen_arg); - exit(1); - } else { - memcpy(&listen_.s_addr, host->h_addr, host->h_length); - } - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Listening address must be specified! " - "Please use command line option --listen or " - "edit %s configuration file\n", args_info.conf_arg); + g_ctrlh = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); + if (!g_ctrlh) { + LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); exit(1); } - /* net */ - /* Store net as in_addr net and mask */ - if (args_info.net_arg) { - if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid network address: %s!", - args_info.net_arg); - exit(1); - } - /* default for network + destination address = net + 1 */ - netaddr = net; - in46a_inc(&netaddr); - destaddr = netaddr; - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Network address must be specified: %s!", - args_info.net_arg); - exit(1); - } - - /* dynip */ - struct in46_prefix i46p; - size_t prefixlen; - if (!args_info.dynip_arg) { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } else { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } - i46p.prefixlen = prefixlen; - if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); - exit(1); - } - - /* DNS1 and DNS2 */ - memset(&dns1, 0, sizeof(dns1)); - if (args_info.pcodns1_arg) { - size_t tmp; - if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - memset(&dns2, 0, sizeof(dns2)); - if (args_info.pcodns2_arg) { - size_t tmp; - if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); + if (daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); exit(1); } } - unsigned int cur = 0; - pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[cur++] = 0x80; /* IPCP */ - pco.v[cur++] = 0x21; - pco.v[cur++] = 0xFF; /* Length of contents */ - pco.v[cur++] = 0x02; /* ACK */ - pco.v[cur++] = 0x00; /* ID: Need to match request */ - pco.v[cur++] = 0x00; /* Length */ - pco.v[cur++] = 0xFF; /* overwritten */ - if (dns1.len == 4) { - pco.v[cur++] = 0x81; /* DNS 1 */ - pco.v[cur++] = 2 + dns1.len; - if (dns1.len == 4) - memcpy(&pco.v[cur], &dns1.v4, dns1.len); - else - memcpy(&pco.v[cur], &dns1.v6, dns1.len); - cur += dns1.len; - } - if (dns2.len == 4) { - pco.v[cur++] = 0x83; - pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ - if (dns2.len == 4) - memcpy(&pco.v[cur], &dns2.v4, dns2.len); - else - memcpy(&pco.v[cur], &dns2.v6, dns2.len); - cur += dns2.len; - } - pco.l = cur; - /* patch in length values */ - pco.v[3] = pco.l - 4; - pco.v[7] = pco.l - 4; - - /* ipup */ - ipup = args_info.ipup_arg; - - /* ipdown */ - ipdown = args_info.ipdown_arg; - - /* Timelimit */ - timelimit = args_info.timelimit_arg; - starttime = time(NULL); - +#if 0 /* qos */ qos.l = 3; qos.v[2] = (args_info.qos_arg) & 0xff; qos.v[1] = ((args_info.qos_arg) >> 8) & 0xff; qos.v[0] = ((args_info.qos_arg) >> 16) & 0xff; +#endif - /* apn */ - if (strlen(args_info.apn_arg) > (sizeof(apn.v) - 1)) { - LOGP(DGGSN, LOGL_ERROR, "Invalid APN\n"); - return -1; - } - apn.l = strlen(args_info.apn_arg) + 1; - apn.v[0] = (char)strlen(args_info.apn_arg); - strncpy((char *)&apn.v[1], args_info.apn_arg, sizeof(apn.v) - 1); - - /* foreground */ - /* If flag not given run as a daemon */ - if (!args_info.fg_flag) { - FILE *f; - int rc; - /* Close the standard file descriptors. */ - /* Is this really needed ? */ - f = freopen("/dev/null", "w", stdout); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdout to /dev/null"); - } - f = freopen("/dev/null", "w", stderr); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stderr to /dev/null"); - } - f = freopen("/dev/null", "r", stdin); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdin to /dev/null"); - } - rc = daemon(0, 0); - if (rc != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, rc, - "Could not daemonize"); - exit(1); - } + /* Main select loop */ + while (!end) { + osmo_select_main(0); } - /* pidfile */ - /* This has to be done after we have our final pid */ - if (args_info.pidfile_arg) { - log_pid(args_info.pidfile_arg); - } - - DEBUGP(DGGSN, "gtpclient: Initialising GTP tunnel\n"); - - if (gtp_new(&gsn, args_info.statedir_arg, &listen_, GTP_MODE_GGSN)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create gtp"); - exit(1); - } - if (gsn->fd0 > maxfd) - maxfd = gsn->fd0; - if (gsn->fd1c > maxfd) - maxfd = gsn->fd1c; - if (gsn->fd1u > maxfd) - maxfd = gsn->fd1u; - - /* use GTP kernel module for data packet encapsulation */ - if (args_info.gtp_linux_given) { - if (gtp_kernel_init(gsn, &net.v4, prefixlen, args_info.net_arg) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to initialize kernel GTP\n"); - goto err; - } - } - - gtp_set_cb_data_ind(gsn, encaps_tun); - gtp_set_cb_delete_context(gsn, delete_context); - gtp_set_cb_create_context_ind(gsn, create_context_ind); - - gsn->priv = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); - if (!gsn->priv) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); - exit(1); - } - - /* skip the configuration of the tun0 if we're using the gtp0 device */ - if (gtp_kernel_enabled()) - goto skip_tun; - - /* Create a tunnel interface */ - DEBUGP(DGGSN, "Creating tun interface\n"); - if (tun_new((struct tun_t **)&tun)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create tun"); - exit(1); - } - - DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); - exit(1); - } - - tun_set_cb_ind(tun, cb_tun_ind); - if (tun->fd > maxfd) - maxfd = tun->fd; - - if (ipup) - tun_runscript(tun, ipup); - -skip_tun: - - /******************************************************************/ - /* Main select loop */ - /******************************************************************/ - - while ((((starttime + timelimit) > time(NULL)) || (0 == timelimit)) - && (!end)) { - - FD_ZERO(&fds); - if (tun) - FD_SET(tun->fd, &fds); - FD_SET(gsn->fd0, &fds); - FD_SET(gsn->fd1c, &fds); - FD_SET(gsn->fd1u, &fds); - - gtp_retranstimeout(gsn, &idleTime); - switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) { - case -1: /* errno == EINTR : unblocked signal */ - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "select() returned -1"); - /* On error, select returns without modifying fds */ - FD_ZERO(&fds); - break; - case 0: - /* printf("Select returned 0\n"); */ - gtp_retrans(gsn); /* Only retransmit if nothing else */ - break; - default: - break; - } - - if (tun && tun->fd != -1 && FD_ISSET(tun->fd, &fds) && - tun_decaps(tun) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "TUN read failed (fd)=(%d)", tun->fd); - } - - if (FD_ISSET(gsn->fd0, &fds)) - gtp_decaps0(gsn); - - if (FD_ISSET(gsn->fd1c, &fds)) - gtp_decaps1c(gsn); - - if (FD_ISSET(gsn->fd1u, &fds)) - gtp_decaps1u(gsn); - - osmo_select_main(1); - } -err: - gtp_kernel_stop(); - cmdline_parser_free(&args_info); - ippool_free(ippool); - gtp_free(gsn); - if (tun) - tun_free(tun); + llist_for_each_entry(ggsn, &g_ggsn_list, list) + ggsn_stop(ggsn); return 1; - } diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h new file mode 100644 index 0000000..bab6cf7 --- /dev/null +++ b/ggsn/ggsn.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "../lib/tun.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "../lib/in46_addr.h" +#include "../gtp/gtp.h" + +#define APN_TYPE_IPv4 0x01 /* v4-only */ +#define APN_TYPE_IPv6 0x02 /* v6-only */ +#define APN_TYPE_IPv4v6 0x04 /* v4v6 dual-stack */ + +struct ggsn_ctx; + +struct apn_ctx_ip { + struct { + struct in46_prefix ifconfig_prefix; + struct in46_prefix static_prefix; + struct in46_prefix dynamic_prefix; + /* v4 DNS server names */ + struct in46_addr dns[2]; + } cfg; + + /* v4 address pool */ + struct ippool_t *pool; +}; + +struct apn_name { + struct llist_head list; + char *name; +}; + +enum apn_gtpu_mode { + APN_GTPU_MODE_TUN = 0, /* default */ + APN_GTPU_MODE_KERNEL_GTP, +}; + +struct apn_ctx { + /* list of APNs inside GGSN */ + struct llist_head list; + /* back-pointer to GGSN */ + struct ggsn_ctx *ggsn; + + bool started; + + struct { + /* Primary name */ + char *name; + /* Description string */ + char *description; + /* List of secondary APN names */ + struct llist_head name_list; + /* types supported address types on this APN */ + uint32_t apn_type_mask; + /* GTP-U via TUN device or in Linux kernel */ + enum apn_gtpu_mode gtpu_mode; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* corresponding tun device */ + struct { + struct { + /* name of the network device */ + char *dev_name; + /* ip-up and ip-down script names/paths */ + char *ipup_script; + char *ipdown_script; + } cfg; + struct tun_t *tun; + struct osmo_fd fd; + } tun; + + struct apn_ctx_ip v4; + struct apn_ctx_ip v6; +}; + +struct ggsn_ctx { + /* global list of GGSNs */ + struct llist_head list; + + /* list of APNs in this GGSN */ + struct llist_head apn_list; + + bool started; + + struct { + char *name; + /* Description string */ + char *description; + /* an APN that shall be used as default for any non-matching APN */ + struct apn_ctx *default_apn; + /* ADdress to which we listen for GTP */ + struct in46_addr listen_addr; + /* directory for state file */ + char *state_dir; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* The libgtp (G)GSN instance, i.e. what listens to GTP */ + struct gsn_t *gsn; + + /* osmo-fd for gsn */ + struct osmo_fd gtp_fd0; + struct osmo_fd gtp_fd1c; + struct osmo_fd gtp_fd1u; + + struct osmo_timer_list gtp_timer; +}; + +/* ggsn_vty.c */ +extern struct llist_head g_ggsn_list; +extern struct vty_app_info g_vty_info; +extern int ggsn_vty_init(void); +struct ggsn_ctx *ggsn_find(const char *name); +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name); +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name); +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name); + +/* ggsn.c */ +extern void *tall_ggsn_ctx; +extern int ggsn_start(struct ggsn_ctx *ggsn); +extern int ggsn_stop(struct ggsn_ctx *ggsn); +extern int apn_start(struct apn_ctx *apn); +extern int apn_stop(struct apn_ctx *apn, bool force); diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c new file mode 100644 index 0000000..f23a298 --- /dev/null +++ b/ggsn/ggsn_vty.c @@ -0,0 +1,890 @@ +/* + * (C) 2017 by Harald Welte + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +#include "ggsn.h" + +#define PREFIX_STR "Prefix (Network/Netmask)\n" +#define IFCONFIG_STR "GGSN-based interface configuration\n" +#define GGSN_STR "Gateway GPRS Support NODE (GGSN)\n" + +LLIST_HEAD(g_ggsn_list); + +enum ggsn_vty_node { + GGSN_NODE = _LAST_OSMOVTY_NODE + 1, + APN_NODE, +}; + +struct ggsn_ctx *ggsn_find(const char *name) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + if (!strcmp(ggsn->cfg.name, name)) + return ggsn; + } + return NULL; +} + +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name) +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(name); + if (ggsn) + return ggsn; + + ggsn = talloc_zero(ctx, struct ggsn_ctx); + if (!ggsn) + return NULL; + + ggsn->cfg.name = talloc_strdup(ggsn, name); + ggsn->cfg.state_dir = talloc_strdup(ggsn, "/tmp"); + ggsn->cfg.shutdown = true; + INIT_LLIST_HEAD(&ggsn->apn_list); + + llist_add_tail(&ggsn->list, &g_ggsn_list); + return ggsn; +} + +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn; + + llist_for_each_entry(apn, &ggsn->apn_list, list) { + if (!strcmp(apn->cfg.name, name)) + return apn; + } + return NULL; +} + +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn = ggsn_find_apn(ggsn, name); + if (apn) + return apn; + + apn = talloc_zero(ggsn, struct apn_ctx); + if (!apn) + return NULL; + apn->ggsn = ggsn; + apn->cfg.name = talloc_strdup(apn, name); + apn->cfg.shutdown = true; + INIT_LLIST_HEAD(&apn->cfg.name_list); + + llist_add_tail(&apn->list, &ggsn->apn_list); + return apn; +} + +/* GGSN Node */ + +static struct cmd_node ggsn_node = { + GGSN_NODE, + "%s(config-ggsn)# ", + 1, +}; + +DEFUN(cfg_ggsn, cfg_ggsn_cmd, + "ggsn NAME", + "Configure the Gateway GPRS Support Node\n" "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find_or_create(tall_ggsn_ctx, argv[0]); + if (!ggsn) + return CMD_WARNING; + + vty->node = GGSN_NODE; + vty->index = ggsn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ggsn, cfg_no_ggsn_cmd, + "no ggsn NAME", + NO_STR "Remove the named Gateway GPRS Support Node\n" + "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!ggsn->cfg.shutdown) { + vty_out(vty, "%% GGSN %s is still active, please shutdown first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!llist_empty(&ggsn->apn_list)) { + vty_out(vty, "%% GGSN %s still has APNs configured, please remove first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&ggsn->list); + talloc_free(ggsn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, + "gtp local-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address for the local GTP bind\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_state_dir, cfg_ggsn_state_dir_cmd, + "gtp state-dir PATH", + "GTP Parameters\n" + "Set the directory for the GTP State file\n" + "Local Directory\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + osmo_talloc_replace_string(ggsn, &ggsn->cfg.state_dir, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_apn, cfg_ggsn_apn_cmd, + "apn NAME", "APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_or_create_apn(ggsn, argv[0]); + if (!apn) + return CMD_WARNING; + + vty->node = APN_NODE; + vty->index = apn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_apn, cfg_ggsn_no_apn_cmd, + "no apn NAME", + NO_STR "Remove APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!apn->cfg.shutdown) { + vty_out(vty, "%% APN %s still active, please shutdown first%s", + apn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&apn->list); + talloc_free(apn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_default_apn, cfg_ggsn_default_apn_cmd, + "default-apn NAME", + "Set a default-APN to be used if no other APN matches\n" + "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No APN of name '%s' found%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + ggsn->cfg.default_apn = apn; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_default_apn, cfg_ggsn_no_default_apn_cmd, + "no default-apn", + NO_STR "Remove default-APN to be used if no other APN matches\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + ggsn->cfg.default_apn = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_shutdown, cfg_ggsn_shutdown_cmd, + "shutdown ggsn", + "Put the GGSN in administrative shut-down\n" GGSN_STR) +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (!ggsn->cfg.shutdown) { + if (ggsn_stop(ggsn)) { + vty_out(vty, "%% Failed to shutdown GGSN%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_shutdown, cfg_ggsn_no_shutdown_cmd, + "no shutdown ggsn", + NO_STR GGSN_STR "Remove the GGSN from administrative shut-down\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (ggsn->cfg.shutdown) { + if (ggsn_start(ggsn) < 0) { + vty_out(vty, "%% Failed to start GGSN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + +/* APN Node */ + +static struct cmd_node apn_node = { + APN_NODE, + "%s(config-ggsn-apn)# ", + 1, +}; + +static const struct value_string pdp_type_names[] = { + { APN_TYPE_IPv4, "v4" }, + { APN_TYPE_IPv6, "v6" }, + { APN_TYPE_IPv4v6, "v4v6" }, + { 0, NULL } +}; + +static const struct value_string apn_gtpu_mode_names[] = { + { APN_GTPU_MODE_TUN, "tun" }, + { APN_GTPU_MODE_KERNEL_GTP, "kernel-gtp" }, + { 0, NULL } +}; + + +#define V4V6V46_STRING "IPv4(-only) PDP Type\n" \ + "IPv6(-only) PDP Type\n" \ + "IPv4v6 (dual-stack) PDP Type\n" + +DEFUN(cfg_apn_type_support, cfg_apn_type_support_cmd, + "type-support (v4|v6|v4v6)", + "Enable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask |= type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_type_support, cfg_apn_no_type_support_cmd, + "no type-support (v4|v6|v4v6)", + NO_STR "Disable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask &= ~type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_gtpu_mode, cfg_apn_gtpu_mode_cmd, + "gtpu-mode (tun|kernel-gtp)", + "Set the Mode for this APN (tun or Linux Kernel GTP)\n" + "GTP-U in userspace using TUN device\n" + "GTP-U in kernel using Linux Kernel GTP\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + apn->cfg.gtpu_mode = get_string_value(apn_gtpu_mode_names, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_tun_dev_name, cfg_apn_tun_dev_name_cmd, + "tun-device NAME", + "Configure tun device name\n" + "TUN device name") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.dev_name, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipup_script, cfg_apn_ipup_script_cmd, + "ipup-script PATH", + "Configure name/path of ip-up script\n" + "File/Path name of ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipup_script, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipup_script, cfg_apn_no_ipup_script_cmd, + "no ipup-script", + NO_STR "Disable ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipup_script); + apn->tun.cfg.ipup_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipdown_script, cfg_apn_ipdown_script_cmd, + "ipdown-script PATH", + "Configure name/path of ip-down script\n" + "File/Path name of ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipdown_script, argv[0]); + return CMD_SUCCESS; +} + +/* convert prefix from "A.B.C.D/M" notation to in46_prefix */ +static void str2prefix(struct in46_prefix *pfx, const char *in) +{ + size_t t; + + ippool_aton(&pfx->addr, &t, in, 0); + pfx->prefixlen = t; +} + +DEFUN(cfg_apn_no_ipdown_script, cfg_apn_no_ipdown_script_cmd, + "no ipdown-script", + NO_STR "Disable ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipdown_script); + apn->tun.cfg.ipdown_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_prefix, cfg_apn_ip_prefix_cmd, + "ip prefix (static|dynamic) A.B.C.D/M", + IP_STR PREFIX_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + /* first update our parsed prefix */ + if (!strcmp(argv[0], "static")) + pfx = &apn->v4.cfg.static_prefix; + else + pfx = &apn->v4.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_ifconfig, cfg_apn_ip_ifconfig_cmd, + "ip ifconfig A.B.C.D/M", + IP_STR IFCONFIG_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v4.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ip_ifconfig, cfg_apn_no_ip_ifconfig_cmd, + "no ip ifconfig", + NO_STR IP_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v4.cfg.ifconfig_prefix, 0, sizeof(apn->v4.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_prefix, cfg_apn_ipv6_prefix_cmd, + "ipv6 prefix (static|dynamic) X:X::X:X/M", + IP6_STR PREFIX_STR "IPv6 Address/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + if (!strcmp(argv[0], "static")) + pfx = &apn->v6.cfg.static_prefix; + else + pfx = &apn->v6.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_ifconfig, cfg_apn_ipv6_ifconfig_cmd, + "ipv6 ifconfig X:X::X:X/M", + IP6_STR IFCONFIG_STR "IPv6 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v6.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipv6_ifconfig, cfg_apn_no_ipv6_ifconfig_cmd, + "no ipv6 ifconfig", + NO_STR IP6_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v6.cfg.ifconfig_prefix, 0, sizeof(apn->v6.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +#define DNS_STRINGS "Configure DNS Server\n" "primary/secondary DNS\n" "IP address of DNS Sever\n" + +DEFUN(cfg_apn_ip_dns, cfg_apn_ip_dns_cmd, + "ip dns <0-1> A.B.C.D", + IP_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v4.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_dns, cfg_apn_ipv6_dns_cmd, + "ipv6 dns <0-1> X:X::X:X", + IP6_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v6.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_dns, cfg_apn_no_dns_cmd, + "no (ip|ipv6) dns <0-1>", + NO_STR IP_STR IP6_STR "Disable DNS Server\n" "primary/secondary DNS\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_addr *a; + int idx = atoi(argv[1]); + + if (!strcmp(argv[0], "ip")) + a = &apn->v4.cfg.dns[idx]; + else + a = &apn->v6.cfg.dns[idx]; + + memset(a, 0, sizeof(*a)); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, + "shutdown", + "Put the APN in administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (!apn->cfg.shutdown) { + if (apn_stop(apn, false)) { + vty_out(vty, "%% Failed to Stop APN%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_shutdown, cfg_apn_no_shutdown_cmd, + "no shutdown", + NO_STR "Remove the APN from administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (apn->cfg.shutdown) { + if (apn_start(apn) < 0) { + vty_out(vty, "%% Failed to start APN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + + +static void vty_dump_prefix(struct vty *vty, const char *pre, const struct in46_prefix *pfx) +{ + vty_out(vty, "%s %s%s", pre, in46p_ntoa(pfx), VTY_NEWLINE); +} + +static void config_write_apn(struct vty *vty, struct apn_ctx *apn) +{ + unsigned int i; + + vty_out(vty, " apn %s%s", apn->cfg.name, VTY_NEWLINE); + if (apn->cfg.description) + vty_out(vty, " description %s%s", apn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtpu-mode %s%s", get_value_string(apn_gtpu_mode_names, apn->cfg.gtpu_mode), + VTY_NEWLINE); + if (apn->tun.cfg.dev_name) + vty_out(vty, " tun-device %s%s", apn->tun.cfg.dev_name, VTY_NEWLINE); + if (apn->tun.cfg.ipup_script) + vty_out(vty, " ipup-script %s%s", apn->tun.cfg.ipup_script, VTY_NEWLINE); + if (apn->tun.cfg.ipdown_script) + vty_out(vty, " ipdown-script %s%s", apn->tun.cfg.ipdown_script, VTY_NEWLINE); + + for (i = 0; i < 32; i++) { + if (!(apn->cfg.apn_type_mask & (1 << i))) + continue; + vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), + VTY_NEWLINE); + } + + /* IPv4 prefixes + DNS */ + if (apn->v4.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix static", &apn->v4.cfg.static_prefix); + if (apn->v4.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix dynamic", &apn->v4.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + if (!apn->v4.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v4.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v4.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ip ifconfig ", &apn->v4.cfg.ifconfig_prefix); + + /* IPv6 prefixes + DNS */ + if (apn->v6.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix static", &apn->v6.cfg.static_prefix); + if (apn->v6.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix dynamic", &apn->v6.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + if (!apn->v6.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v6.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); + + /* must be last */ + vty_out(vty, " %sshutdown%s", apn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); +} + +static int config_write_ggsn(struct vty *vty) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + struct apn_ctx *apn; + vty_out(vty, "ggsn %s%s", ggsn->cfg.name, VTY_NEWLINE); + if (ggsn->cfg.description) + vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); + vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + llist_for_each_entry(apn, &ggsn->apn_list, list) + config_write_apn(vty, apn); + if (ggsn->cfg.default_apn) + vty_out(vty, " default-apn %s%s", ggsn->cfg.default_apn->cfg.name, VTY_NEWLINE); + /* must be last */ + vty_out(vty, " %sshutdown ggsn%s", ggsn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); + } + + return 0; +} + +static const char *print_gsnaddr(const struct ul16_t *in) +{ + struct in46_addr in46; + + in46.len = in->l; + OSMO_ASSERT(in->l <= sizeof(in46.v6)); + memcpy(&in46.v6, in->v, in->l); + + return in46a_ntoa(&in46); +} + +static void show_one_pdp(struct vty *vty, struct pdp_t *pdp) +{ + struct in46_addr eua46; + + vty_out(vty, "IMSI: %s, NSAPI: %u, MSISDN: %s%s", imsi_gtp2str(&pdp->imsi), pdp->nsapi, + osmo_hexdump_nospc(pdp->msisdn.v, pdp->msisdn.l), VTY_NEWLINE); + + vty_out(vty, " Control: %s:%08x ", print_gsnaddr(&pdp->gsnlc), pdp->teic_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnrc), pdp->teic_gn, VTY_NEWLINE); + + vty_out(vty, " Data: %s:%08x ", print_gsnaddr(&pdp->gsnlu), pdp->teid_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnru), pdp->teid_gn, VTY_NEWLINE); + + in46a_from_eua(&pdp->eua, &eua46); + vty_out(vty, " End-User Address: %s%s", in46a_ntoa(&eua46), VTY_NEWLINE); +} + +DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, + "show pdp-context imsi IMSI [<0-15>]", + SHOW_STR "Display information on PDP Context\n" + "PDP contexts for given IMSI\n" + "PDP context for given NSAPI\n") +{ + uint64_t imsi = strtoull(argv[0], NULL, 10); + unsigned int nsapi; + struct pdp_t *pdp; + int num_found = 0; + + if (argc > 1) { + nsapi = atoi(argv[1]); + if (pdp_getimsi(&pdp, imsi, nsapi)) { + show_one_pdp(vty, pdp); + num_found++; + } + } else { + for (nsapi = 0; nsapi < PDP_MAXNSAPI; nsapi++) { + if (pdp_getimsi(&pdp, imsi, nsapi)) + continue; + show_one_pdp(vty, pdp); + num_found++; + } + } + if (num_found == 0) { + vty_out(vty, "%% No such PDP context found%s", VTY_NEWLINE); + return CMD_WARNING; + } else + return CMD_SUCCESS; +} + +/* show all (active) PDP contexts within a pool */ +static void ippool_show_pdp_contexts(struct vty *vty, struct ippool_t *pool) +{ + unsigned int i; + + if (!pool) + return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + if (member->inuse == 0) + continue; + show_one_pdp(vty, member->peer); + } +} + +/* show all (active) PDP contexts within an APN */ +static void apn_show_pdp_contexts(struct vty *vty, struct apn_ctx *apn) +{ + ippool_show_pdp_contexts(vty, apn->v4.pool); + ippool_show_pdp_contexts(vty, apn->v6.pool); +} + +DEFUN(show_pdpctx, show_pdpctx_cmd, + "show pdp-context ggsn NAME [apn APN]", + SHOW_STR "Show PDP Context Information\n" + GGSN_STR "GGSN Name\n") // FIXME +{ + struct ggsn_ctx *ggsn; + struct apn_ctx *apn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (argc < 2) { + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_show_pdp_contexts(vty, apn); + } else { + apn = ggsn_find_apn(ggsn, argv[1]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + apn_show_pdp_contexts(vty, apn); + } + + return CMD_SUCCESS; +} + +static void show_apn(struct vty *vty, struct apn_ctx *apn) +{ + vty_out(vty, " APN: %s%s", apn->cfg.name, VTY_NEWLINE); + /* FIXME */ +} + +static void show_one_ggsn(struct vty *vty, struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + vty_out(vty, "GGSN %s: Bound to %s%s", ggsn->cfg.name, in46a_ntoa(&ggsn->cfg.listen_addr), + VTY_NEWLINE); + /* FIXME */ + + llist_for_each_entry(apn, &ggsn->apn_list, list) + show_apn(vty, apn); +} + +DEFUN(show_ggsn, show_ggsn_cmd, + "show ggsn [NAME]", + SHOW_STR "Display information on the GGSN\n") +{ + struct ggsn_ctx *ggsn; + + if (argc == 0) { + llist_for_each_entry(ggsn, &g_ggsn_list, list) + show_one_ggsn(vty, ggsn); + } else { + ggsn = ggsn_find(argv[0]); + if (!ggsn) + return CMD_WARNING; + show_one_ggsn(vty, ggsn); + } + + return CMD_SUCCESS; +} + +int ggsn_vty_init(void) +{ + install_element_ve(&show_pdpctx_cmd); + install_element_ve(&show_pdpctx_imsi_cmd); + install_element_ve(&show_ggsn_cmd); + + install_element(CONFIG_NODE, &cfg_ggsn_cmd); + install_element(CONFIG_NODE, &cfg_no_ggsn_cmd); + install_node(&ggsn_node, config_write_ggsn); + vty_install_default(GGSN_NODE); + install_element(GGSN_NODE, &cfg_description_cmd); + install_element(GGSN_NODE, &cfg_no_description_cmd); + install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); + install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_default_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_default_apn_cmd); + + install_node(&apn_node, NULL); + vty_install_default(APN_NODE); + install_element(APN_NODE, &cfg_description_cmd); + install_element(APN_NODE, &cfg_no_description_cmd); + install_element(APN_NODE, &cfg_apn_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_no_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_gtpu_mode_cmd); + install_element(APN_NODE, &cfg_apn_type_support_cmd); + install_element(APN_NODE, &cfg_apn_no_type_support_cmd); + install_element(APN_NODE, &cfg_apn_tun_dev_name_cmd); + install_element(APN_NODE, &cfg_apn_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_ip_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ip_dns_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_dns_cmd); + install_element(APN_NODE, &cfg_apn_no_dns_cmd); + install_element(APN_NODE, &cfg_apn_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + + return 0; +} + +static int ggsn_vty_is_config_node(struct vty *vty, int node) +{ + switch (node) { + case GGSN_NODE: + case APN_NODE: + return 1; + default: + return 0; + } +} + +static int ggsn_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + case GGSN_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + vty->index_sub = NULL; + break; + case APN_NODE: + vty->node = GGSN_NODE; + { + struct apn_ctx *apn = vty->index; + vty->index = apn->ggsn; + vty->index_sub = &apn->ggsn->cfg.description; + } + break; + } + + return vty->node; +} + +static const char ggsn_copyright[] = + "Copyright (C) 2011-2017 Harald Welte \r\n" + "Copyright (C) 2012-2017 Holger Hans Peter Freyther \r\n" + "Copyright (C) 2012-2017 sysmocom - s.f.m.c. GmbH\r\n" + "Copyright (C) 2002-2005 Mondru AB\r\n" + "License GPLv2: GNU GPL version 2 \r\n" + "This is free software: you are free to change and redistribute it.\r\n" + "There is NO WARRANTY, to the extent permitted by law.\r\n"; + +struct vty_app_info g_vty_info = { + .name = "OpenGGSN", + .version = PACKAGE_VERSION, + .copyright = ggsn_copyright, + .go_parent_cb = ggsn_vty_go_parent, + .is_config_node = ggsn_vty_is_config_node, +}; diff --git a/lib/tun.c b/lib/tun.c index e8368e5..76ac379 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -583,7 +583,7 @@ return tun_route(this, dst, gateway, mask, 1); } -int tun_new(struct tun_t **tun) +int tun_new(struct tun_t **tun, const char *dev_name) { #if defined(__linux__) @@ -615,6 +615,8 @@ /* Set device flags. For some weird reason this is also the method used to obtain the network interface name */ memset(&ifr, 0, sizeof(ifr)); + if (dev_name) + strcpy(ifr.ifr_name, dev_name); ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); diff --git a/lib/tun.h b/lib/tun.h index 67ef39d..50ac806 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -65,7 +65,7 @@ void *priv; }; -extern int tun_new(struct tun_t **tun); +extern int tun_new(struct tun_t **tun, const char *dev_name); extern int tun_free(struct tun_t *tun); extern int tun_decaps(struct tun_t *this); extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1f0b3f9..ed1fb93 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1461,7 +1461,7 @@ if (options.createif) { printf("Setting up interface\n"); /* Create a tunnel interface */ - if (tun_new((struct tun_t **)&tun)) { + if (tun_new((struct tun_t **)&tun, NULL)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Failed to create tun"); exit(1); -- To view, visit https://gerrit.osmocom.org/3857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:24 +0000 Subject: osmo-ggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:28 +0000 Subject: osmo-ggsn[master]: Documentation update: Remove NEWS, README.Solaris, update RE... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:30 +0000 Subject: osmo-ggsn[master]: ggsn: Handle SIGTERM like SIGINT and terminate In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:39 +0000 Subject: osmo-ggsn[master]: Rename OpenGGSN to OsmoGGSN In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:42 +0000 Subject: osmo-ggsn[master]: remove bogus 'version' script In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:44 +0000 Subject: osmo-ggsn[master]: Move examples to doc/examples and include them in DIST In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:46 +0000 Subject: osmo-ggsn[master]: ggsn: Add ability to specify local IP addresses for GTP-C an... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:56 +0000 Subject: [MERGED] osmo-ggsn[master]: Move examples to doc/examples and include them in DIST In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move examples to doc/examples and include them in DIST ...................................................................... Move examples to doc/examples and include them in DIST Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 --- M configure.ac R contrib/osmo-ggsn.init M debian/osmo-ggsn.examples M doc/Makefile.am A doc/examples/Makefile.am R doc/examples/firewall R doc/examples/osmo-ggsn.cfg R doc/examples/sgsnemu.conf 8 files changed, 28 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index e6b84fa..2b9343d 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,7 @@ AC_CONFIG_FILES([Makefile doc/Makefile + doc/examples/Makefile ggsn/Makefile gtp/Makefile lib/Makefile diff --git a/examples/osmo-ggsn.init b/contrib/osmo-ggsn.init similarity index 100% rename from examples/osmo-ggsn.init rename to contrib/osmo-ggsn.init diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples index 3898d26..775b9cd 100644 --- a/debian/osmo-ggsn.examples +++ b/debian/osmo-ggsn.examples @@ -1,2 +1,2 @@ -examples/osmo-ggsn.conf -examples/sgsnemu.conf +doc/examples/osmo-ggsn.conf +doc/examples/sgsnemu.conf diff --git a/doc/Makefile.am b/doc/Makefile.am index 7e2246c..46c634e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,5 +2,6 @@ man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) - - +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..530c3fa --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,22 @@ +CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,' + +dist-hook: + for f in $$($(CFG_FILES)); do \ + j="$(distdir)/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +install-data-hook: + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +uninstall-hook: + @$(PRE_UNINSTALL) + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + $(RM) $$j; \ + done diff --git a/examples/firewall b/doc/examples/firewall similarity index 100% rename from examples/firewall rename to doc/examples/firewall diff --git a/examples/osmo-ggsn.cfg b/doc/examples/osmo-ggsn.cfg similarity index 100% rename from examples/osmo-ggsn.cfg rename to doc/examples/osmo-ggsn.cfg diff --git a/examples/sgsnemu.conf b/doc/examples/sgsnemu.conf similarity index 100% rename from examples/sgsnemu.conf rename to doc/examples/sgsnemu.conf -- To view, visit https://gerrit.osmocom.org/3862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:56 +0000 Subject: [MERGED] osmo-ggsn[master]: remove bogus 'version' script In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove bogus 'version' script ...................................................................... remove bogus 'version' script Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 --- D version 1 file changed, 0 insertions(+), 24 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/version b/version deleted file mode 100755 index ba4d6a5..0000000 --- a/version +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Little shell script to grab current version number from configure.in -# -# $Id: version,v 1.3 2003/01/28 22:39:30 jjako Exp $ - -VER=`grep AC_INIT configure.in | awk -F'[(),]' '{print $3}'` -if [ "$1" == "-VERSION" ] -then - echo $VER | awk -F'.' '{print $1}' - exit -fi -if [ "$1" == "-PATCHLEVEL" ] -then - echo $VER | awk -F'.' '{print $2}' - exit -fi -if [ "$1" == "-SUBLEVEL" ] -then - echo $VER | awk -F'.' '{print $3}' - exit -fi -echo $VER -exit -- To view, visit https://gerrit.osmocom.org/3861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:56 +0000 Subject: [MERGED] osmo-ggsn[master]: Rename OpenGGSN to OsmoGGSN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rename OpenGGSN to OsmoGGSN ...................................................................... Rename OpenGGSN to OsmoGGSN Osmocom has maintained this program since about 7 years now, while the original author / copyright holder has completely disappeared. With the introduction of Osmocom-style CTRL and VTY interfaces, the way how the program is used and configured has substantially changed. In order to avoid confusion in terms of configuration file format etc, let's rename it to OsmoGGSN. Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d --- M .gitignore M AUTHORS M README.FreeBSD M README.MacOSX M README.md M configure.ac M debian/changelog M debian/control M debian/copyright D debian/openggsn.examples A debian/osmo-ggsn.examples R debian/osmo-ggsn.init R debian/osmo-ggsn.install M debian/rules M doc/Compliance.html M doc/Makefile.am R doc/osmo-ggsn.8 M doc/sgsnemu.8 D examples/ggsn.init A examples/osmo-ggsn.init M ggsn/Makefile.am M ggsn/ggsn.c M ggsn/ggsn_vty.c M gtp/gtp.c M gtp/gtp.h M gtp/gtpie.c M gtp/gtpie.h M gtp/pdp.c M gtp/pdp.h M gtp/queue.c M gtp/queue.h M libgtp.pc.in D openggsn.spec.in A osmo-ggsn.spec.in M sgsnemu/cmdline.ggo M sgsnemu/sgsnemu.c 36 files changed, 316 insertions(+), 302 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 111fa98..6885cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,13 +15,13 @@ libtool ltmain.sh missing -openggsn.spec +osmo-ggsn.spec stamp-h1 doc/Makefile.in ggsn/Makefile.in gtp/Makefile.in sgsnemu/Makefile.in -debian/openggsn/ +debian/osmo-ggsn/ debian/*.debhelper debian/libgtp/ debian/*.log @@ -33,7 +33,7 @@ debian/files debian/libgtp-dev/ libgtp.pc -ggsn/ggsn +ggsn/osmo-ggsn m4/ *.swp *.o diff --git a/AUTHORS b/AUTHORS index 5f10990..cba1896 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -OpenGGSN - Gateway GPRS Support Node +OsmoGGSN - Osmocom Gateway GPRS Support Node, based on OpenGGSN Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen Copyright (C) 2010-2017 Harald Welte Copyright (C) 2012-2016 Holger Hans Peter Freyther diff --git a/README.FreeBSD b/README.FreeBSD index b5cc66d..2f4bce5 100644 --- a/README.FreeBSD +++ b/README.FreeBSD @@ -1,4 +1,4 @@ -OpenGGSN/FreeBSD notes +OsmoGGSN/FreeBSD notes FreeBSD support is experimental, please test and report bugs. The FreeBSD port is tested on FreeBSD 4.x, but may also work on 5.x series. diff --git a/README.MacOSX b/README.MacOSX index 0a904cd..a8c4776 100644 --- a/README.MacOSX +++ b/README.MacOSX @@ -1,4 +1,4 @@ -OpenGGSN/Mac OS X notes +OsmoGGSN/Mac OS X notes Mac OS X support is experimental, please test and report bugs. The Mac OS X port is tested on Mac OS X 10.3.5, but may also work on diff --git a/README.md b/README.md index 829adcd..42613cf 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -OpenGGSN - Open Source GGSN +OsmoGGSN - Open Source GGSN =========================== This repository contains a C-language implementation of a GGSN (Gateway GPRS Support Node), a core network element of ETSI/3GPP cellular networks such as GPRS, EDGE, UMTS or HSPA. -OpenGGSN is part of the [Osmocom](https://osmocom.org/) Open Source +OsmoGGSN is part of the [Osmocom](https://osmocom.org/) Open Source Mobile Communications projects, even thogh it was previously developed by Mondru AB. @@ -18,11 +18,11 @@ GIT Repository -------------- -You can clone from the official libosmocore.git repository using +You can clone from the official osmo-ggsn.git repository using - git clone git://git.osmocom.org/openggsn.git + git clone git://git.osmocom.org/osmo-ggsn.git -There is a cgit interface at http://git.osmocom.org/openggsn/ +There is a cgit interface at http://git.osmocom.org/osmo-ggsn/ Documentation ------------- @@ -34,7 +34,7 @@ Mailing List ------------ -Discussions related to openggsn are happening on the +Discussions related to OsmoGGSN are happening on the osmocom-net-gprs at lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/osmocom-net-gprs for subscription options and the list archive. @@ -54,10 +54,8 @@ https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details -The current patch queue for OpenGGSN can be seen at -https://gerrit.osmocom.org/#/q/project:openggsn+status:open -OPENGGSN README -=============== +The current patch queue for OsmoGGSN can be seen at +https://gerrit.osmocom.org/#/q/project:osmo-ggsn+status:open QuickStart @@ -67,7 +65,7 @@ ------------ *Linux* -OpenGGSN was originally developed and tested using Redhat 8.0 and 9.0 +OsmoGGSN was originally developed and tested using Redhat 8.0 and 9.0 and is these days mostly developed on Debian GNU/Linux. It should run also on other Linux distributions as well as FreeBSD, but this is untested. Compilation on Solaris 2.8 has also been verified. @@ -84,7 +82,7 @@ Installation from binary ------------------------ -OpenGGSN is built for common versions of Debian and Ubuntu as part of +OsmoGGSN is built for common versions of Debian and Ubuntu as part of the [Osmocom Nightly Builds](https://osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds) project. If you don't want to do development, it is suggested to simply use those binary packages, rather than building yourself from source. @@ -141,13 +139,13 @@ Features ======== -OpenGGSN is an open source implementation of GPRS Support Nodes +OsmoGGSN is an open source implementation of GPRS Support Nodes (GSNs). It implements the GPRS tunneling protocol (GTP) version 0 and version 1. -OpenGGSN provides 3 components: +OsmoGGSN provides 3 components: * gtplib - * ggsn + * osmo-ggsn * sgsnemu *gtplib* @@ -157,8 +155,8 @@ 29.060). At the moment no interface documentation is available for download. -*ggsn* -The ggsn implements a Gateway GPRS Support Node. The GGSN is a small +*osmo-ggsn* +The osmo-ggsn implements a Gateway GPRS Support Node. The GGSN is a small application which is provided in order to test and demonstrate the use of gtplib. It is fully compliant to the 3GPP standards, but lacks important functionality such as charging and management. Use this @@ -180,7 +178,7 @@ Tun --- -Both ggsn and sgsnemu uses the tun package. You need at least tun +Both osmo-ggsn and sgsnemu uses the tun package. You need at least tun version 1.1. With Linux tun is normally included from kernel version 2.4.7. To configure automatic loading: @@ -210,16 +208,16 @@ Please refer to the project homepage -Running ggsn -============ +Running osmo-ggsn +================= -Use ggsn -h for a list of available options. All options available on +Use osmo-ggsn -h for a list of available options. All options available on the command line can also be given in a configuration file. See -examples/ggsn.conf for the format of this file. +examples/osmo-ggsn.cfg for the format of this file. -Start the ggsn as root using the command: +Start osmo-ggsn as root using the command: -ggsn -c examples/ggsn.conf +osmo-ggsn -c examples/osmo-ggsn.cfg First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is @@ -248,9 +246,9 @@ echo 1 > /proc/sys/net/ipv4/ip_forward If you installed using a binary RPM package it is possible to start -ggsn by using the Sys 5 script: +osmo-ggsn by using the Sys 5 script: -/etc/init.d/ggsn start +/etc/init.d/osmo-ggsn start Running sgsnemu @@ -285,7 +283,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1823]: GTP: gtp_newgsn() started + OsmoGGSN[1823]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request @@ -321,7 +319,7 @@ Using MSISDN: 46702123456 Initialising GTP library - OpenGGSN[1838]: GTP: gtp_newgsn() started + OsmoGGSN[1838]: GTP: gtp_newgsn() started Done initialising GTP library Sending off echo request diff --git a/configure.ac b/configure.ac index 9d3a8e4..e6b84fa 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) +AC_INIT(osmo-ggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) AC_CONFIG_SRCDIR([gtp/gtp.c]) AM_CONFIG_HEADER([config.h]) #AC_CONFIG_HEADER([config.h]) @@ -149,9 +149,9 @@ sgsnemu/Makefile tests/Makefile libgtp.pc - openggsn.spec]) + osmo-ggsn.spec]) AC_OUTPUT echo " -openggsn Configuration: +osmo-ggsn Configuration: GTP Linux kernel support: ${enable_gtp_linux}" diff --git a/debian/changelog b/debian/changelog index 357cc01..7c82dbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-ggsn (0.94.0) UNRELEASED; urgency=medium + + * Transition to OsmoGGSN + + -- Harald Welte Tue, 05 Sep 2017 09:34:20 +0200 + openggsn (0.94.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] diff --git a/debian/control b/debian/control index 4e5b168..bed17e2 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: openggsn +Source: osmo-ggsn Maintainer: Harald Welte Section: net Priority: optional @@ -9,16 +9,16 @@ dh-autoreconf, libosmocore-dev (>= 0.8.0) Standards-Version: 3.9.6 -Vcs-Browser: http://ggsn.git.sourceforge.net/git/gitweb.cgi?p=ggsn/ggsn;a=summary -Vcs-Git: git://ggsn.git.sourceforge.net/gitroot/ggsn/ggsn +Vcs-Browser: http://git.osmocom.org/osmo-ggsn/ +Vcs-Git: git://git.osmocom.org/osmo-ggsn Homepage: https://projects.osmocom.org/projects/openggsn -Package: openggsn +Package: osmo-ggsn Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Gateway GPRS Support Node (GGSN) - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +Description: Osmocom Gateway GPRS Support Node (GGSN) + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -29,11 +29,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Description: library implementing the GTP protocol between SGSN and GGSN - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . - This library is part of openggsn and implements the GTP protocol between + This library is part of OsmoGGSN and implements the GTP protocol between SGSN (Serving GPRS support node) and GGSN. Package: libgtp-dev @@ -43,17 +43,17 @@ Depends: ${misc:Depends}, libgtp1 (= ${binary:Version}) Description: Development files for libgtp - OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile + OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. . The library libgtp implements the GTP protocol between SGSN and GGSN and this package contains the development files for this library. -Package: openggsn-dbg +Package: osmo-ggsn-dbg Section: debug Architecture: any Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), openggsn (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libgtp1 (= ${binary:Version}), osmo-ggsn (= ${binary:Version}) Multi-Arch: same -Description: Debug symbols for OpenGGSN +Description: Debug symbols for OsmoGGSN diff --git a/debian/copyright b/debian/copyright index b3339d9..a6507bd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,11 +1,13 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: openggsn -Source: http://sourceforge.net/projects/ggsn/ +Upstream-Name: osmo-ggsn +Source: https://osmocom.org/projects/openggsn Files: * -Copyright: 2002 Jens Jakobsen - 2002-2004 Mondru AB - 2010-2011 Harald Welte +Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen +Copyright (C) 2010-2017 Harald Welte +Copyright (C) 2012-2016 Holger Hans Peter Freyther +Copyright (C) 2014-2016 Pablo Neira Ayuso +Copyright (C) 2014-2016 sysmocom - s.f.m.c. GmbH License: GPL-2 Files: lib/getopt.c @@ -15,7 +17,7 @@ License: LGPL-2.1+ Files: debian/* -Copyright: 2010-2015 Harald Welte +Copyright: 2010-2017 Harald Welte 2016 Ruben Undheim License: GPL-2 diff --git a/debian/openggsn.examples b/debian/openggsn.examples deleted file mode 100644 index 1fa82f3..0000000 --- a/debian/openggsn.examples +++ /dev/null @@ -1,2 +0,0 @@ -examples/ggsn.conf -examples/sgsnemu.conf diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples new file mode 100644 index 0000000..3898d26 --- /dev/null +++ b/debian/osmo-ggsn.examples @@ -0,0 +1,2 @@ +examples/osmo-ggsn.conf +examples/sgsnemu.conf diff --git a/debian/openggsn.init b/debian/osmo-ggsn.init similarity index 91% rename from debian/openggsn.init rename to debian/osmo-ggsn.init index d4fcb18..6fe1b87 100755 --- a/debian/openggsn.init +++ b/debian/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 2 3 4 5 @@ -13,18 +13,18 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" +DESC="OsmoGGSN Gateway GPRS Support Node" NAME=ggsn -DAEMON=/usr/bin/ggsn +DAEMON=/usr/bin/osmo-ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/openggsn +SCRIPTNAME=/etc/init.d/osmo-ggsn # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present -[ -r /etc/default/openggsn ] && . /etc/default/openggsn +[ -r /etc/default/osmo-ggsn ] && . /etc/default/osmo-ggsn # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -46,13 +46,13 @@ || return 1 # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn fi # Check for GTP restart counter - if [ ! -f /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart + if [ ! -f /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart fi start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ diff --git a/debian/openggsn.install b/debian/osmo-ggsn.install similarity index 67% rename from debian/openggsn.install rename to debian/osmo-ggsn.install index 4b301e1..522a3d1 100644 --- a/debian/openggsn.install +++ b/debian/osmo-ggsn.install @@ -1,3 +1,3 @@ -/usr/bin/ggsn +/usr/bin/osmo-ggsn /usr/bin/sgsnemu /usr/share/man/man8/* diff --git a/debian/rules b/debian/rules index aa95e28..6f27da9 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,7 @@ dh $@ --with autoreconf override_dh_strip: - dh_strip --dbg-package=openggsn-dbg + dh_strip --dbg-package=osmo-ggsn-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version diff --git a/doc/Compliance.html b/doc/Compliance.html index f33bc6f..4c2fc3a 100644 --- a/doc/Compliance.html +++ b/doc/Compliance.html @@ -7,7 +7,7 @@

Protocol Compliance List

-OpenGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the following tables the support of each individual message type is detailed. The numbers before each feature indicates the relevant section in the standard.
diff --git a/doc/Makefile.am b/doc/Makefile.am index 43b00d0..7e2246c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -man_MANS = ggsn.8 sgsnemu.8 +man_MANS = osmo-ggsn.8 sgsnemu.8 man_aux = $(man_MANS:.1=.x) EXTRA_DIST = $(man_MANS) diff --git a/doc/ggsn.8 b/doc/osmo-ggsn.8 similarity index 89% rename from doc/ggsn.8 rename to doc/osmo-ggsn.8 index 89dcb61b..b9f928f 100644 --- a/doc/ggsn.8 +++ b/doc/osmo-ggsn.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -12,24 +12,24 @@ .\" * .\" * Contributor(s): .\" * -.\" Manual page for ggsn +.\" Manual page for osmo-ggsn .\" SH section heading .\" SS subsection heading .\" LP paragraph .\" IP indented paragraph .\" TP hanging label -.TH ggsn 8 "July 2003" +.TH osmo-ggsn 8 "August 2017" .SH NAME -ggsn \- Gateway GPRS Support Node. +osmo-ggsn \- Gateway GPRS Support Node. .SH SYNOPSIS -.B ggsn +.B osmo-ggsn \-\-help -.B ggsn +.B osmo-ggsn \-\-version -.B ggsn +.B osmo-ggsn [ .BI \-\-help ] [ @@ -40,9 +40,9 @@ .BI \-\-version ] .SH DESCRIPTION -.B ggsn +.B osmo-ggsn is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Gateway GPRS Support Node. It is used by mobile operators as the interface between the Internet and the rest of the mobile network infrastructure. @@ -62,14 +62,14 @@ The other interface can be thought of as the uplink interface, and interfaces the GGSN to an external data network. Gi is most often an interface to the Internet. -.B ggsn +.B osmo-ggsn uses the .B TUN/TAP driver for the Gi interface. A tun network interface is established when the -.B ggsn +.B osmo-ggsn is started. -.B ggsn +.B osmo-ggsn will accept incoming connections from mobile stations through the radio access network and the SGSN. When a connection request is received the ggsn will allocate a dynamic IP address for the mobile @@ -79,7 +79,7 @@ framework. Typically -.B ggsn +.B osmo-ggsn will be deployed with two Ethernet interfaces. One for the Gn/Gp interface, and one for the Gi interface. Policy routing and firewall rules should be used in order to separate Gi traffic from Gn/Gp @@ -105,25 +105,25 @@ (default = ./openggsn.cfg) .SH FILES -.I ./openggsn.cfg +.I ./osmo-ggsn.cfg .RS The configuration file for -.B ggsn. +.B osmo-ggsn. .RE -.I /var/run/ggsn.pid +.I /var/run/osmo-ggsn.pid .RS Process ID file. .RE -.I /var/lib/ggsn +.I /var/lib/osmo-ggsn .RS Directory holding nonvolatile data. .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at +Report all bugs to the OsmoGGSN bug tracking list at .I https://osmocom.org/projects/openggsn -.B ggsn +.B osmo-ggsn has very limited management support. Currently both SNMP as well as billing mechanisms are missing. @@ -135,13 +135,13 @@ .LP Besides the long options documented in this man page -.B ggsn +.B osmo-ggsn also accepts a number of short options with the same functionality. Use -.B ggsn --help +.B osmo-ggsn --help for a full list of all the available options. The TUN/TAP driver is required for proper operation of -.B ggsn. +.B osmo-ggsn. For linux kernels later than 2.4.7 the TUN/TAP driver is included in the kernel, but typically needs to be loaded manually with .B modprobe tun. For automatic loading the line @@ -152,7 +152,7 @@ .I http://vtun.sourceforge.net/tun/ for information on how to install and configure the tun driver. -.B ggsn +.B osmo-ggsn uses the GPRS Tunneling Protocol (GTP) as specified by the Third Generation Partnership Project (3GPP). 3GPP protocols specifications can be found at diff --git a/doc/sgsnemu.8 b/doc/sgsnemu.8 index af8f3ff..197bd5d 100644 --- a/doc/sgsnemu.8 +++ b/doc/sgsnemu.8 @@ -1,5 +1,5 @@ -.\" * OpenGGSN - Gateway GPRS Support Node +.\" * OsmoGGSN - Gateway GPRS Support Node .\" * Copyright (C) 2002, 2003 Mondru AB. .\" * .\" * The contents of this file may be used under the terms of the GNU @@ -90,7 +90,7 @@ .SH DESCRIPTION .B sgsnemu is part of the -.B OpenGGSN +.B OsmoGGSN project, and implements a Serving GPRS Support Node (SGSN) emulator. It can be used for testing Gateway GPRS Support Nodes (GGSNs), GPRS core networks as well as GPRS roaming connections. @@ -348,8 +348,8 @@ .RE .SH BUGS -Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/sgsnemu/ +Report all bugs to the OsmoGGSN bug tracking list at +.I http://osmocom.org/projects/openggsn/issues .SH "SEE ALSO" diff --git a/examples/ggsn.init b/examples/ggsn.init deleted file mode 100644 index 7d9689a..0000000 --- a/examples/ggsn.init +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# ggsn This shell script takes care of starting and stopping -# ggsn. -# -# chkconfig: - 65 35 -# description: ggsn is a Gateway GPRS Support Node. - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -if [ -f /etc/sysconfig/ggsn ]; then - . /etc/sysconfig/ggsn -fi - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -f /usr/bin/ggsn ] || exit 0 -[ -f /etc/ggsn.conf ] || exit 0 - -RETVAL=0 -prog="ggsn" - -start() { - # Start daemons. - echo -n $"Starting $prog: " - - # Load tun module - /sbin/modprobe tun >/dev/null 2>&1 - - # Enable routing of packets: WARNING!!! - # Users should enable this explicitly - # echo 1 > /proc/sys/net/ipv4/ip_forward - - # Check for runtime directory of nonvolatile data - if [ ! -d /var/lib/ggsn ]; then - mkdir /var/lib/ggsn - fi - - # Check for GTP restart counter - if [ ! -d /var/lib/ggsn/gsn_restart ]; then - echo 0 > /var/lib/ggsn/gsn_restart - fi - - - daemon /usr/bin/ggsn - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ggsn - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n $"Shutting down $prog: " - killproc ggsn - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ggsn /var/run/ggsn.pid - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/ggsn ] ; then - stop - start - RETVAL=$? - fi - ;; - status) - status ggsn - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL - diff --git a/examples/osmo-ggsn.init b/examples/osmo-ggsn.init new file mode 100644 index 0000000..2deb378 --- /dev/null +++ b/examples/osmo-ggsn.init @@ -0,0 +1,97 @@ +#!/bin/sh +# +# osmo-ggsn This shell script takes care of starting and stopping +# osmo-ggsn. +# +# chkconfig: - 65 35 +# description: osmo-ggsn is a Gateway GPRS Support Node. + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +if [ -f /etc/sysconfig/osmo-ggsn ]; then + . /etc/sysconfig/osmo-ggsn +fi + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -f /usr/bin/osmo-ggsn ] || exit 0 +[ -f /etc/osmo-ggsn.cfg ] || exit 0 + +RETVAL=0 +prog="osmo-ggsn" + +start() { + # Start daemons. + echo -n $"Starting $prog: " + + # Load tun module + /sbin/modprobe tun >/dev/null 2>&1 + + # Enable routing of packets: WARNING!!! + # Users should enable this explicitly + # echo 1 > /proc/sys/net/ipv4/ip_forward + + # Check for runtime directory of nonvolatile data + if [ ! -d /var/lib/osmo-ggsn ]; then + mkdir /var/lib/osmo-ggsn + fi + + # Check for GTP restart counter + if [ ! -d /var/lib/osmo-ggsn/gsn_restart ]; then + echo 0 > /var/lib/osmo-ggsn/gsn_restart + fi + + + daemon /usr/bin/osmo-ggsn + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/osmo-ggsn + return $RETVAL +} + +stop() { + # Stop daemons. + echo -n $"Shutting down $prog: " + killproc osmo-ggsn + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f /var/lock/subsys/osmo-ggsn /var/run/osmo-ggsn.pid + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/osmo-ggsn ] ; then + stop + start + RETVAL=$? + fi + ;; + status) + status osmo-ggsn + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL + diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index fef12d3..8a468a9 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -1,19 +1,19 @@ -bin_PROGRAMS = ggsn +bin_PROGRAMS = osmo-ggsn AM_LDFLAGS = @EXEC_LDFLAGS@ AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) +osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD += -lgtpnl +osmo_ggsn_LDADD += -lgtpnl endif -ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a +osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL -ggsn_SOURCES += gtp-kernel.c +osmo_ggsn_SOURCES += gtp-kernel.c endif diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index ee64cb9..0b877cf 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 by Harald Welte * @@ -592,7 +592,7 @@ return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } -static char *config_file = "openggsn.cfg"; +static char *config_file = "osmo-ggsn.cfg"; /* callback for tun device osmocom select loop integration */ static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) @@ -804,7 +804,7 @@ struct ggsn_ctx *ggsn; int rc; - tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "OsmoGGSN"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); /* Handle keyboard interrupt SIGINT */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index f23a298..4a3e753 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -882,7 +882,7 @@ "There is NO WARRANTY, to the extent permitted by law.\r\n"; struct vty_app_info g_vty_info = { - .name = "OpenGGSN", + .name = "OsmoGGSN", .version = PACKAGE_VERSION, .copyright = ggsn_copyright, .go_parent_cb = ggsn_vty_go_parent, diff --git a/gtp/gtp.c b/gtp/gtp.c index 87ab075..27a07b1 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1,6 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2010-2011, 2016-2017 Harald Welte + * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/gtp.h b/gtp/gtp.h index 7fa9ae7..b40c6df 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.c b/gtp/gtpie.c index c8db449..0744370 100644 --- a/gtp/gtpie.c +++ b/gtp/gtpie.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/gtpie.h b/gtp/gtpie.h index fb8598e..9fe7943 100644 --- a/gtp/gtpie.h +++ b/gtp/gtpie.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/gtp/pdp.c b/gtp/pdp.c index c576a4e..ff9c681 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/pdp.h b/gtp/pdp.h index c51e9e2..cb98920 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -1,6 +1,7 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.c b/gtp/queue.c index fbfa1ec..82cd7b4 100644 --- a/gtp/queue.c +++ b/gtp/queue.c @@ -1,7 +1,8 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2011 Harald Welte + * Copyright (C) 2016 sysmocom - s.f.m.c. GmbH * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright diff --git a/gtp/queue.h b/gtp/queue.h index 556b6ef..2e253dd 100644 --- a/gtp/queue.h +++ b/gtp/queue.h @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002 Mondru AB. * * The contents of this file may be used under the terms of the GNU diff --git a/libgtp.pc.in b/libgtp.pc.in index 2201608..e6048e9 100644 --- a/libgtp.pc.in +++ b/libgtp.pc.in @@ -3,7 +3,7 @@ libdir=@libdir@ includedir=@includedir@ -Name: OpenGGSN STP Library +Name: OsmoGGSN GTP Library Description: C Utility Library Version: @VERSION@ Libs: -L${libdir} -lgtp diff --git a/openggsn.spec.in b/openggsn.spec.in deleted file mode 100644 index f15866e..0000000 --- a/openggsn.spec.in +++ /dev/null @@ -1,87 +0,0 @@ -Summary: Open Source Gateway GPRS Support Node (GGSN) -Name: @PACKAGE@ -Version: @VERSION@ -Release: 1 -URL: http://sourceforge.net/projects/ggsn/ -Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz -License: GPL -Group: System Environment/Daemons -BuildRoot: %{_tmppath}/%{name}-root - -%description -OpenGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile -operators as the interface between the Internet and the rest of the -mobile network infrastructure. The project also provides an SGSN -emulator suitable for GPRS core network testing. - -%prep -%setup -q - -%build - -./configure --prefix=/usr --enable-static-exec - -make - -%install - -make install prefix=$RPM_BUILD_ROOT/usr -strip $RPM_BUILD_ROOT/usr/bin/ggsn -strip $RPM_BUILD_ROOT/usr/bin/sgsnemu - -#Copy ggsn init script in place -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d -install -m755 examples/ggsn.init \ - $RPM_BUILD_ROOT/etc/rc.d/init.d/ggsn - -#Copy ggsn.conf in place -install -m755 examples/ggsn.conf \ - $RPM_BUILD_ROOT/etc/ggsn.conf - -#Copy gsn_restart file in place -mkdir -p $RPM_BUILD_ROOT/var/lib/ggsn -echo "0" > $RPM_BUILD_ROOT/var/lib/ggsn/gsn_restart - -#Clean up unwanted library files -rm -rf $RPM_BUILD_ROOT/usr/include/* -rm -rf $RPM_BUILD_ROOT/usr/lib/* - - -%clean -rm -rf $RPM_BUILD_ROOT -make clean - -%post -/sbin/chkconfig --add ggsn - -%files -%defattr(-,root,root) - -/usr/bin/ggsn -/usr/bin/sgsnemu -/etc/rc.d/init.d/ggsn -%dir /var/lib/ggsn -/var/lib/ggsn/gsn_restart - -%doc AUTHORS COPYING INSTALL NEWS README.md -%doc examples/ggsn.conf -%doc examples/sgsnemu.conf -%doc examples/ggsn.init -%doc examples/firewall -%doc /usr/man/man8/ggsn.8.gz -%doc /usr/man/man8/sgsnemu.8.gz - -%config /etc/ggsn.conf - - -#/usr/lib/libgtp.a -#/usr/lib/libgtp.la -#/usr/lib/libgtp.so -#/usr/lib/libgtp.so.0 -#/usr/lib/libgtp.so.0.0.0 - - - -%changelog -* Mon Jun 30 2003 -- Initial build. diff --git a/osmo-ggsn.spec.in b/osmo-ggsn.spec.in new file mode 100644 index 0000000..9613bca --- /dev/null +++ b/osmo-ggsn.spec.in @@ -0,0 +1,90 @@ +Summary: Osmocom Gateway GPRS Support Node (GGSN) +Name: @PACKAGE@ +Version: @VERSION@ +Release: 1 +URL: https://osmocom.org/projects/openggsn +Source0: http://prdownloads.sourceforge.net/ggsn/%{name}-%{version}.tar.gz +License: GPL +Group: System Environment/Daemons +BuildRoot: %{_tmppath}/%{name}-root + +%description +OsmoGGSN is a Gateway GPRS Support Node (GGSN). It is used by mobile +operators as the interface between the Internet and the rest of the +mobile network infrastructure. The project also provides an SGSN +emulator suitable for GPRS core network testing. + +%prep +%setup -q + +%build + +./configure --prefix=/usr --enable-static-exec + +make + +%install + +make install prefix=$RPM_BUILD_ROOT/usr +strip $RPM_BUILD_ROOT/usr/bin/osmo-ggsn +strip $RPM_BUILD_ROOT/usr/bin/sgsnemu + +#Copy osmo-ggsn init script in place +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +install -m755 examples/osmo-ggsn.init \ + $RPM_BUILD_ROOT/etc/rc.d/init.d/osmo-ggsn + +#Copy osmo-ggsn.conf in place +install -m755 examples/osmo-ggsn.cfg \ + $RPM_BUILD_ROOT/etc/osmo-ggsn.cfg + +#Copy gsn_restart file in place +mkdir -p $RPM_BUILD_ROOT/var/lib/osmo-ggsn +echo "0" > $RPM_BUILD_ROOT/var/lib/osmo-ggsn/gsn_restart + +#Clean up unwanted library files +rm -rf $RPM_BUILD_ROOT/usr/include/* +rm -rf $RPM_BUILD_ROOT/usr/lib/* + + +%clean +rm -rf $RPM_BUILD_ROOT +make clean + +%post +/sbin/chkconfig --add osmo-ggsn + +%files +%defattr(-,root,root) + +/usr/bin/osmo-ggsn +/usr/bin/sgsnemu +/etc/rc.d/init.d/osmo-ggsn +%dir /var/lib/osmo-ggsn +/var/lib/osmo-ggsn/gsn_restart + +%doc AUTHORS COPYING INSTALL NEWS README.md +%doc examples/osmo-ggsn.conf +%doc examples/sgsnemu.conf +%doc examples/osmo-ggsn.init +%doc examples/firewall +%doc /usr/man/man8/osmo-ggsn.8.gz +%doc /usr/man/man8/sgsnemu.8.gz + +%config /etc/osmo-ggsn.cfg + + +#/usr/lib/libgtp.a +#/usr/lib/libgtp.la +#/usr/lib/libgtp.so +#/usr/lib/libgtp.so.0 +#/usr/lib/libgtp.so.0.0.0 + + + +%changelog +* Mon Jun 30 2017 +- Update to OsmoGGSN + +* Mon Jun 30 2003 +- Initial build. diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0c1b06c..ee5e55d 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -1,4 +1,4 @@ -# OpenGGSN - Gateway GPRS Support Node +# OsmoGGSN - Gateway GPRS Support Node # Copyright (C) 2002, 2003, 2004 Mondru AB. # # The contents of this file may be used under the terms of the GNU diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index ed1fb93..0157e22 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1,5 +1,5 @@ /* - * OpenGGSN - Gateway GPRS Support Node + * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * * The contents of this file may be used under the terms of the GNU -- To view, visit https://gerrit.osmocom.org/3860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2da30f7d4828e185bfac1a4e2d8414b01cbe4f9d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:56 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Handle SIGTERM like SIGINT and terminate In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Handle SIGTERM like SIGINT and terminate ...................................................................... ggsn: Handle SIGTERM like SIGINT and terminate Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 2bf3d7e..ee64cb9 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -657,6 +657,7 @@ LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); switch (s) { case SIGINT: + case SIGTERM: LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); end = 1; break; @@ -803,11 +804,12 @@ struct ggsn_ctx *ggsn; int rc; - /* Handle keyboard interrupt SIGINT */ tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); msgb_talloc_ctx_init(tall_ggsn_ctx, 0); + /* Handle keyboard interrupt SIGINT */ signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:57 +0000 Subject: [MERGED] osmo-ggsn[master]: Documentation update: Remove NEWS, README.Solaris, update RE... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Documentation update: Remove NEWS, README.Solaris, update README.md ...................................................................... Documentation update: Remove NEWS, README.Solaris, update README.md * README.Solaris is obsolete and related code has been removed * NEWS file was unmaintained for more than a decade, remove it * Remove "Performance" chapter about 550MHz Athlon * gengetopt is no longer needed for ggsn * remove compilation/installation instructions horribly out of date * command line syntax of 'ggsn' program has changed Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db --- M Makefile.am D NEWS D README.Solaris M README.md 4 files changed, 3 insertions(+), 240 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 1d7eaba..517e265 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,6 @@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris +EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX @RELMAKE@ diff --git a/NEWS b/NEWS deleted file mode 100644 index b1352a5..0000000 --- a/NEWS +++ /dev/null @@ -1,78 +0,0 @@ -OPENGGSN NEWS -============= - -OpenGGSN - Gateway GPRS Support Node -Copyright (C) 2002, 2003, 2004 Mondru AB. - -Version 0.84 -============ - -* Initial MAC OSX support (Thanks to Pekka Nikander) -* Quality assurance and improved error logging (Thanks to Pekka - Nikander and Jonny Winberg) - -Version 0.83 -============ - -* Added selection mode and charging characteristics option to sgsnemu. -* Bug fixes on charging characteristics and PPP PCO length.(Thanks to - Loic Bernable ). -* Improved Solaris support, hash table bugfix and improved logging. - -Version 0.82 -============ - -* Improved Solaris support. -* Routing manipulation and IP address alias capability for FreeBSD. -* Initial Debian port (Thanks to ARAKI Yasuhiro ). - -Version 0.81 -============ - - * Initial FreeBSD port (Thanks to Pavel Andreev ). - * IMSI '1111' bugfix (Thanks to Pavel Andreev ). - -Version 0.8 -=========== - - * Support for compilation under Solaris. - * Iptables firewall script. - * New options for sgsnemu - - -Version 0.7 -=========== - - * Support for GTP1. Currently without support for the secondary pdp - context activation procedure. - * sgsnemu will first attempt to use GTP1. If that fails it will - fallback to using GTP0. - * Standards compliance document. - -Version 0.6 -=========== - - * Improved README file. - * Now uses ioctl instead of ifconfig and route in ggsn and sgsnemu. - * Absolute path to gtp library in ggsn/Makefile.am and ggsn/Makefile.am - * Compiles with gengetopt 2.8 (Thanks to Lorenzo Bettini ) - * sgsnemu is now able to handle several contexts and allocate - interface IP addresses for each context. - * ggsn now supports protocol configuration option DNS - addresses. This allow mobile stations to set up DNS based on - information configured in the ggsn. - * Ping facility in sgsnemu allow testing without the need to route - packets through the tun interface. - * Man pages for ggsn and sgsnemu. - * Sys 5 init script. - * Spec file for building binary RPM packages. - * If not --createif exit after "ping" or "echo" finishes - * If sgsnemu echo failure, exit with code != 0 - - -Version 0.5 -=========== - - * Initial release. See README file for installation and usage - instructions. - diff --git a/README.Solaris b/README.Solaris deleted file mode 100644 index 2ac6dbc..0000000 --- a/README.Solaris +++ /dev/null @@ -1,41 +0,0 @@ -OpenGGSN/Solaris notes -====================== - -Solaris support is experimental, please test and report bugs. The -Solaris port is tested under Solaris 8. - -Compiling ---------- - -You need to edit the following line in ggsn/Makefile.in and -sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -After this you install by the following commands: -./configure -make -make install - - -TUN ---- - -You might or might not need to install the tun driver manually. For -general information about tun see http://vtun.sourceforge.net/tun/ - - -Known problems --------------- - -Currently multiple IP addresses on the same network interface is not -implemented for Solaris. - -Currently routing table manipulation is not implemented for -Solaris. You have to set the routes manually after you start ggsn or -sgsnemu. - diff --git a/README.md b/README.md index 8e4ceae..829adcd 100644 --- a/README.md +++ b/README.md @@ -174,26 +174,6 @@ will fallback to GTPv0. -Performance -=========== - -Two experiments were performed in order to test the performance of -sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of -RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had -100 Mb/s NICs (RTL-8139) and were connected through a crossed patch -cable. Both tests were performed by sending ICMP echo packets from -sgsnemu to the ggsn. - -89.5 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1400 bytes. Transfer time 1.27 sec, no packets lost. - -71.4 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 1000 bytes. Transfer time 1.15 sec, no packets lost. - -12,1 Mb/s IP throughput when sending 10000 ICMP ping packets with a -payload of 100 bytes. Transfer time 0.84 sec, no packets lost. - - Required software ================= @@ -209,19 +189,12 @@ Alternatively you can execute "modprobe tun" on the commandline. -For Solaris the tun driver needs to be installed manually. For general -information about tun see http://vtun.sourceforge.net/tun/ - Gengetopt --------- Gengetopt is required if you want to change the options defined in the cmdline.ggo source file. You need at least gengetopt version 2.8. If you are just going to compile the programs you don't need gengetopt. - -To use gengetopt for the ggsn do the following: -cd ggsn -gengetopt < cmdline.ggo --conf-parser To use gengetopt for the sgsnemu do the following: cd sgsnemu @@ -234,98 +207,7 @@ Compilation and Installation ============================ - -Setting up autotools --------------------- - -You do not need to perform this step if you are only going to compile -the package: - -1. Get version from somewhere: Script to extract version from configure.in -2. Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config -3. Run autoscan and copy configure.scan to configure.in -4. Add/edit the following lines in configure.in: - - AC_INIT(openggsn, 0.70, jj at openggsn.org) - - AC_CONFIG_SRCDIR([gtp/gtp.c]) - - AM_CONFIG_HEADER([config.h]) - - AC_PROG_LIBTOOL - - AM_PROG_LIBTOOL - - AM_INIT_AUTOMAKE() -5. libtoolize --automake --copy - (ads copy of ltmain.sh) -6. aclocal -7. autoheader -8. automake --add-missing --copy - (Ads copy of mkinstalldirs missing, install-sh, depcomp) -9. automake -10. autoconf - -The above will initialise the project to the current version of -autotools (As installed in RedHat 8.0). See -http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 -for details on autotools. - - -Checking out from CVS ---------------------- - -To download the latest source code from anonymous CVS: - -cvs -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn login -cvs -z3 -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Or to download from developer CVS: - -export CVS_RSH=ssh -cvs -z3 -d:ext:developername at cvs.sourceforge.net:/cvsroot/ggsn co openggsn - -Both the above sets of commands creates a new directory called openggsn. - - -Compilation and installation ----------------------------- - -If compiling under Solaris you need to edit the following line in -ggsn/Makefile.in and sgsnemu/Makefile.in: - -LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib @EXEC_LDFLAGS@ - -should be changed to: - -LDFLAGS = -lresolv -lsocket -lnsl @EXEC_LDFLAGS@ - -Note that the above is not necessary on other platforms. Compilation -and installation is performed by the following steps: - - 1. ./configure - 2. make clean - 3. cd gtp - 4. make - 5. make install (as root) - 6. cd .. - (Step 3 to 6 you only need to run the first time to install libgtp) - 7. make - 8. make install (as root) - 9. Add /usr/local/lib to /etc/ld.so.conf -10. run ldconfig - -(Steps 9 and 10 are not required as path to libgtp is included in Makefile) - -Documentation can be converted to html by issuing: - - 1. txt2html -pm -tf README > README.html - 2. txt2html -pm -tf NEWS > NEWS.html - 3. man2htm ggsn.8 > ggsn.html - 4. man2htm sgsnemu.8 > sgsnemu.html - - -Installation from binary ------------------------- - -1. rpm -i openggsn-.rpm - -This will install binaries, man pages, configuration files as well as -a Sys V init script for the ggsn. +Please refer to the project homepage Running ggsn @@ -337,7 +219,7 @@ Start the ggsn as root using the command: -ggsn -c examples/ggsn.conf --fg -l 10.0.0.40 --net 192.168.0.0/24 --dynip 192.168.0.0/24 +ggsn -c examples/ggsn.conf First a tun network interface will be created. In the above example the network interface address is 192.168.0.0 and the mask is -- To view, visit https://gerrit.osmocom.org/3858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I45d627911503c7b733cae6a1396ca4d69a9994db Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 07:22:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 07:22:57 +0000 Subject: [MERGED] osmo-ggsn[master]: Introduce a VTY, factually turning OpenGGSN into an Osmocom ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Introduce a VTY, factually turning OpenGGSN into an Osmocom program ...................................................................... Introduce a VTY, factually turning OpenGGSN into an Osmocom program Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 --- M doc/ggsn.8 D examples/ggsn.conf A examples/osmo-ggsn.cfg M ggsn/Makefile.am D ggsn/cmdline.c D ggsn/cmdline.ggo D ggsn/cmdline.h M ggsn/ggsn.c A ggsn/ggsn.h A ggsn/ggsn_vty.c M lib/tun.c M lib/tun.h M sgsnemu/sgsnemu.c 13 files changed, 1,675 insertions(+), 2,177 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/ggsn.8 b/doc/ggsn.8 index 62d467a..89dcb61b 100644 --- a/doc/ggsn.8 +++ b/doc/ggsn.8 @@ -31,33 +31,13 @@ .B ggsn [ -.BI \-\-fg +.BI \-\-help ] [ -.BI \-\-debug +.BI \-\-daemonize ] [ -.BI \-\-conf " file" +.BI \-\-config-file " file" ] [ -.BI \-\-pidfile " file" -] [ -.BI \-\-statedir " file" -] [ -.BI \-\-listen " host" -] [ -.BI \-\-net " net" -] [ -.BI \-\-ipup " script" -] [ -.BI \-\-ipdown " script" -] [ -.BI \-\-dynip " net" -] [ -.BI \-\-statip " net" -] [ -.BI \-\-pcodns1 " host" -] [ -.BI \-\-pcodns2 " host" -] [ -.BI \-\-timelimit " seconds" +.BI \-\-version ] .SH DESCRIPTION .B ggsn @@ -115,86 +95,17 @@ Print version and exit. .TP -.BI --fg -Run in foreground (default = off) +.BI --daemonize +Run in background as a daemon (default = off) .TP -.BI --debug -Run in debug mode (default = off) - -.TP -.BI --conf " file" +.BI --config-file " file" Read configuration .I file -(default = /etc/ggsn.conf) where each line corresponds to one command -line option, but with the leading '--' removed. Command line options -override the options given in the configuration file. - -.TP -.BI --pidfile " file" -Filename of process id -.I file -(default = /var/run/ggsn.pid) - -.TP -.BI --statedir " path" -.I path -to directory of nonvolatile data (default = /var/lib/ggsn/) - -.TP -.BI --listen " host" -Local interface IP address to use for the Gn/Gp interface. This option -must be specified. For security issues it is not possible to use -INADDR_ANY. - -.TP -.BI --net " net" -Network address of the Gi interface (default = 192.168.0.0/24). The -network address is set during initialisation when -.B ggsn -establishes a tun device for the Gi interface. - -.TP -.BI --ipup " script" -Script executed after the Gi tun network interface has been brought -up. Executed with the following parameters: - -.TP -.BI --ipdown " script" -Script executed after the Gi tun network interface has been taken -down. Executed with the following parameters: - -.TP -.BI --dynip " net" -Dynamic IP address pool. Specifies a pool of dynamic IP addresses. If -this option is omitted the network address specified by the -.BI --net -option is used for dynamic IP address allocation. - -.TP -.BI --pcodns1 " host" -PCO DNS Server 1 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --pcodns2 " host" -PCO DNS Server 2 (default = 0.0.0.0). PCO stands for Protocol -Configuration options, and is part of the GPRS protocols. It is used -to inform the mobile station about the DNS address to use for host -name resolution. - -.TP -.BI --timelimit " seconds" -Exit -.B ggsn -after \fIseconds\fP. Used for debugging. - +(default = ./openggsn.cfg) .SH FILES -.I /etc/ggsn.conf +.I ./openggsn.cfg .RS The configuration file for .B ggsn. @@ -210,7 +121,7 @@ .SH BUGS Report all bugs to the OpenGGSN bug tracking list at -.I http://sourceforge.net/projects/ggsn/ +.I https://osmocom.org/projects/openggsn .B ggsn has very limited management support. Currently both SNMP as well as @@ -250,6 +161,7 @@ .SH COPYRIGHT Copyright (C) 2002, 2003 by Mondru AB. +Copyright (C) 2017 Harald Welte The contents of this file may be used under the terms of the GNU General Public License Version 2, provided that the above copyright @@ -258,3 +170,4 @@ .SH AUTHORS Jens Jakobsen +Harald Welte diff --git a/examples/ggsn.conf b/examples/ggsn.conf deleted file mode 100644 index 6dcfe44..0000000 --- a/examples/ggsn.conf +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################## -# -# Sample ggsn configuration file -# -############################################################################## - -# TAG: fg -# Include this flag if process is to run in the foreground -# -#fg - -# TAG: debug -# Include this flag to include debug information. -#debug - - -# TAG: conf -# Configuration file to use. This file is the configuration file, -# so changing this parameter in the configuration file does not make -# sense. Use it on the command line instead. - -# TAG: pidfile -# File to store information about the process id of the program. -# The program must have write access to this file/directory. -#pidfile /var/run/ggsn.pid - -# TAG: statedir -# Directory to use for nonvolatile storage. -# The program must have write access to this directory. -#statedir /var/lib/ggsn/ - - -# TAG: listen -# Specifies the local IP address to listen to -#listen 10.0.0.240 - -# TAG: net -# IP network address of external packet data network -# Used to set up network interface. -#net 192.168.0.0/24 - -# TAG: ipup -# Script executed after network interface has been brought up. -# Executed with the following parameters: -#ipup /etc/ggsn/ip-up - -# TAG: ipdown -# Script executed after network interface has been taken down. -# Executed with the following parameters: -#ipdown /etc/ggsn/ip-down - -# TAG: dynip -# Dynamic IP address pool. -# Used for allocation of dynamic IP address when address is not given -# by HLR. -# If this option is not given then the net option is used as a substitute. -#dynip 192.168.0.0/24 - -# TAG: statip -# Use of this tag is currently UNSUPPORTED -# Static IP address pool. -# Used for allocation of static IP address by means of HLR. -#statip 192.168.1.0/24 - -# TAG: pcodns1 -# Protocol configuration option domain name system server 1. -#pcodns1 0.0.0.0 - -# TAG: pcodns2 -# Protocol configuration option domain name system server 2. -#pcodns2 0.0.0.0 - -# TAG: timelimit -# Exit after timelimit seconds. -# Setting timelimit to zero will cause the program not to exit. -#timelimit 0 - -# TAG: apn -# Use of this tag is EXPERIMENTAL -# Access point name to connect to when run in client mode. -#apn internet - -# TAG: qos -# Use of this tag is EXPERIMENTAL -# Requested Quality of Service used when run in client mode. -# 3 bytes corresponding to ???? -#qos 0x0b921f - -# TAG: qos -# Enable GTP datapath through Linux kernel driver gtp.ko (since 4.7). -#gtp-linux - diff --git a/examples/osmo-ggsn.cfg b/examples/osmo-ggsn.cfg new file mode 100644 index 0000000..763e561 --- /dev/null +++ b/examples/osmo-ggsn.cfg @@ -0,0 +1,71 @@ +! +! OpenGGSN (0.94.1-adac) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging print category 0 + logging timestamp 0 + logging level ip info + logging level tun info + logging level ggsn info + logging level sgsn notice + logging level icmp6 notice + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice + logging level lctrl notice + logging level lgtp info + logging level lstats notice + logging level lgsup notice + logging level loap notice + logging level lss7 notice + logging level lsccp notice + logging level lsua notice + logging level lm3ua notice + logging level lmgcp notice +! +stats interval 5 +! +line vty + no login +! +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown + apn inet6 + gtpu-mode tun + tun-device tun6 + type-support v6 + ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2000:0:0:0:0/56 + no shutdown + apn inet46 + gtpu-mode tun + tun-device tun46 + type-support v4v6 + ip prefix dynamic 176.16.46.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.46.0/24 + ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 + no shutdown + default-apn internet + no shutdown ggsn diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index c945f0b..fef12d3 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -2,17 +2,17 @@ AM_LDFLAGS = @EXEC_LDFLAGS@ -AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) + +ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL -ggsn_LDADD = @EXEC_LDADD@ -lgtp -lgtpnl -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) -else -ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) +ggsn_LDADD += -lgtpnl endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h +ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/cmdline.c b/ggsn/cmdline.c deleted file mode 100644 index 31c0744..0000000 --- a/ggsn/cmdline.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* - File autogenerated by gengetopt version 2.22.6 - generated with the following command: - gengetopt -i cmdline.ggo --conf-parser - - The developers of gengetopt consider the fixed text that goes in all - gengetopt output files to be in the public domain: - we make no copyright claims on it. -*/ - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#ifndef FIX_UNUSED -#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ -#endif - -#include - -#include "cmdline.h" - -const char *gengetopt_args_info_purpose = ""; - -const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; - -const char *gengetopt_args_info_versiontext = ""; - -const char *gengetopt_args_info_description = ""; - -const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -f, --fg Run in foreground (default=off)", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file (default=`/etc/ggsn.conf')", - " --pidfile=STRING Filename of process id file\n (default=`/var/run/ggsn.pid')", - " --statedir=STRING Directory of nonvolatile data\n (default=`/var/lib/ggsn/')", - " -l, --listen=STRING Local interface", - " -n, --net=STRING Network (default=`192.168.0.0/24')", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --dynip=STRING Dynamic IP address pool", - " --statip=STRING Static IP address pool", - " --pcodns1=STRING PCO DNS Server 1 (default=`0.0.0.0')", - " --pcodns2=STRING PCO DNS Server 2 (default=`0.0.0.0')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " -a, --apn=STRING Access point name (default=`internet')", - " -q, --qos=INT Requested quality of service (default=`0x0b921f')", - " --logfile=STRING Logfile for errors", - " --loglevel=STRING Global log ldevel (default=`error')", - " -g, --gtp-linux GTP linux kernel support (default=off)", - 0 -}; - -typedef enum {ARG_NO - , ARG_FLAG - , ARG_STRING - , ARG_INT -} cmdline_parser_arg_type; - -static -void clear_given (struct gengetopt_args_info *args_info); -static -void clear_args (struct gengetopt_args_info *args_info); - -static int -cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error); - -struct line_list -{ - char * string_arg; - struct line_list * next; -}; - -static struct line_list *cmd_line_list = 0; -static struct line_list *cmd_line_list_tmp = 0; - -static void -free_cmd_list(void) -{ - /* free the list of a previous call */ - if (cmd_line_list) - { - while (cmd_line_list) { - cmd_line_list_tmp = cmd_line_list; - cmd_line_list = cmd_line_list->next; - free (cmd_line_list_tmp->string_arg); - free (cmd_line_list_tmp); - } - } -} - - -static char * -gengetopt_strdup (const char *s); - -static -void clear_given (struct gengetopt_args_info *args_info) -{ - args_info->help_given = 0 ; - args_info->version_given = 0 ; - args_info->fg_given = 0 ; - args_info->debug_given = 0 ; - args_info->conf_given = 0 ; - args_info->pidfile_given = 0 ; - args_info->statedir_given = 0 ; - args_info->listen_given = 0 ; - args_info->net_given = 0 ; - args_info->ipup_given = 0 ; - args_info->ipdown_given = 0 ; - args_info->dynip_given = 0 ; - args_info->statip_given = 0 ; - args_info->pcodns1_given = 0 ; - args_info->pcodns2_given = 0 ; - args_info->timelimit_given = 0 ; - args_info->apn_given = 0 ; - args_info->qos_given = 0 ; - args_info->logfile_given = 0 ; - args_info->loglevel_given = 0 ; - args_info->gtp_linux_given = 0 ; -} - -static -void clear_args (struct gengetopt_args_info *args_info) -{ - FIX_UNUSED (args_info); - args_info->fg_flag = 0; - args_info->debug_flag = 0; - args_info->conf_arg = gengetopt_strdup ("/etc/ggsn.conf"); - args_info->conf_orig = NULL; - args_info->pidfile_arg = gengetopt_strdup ("/var/run/ggsn.pid"); - args_info->pidfile_orig = NULL; - args_info->statedir_arg = gengetopt_strdup ("/var/lib/ggsn/"); - args_info->statedir_orig = NULL; - args_info->listen_arg = NULL; - args_info->listen_orig = NULL; - args_info->net_arg = gengetopt_strdup ("192.168.0.0/24"); - args_info->net_orig = NULL; - args_info->ipup_arg = NULL; - args_info->ipup_orig = NULL; - args_info->ipdown_arg = NULL; - args_info->ipdown_orig = NULL; - args_info->dynip_arg = NULL; - args_info->dynip_orig = NULL; - args_info->statip_arg = NULL; - args_info->statip_orig = NULL; - args_info->pcodns1_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns1_orig = NULL; - args_info->pcodns2_arg = gengetopt_strdup ("0.0.0.0"); - args_info->pcodns2_orig = NULL; - args_info->timelimit_arg = 0; - args_info->timelimit_orig = NULL; - args_info->apn_arg = gengetopt_strdup ("internet"); - args_info->apn_orig = NULL; - args_info->qos_arg = 0x0b921f; - args_info->qos_orig = NULL; - args_info->logfile_arg = NULL; - args_info->logfile_orig = NULL; - args_info->loglevel_arg = gengetopt_strdup ("error"); - args_info->loglevel_orig = NULL; - args_info->gtp_linux_flag = 0; - -} - -static -void init_args_info(struct gengetopt_args_info *args_info) -{ - - - args_info->help_help = gengetopt_args_info_help[0] ; - args_info->version_help = gengetopt_args_info_help[1] ; - args_info->fg_help = gengetopt_args_info_help[2] ; - args_info->debug_help = gengetopt_args_info_help[3] ; - args_info->conf_help = gengetopt_args_info_help[4] ; - args_info->pidfile_help = gengetopt_args_info_help[5] ; - args_info->statedir_help = gengetopt_args_info_help[6] ; - args_info->listen_help = gengetopt_args_info_help[7] ; - args_info->net_help = gengetopt_args_info_help[8] ; - args_info->ipup_help = gengetopt_args_info_help[9] ; - args_info->ipdown_help = gengetopt_args_info_help[10] ; - args_info->dynip_help = gengetopt_args_info_help[11] ; - args_info->statip_help = gengetopt_args_info_help[12] ; - args_info->pcodns1_help = gengetopt_args_info_help[13] ; - args_info->pcodns2_help = gengetopt_args_info_help[14] ; - args_info->timelimit_help = gengetopt_args_info_help[15] ; - args_info->apn_help = gengetopt_args_info_help[16] ; - args_info->qos_help = gengetopt_args_info_help[17] ; - args_info->logfile_help = gengetopt_args_info_help[18] ; - args_info->loglevel_help = gengetopt_args_info_help[19] ; - args_info->gtp_linux_help = gengetopt_args_info_help[20] ; - -} - -void -cmdline_parser_print_version (void) -{ - printf ("%s %s\n", - (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), - CMDLINE_PARSER_VERSION); - - if (strlen(gengetopt_args_info_versiontext) > 0) - printf("\n%s\n", gengetopt_args_info_versiontext); -} - -static void print_help_common(void) { - cmdline_parser_print_version (); - - if (strlen(gengetopt_args_info_purpose) > 0) - printf("\n%s\n", gengetopt_args_info_purpose); - - if (strlen(gengetopt_args_info_usage) > 0) - printf("\n%s\n", gengetopt_args_info_usage); - - printf("\n"); - - if (strlen(gengetopt_args_info_description) > 0) - printf("%s\n\n", gengetopt_args_info_description); -} - -void -cmdline_parser_print_help (void) -{ - int i = 0; - print_help_common(); - while (gengetopt_args_info_help[i]) - printf("%s\n", gengetopt_args_info_help[i++]); -} - -void -cmdline_parser_init (struct gengetopt_args_info *args_info) -{ - clear_given (args_info); - clear_args (args_info); - init_args_info (args_info); -} - -void -cmdline_parser_params_init(struct cmdline_parser_params *params) -{ - if (params) - { - params->override = 0; - params->initialize = 1; - params->check_required = 1; - params->check_ambiguity = 0; - params->print_errors = 1; - } -} - -struct cmdline_parser_params * -cmdline_parser_params_create(void) -{ - struct cmdline_parser_params *params = - (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); - cmdline_parser_params_init(params); - return params; -} - -static void -free_string_field (char **s) -{ - if (*s) - { - free (*s); - *s = 0; - } -} - - -static void -cmdline_parser_release (struct gengetopt_args_info *args_info) -{ - - free_string_field (&(args_info->conf_arg)); - free_string_field (&(args_info->conf_orig)); - free_string_field (&(args_info->pidfile_arg)); - free_string_field (&(args_info->pidfile_orig)); - free_string_field (&(args_info->statedir_arg)); - free_string_field (&(args_info->statedir_orig)); - free_string_field (&(args_info->listen_arg)); - free_string_field (&(args_info->listen_orig)); - free_string_field (&(args_info->net_arg)); - free_string_field (&(args_info->net_orig)); - free_string_field (&(args_info->ipup_arg)); - free_string_field (&(args_info->ipup_orig)); - free_string_field (&(args_info->ipdown_arg)); - free_string_field (&(args_info->ipdown_orig)); - free_string_field (&(args_info->dynip_arg)); - free_string_field (&(args_info->dynip_orig)); - free_string_field (&(args_info->statip_arg)); - free_string_field (&(args_info->statip_orig)); - free_string_field (&(args_info->pcodns1_arg)); - free_string_field (&(args_info->pcodns1_orig)); - free_string_field (&(args_info->pcodns2_arg)); - free_string_field (&(args_info->pcodns2_orig)); - free_string_field (&(args_info->timelimit_orig)); - free_string_field (&(args_info->apn_arg)); - free_string_field (&(args_info->apn_orig)); - free_string_field (&(args_info->qos_orig)); - free_string_field (&(args_info->logfile_arg)); - free_string_field (&(args_info->logfile_orig)); - free_string_field (&(args_info->loglevel_arg)); - free_string_field (&(args_info->loglevel_orig)); - - - - clear_given (args_info); -} - - -static void -write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) -{ - FIX_UNUSED (values); - if (arg) { - fprintf(outfile, "%s=\"%s\"\n", opt, arg); - } else { - fprintf(outfile, "%s\n", opt); - } -} - - -int -cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) -{ - int i = 0; - - if (!outfile) - { - fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); - return EXIT_FAILURE; - } - - if (args_info->help_given) - write_into_file(outfile, "help", 0, 0 ); - if (args_info->version_given) - write_into_file(outfile, "version", 0, 0 ); - if (args_info->fg_given) - write_into_file(outfile, "fg", 0, 0 ); - if (args_info->debug_given) - write_into_file(outfile, "debug", 0, 0 ); - if (args_info->conf_given) - write_into_file(outfile, "conf", args_info->conf_orig, 0); - if (args_info->pidfile_given) - write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); - if (args_info->statedir_given) - write_into_file(outfile, "statedir", args_info->statedir_orig, 0); - if (args_info->listen_given) - write_into_file(outfile, "listen", args_info->listen_orig, 0); - if (args_info->net_given) - write_into_file(outfile, "net", args_info->net_orig, 0); - if (args_info->ipup_given) - write_into_file(outfile, "ipup", args_info->ipup_orig, 0); - if (args_info->ipdown_given) - write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); - if (args_info->dynip_given) - write_into_file(outfile, "dynip", args_info->dynip_orig, 0); - if (args_info->statip_given) - write_into_file(outfile, "statip", args_info->statip_orig, 0); - if (args_info->pcodns1_given) - write_into_file(outfile, "pcodns1", args_info->pcodns1_orig, 0); - if (args_info->pcodns2_given) - write_into_file(outfile, "pcodns2", args_info->pcodns2_orig, 0); - if (args_info->timelimit_given) - write_into_file(outfile, "timelimit", args_info->timelimit_orig, 0); - if (args_info->apn_given) - write_into_file(outfile, "apn", args_info->apn_orig, 0); - if (args_info->qos_given) - write_into_file(outfile, "qos", args_info->qos_orig, 0); - if (args_info->logfile_given) - write_into_file(outfile, "logfile", args_info->logfile_orig, 0); - if (args_info->loglevel_given) - write_into_file(outfile, "loglevel", args_info->loglevel_orig, 0); - if (args_info->gtp_linux_given) - write_into_file(outfile, "gtp-linux", 0, 0 ); - - - i = EXIT_SUCCESS; - return i; -} - -int -cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) -{ - FILE *outfile; - int i = 0; - - outfile = fopen(filename, "w"); - - if (!outfile) - { - fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - i = cmdline_parser_dump(outfile, args_info); - fclose (outfile); - - return i; -} - -void -cmdline_parser_free (struct gengetopt_args_info *args_info) -{ - cmdline_parser_release (args_info); -} - -/** @brief replacement of strdup, which is not standard */ -char * -gengetopt_strdup (const char *s) -{ - char *result = 0; - if (!s) - return result; - - result = (char*)malloc(strlen(s) + 1); - if (result == (char*)0) - return (char*)0; - strcpy(result, s); - return result; -} - -int -cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) -{ - return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); -} - -int -cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int result; - result = cmdline_parser_internal (argc, argv, args_info, params, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) -{ - int result; - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); - - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} - -int -cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) -{ - FIX_UNUSED (args_info); - FIX_UNUSED (prog_name); - return EXIT_SUCCESS; -} - - -static char *package_name = 0; - -/** - * @brief updates an option - * @param field the generic pointer to the field to update - * @param orig_field the pointer to the orig field - * @param field_given the pointer to the number of occurrence of this option - * @param prev_given the pointer to the number of occurrence already seen - * @param value the argument for this option (if null no arg was specified) - * @param possible_values the possible values for this option (if specified) - * @param default_value the default value (in case the option only accepts fixed values) - * @param arg_type the type of this option - * @param check_ambiguity @see cmdline_parser_params.check_ambiguity - * @param override @see cmdline_parser_params.override - * @param no_free whether to free a possible previous value - * @param multiple_option whether this is a multiple option - * @param long_opt the corresponding long option - * @param short_opt the corresponding short option (or '-' if none) - * @param additional_error possible further error specification - */ -static -int update_arg(void *field, char **orig_field, - unsigned int *field_given, unsigned int *prev_given, - char *value, const char *possible_values[], - const char *default_value, - cmdline_parser_arg_type arg_type, - int check_ambiguity, int override, - int no_free, int multiple_option, - const char *long_opt, char short_opt, - const char *additional_error) -{ - char *stop_char = 0; - const char *val = value; - int found; - char **string_field; - FIX_UNUSED (field); - - stop_char = 0; - found = 0; - - if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) - { - if (short_opt != '-') - fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", - package_name, long_opt, short_opt, - (additional_error ? additional_error : "")); - else - fprintf (stderr, "%s: `--%s' option given more than once%s\n", - package_name, long_opt, - (additional_error ? additional_error : "")); - return 1; /* failure */ - } - - FIX_UNUSED (default_value); - - if (field_given && *field_given && ! override) - return 0; - if (prev_given) - (*prev_given)++; - if (field_given) - (*field_given)++; - if (possible_values) - val = possible_values[found]; - - switch(arg_type) { - case ARG_FLAG: - *((int *)field) = !*((int *)field); - break; - case ARG_INT: - if (val) *((int *)field) = strtol (val, &stop_char, 0); - break; - case ARG_STRING: - if (val) { - string_field = (char **)field; - if (!no_free && *string_field) - free (*string_field); /* free previous string */ - *string_field = gengetopt_strdup (val); - } - break; - default: - break; - }; - - /* check numeric conversion */ - switch(arg_type) { - case ARG_INT: - if (val && !(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); - return 1; /* failure */ - } - break; - default: - ; - }; - - /* store the original value */ - switch(arg_type) { - case ARG_NO: - case ARG_FLAG: - break; - default: - if (value && orig_field) { - if (no_free) { - *orig_field = value; - } else { - if (*orig_field) - free (*orig_field); /* free previous string */ - *orig_field = gengetopt_strdup (value); - } - } - }; - - return 0; /* OK */ -} - - -int -cmdline_parser_internal ( - int argc, char **argv, struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params, const char *additional_error) -{ - int c; /* Character of the parsed option. */ - - int error_occurred = 0; - struct gengetopt_args_info local_args_info; - - int override; - int initialize; - int check_required; - int check_ambiguity; - - package_name = argv[0]; - - override = params->override; - initialize = params->initialize; - check_required = params->check_required; - check_ambiguity = params->check_ambiguity; - - if (initialize) - cmdline_parser_init (args_info); - - cmdline_parser_init (&local_args_info); - - optarg = 0; - optind = 0; - opterr = params->print_errors; - optopt = '?'; - - while (1) - { - int option_index = 0; - - static struct option long_options[] = { - { "help", 0, NULL, 'h' }, - { "version", 0, NULL, 'V' }, - { "fg", 0, NULL, 'f' }, - { "debug", 0, NULL, 'd' }, - { "conf", 1, NULL, 'c' }, - { "pidfile", 1, NULL, 0 }, - { "statedir", 1, NULL, 0 }, - { "listen", 1, NULL, 'l' }, - { "net", 1, NULL, 'n' }, - { "ipup", 1, NULL, 0 }, - { "ipdown", 1, NULL, 0 }, - { "dynip", 1, NULL, 0 }, - { "statip", 1, NULL, 0 }, - { "pcodns1", 1, NULL, 0 }, - { "pcodns2", 1, NULL, 0 }, - { "timelimit", 1, NULL, 0 }, - { "apn", 1, NULL, 'a' }, - { "qos", 1, NULL, 'q' }, - { "logfile", 1, NULL, 0 }, - { "loglevel", 1, NULL, 0 }, - { "gtp-linux", 0, NULL, 'g' }, - { 0, 0, 0, 0 } - }; - - c = getopt_long (argc, argv, "hVfdc:l:n:a:q:g", long_options, &option_index); - - if (c == -1) break; /* Exit from `while (1)' loop. */ - - switch (c) - { - case 'h': /* Print help and exit. */ - cmdline_parser_print_help (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'V': /* Print version and exit. */ - cmdline_parser_print_version (); - cmdline_parser_free (&local_args_info); - exit (EXIT_SUCCESS); - - case 'f': /* Run in foreground. */ - - - if (update_arg((void *)&(args_info->fg_flag), 0, &(args_info->fg_given), - &(local_args_info.fg_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "fg", 'f', - additional_error)) - goto failure; - - break; - case 'd': /* Run in debug mode. */ - - - if (update_arg((void *)&(args_info->debug_flag), 0, &(args_info->debug_given), - &(local_args_info.debug_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "debug", 'd', - additional_error)) - goto failure; - - break; - case 'c': /* Read configuration file. */ - - - if (update_arg( (void *)&(args_info->conf_arg), - &(args_info->conf_orig), &(args_info->conf_given), - &(local_args_info.conf_given), optarg, 0, "/etc/ggsn.conf", ARG_STRING, - check_ambiguity, override, 0, 0, - "conf", 'c', - additional_error)) - goto failure; - - break; - case 'l': /* Local interface. */ - - - if (update_arg( (void *)&(args_info->listen_arg), - &(args_info->listen_orig), &(args_info->listen_given), - &(local_args_info.listen_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "listen", 'l', - additional_error)) - goto failure; - - break; - case 'n': /* Network. */ - - - if (update_arg( (void *)&(args_info->net_arg), - &(args_info->net_orig), &(args_info->net_given), - &(local_args_info.net_given), optarg, 0, "192.168.0.0/24", ARG_STRING, - check_ambiguity, override, 0, 0, - "net", 'n', - additional_error)) - goto failure; - - break; - case 'a': /* Access point name. */ - - - if (update_arg( (void *)&(args_info->apn_arg), - &(args_info->apn_orig), &(args_info->apn_given), - &(local_args_info.apn_given), optarg, 0, "internet", ARG_STRING, - check_ambiguity, override, 0, 0, - "apn", 'a', - additional_error)) - goto failure; - - break; - case 'q': /* Requested quality of service. */ - - - if (update_arg( (void *)&(args_info->qos_arg), - &(args_info->qos_orig), &(args_info->qos_given), - &(local_args_info.qos_given), optarg, 0, "0x0b921f", ARG_INT, - check_ambiguity, override, 0, 0, - "qos", 'q', - additional_error)) - goto failure; - - break; - case 'g': /* GTP linux kernel support. */ - - - if (update_arg((void *)&(args_info->gtp_linux_flag), 0, &(args_info->gtp_linux_given), - &(local_args_info.gtp_linux_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "gtp-linux", 'g', - additional_error)) - goto failure; - - break; - - case 0: /* Long option with no short option */ - /* Filename of process id file. */ - if (strcmp (long_options[option_index].name, "pidfile") == 0) - { - - - if (update_arg( (void *)&(args_info->pidfile_arg), - &(args_info->pidfile_orig), &(args_info->pidfile_given), - &(local_args_info.pidfile_given), optarg, 0, "/var/run/ggsn.pid", ARG_STRING, - check_ambiguity, override, 0, 0, - "pidfile", '-', - additional_error)) - goto failure; - - } - /* Directory of nonvolatile data. */ - else if (strcmp (long_options[option_index].name, "statedir") == 0) - { - - - if (update_arg( (void *)&(args_info->statedir_arg), - &(args_info->statedir_orig), &(args_info->statedir_given), - &(local_args_info.statedir_given), optarg, 0, "/var/lib/ggsn/", ARG_STRING, - check_ambiguity, override, 0, 0, - "statedir", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-up. */ - else if (strcmp (long_options[option_index].name, "ipup") == 0) - { - - - if (update_arg( (void *)&(args_info->ipup_arg), - &(args_info->ipup_orig), &(args_info->ipup_given), - &(local_args_info.ipup_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipup", '-', - additional_error)) - goto failure; - - } - /* Script to run after link-down. */ - else if (strcmp (long_options[option_index].name, "ipdown") == 0) - { - - - if (update_arg( (void *)&(args_info->ipdown_arg), - &(args_info->ipdown_orig), &(args_info->ipdown_given), - &(local_args_info.ipdown_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "ipdown", '-', - additional_error)) - goto failure; - - } - /* Dynamic IP address pool. */ - else if (strcmp (long_options[option_index].name, "dynip") == 0) - { - - - if (update_arg( (void *)&(args_info->dynip_arg), - &(args_info->dynip_orig), &(args_info->dynip_given), - &(local_args_info.dynip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "dynip", '-', - additional_error)) - goto failure; - - } - /* Static IP address pool. */ - else if (strcmp (long_options[option_index].name, "statip") == 0) - { - - - if (update_arg( (void *)&(args_info->statip_arg), - &(args_info->statip_orig), &(args_info->statip_given), - &(local_args_info.statip_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "statip", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 1. */ - else if (strcmp (long_options[option_index].name, "pcodns1") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns1_arg), - &(args_info->pcodns1_orig), &(args_info->pcodns1_given), - &(local_args_info.pcodns1_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns1", '-', - additional_error)) - goto failure; - - } - /* PCO DNS Server 2. */ - else if (strcmp (long_options[option_index].name, "pcodns2") == 0) - { - - - if (update_arg( (void *)&(args_info->pcodns2_arg), - &(args_info->pcodns2_orig), &(args_info->pcodns2_given), - &(local_args_info.pcodns2_given), optarg, 0, "0.0.0.0", ARG_STRING, - check_ambiguity, override, 0, 0, - "pcodns2", '-', - additional_error)) - goto failure; - - } - /* Exit after timelimit seconds. */ - else if (strcmp (long_options[option_index].name, "timelimit") == 0) - { - - - if (update_arg( (void *)&(args_info->timelimit_arg), - &(args_info->timelimit_orig), &(args_info->timelimit_given), - &(local_args_info.timelimit_given), optarg, 0, "0", ARG_INT, - check_ambiguity, override, 0, 0, - "timelimit", '-', - additional_error)) - goto failure; - - } - /* Logfile for errors. */ - else if (strcmp (long_options[option_index].name, "logfile") == 0) - { - - - if (update_arg( (void *)&(args_info->logfile_arg), - &(args_info->logfile_orig), &(args_info->logfile_given), - &(local_args_info.logfile_given), optarg, 0, 0, ARG_STRING, - check_ambiguity, override, 0, 0, - "logfile", '-', - additional_error)) - goto failure; - - } - /* Global log ldevel. */ - else if (strcmp (long_options[option_index].name, "loglevel") == 0) - { - - - if (update_arg( (void *)&(args_info->loglevel_arg), - &(args_info->loglevel_orig), &(args_info->loglevel_given), - &(local_args_info.loglevel_given), optarg, 0, "error", ARG_STRING, - check_ambiguity, override, 0, 0, - "loglevel", '-', - additional_error)) - goto failure; - - } - - break; - case '?': /* Invalid option. */ - /* `getopt_long' already printed an error message. */ - goto failure; - - default: /* bug: option not considered. */ - fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); - abort (); - } /* switch */ - } /* while */ - - - - - cmdline_parser_release (&local_args_info); - - if ( error_occurred ) - return (EXIT_FAILURE); - - return 0; - -failure: - - cmdline_parser_release (&local_args_info); - return (EXIT_FAILURE); -} - -#ifndef CONFIG_FILE_LINE_SIZE -#define CONFIG_FILE_LINE_SIZE 2048 -#endif -#define ADDITIONAL_ERROR " in configuration file " - -#define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) -/* 3 is for "--" and "=" */ - -static int -_cmdline_parser_configfile (const char *filename, int *my_argc) -{ - FILE* file; - char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE+1]; - char linebuf[CONFIG_FILE_LINE_SIZE]; - int line_num = 0; - int result = 0, equal; - char *fopt, *farg; - char *str_index; - size_t len, next_token; - char delimiter; - - if ((file = fopen(filename, "r")) == 0) - { - fprintf (stderr, "%s: Error opening configuration file '%s'\n", - CMDLINE_PARSER_PACKAGE, filename); - return EXIT_FAILURE; - } - - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) - { - ++line_num; - my_argv[0] = '\0'; - len = strlen(linebuf); - if (len > (CONFIG_FILE_LINE_BUFFER_SIZE-1)) - { - fprintf (stderr, "%s:%s:%d: Line too long in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - - /* find first non-whitespace character in the line */ - next_token = strspn (linebuf, " \t\r\n"); - str_index = linebuf + next_token; - - if ( str_index[0] == '\0' || str_index[0] == '#') - continue; /* empty line or comment line is skipped */ - - fopt = str_index; - - /* truncate fopt at the end of the first non-valid character */ - next_token = strcspn (fopt, " \t\r\n="); - - if (fopt[next_token] == '\0') /* the line is over */ - { - farg = 0; - equal = 0; - goto noarg; - } - - /* remember if equal sign is present */ - equal = (fopt[next_token] == '='); - fopt[next_token++] = '\0'; - - /* advance pointers to the next token after the end of fopt */ - next_token += strspn (fopt + next_token, " \t\r\n"); - - /* check for the presence of equal sign, and if so, skip it */ - if ( !equal ) - if ((equal = (fopt[next_token] == '='))) - { - next_token++; - next_token += strspn (fopt + next_token, " \t\r\n"); - } - str_index += next_token; - - /* find argument */ - farg = str_index; - if ( farg[0] == '\"' || farg[0] == '\'' ) - { /* quoted argument */ - str_index = strchr (++farg, str_index[0] ); /* skip opening quote */ - if (! str_index) - { - fprintf - (stderr, - "%s:%s:%d: unterminated string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - else - { /* read up the remaining part up to a delimiter */ - next_token = strcspn (farg, " \t\r\n#\'\""); - str_index += next_token; - } - - /* truncate farg at the delimiter and store it for further check */ - delimiter = *str_index, *str_index++ = '\0'; - - /* everything but comment is illegal at the end of line */ - if (delimiter != '\0' && delimiter != '#') - { - str_index += strspn(str_index, " \t\r\n"); - if (*str_index != '\0' && *str_index != '#') - { - fprintf - (stderr, - "%s:%s:%d: malformed string in configuration file\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - result = EXIT_FAILURE; - break; - } - } - - noarg: - if (!strcmp(fopt,"include")) { - if (farg && *farg) { - result = _cmdline_parser_configfile(farg, my_argc); - } else { - fprintf(stderr, "%s:%s:%d: include requires a filename argument.\n", - CMDLINE_PARSER_PACKAGE, filename, line_num); - } - continue; - } - len = strlen(fopt); - strcat (my_argv, len > 1 ? "--" : "-"); - strcat (my_argv, fopt); - if (len > 1 && ((farg && *farg) || equal)) - strcat (my_argv, "="); - if (farg && *farg) - strcat (my_argv, farg); - ++(*my_argc); - - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(my_argv); - } /* while */ - - if (file) - fclose(file); - return result; -} - -int -cmdline_parser_configfile ( - const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required) -{ - struct cmdline_parser_params params; - - params.override = override; - params.initialize = initialize; - params.check_required = check_required; - params.check_ambiguity = 0; - params.print_errors = 1; - - return cmdline_parser_config_file (filename, args_info, ¶ms); -} - -int -cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params) -{ - int i, result; - int my_argc = 1; - char **my_argv_arg; - char *additional_error; - - /* store the program name */ - cmd_line_list_tmp = (struct line_list *) malloc (sizeof (struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup (CMDLINE_PARSER_PACKAGE); - - result = _cmdline_parser_configfile(filename, &my_argc); - - if (result != EXIT_FAILURE) { - my_argv_arg = (char **) malloc((my_argc+1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - - my_argv_arg[my_argc] = 0; - - additional_error = (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy (additional_error, ADDITIONAL_ERROR); - strcat (additional_error, filename); - result = - cmdline_parser_internal (my_argc, my_argv_arg, args_info, - params, - additional_error); - - free (additional_error); - free (my_argv_arg); - } - - free_cmd_list(); - if (result == EXIT_FAILURE) - { - cmdline_parser_free (args_info); - exit (EXIT_FAILURE); - } - - return result; -} diff --git a/ggsn/cmdline.ggo b/ggsn/cmdline.ggo deleted file mode 100644 index 7426707..0000000 --- a/ggsn/cmdline.ggo +++ /dev/null @@ -1,38 +0,0 @@ -# OpenGGSN - Gateway GPRS Support Node -# Copyright (C) 2002, 2003, 2004 Mondru AB. -# -# The contents of this file may be used under the terms of the GNU -# General Public License Version 2, provided that the above copyright -# notice and this permission notice is included in all copies or -# substantial portions of the software. -# -# Use "gengetopt --conf-parser < cmdline.ggo" -# to generate cmdline.c and cmdline.h - -option "fg" f "Run in foreground" flag off -option "debug" d "Run in debug mode" flag off - -option "conf" c "Read configuration file" string default="/etc/ggsn.conf" no -option "pidfile" - "Filename of process id file" string default="/var/run/ggsn.pid" no -option "statedir" - "Directory of nonvolatile data" string default="/var/lib/ggsn/" no - -option "listen" l "Local interface" string no -option "net" n "Network" string default="192.168.0.0/24" no -option "ipup" - "Script to run after link-up" string no -option "ipdown" - "Script to run after link-down" string no - -option "dynip" - "Dynamic IP address pool" string no -option "statip" - "Static IP address pool" string no - -option "pcodns1" - "PCO DNS Server 1" string default="0.0.0.0" no -option "pcodns2" - "PCO DNS Server 2" string default="0.0.0.0" no - -option "timelimit" - "Exit after timelimit seconds" int default="0" no - -option "apn" a "Access point name" string default="internet" no -option "qos" q "Requested quality of service" int default="0x0b921f" no -option "logfile" - "Logfile for errors" string no -option "loglevel" - "Global log ldevel" string default="error" no - -option "gtp-linux" g "GTP linux kernel support" flag off - diff --git a/ggsn/cmdline.h b/ggsn/cmdline.h deleted file mode 100644 index 57f5cae..0000000 --- a/ggsn/cmdline.h +++ /dev/null @@ -1,275 +0,0 @@ -/** @file cmdline.h - * @brief The header file for the command line option parser - * generated by GNU Gengetopt version 2.22.6 - * http://www.gnu.org/software/gengetopt. - * DO NOT modify this file, since it can be overwritten - * @author GNU Gengetopt by Lorenzo Bettini */ - -#ifndef CMDLINE_H -#define CMDLINE_H - -/* If we use autoconf. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include /* for FILE */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef CMDLINE_PARSER_PACKAGE -/** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE -#endif - -#ifndef CMDLINE_PARSER_PACKAGE_NAME -/** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif -#endif - -#ifndef CMDLINE_PARSER_VERSION -/** @brief the program version */ -#define CMDLINE_PARSER_VERSION VERSION -#endif - -/** @brief Where the command line options are stored */ -struct gengetopt_args_info -{ - const char *help_help; /**< @brief Print help and exit help description. */ - const char *version_help; /**< @brief Print version and exit help description. */ - int fg_flag; /**< @brief Run in foreground (default=off). */ - const char *fg_help; /**< @brief Run in foreground help description. */ - int debug_flag; /**< @brief Run in debug mode (default=off). */ - const char *debug_help; /**< @brief Run in debug mode help description. */ - char * conf_arg; /**< @brief Read configuration file (default='/etc/ggsn.conf'). */ - char * conf_orig; /**< @brief Read configuration file original value given at command line. */ - const char *conf_help; /**< @brief Read configuration file help description. */ - char * pidfile_arg; /**< @brief Filename of process id file (default='/var/run/ggsn.pid'). */ - char * pidfile_orig; /**< @brief Filename of process id file original value given at command line. */ - const char *pidfile_help; /**< @brief Filename of process id file help description. */ - char * statedir_arg; /**< @brief Directory of nonvolatile data (default='/var/lib/ggsn/'). */ - char * statedir_orig; /**< @brief Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /**< @brief Directory of nonvolatile data help description. */ - char * listen_arg; /**< @brief Local interface. */ - char * listen_orig; /**< @brief Local interface original value given at command line. */ - const char *listen_help; /**< @brief Local interface help description. */ - char * net_arg; /**< @brief Network (default='192.168.0.0/24'). */ - char * net_orig; /**< @brief Network original value given at command line. */ - const char *net_help; /**< @brief Network help description. */ - char * ipup_arg; /**< @brief Script to run after link-up. */ - char * ipup_orig; /**< @brief Script to run after link-up original value given at command line. */ - const char *ipup_help; /**< @brief Script to run after link-up help description. */ - char * ipdown_arg; /**< @brief Script to run after link-down. */ - char * ipdown_orig; /**< @brief Script to run after link-down original value given at command line. */ - const char *ipdown_help; /**< @brief Script to run after link-down help description. */ - char * dynip_arg; /**< @brief Dynamic IP address pool. */ - char * dynip_orig; /**< @brief Dynamic IP address pool original value given at command line. */ - const char *dynip_help; /**< @brief Dynamic IP address pool help description. */ - char * statip_arg; /**< @brief Static IP address pool. */ - char * statip_orig; /**< @brief Static IP address pool original value given at command line. */ - const char *statip_help; /**< @brief Static IP address pool help description. */ - char * pcodns1_arg; /**< @brief PCO DNS Server 1 (default='0.0.0.0'). */ - char * pcodns1_orig; /**< @brief PCO DNS Server 1 original value given at command line. */ - const char *pcodns1_help; /**< @brief PCO DNS Server 1 help description. */ - char * pcodns2_arg; /**< @brief PCO DNS Server 2 (default='0.0.0.0'). */ - char * pcodns2_orig; /**< @brief PCO DNS Server 2 original value given at command line. */ - const char *pcodns2_help; /**< @brief PCO DNS Server 2 help description. */ - int timelimit_arg; /**< @brief Exit after timelimit seconds (default='0'). */ - char * timelimit_orig; /**< @brief Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /**< @brief Exit after timelimit seconds help description. */ - char * apn_arg; /**< @brief Access point name (default='internet'). */ - char * apn_orig; /**< @brief Access point name original value given at command line. */ - const char *apn_help; /**< @brief Access point name help description. */ - int qos_arg; /**< @brief Requested quality of service (default='0x0b921f'). */ - char * qos_orig; /**< @brief Requested quality of service original value given at command line. */ - const char *qos_help; /**< @brief Requested quality of service help description. */ - char * logfile_arg; /**< @brief Logfile for errors. */ - char * logfile_orig; /**< @brief Logfile for errors original value given at command line. */ - const char *logfile_help; /**< @brief Logfile for errors help description. */ - char * loglevel_arg; /**< @brief Global log ldevel (default='error'). */ - char * loglevel_orig; /**< @brief Global log ldevel original value given at command line. */ - const char *loglevel_help; /**< @brief Global log ldevel help description. */ - int gtp_linux_flag; /**< @brief GTP linux kernel support (default=off). */ - const char *gtp_linux_help; /**< @brief GTP linux kernel support help description. */ - - unsigned int help_given ; /**< @brief Whether help was given. */ - unsigned int version_given ; /**< @brief Whether version was given. */ - unsigned int fg_given ; /**< @brief Whether fg was given. */ - unsigned int debug_given ; /**< @brief Whether debug was given. */ - unsigned int conf_given ; /**< @brief Whether conf was given. */ - unsigned int pidfile_given ; /**< @brief Whether pidfile was given. */ - unsigned int statedir_given ; /**< @brief Whether statedir was given. */ - unsigned int listen_given ; /**< @brief Whether listen was given. */ - unsigned int net_given ; /**< @brief Whether net was given. */ - unsigned int ipup_given ; /**< @brief Whether ipup was given. */ - unsigned int ipdown_given ; /**< @brief Whether ipdown was given. */ - unsigned int dynip_given ; /**< @brief Whether dynip was given. */ - unsigned int statip_given ; /**< @brief Whether statip was given. */ - unsigned int pcodns1_given ; /**< @brief Whether pcodns1 was given. */ - unsigned int pcodns2_given ; /**< @brief Whether pcodns2 was given. */ - unsigned int timelimit_given ; /**< @brief Whether timelimit was given. */ - unsigned int apn_given ; /**< @brief Whether apn was given. */ - unsigned int qos_given ; /**< @brief Whether qos was given. */ - unsigned int logfile_given ; /**< @brief Whether logfile was given. */ - unsigned int loglevel_given ; /**< @brief Whether loglevel was given. */ - unsigned int gtp_linux_given ; /**< @brief Whether gtp-linux was given. */ - -} ; - -/** @brief The additional parameters to pass to parser functions */ -struct cmdline_parser_params -{ - int override; /**< @brief whether to override possibly already present options (default 0) */ - int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ - int check_required; /**< @brief whether to check that all required options were provided (default 1) */ - int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ - int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ -} ; - -/** @brief the purpose string of the program */ -extern const char *gengetopt_args_info_purpose; -/** @brief the usage string of the program */ -extern const char *gengetopt_args_info_usage; -/** @brief the description string of the program */ -extern const char *gengetopt_args_info_description; -/** @brief all the lines making the help output */ -extern const char *gengetopt_args_info_help[]; - -/** - * The command line parser - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser (int argc, char **argv, - struct gengetopt_args_info *args_info); - -/** - * The command line parser (version with additional parameters - deprecated) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_ext() instead - */ -int cmdline_parser2 (int argc, char **argv, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The command line parser (version with additional parameters) - * @param argc the number of command line options - * @param argv the command line options - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_ext (int argc, char **argv, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Save the contents of the option struct into an already open FILE stream. - * @param outfile the stream where to dump options - * @param args_info the option struct to dump - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_dump(FILE *outfile, - struct gengetopt_args_info *args_info); - -/** - * Save the contents of the option struct into a (text) file. - * This file can be read by the config file parser (if generated by gengetopt) - * @param filename the file where to save - * @param args_info the option struct to save - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_file_save(const char *filename, - struct gengetopt_args_info *args_info); - -/** - * Print the help - */ -void cmdline_parser_print_help(void); -/** - * Print the version - */ -void cmdline_parser_print_version(void); - -/** - * Initializes all the fields a cmdline_parser_params structure - * to their default values - * @param params the structure to initialize - */ -void cmdline_parser_params_init(struct cmdline_parser_params *params); - -/** - * Allocates dynamically a cmdline_parser_params structure and initializes - * all its fields to their default values - * @return the created and initialized cmdline_parser_params structure - */ -struct cmdline_parser_params *cmdline_parser_params_create(void); - -/** - * Initializes the passed gengetopt_args_info structure's fields - * (also set default values for options that have a default) - * @param args_info the structure to initialize - */ -void cmdline_parser_init (struct gengetopt_args_info *args_info); -/** - * Deallocates the string fields of the gengetopt_args_info structure - * (but does not deallocate the structure itself) - * @param args_info the structure to deallocate - */ -void cmdline_parser_free (struct gengetopt_args_info *args_info); - -/** - * The config file parser (deprecated version) - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param override whether to override possibly already present options - * @param initialize whether to initialize the option structure my_args_info - * @param check_required whether to check that all required options were provided - * @return 0 if everything went fine, NON 0 if an error took place - * @deprecated use cmdline_parser_config_file() instead - */ -int cmdline_parser_configfile (const char *filename, - struct gengetopt_args_info *args_info, - int override, int initialize, int check_required); - -/** - * The config file parser - * @param filename the name of the config file - * @param args_info the structure where option information will be stored - * @param params additional parameters for the parser - * @return 0 if everything went fine, NON 0 if an error took place - */ -int cmdline_parser_config_file (const char *filename, - struct gengetopt_args_info *args_info, - struct cmdline_parser_params *params); - -/** - * Checks that all the required options were specified - * @param args_info the structure to check - * @param prog_name the name of the program that will be used to print - * possible errors - * @return - */ -int cmdline_parser_required (struct gengetopt_args_info *args_info, - const char *prog_name); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* CMDLINE_H */ diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d865707..2bf3d7e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,6 +1,7 @@ /* * OpenGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -19,42 +20,43 @@ #include "../config.h" -#include - #ifdef HAVE_STDINT_H #include #endif +#include #include -#include #include #include #include #include +#include +#include +#include #include -#include +#include + +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - +#include #include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include #include "../lib/tun.h" #include "../lib/ippool.h" @@ -62,82 +64,188 @@ #include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" -#include "cmdline.h" #include "gtp-kernel.h" #include "icmpv6.h" +#include "ggsn.h" -int end = 0; -int maxfd = 0; /* For select() */ +void *tall_ggsn_ctx; -struct in_addr listen_; -struct in46_addr netaddr, destaddr, net; /* Network interface */ -size_t prefixlen; -struct in46_addr dns1, dns2; /* PCO DNS address */ -char *ipup, *ipdown; /* Filename of scripts */ -int debug; /* Print debug output */ -struct ul255_t pco; +static int end = 0; +static int daemonize = 0; +static struct ctrl_handle *g_ctrlh; + struct ul255_t qos; struct ul255_t apn; -struct gsn_t *gsn; /* GSN instance */ -struct tun_t *tun; /* TUN instance */ -struct ippool_t *ippool; /* Pool of IP addresses */ +#define LOGPAPN(level, apn, fmt, args...) \ + LOGP(DGGSN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args) -/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ -void signal_handler(int s) +#define LOGPGGSN(level, ggsn, fmt, args...) \ + LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) + +#define LOGPPDP(level, pdp, fmt, args...) \ + LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); + + +static void pool_close_all_pdp(struct ippool_t *pool) { - DEBUGP(DGGSN, "Received signal %d, exiting.\n", s); - end = 1; -} + unsigned int i; -/* Used to write process ID to file. Assume someone else will delete */ -void log_pid(char *pidfile) -{ - FILE *file; - mode_t oldmask; - - oldmask = umask(022); - file = fopen(pidfile, "w"); - umask(oldmask); - if (!file) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to create process ID file: %s!", pidfile); + if (!pool) return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + struct pdp_t *pdp; + + if (!member->inuse) + continue; + pdp = member->peer; + if (!pdp) + continue; + LOGPPDP(LOGL_DEBUG, pdp, "Sending DELETE PDP CTX due to shutdown\n"); + gtp_delete_context_req(pdp->gsn, pdp, NULL, 1); } - fprintf(file, "%d\n", (int)getpid()); - fclose(file); } -#if defined(__sun__) -int daemon(int nochdir, int noclose) +int apn_stop(struct apn_ctx *apn, bool force) { - int fd; + if (!apn->started) + return 0; - switch (fork()) { - case -1: - return (-1); - case 0: + LOGPAPN(LOGL_NOTICE, apn, "%sStopping\n", force ? "FORCED " : ""); + /* check if pools have any active PDP contexts and bail out */ + pool_close_all_pdp(apn->v4.pool); + pool_close_all_pdp(apn->v6.pool); + + /* shutdown whatever old state might be left */ + if (apn->tun.tun) { + /* run ip-down script */ + if (apn->tun.cfg.ipdown_script) { + LOGPAPN( LOGL_INFO, apn, "Running %s\n", apn->tun.cfg.ipdown_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipdown_script); + } + /* release tun device */ + LOGPAPN(LOGL_INFO, apn, "Closing TUN device\n"); + osmo_fd_unregister(&apn->tun.fd); + tun_free(apn->tun.tun); + apn->tun.tun = NULL; + } + + if (apn->v4.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv4 pool\n"); + ippool_free(apn->v4.pool); + apn->v4.pool = NULL; + } + if (apn->v6.pool) { + LOGPAPN(LOGL_INFO, apn, "Releasing IPv6 pool\n"); + ippool_free(apn->v6.pool); + apn->v6.pool = NULL; + } + + apn->started = false; + return 0; +} + +/* actually start the APN with its current config */ +int apn_start(struct apn_ctx *apn) +{ + if (apn->started) + return 0; + + LOGPAPN(LOGL_INFO, apn, "Starting\n"); + switch (apn->cfg.gtpu_mode) { + case APN_GTPU_MODE_TUN: + LOGPAPN(LOGL_INFO, apn, "Opening TUN device %s\n", apn->tun.cfg.dev_name); + if (tun_new(&apn->tun.tun, apn->tun.cfg.dev_name)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to configure tun device\n"); + return -1; + } + LOGPAPN(LOGL_INFO, apn, "Opened TUN device %s\n", apn->tun.tun->devname); + + /* Register with libosmcoore */ + osmo_fd_setup(&apn->tun.fd, apn->tun.tun->fd, BSC_FD_READ, ggsn_tun_fd_cb, apn, 0); + osmo_fd_register(&apn->tun.fd); + + /* Set TUN library callback */ + tun_set_cb_ind(apn->tun.tun, cb_tun_ind); + + if (apn->v4.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IP address %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v4.cfg.ifconfig_prefix.addr, NULL, + apn->v4.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv4 address %s: %s\n", + in46p_ntoa(&apn->v4.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->v6.cfg.ifconfig_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Setting tun IPv6 address %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix)); + if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL, + apn->v6.cfg.ifconfig_prefix.prefixlen)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s\n", + in46p_ntoa(&apn->v6.cfg.ifconfig_prefix), strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + + if (apn->tun.cfg.ipup_script) { + LOGPAPN(LOGL_INFO, apn, "Running ip-up script %s\n", + apn->tun.cfg.ipup_script); + tun_runscript(apn->tun.tun, apn->tun.cfg.ipup_script); + } + /* set back-pointer from TUN device to APN */ + apn->tun.tun->priv = apn; + break; + case APN_GTPU_MODE_KERNEL_GTP: + LOGPAPN(LOGL_ERROR, apn, "FIXME: Kernel GTP\n"); +#if 0 + /* use GTP kernel module for data packet encapsulation */ + if (gtp_kernel_init(gsn, &net.v4, prefixlen, net_arg) < 0) + goto err; +#endif break; default: - _exit(0); + LOGPAPN(LOGL_ERROR, apn, "Unknown GTPU Mode %d\n", apn->cfg.gtpu_mode); + return -1; } - if (setsid() == -1) - return (-1); - - if (!nochdir) - chdir("/"); - - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { - dup2(fd, STDIN_FILENO); - dup2(fd, STDOUT_FILENO); - dup2(fd, STDERR_FILENO); - if (fd > 2) - close(fd); + /* Create IPv4 pool */ + if (apn->v4.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv4 pool %s\n", + in46p_ntoa(&apn->v4.cfg.dynamic_prefix)); + if (ippool_new(&apn->v4.pool, &apn->v4.cfg.dynamic_prefix, + &apn->v4.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv4 pool\n"); + apn_stop(apn, false); + return -1; + } } - return (0); + + /* Create IPv6 pool */ + if (apn->v6.cfg.dynamic_prefix.addr.len) { + LOGPAPN(LOGL_INFO, apn, "Creating IPv6 pool %s\n", + in46p_ntoa(&apn->v6.cfg.dynamic_prefix)); + if (ippool_new(&apn->v6.pool, &apn->v6.cfg.dynamic_prefix, + &apn->v6.cfg.static_prefix, 0)) { + LOGPAPN(LOGL_ERROR, apn, "Failed to create IPv6 pool\n"); + apn_stop(apn, false); + return -1; + } + } + + LOGPAPN(LOGL_NOTICE, apn, "Successfully started\n"); + apn->started = true; + return 0; } -#endif static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { @@ -148,27 +256,29 @@ snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); - if (ctrl_cmd_send_trap(gsn->priv, var, val) < 0) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); + if (ctrl_cmd_send_trap(g_ctrlh, var, val) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Failed to create and send TRAP %s\n", var); return false; } return true; } -int delete_context(struct pdp_t *pdp) +static int delete_context(struct pdp_t *pdp) { - DEBUGP(DGGSN, "Deleting PDP context\n"); + struct gsn_t *gsn = pdp->gsn; + struct ippoolm_t *ipp = (struct ippoolm_t *)pdp->peer; + + LOGPPDP(LOGL_INFO, pdp, "Deleting PDP context\n"); struct ippoolm_t *member = pdp->peer; if (pdp->peer) { send_trap(gsn, pdp, member, "imsi-rem-ip"); /* TRAP with IP removal */ - ippool_freeip(ippool, (struct ippoolm_t *)pdp->peer); + ippool_freeip(ipp->pool, ipp); } else - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Peer not defined!"); + LOGPPDP(LOGL_ERROR, pdp, "Cannot find/free IP Pool member\n"); if (gtp_kernel_tunnel_del(pdp)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot delete tunnel from kernel: %s\n", + LOGPPDP(LOGL_ERROR, pdp, "Cannot delete tunnel from kernel:%s\n", strerror(errno)); } @@ -236,31 +346,74 @@ return false; } +/* construct an IPCP PCO from up to two given DNS addreses */ +static int build_ipcp_pco(struct msgb *msg, uint8_t id, const struct in46_addr *dns1, + const struct in46_addr *dns2) +{ + uint8_t *len1, *len2; + uint8_t *start = msg->tail; + unsigned int len_appended; + + /* Three byte T16L header */ + msgb_put_u16(msg, 0x8021); /* IPCP */ + len1 = msgb_put(msg, 1); /* Length of contents: delay */ + + msgb_put_u8(msg, 0x02); /* ACK */ + msgb_put_u8(msg, id); /* ID: Needs to match request */ + msgb_put_u8(msg, 0x00); /* Length MSB */ + len2 = msgb_put(msg, 1); /* Length LSB: delay */ + + if (dns1 && dns1->len == 4) { + msgb_put_u8(msg, 0x81); /* DNS1 Tag */ + msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ + msgb_put_u32(msg, dns1->v4.s_addr); + } + + if (dns2 && dns2->len == 4) { + msgb_put_u8(msg, 0x83); /* DNS2 Tag */ + msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ + msgb_put_u32(msg, dns2->v4.s_addr); + } + + /* patch in length values */ + len_appended = msg->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; + + return 0; +} + /* process one PCO request from a MS/UE, putting together the proper responses */ -static void process_pco(struct pdp_t *pdp) +static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + unsigned int i; + + OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ /* FIXME: also check if primary / secondary DNS was requested */ if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { /* FIXME: properly implement this for IPCP */ - uint8_t *cur = msgb_put(msg, pco.l-1); - memcpy(cur, pco.v+1, pco.l-1); + build_ipcp_pco(msg, 0, &apn->v4.cfg.dns[0], &apn->v4.cfg.dns[1]); } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { - if (dns1.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); - if (dns2.len == 16) - msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + if (i46a->len != 16) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); + } } if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { - if (dns1.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); - if (dns2.len == 4) - msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + if (i46a->len != 4) + continue; + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); + } } if (msgb_length(msg) > 1) { @@ -274,11 +427,29 @@ int create_context_ind(struct pdp_t *pdp) { + static char name_buf[256]; + struct gsn_t *gsn = pdp->gsn; + struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr; struct ippoolm_t *member; + struct apn_ctx *apn; int rc; - DEBUGP(DGGSN, "Received create PDP context request\n"); + osmo_apn_to_str(name_buf, pdp->apn_req.v, pdp->apn_req.l); + + LOGPPDP(LOGL_DEBUG, pdp, "Processing create PDP context request for APN '%s'\n", name_buf); + + /* First find an exact APN name match */ + apn = ggsn_find_apn(ggsn, name_buf); + /* then try default (if any) */ + if (!apn) + apn = ggsn->cfg.default_apn; + if (!apn) { + /* no APN found for what user requested */ + LOGPPDP(LOGL_NOTICE, pdp, "Unknown APN '%s', rejecting\n", name_buf); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_MISSING_APN); + return 0; + } /* FIXME: we manually force all context requests to dynamic here! */ if (pdp->eua.l > 2) @@ -290,21 +461,30 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + LOGPPDP(LOGL_ERROR, pdp, "Cannot decode EUA from MS/SGSN: %s\n", osmo_hexdump(pdp->eua.v, pdp->eua.l)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); return 0; } - rc = ippool_newip(ippool, &member, &addr, 0); - if (rc < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); - gtp_create_context_resp(gsn, pdp, -rc); - return 0; /* Allready in use, or no more available */ - } + if (addr.len == sizeof(struct in_addr)) { + rc = ippool_newip(apn->v4.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + in46a_to_eua(&member->addr, &pdp->eua); - if (addr.len == sizeof(struct in6_addr)) { + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ + if (gtp_kernel_tunnel_add(pdp) < 0) { + LOGPPDP(LOGL_ERROR, pdp, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; + } + } else if (addr.len == sizeof(struct in6_addr)) { struct in46_addr tmp; + rc = ippool_newip(apn->v6.pool, &member, &addr, 0); + if (rc < 0) + goto err_pool_full; + /* IPv6 doesn't really send the real/allocated address at this point, but just * the link-identifier which the MS shall use for router solicitation */ tmp.len = addr.len; @@ -314,43 +494,46 @@ memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); in46a_to_eua(&tmp, &pdp->eua); } else - in46a_to_eua(&member->addr, &pdp->eua); - pdp->peer = member; - pdp->ipif = tun; /* TODO */ - member->peer = pdp; + OSMO_ASSERT(0); - /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ - if (gtp_kernel_tunnel_add(pdp) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Cannot add tunnel to kernel: %s\n", strerror(errno)); - gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); - return 0; - } + pdp->peer = member; + pdp->ipif = apn->tun.tun; /* TODO */ + member->peer = pdp; if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } - process_pco(pdp); + process_pco(apn, pdp); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ + +err_pool_full: + LOGPPDP(LOGL_ERROR, pdp, "Cannot allocate IP address from pool (full!)\n"); + gtp_create_context_resp(gsn, pdp, -rc); + return 0; /* Already in use, or no more available */ } -/* Callback for receiving messages from tun */ -int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) +/* Internet-originated IP packet, needs to be sent via GTP towards MS */ +static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { + struct apn_ctx *apn = tun->priv; struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + struct ippool_t *pool; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + pool = apn->v4.pool; } else if (iph->version == 6) { /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct @@ -358,20 +541,25 @@ * prefix, i.e. the first 8 bytes of the address */ dst.len = 8; dst.v6 = ip6h->ip6_dst; + pool = apn->v6.pool; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); + LOGP(DTUN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } - DEBUGP(DGGSN, "Received packet from tun!\n"); + /* IPv6 packet but no IPv6 pool, or IPv4 packet with no IPv4 pool */ + if (!pool) + return 0; - if (ippool_getip(ippool, &ipm, &dst)) { - DEBUGP(DGGSN, "Received packet with no destination!!!\n"); + DEBUGP(DTUN, "Received packet from tun!\n"); + + if (ippool_getip(pool, &ipm, &dst)) { + DEBUGP(DTUN, "Received packet with no PDP contex!!\n"); return 0; } if (ipm->peer) /* Check if a peer protocol is defined */ - gtp_data_req(gsn, (struct pdp_t *)ipm->peer, pack, len); + gtp_data_req(apn->ggsn->gsn, (struct pdp_t *)ipm->peer, pack, len); return 0; } @@ -380,435 +568,303 @@ .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } }; -int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) +/* MS-originated GTP1-U packet, needs to be sent via TUN device */ +static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + LOGPPDP(LOGL_DEBUG, pdp, "Packet received: forwarding to tun\n"); switch (iph->version) { case 6: /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(gsn, pdp, pack, len); + return handle_router_mcast(pdp->gsn, pdp, pack, len); break; case 4: break; default: - LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", + osmo_hexdump(pack, len)); return -1; } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } +static char *config_file = "openggsn.cfg"; + +/* callback for tun device osmocom select loop integration */ +static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct apn_ctx *apn = fd->data; + + OSMO_ASSERT(what & BSC_FD_READ); + + return tun_decaps(apn->tun.tun); +} + +/* callback for libgtp osmocom select loop integration */ +static int ggsn_gtp_fd_cb(struct osmo_fd *fd, unsigned int what) +{ + struct ggsn_ctx *ggsn = fd->data; + int rc; + + OSMO_ASSERT(what & BSC_FD_READ); + + switch (fd->priv_nr) { + case 0: + rc = gtp_decaps0(ggsn->gsn); + break; + case 1: + rc = gtp_decaps1c(ggsn->gsn); + break; + case 2: + rc = gtp_decaps1u(ggsn->gsn); + break; + default: + OSMO_ASSERT(0); + break; + } + return rc; +} + +static void ggsn_gtp_tmr_start(struct ggsn_ctx *ggsn) +{ + struct timeval next; + + /* Retrieve next retransmission as timeval */ + gtp_retranstimeout(ggsn->gsn, &next); + + /* re-schedule the timer */ + osmo_timer_schedule(&ggsn->gtp_timer, next.tv_sec, next.tv_usec/1000); +} + +/* timer callback for libgtp retransmission and ping */ +static void ggsn_gtp_tmr_cb(void *data) +{ + struct ggsn_ctx *ggsn = data; + + /* do all the retransmissions as needed */ + gtp_retrans(ggsn->gsn); + + ggsn_gtp_tmr_start(ggsn); +} + +/* To exit gracefully. Used with GCC compilation flag -pg and gprof */ +static void signal_handler(int s) +{ + LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s); + switch (s) { + case SIGINT: + LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n"); + end = 1; + break; + case SIGABRT: + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_ggsn_ctx, stderr); + break; + case SIGUSR2: + talloc_report_full(tall_vty_ctx, stderr); + break; + default: + break; + } +} + + +/* Start a given GGSN */ +int ggsn_start(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + int rc; + + if (ggsn->started) + return 0; + + LOGPGGSN(LOGL_INFO, ggsn, "Starting GGSN\n"); + + /* Start libgtp listener */ + if (gtp_new(&ggsn->gsn, ggsn->cfg.state_dir, &ggsn->cfg.listen_addr.v4, GTP_MODE_GGSN)) { + LOGPGGSN(LOGL_ERROR, ggsn, "Failed to create GTP: %s\n", strerror(errno)); + return -1; + } + ggsn->gsn->priv = ggsn; + + /* Register File Descriptors */ + osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); + rc = osmo_fd_register(&ggsn->gtp_fd0); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1c, ggsn->gsn->fd1c, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 1); + rc = osmo_fd_register(&ggsn->gtp_fd1c); + OSMO_ASSERT(rc == 0); + + osmo_fd_setup(&ggsn->gtp_fd1u, ggsn->gsn->fd1u, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 2); + rc = osmo_fd_register(&ggsn->gtp_fd1u); + OSMO_ASSERT(rc == 0); + + /* Start GTP re-transmission timer */ + osmo_timer_setup(&ggsn->gtp_timer, ggsn_gtp_tmr_cb, ggsn); + + gtp_set_cb_data_ind(ggsn->gsn, encaps_tun); + gtp_set_cb_delete_context(ggsn->gsn, delete_context); + gtp_set_cb_create_context_ind(ggsn->gsn, create_context_ind); + + LOGPGGSN(LOGL_NOTICE, ggsn, "Successfully started\n"); + ggsn->started = true; + + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_start(apn); + + return 0; +} + +/* Stop a given GGSN */ +int ggsn_stop(struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + + if (!ggsn->started) + return 0; + + /* iterate over all APNs and stop them */ + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_stop(apn, true); + + osmo_timer_del(&ggsn->gtp_timer); + + osmo_fd_unregister(&ggsn->gtp_fd1u); + osmo_fd_unregister(&ggsn->gtp_fd1c); + osmo_fd_unregister(&ggsn->gtp_fd0); + + if (ggsn->gsn) { + gtp_free(ggsn->gsn); + ggsn->gsn = NULL; + } + + ggsn->started = false; + return 0; +} + +static void print_usage() +{ + printf("Usage: osmo-ggsn [-h] [-D] [-c configfile] [-V]\n"); +} + +static void print_help() +{ + printf( " Some useful help...\n" + " -h --help This help text\n" + " -D --daemonize Fork the process into a background daemon\n" + " -c --config-file filename The config file to use\n" + " -V --version Print the version of OsmoGGSN\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' }, + { "daemonize", 0, 0, 'D' }, + { "config-file", 1, 0, 'c' }, + { "version", 0, 0, 'V' }, + { 0, 0, 0, 0 } + }; + + c = getopt_long(argc, argv, "hdc:V", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_usage(); + print_help(); + exit(0); + case 'D': + daemonize = 1; + break; + case 'c': + config_file = optarg; + break; + case 'V': + print_version(1); + exit(0); + break; + } + } +} + int main(int argc, char **argv) { - /* gengeopt declarations */ - struct gengetopt_args_info args_info; - - struct hostent *host; + struct ggsn_ctx *ggsn; + int rc; /* Handle keyboard interrupt SIGINT */ - struct sigaction s; - s.sa_handler = (void *)signal_handler; - if ((0 != sigemptyset(&s.sa_mask)) && debug) - printf("sigemptyset failed.\n"); - s.sa_flags = SA_RESETHAND; - if ((sigaction(SIGINT, &s, NULL) != 0) && debug) - printf("Could not register SIGINT signal handler.\n"); + tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn"); + msgb_talloc_ctx_init(tall_ggsn_ctx, 0); - fd_set fds; /* For select() */ - struct timeval idleTime; /* How long to select() */ + signal(SIGINT, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); - int timelimit; /* Number of seconds to be connected */ - int starttime; /* Time program was started */ - + osmo_init_ignore_signals(); osmo_init_logging(&log_info); + osmo_stats_init(tall_ggsn_ctx); - if (cmdline_parser(argc, argv, &args_info) != 0) - exit(1); - if (args_info.debug_flag) { - printf("listen: %s\n", args_info.listen_arg); - if (args_info.conf_arg) - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp_linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); + vty_init(&g_vty_info); + logging_vty_add_cmds(NULL); + osmo_stats_vty_add_cmds(&log_info); + ggsn_vty_init(); + ctrl_vty_init(tall_ggsn_ctx); + + handle_options(argc, argv); + + rate_ctr_init(tall_ggsn_ctx); + + rc = vty_read_config_file(config_file, NULL); + if (rc < 0) { + fprintf(stderr, "Failed to open config file: '%s'\n", config_file); + exit(2); } - /* Try out our new parser */ - - if (cmdline_parser_configfile(args_info.conf_arg, &args_info, 0, 0, 0) - != 0) + rc = telnet_init_dynif(tall_ggsn_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_GGSN); + if (rc < 0) exit(1); - /* Open a log file */ - if (args_info.logfile_arg) { - struct log_target *tgt; - int lvl; - - tgt = log_target_find(LOG_TGT_TYPE_FILE, args_info.logfile_arg); - if (!tgt) { - tgt = log_target_create_file(args_info.logfile_arg); - if (!tgt) { - LOGP(DGGSN, LOGL_ERROR, - "Failed to create logfile: %s\n", - args_info.logfile_arg); - exit(1); - } - log_add_target(tgt); - } - log_set_all_filter(tgt, 1); - log_set_use_color(tgt, 0); - - if (args_info.loglevel_arg) { - lvl = log_parse_level(args_info.loglevel_arg); - log_set_log_level(tgt, lvl); - LOGP(DGGSN, LOGL_NOTICE, - "Set file log level to %s\n", - log_level_str(lvl)); - } - } - - if (args_info.debug_flag) { - printf("cmdline_parser_configfile\n"); - printf("listen: %s\n", args_info.listen_arg); - printf("conf: %s\n", args_info.conf_arg); - printf("fg: %d\n", args_info.fg_flag); - printf("debug: %d\n", args_info.debug_flag); - printf("qos: %#08x\n", args_info.qos_arg); - if (args_info.apn_arg) - printf("apn: %s\n", args_info.apn_arg); - if (args_info.net_arg) - printf("net: %s\n", args_info.net_arg); - if (args_info.dynip_arg) - printf("dynip: %s\n", args_info.dynip_arg); - if (args_info.statip_arg) - printf("statip: %s\n", args_info.statip_arg); - if (args_info.ipup_arg) - printf("ipup: %s\n", args_info.ipup_arg); - if (args_info.ipdown_arg) - printf("ipdown: %s\n", args_info.ipdown_arg); - if (args_info.pidfile_arg) - printf("pidfile: %s\n", args_info.pidfile_arg); - if (args_info.statedir_arg) - printf("statedir: %s\n", args_info.statedir_arg); - if (args_info.gtp_linux_flag) - printf("gtp-linux: %d\n", args_info.gtp_linux_flag); - printf("timelimit: %d\n", args_info.timelimit_arg); - } - - /* Handle each option */ - - /* debug */ - debug = args_info.debug_flag; - - /* listen */ - /* Do hostname lookup to translate hostname to IP address */ - /* Any port listening is not possible as a valid address is */ - /* required for create_pdp_context_response messages */ - if (args_info.listen_arg) { - if (!(host = gethostbyname(args_info.listen_arg))) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid listening address: %s!", - args_info.listen_arg); - exit(1); - } else { - memcpy(&listen_.s_addr, host->h_addr, host->h_length); - } - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Listening address must be specified! " - "Please use command line option --listen or " - "edit %s configuration file\n", args_info.conf_arg); + g_ctrlh = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); + if (!g_ctrlh) { + LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); exit(1); } - /* net */ - /* Store net as in_addr net and mask */ - if (args_info.net_arg) { - if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Invalid network address: %s!", - args_info.net_arg); - exit(1); - } - /* default for network + destination address = net + 1 */ - netaddr = net; - in46a_inc(&netaddr); - destaddr = netaddr; - } else { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Network address must be specified: %s!", - args_info.net_arg); - exit(1); - } - - /* dynip */ - struct in46_prefix i46p; - size_t prefixlen; - if (!args_info.dynip_arg) { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.net_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } else { - if (ippool_aton(&i46p.addr, &prefixlen, args_info.dynip_arg, 0)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); - exit(1); - } - } - i46p.prefixlen = prefixlen; - if (ippool_new(&ippool, &i46p, NULL, IPPOOL_NONETWORK | IPPOOL_NOGATEWAY | IPPOOL_NOBROADCAST)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to allocate IP pool!"); - exit(1); - } - - /* DNS1 and DNS2 */ - memset(&dns1, 0, sizeof(dns1)); - if (args_info.pcodns1_arg) { - size_t tmp; - if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - memset(&dns2, 0, sizeof(dns2)); - if (args_info.pcodns2_arg) { - size_t tmp; - if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); + if (daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); exit(1); } } - unsigned int cur = 0; - pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[cur++] = 0x80; /* IPCP */ - pco.v[cur++] = 0x21; - pco.v[cur++] = 0xFF; /* Length of contents */ - pco.v[cur++] = 0x02; /* ACK */ - pco.v[cur++] = 0x00; /* ID: Need to match request */ - pco.v[cur++] = 0x00; /* Length */ - pco.v[cur++] = 0xFF; /* overwritten */ - if (dns1.len == 4) { - pco.v[cur++] = 0x81; /* DNS 1 */ - pco.v[cur++] = 2 + dns1.len; - if (dns1.len == 4) - memcpy(&pco.v[cur], &dns1.v4, dns1.len); - else - memcpy(&pco.v[cur], &dns1.v6, dns1.len); - cur += dns1.len; - } - if (dns2.len == 4) { - pco.v[cur++] = 0x83; - pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ - if (dns2.len == 4) - memcpy(&pco.v[cur], &dns2.v4, dns2.len); - else - memcpy(&pco.v[cur], &dns2.v6, dns2.len); - cur += dns2.len; - } - pco.l = cur; - /* patch in length values */ - pco.v[3] = pco.l - 4; - pco.v[7] = pco.l - 4; - - /* ipup */ - ipup = args_info.ipup_arg; - - /* ipdown */ - ipdown = args_info.ipdown_arg; - - /* Timelimit */ - timelimit = args_info.timelimit_arg; - starttime = time(NULL); - +#if 0 /* qos */ qos.l = 3; qos.v[2] = (args_info.qos_arg) & 0xff; qos.v[1] = ((args_info.qos_arg) >> 8) & 0xff; qos.v[0] = ((args_info.qos_arg) >> 16) & 0xff; +#endif - /* apn */ - if (strlen(args_info.apn_arg) > (sizeof(apn.v) - 1)) { - LOGP(DGGSN, LOGL_ERROR, "Invalid APN\n"); - return -1; - } - apn.l = strlen(args_info.apn_arg) + 1; - apn.v[0] = (char)strlen(args_info.apn_arg); - strncpy((char *)&apn.v[1], args_info.apn_arg, sizeof(apn.v) - 1); - - /* foreground */ - /* If flag not given run as a daemon */ - if (!args_info.fg_flag) { - FILE *f; - int rc; - /* Close the standard file descriptors. */ - /* Is this really needed ? */ - f = freopen("/dev/null", "w", stdout); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdout to /dev/null"); - } - f = freopen("/dev/null", "w", stderr); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stderr to /dev/null"); - } - f = freopen("/dev/null", "r", stdin); - if (f == NULL) { - SYS_ERR(DGGSN, LOGL_NOTICE, 0, - "Could not redirect stdin to /dev/null"); - } - rc = daemon(0, 0); - if (rc != 0) { - SYS_ERR(DGGSN, LOGL_ERROR, rc, - "Could not daemonize"); - exit(1); - } + /* Main select loop */ + while (!end) { + osmo_select_main(0); } - /* pidfile */ - /* This has to be done after we have our final pid */ - if (args_info.pidfile_arg) { - log_pid(args_info.pidfile_arg); - } - - DEBUGP(DGGSN, "gtpclient: Initialising GTP tunnel\n"); - - if (gtp_new(&gsn, args_info.statedir_arg, &listen_, GTP_MODE_GGSN)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create gtp"); - exit(1); - } - if (gsn->fd0 > maxfd) - maxfd = gsn->fd0; - if (gsn->fd1c > maxfd) - maxfd = gsn->fd1c; - if (gsn->fd1u > maxfd) - maxfd = gsn->fd1u; - - /* use GTP kernel module for data packet encapsulation */ - if (args_info.gtp_linux_given) { - if (gtp_kernel_init(gsn, &net.v4, prefixlen, args_info.net_arg) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to initialize kernel GTP\n"); - goto err; - } - } - - gtp_set_cb_data_ind(gsn, encaps_tun); - gtp_set_cb_delete_context(gsn, delete_context); - gtp_set_cb_create_context_ind(gsn, create_context_ind); - - gsn->priv = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_GGSN, NULL); - if (!gsn->priv) { - LOGP(DGGSN, LOGL_ERROR, "Failed to create CTRL interface.\n"); - exit(1); - } - - /* skip the configuration of the tun0 if we're using the gtp0 device */ - if (gtp_kernel_enabled()) - goto skip_tun; - - /* Create a tunnel interface */ - DEBUGP(DGGSN, "Creating tun interface\n"); - if (tun_new((struct tun_t **)&tun)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to create tun"); - exit(1); - } - - DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); - exit(1); - } - - tun_set_cb_ind(tun, cb_tun_ind); - if (tun->fd > maxfd) - maxfd = tun->fd; - - if (ipup) - tun_runscript(tun, ipup); - -skip_tun: - - /******************************************************************/ - /* Main select loop */ - /******************************************************************/ - - while ((((starttime + timelimit) > time(NULL)) || (0 == timelimit)) - && (!end)) { - - FD_ZERO(&fds); - if (tun) - FD_SET(tun->fd, &fds); - FD_SET(gsn->fd0, &fds); - FD_SET(gsn->fd1c, &fds); - FD_SET(gsn->fd1u, &fds); - - gtp_retranstimeout(gsn, &idleTime); - switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) { - case -1: /* errno == EINTR : unblocked signal */ - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "select() returned -1"); - /* On error, select returns without modifying fds */ - FD_ZERO(&fds); - break; - case 0: - /* printf("Select returned 0\n"); */ - gtp_retrans(gsn); /* Only retransmit if nothing else */ - break; - default: - break; - } - - if (tun && tun->fd != -1 && FD_ISSET(tun->fd, &fds) && - tun_decaps(tun) < 0) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "TUN read failed (fd)=(%d)", tun->fd); - } - - if (FD_ISSET(gsn->fd0, &fds)) - gtp_decaps0(gsn); - - if (FD_ISSET(gsn->fd1c, &fds)) - gtp_decaps1c(gsn); - - if (FD_ISSET(gsn->fd1u, &fds)) - gtp_decaps1u(gsn); - - osmo_select_main(1); - } -err: - gtp_kernel_stop(); - cmdline_parser_free(&args_info); - ippool_free(ippool); - gtp_free(gsn); - if (tun) - tun_free(tun); + llist_for_each_entry(ggsn, &g_ggsn_list, list) + ggsn_stop(ggsn); return 1; - } diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h new file mode 100644 index 0000000..bab6cf7 --- /dev/null +++ b/ggsn/ggsn.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "../lib/tun.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "../lib/in46_addr.h" +#include "../gtp/gtp.h" + +#define APN_TYPE_IPv4 0x01 /* v4-only */ +#define APN_TYPE_IPv6 0x02 /* v6-only */ +#define APN_TYPE_IPv4v6 0x04 /* v4v6 dual-stack */ + +struct ggsn_ctx; + +struct apn_ctx_ip { + struct { + struct in46_prefix ifconfig_prefix; + struct in46_prefix static_prefix; + struct in46_prefix dynamic_prefix; + /* v4 DNS server names */ + struct in46_addr dns[2]; + } cfg; + + /* v4 address pool */ + struct ippool_t *pool; +}; + +struct apn_name { + struct llist_head list; + char *name; +}; + +enum apn_gtpu_mode { + APN_GTPU_MODE_TUN = 0, /* default */ + APN_GTPU_MODE_KERNEL_GTP, +}; + +struct apn_ctx { + /* list of APNs inside GGSN */ + struct llist_head list; + /* back-pointer to GGSN */ + struct ggsn_ctx *ggsn; + + bool started; + + struct { + /* Primary name */ + char *name; + /* Description string */ + char *description; + /* List of secondary APN names */ + struct llist_head name_list; + /* types supported address types on this APN */ + uint32_t apn_type_mask; + /* GTP-U via TUN device or in Linux kernel */ + enum apn_gtpu_mode gtpu_mode; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* corresponding tun device */ + struct { + struct { + /* name of the network device */ + char *dev_name; + /* ip-up and ip-down script names/paths */ + char *ipup_script; + char *ipdown_script; + } cfg; + struct tun_t *tun; + struct osmo_fd fd; + } tun; + + struct apn_ctx_ip v4; + struct apn_ctx_ip v6; +}; + +struct ggsn_ctx { + /* global list of GGSNs */ + struct llist_head list; + + /* list of APNs in this GGSN */ + struct llist_head apn_list; + + bool started; + + struct { + char *name; + /* Description string */ + char *description; + /* an APN that shall be used as default for any non-matching APN */ + struct apn_ctx *default_apn; + /* ADdress to which we listen for GTP */ + struct in46_addr listen_addr; + /* directory for state file */ + char *state_dir; + /* administratively shut-down (true) or not (false) */ + bool shutdown; + } cfg; + + /* The libgtp (G)GSN instance, i.e. what listens to GTP */ + struct gsn_t *gsn; + + /* osmo-fd for gsn */ + struct osmo_fd gtp_fd0; + struct osmo_fd gtp_fd1c; + struct osmo_fd gtp_fd1u; + + struct osmo_timer_list gtp_timer; +}; + +/* ggsn_vty.c */ +extern struct llist_head g_ggsn_list; +extern struct vty_app_info g_vty_info; +extern int ggsn_vty_init(void); +struct ggsn_ctx *ggsn_find(const char *name); +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name); +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name); +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name); + +/* ggsn.c */ +extern void *tall_ggsn_ctx; +extern int ggsn_start(struct ggsn_ctx *ggsn); +extern int ggsn_stop(struct ggsn_ctx *ggsn); +extern int apn_start(struct apn_ctx *apn); +extern int apn_stop(struct apn_ctx *apn, bool force); diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c new file mode 100644 index 0000000..f23a298 --- /dev/null +++ b/ggsn/ggsn_vty.c @@ -0,0 +1,890 @@ +/* + * (C) 2017 by Harald Welte + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +#include "ggsn.h" + +#define PREFIX_STR "Prefix (Network/Netmask)\n" +#define IFCONFIG_STR "GGSN-based interface configuration\n" +#define GGSN_STR "Gateway GPRS Support NODE (GGSN)\n" + +LLIST_HEAD(g_ggsn_list); + +enum ggsn_vty_node { + GGSN_NODE = _LAST_OSMOVTY_NODE + 1, + APN_NODE, +}; + +struct ggsn_ctx *ggsn_find(const char *name) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + if (!strcmp(ggsn->cfg.name, name)) + return ggsn; + } + return NULL; +} + +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name) +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(name); + if (ggsn) + return ggsn; + + ggsn = talloc_zero(ctx, struct ggsn_ctx); + if (!ggsn) + return NULL; + + ggsn->cfg.name = talloc_strdup(ggsn, name); + ggsn->cfg.state_dir = talloc_strdup(ggsn, "/tmp"); + ggsn->cfg.shutdown = true; + INIT_LLIST_HEAD(&ggsn->apn_list); + + llist_add_tail(&ggsn->list, &g_ggsn_list); + return ggsn; +} + +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn; + + llist_for_each_entry(apn, &ggsn->apn_list, list) { + if (!strcmp(apn->cfg.name, name)) + return apn; + } + return NULL; +} + +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn = ggsn_find_apn(ggsn, name); + if (apn) + return apn; + + apn = talloc_zero(ggsn, struct apn_ctx); + if (!apn) + return NULL; + apn->ggsn = ggsn; + apn->cfg.name = talloc_strdup(apn, name); + apn->cfg.shutdown = true; + INIT_LLIST_HEAD(&apn->cfg.name_list); + + llist_add_tail(&apn->list, &ggsn->apn_list); + return apn; +} + +/* GGSN Node */ + +static struct cmd_node ggsn_node = { + GGSN_NODE, + "%s(config-ggsn)# ", + 1, +}; + +DEFUN(cfg_ggsn, cfg_ggsn_cmd, + "ggsn NAME", + "Configure the Gateway GPRS Support Node\n" "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find_or_create(tall_ggsn_ctx, argv[0]); + if (!ggsn) + return CMD_WARNING; + + vty->node = GGSN_NODE; + vty->index = ggsn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_ggsn, cfg_no_ggsn_cmd, + "no ggsn NAME", + NO_STR "Remove the named Gateway GPRS Support Node\n" + "GGSN Name (has only local significance)\n") +{ + struct ggsn_ctx *ggsn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!ggsn->cfg.shutdown) { + vty_out(vty, "%% GGSN %s is still active, please shutdown first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + if (!llist_empty(&ggsn->apn_list)) { + vty_out(vty, "%% GGSN %s still has APNs configured, please remove first%s", + ggsn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&ggsn->list); + talloc_free(ggsn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, + "gtp local-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address for the local GTP bind\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_state_dir, cfg_ggsn_state_dir_cmd, + "gtp state-dir PATH", + "GTP Parameters\n" + "Set the directory for the GTP State file\n" + "Local Directory\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + osmo_talloc_replace_string(ggsn, &ggsn->cfg.state_dir, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_apn, cfg_ggsn_apn_cmd, + "apn NAME", "APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_or_create_apn(ggsn, argv[0]); + if (!apn) + return CMD_WARNING; + + vty->node = APN_NODE; + vty->index = apn; + vty->index_sub = &ggsn->cfg.description; + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_apn, cfg_ggsn_no_apn_cmd, + "no apn NAME", + NO_STR "Remove APN Configuration\n" "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (!apn->cfg.shutdown) { + vty_out(vty, "%% APN %s still active, please shutdown first%s", + apn->cfg.name, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_del(&apn->list); + talloc_free(apn); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_default_apn, cfg_ggsn_default_apn_cmd, + "default-apn NAME", + "Set a default-APN to be used if no other APN matches\n" + "APN Name\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + struct apn_ctx *apn; + + apn = ggsn_find_apn(ggsn, argv[0]); + if (!apn) { + vty_out(vty, "%% No APN of name '%s' found%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + ggsn->cfg.default_apn = apn; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_default_apn, cfg_ggsn_no_default_apn_cmd, + "no default-apn", + NO_STR "Remove default-APN to be used if no other APN matches\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + ggsn->cfg.default_apn = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_shutdown, cfg_ggsn_shutdown_cmd, + "shutdown ggsn", + "Put the GGSN in administrative shut-down\n" GGSN_STR) +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (!ggsn->cfg.shutdown) { + if (ggsn_stop(ggsn)) { + vty_out(vty, "%% Failed to shutdown GGSN%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_no_shutdown, cfg_ggsn_no_shutdown_cmd, + "no shutdown ggsn", + NO_STR GGSN_STR "Remove the GGSN from administrative shut-down\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + + if (ggsn->cfg.shutdown) { + if (ggsn_start(ggsn) < 0) { + vty_out(vty, "%% Failed to start GGSN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + ggsn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + +/* APN Node */ + +static struct cmd_node apn_node = { + APN_NODE, + "%s(config-ggsn-apn)# ", + 1, +}; + +static const struct value_string pdp_type_names[] = { + { APN_TYPE_IPv4, "v4" }, + { APN_TYPE_IPv6, "v6" }, + { APN_TYPE_IPv4v6, "v4v6" }, + { 0, NULL } +}; + +static const struct value_string apn_gtpu_mode_names[] = { + { APN_GTPU_MODE_TUN, "tun" }, + { APN_GTPU_MODE_KERNEL_GTP, "kernel-gtp" }, + { 0, NULL } +}; + + +#define V4V6V46_STRING "IPv4(-only) PDP Type\n" \ + "IPv6(-only) PDP Type\n" \ + "IPv4v6 (dual-stack) PDP Type\n" + +DEFUN(cfg_apn_type_support, cfg_apn_type_support_cmd, + "type-support (v4|v6|v4v6)", + "Enable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask |= type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_type_support, cfg_apn_no_type_support_cmd, + "no type-support (v4|v6|v4v6)", + NO_STR "Disable support for PDP Type\n" + V4V6V46_STRING) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + uint32_t type = get_string_value(pdp_type_names, argv[0]); + + apn->cfg.apn_type_mask &= ~type; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_gtpu_mode, cfg_apn_gtpu_mode_cmd, + "gtpu-mode (tun|kernel-gtp)", + "Set the Mode for this APN (tun or Linux Kernel GTP)\n" + "GTP-U in userspace using TUN device\n" + "GTP-U in kernel using Linux Kernel GTP\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + apn->cfg.gtpu_mode = get_string_value(apn_gtpu_mode_names, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_tun_dev_name, cfg_apn_tun_dev_name_cmd, + "tun-device NAME", + "Configure tun device name\n" + "TUN device name") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.dev_name, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipup_script, cfg_apn_ipup_script_cmd, + "ipup-script PATH", + "Configure name/path of ip-up script\n" + "File/Path name of ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipup_script, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipup_script, cfg_apn_no_ipup_script_cmd, + "no ipup-script", + NO_STR "Disable ip-up script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipup_script); + apn->tun.cfg.ipup_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipdown_script, cfg_apn_ipdown_script_cmd, + "ipdown-script PATH", + "Configure name/path of ip-down script\n" + "File/Path name of ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + osmo_talloc_replace_string(apn, &apn->tun.cfg.ipdown_script, argv[0]); + return CMD_SUCCESS; +} + +/* convert prefix from "A.B.C.D/M" notation to in46_prefix */ +static void str2prefix(struct in46_prefix *pfx, const char *in) +{ + size_t t; + + ippool_aton(&pfx->addr, &t, in, 0); + pfx->prefixlen = t; +} + +DEFUN(cfg_apn_no_ipdown_script, cfg_apn_no_ipdown_script_cmd, + "no ipdown-script", + NO_STR "Disable ip-down script\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + talloc_free(apn->tun.cfg.ipdown_script); + apn->tun.cfg.ipdown_script = NULL; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_prefix, cfg_apn_ip_prefix_cmd, + "ip prefix (static|dynamic) A.B.C.D/M", + IP_STR PREFIX_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + /* first update our parsed prefix */ + if (!strcmp(argv[0], "static")) + pfx = &apn->v4.cfg.static_prefix; + else + pfx = &apn->v4.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ip_ifconfig, cfg_apn_ip_ifconfig_cmd, + "ip ifconfig A.B.C.D/M", + IP_STR IFCONFIG_STR "IPv4 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v4.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ip_ifconfig, cfg_apn_no_ip_ifconfig_cmd, + "no ip ifconfig", + NO_STR IP_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v4.cfg.ifconfig_prefix, 0, sizeof(apn->v4.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_prefix, cfg_apn_ipv6_prefix_cmd, + "ipv6 prefix (static|dynamic) X:X::X:X/M", + IP6_STR PREFIX_STR "IPv6 Address/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_prefix *pfx; + + if (!strcmp(argv[0], "static")) + pfx = &apn->v6.cfg.static_prefix; + else + pfx = &apn->v6.cfg.dynamic_prefix; + str2prefix(pfx, argv[1]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_ifconfig, cfg_apn_ipv6_ifconfig_cmd, + "ipv6 ifconfig X:X::X:X/M", + IP6_STR IFCONFIG_STR "IPv6 Adress/Prefix-Length\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + str2prefix(&apn->v6.cfg.ifconfig_prefix, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_ipv6_ifconfig, cfg_apn_no_ipv6_ifconfig_cmd, + "no ipv6 ifconfig", + NO_STR IP6_STR IFCONFIG_STR) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + memset(&apn->v6.cfg.ifconfig_prefix, 0, sizeof(apn->v6.cfg.ifconfig_prefix)); + return CMD_SUCCESS; +} + +#define DNS_STRINGS "Configure DNS Server\n" "primary/secondary DNS\n" "IP address of DNS Sever\n" + +DEFUN(cfg_apn_ip_dns, cfg_apn_ip_dns_cmd, + "ip dns <0-1> A.B.C.D", + IP_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v4.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_ipv6_dns, cfg_apn_ipv6_dns_cmd, + "ipv6 dns <0-1> X:X::X:X", + IP6_STR DNS_STRINGS) +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + int idx = atoi(argv[0]); + size_t dummy; + + ippool_aton(&apn->v6.cfg.dns[idx], &dummy, argv[1], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_dns, cfg_apn_no_dns_cmd, + "no (ip|ipv6) dns <0-1>", + NO_STR IP_STR IP6_STR "Disable DNS Server\n" "primary/secondary DNS\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + struct in46_addr *a; + int idx = atoi(argv[1]); + + if (!strcmp(argv[0], "ip")) + a = &apn->v4.cfg.dns[idx]; + else + a = &apn->v6.cfg.dns[idx]; + + memset(a, 0, sizeof(*a)); + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, + "shutdown", + "Put the APN in administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (!apn->cfg.shutdown) { + if (apn_stop(apn, false)) { + vty_out(vty, "%% Failed to Stop APN%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = true; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_shutdown, cfg_apn_no_shutdown_cmd, + "no shutdown", + NO_STR "Remove the APN from administrative shut-down\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + + if (apn->cfg.shutdown) { + if (apn_start(apn) < 0) { + vty_out(vty, "%% Failed to start APN, check log for details%s", VTY_NEWLINE); + return CMD_WARNING; + } + apn->cfg.shutdown = false; + } + + return CMD_SUCCESS; +} + + +static void vty_dump_prefix(struct vty *vty, const char *pre, const struct in46_prefix *pfx) +{ + vty_out(vty, "%s %s%s", pre, in46p_ntoa(pfx), VTY_NEWLINE); +} + +static void config_write_apn(struct vty *vty, struct apn_ctx *apn) +{ + unsigned int i; + + vty_out(vty, " apn %s%s", apn->cfg.name, VTY_NEWLINE); + if (apn->cfg.description) + vty_out(vty, " description %s%s", apn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtpu-mode %s%s", get_value_string(apn_gtpu_mode_names, apn->cfg.gtpu_mode), + VTY_NEWLINE); + if (apn->tun.cfg.dev_name) + vty_out(vty, " tun-device %s%s", apn->tun.cfg.dev_name, VTY_NEWLINE); + if (apn->tun.cfg.ipup_script) + vty_out(vty, " ipup-script %s%s", apn->tun.cfg.ipup_script, VTY_NEWLINE); + if (apn->tun.cfg.ipdown_script) + vty_out(vty, " ipdown-script %s%s", apn->tun.cfg.ipdown_script, VTY_NEWLINE); + + for (i = 0; i < 32; i++) { + if (!(apn->cfg.apn_type_mask & (1 << i))) + continue; + vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), + VTY_NEWLINE); + } + + /* IPv4 prefixes + DNS */ + if (apn->v4.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix static", &apn->v4.cfg.static_prefix); + if (apn->v4.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ip prefix dynamic", &apn->v4.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + if (!apn->v4.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v4.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v4.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ip ifconfig ", &apn->v4.cfg.ifconfig_prefix); + + /* IPv6 prefixes + DNS */ + if (apn->v6.cfg.static_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix static", &apn->v6.cfg.static_prefix); + if (apn->v6.cfg.dynamic_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 prefix dynamic", &apn->v6.cfg.dynamic_prefix); + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + if (!apn->v6.cfg.dns[i].len) + continue; + vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); + } + if (apn->v6.cfg.ifconfig_prefix.addr.len) + vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); + + /* must be last */ + vty_out(vty, " %sshutdown%s", apn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); +} + +static int config_write_ggsn(struct vty *vty) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + struct apn_ctx *apn; + vty_out(vty, "ggsn %s%s", ggsn->cfg.name, VTY_NEWLINE); + if (ggsn->cfg.description) + vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); + vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); + vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + llist_for_each_entry(apn, &ggsn->apn_list, list) + config_write_apn(vty, apn); + if (ggsn->cfg.default_apn) + vty_out(vty, " default-apn %s%s", ggsn->cfg.default_apn->cfg.name, VTY_NEWLINE); + /* must be last */ + vty_out(vty, " %sshutdown ggsn%s", ggsn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); + } + + return 0; +} + +static const char *print_gsnaddr(const struct ul16_t *in) +{ + struct in46_addr in46; + + in46.len = in->l; + OSMO_ASSERT(in->l <= sizeof(in46.v6)); + memcpy(&in46.v6, in->v, in->l); + + return in46a_ntoa(&in46); +} + +static void show_one_pdp(struct vty *vty, struct pdp_t *pdp) +{ + struct in46_addr eua46; + + vty_out(vty, "IMSI: %s, NSAPI: %u, MSISDN: %s%s", imsi_gtp2str(&pdp->imsi), pdp->nsapi, + osmo_hexdump_nospc(pdp->msisdn.v, pdp->msisdn.l), VTY_NEWLINE); + + vty_out(vty, " Control: %s:%08x ", print_gsnaddr(&pdp->gsnlc), pdp->teic_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnrc), pdp->teic_gn, VTY_NEWLINE); + + vty_out(vty, " Data: %s:%08x ", print_gsnaddr(&pdp->gsnlu), pdp->teid_own); + vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(&pdp->gsnru), pdp->teid_gn, VTY_NEWLINE); + + in46a_from_eua(&pdp->eua, &eua46); + vty_out(vty, " End-User Address: %s%s", in46a_ntoa(&eua46), VTY_NEWLINE); +} + +DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, + "show pdp-context imsi IMSI [<0-15>]", + SHOW_STR "Display information on PDP Context\n" + "PDP contexts for given IMSI\n" + "PDP context for given NSAPI\n") +{ + uint64_t imsi = strtoull(argv[0], NULL, 10); + unsigned int nsapi; + struct pdp_t *pdp; + int num_found = 0; + + if (argc > 1) { + nsapi = atoi(argv[1]); + if (pdp_getimsi(&pdp, imsi, nsapi)) { + show_one_pdp(vty, pdp); + num_found++; + } + } else { + for (nsapi = 0; nsapi < PDP_MAXNSAPI; nsapi++) { + if (pdp_getimsi(&pdp, imsi, nsapi)) + continue; + show_one_pdp(vty, pdp); + num_found++; + } + } + if (num_found == 0) { + vty_out(vty, "%% No such PDP context found%s", VTY_NEWLINE); + return CMD_WARNING; + } else + return CMD_SUCCESS; +} + +/* show all (active) PDP contexts within a pool */ +static void ippool_show_pdp_contexts(struct vty *vty, struct ippool_t *pool) +{ + unsigned int i; + + if (!pool) + return; + + for (i = 0; i < pool->listsize; i++) { + struct ippoolm_t *member = &pool->member[i]; + if (member->inuse == 0) + continue; + show_one_pdp(vty, member->peer); + } +} + +/* show all (active) PDP contexts within an APN */ +static void apn_show_pdp_contexts(struct vty *vty, struct apn_ctx *apn) +{ + ippool_show_pdp_contexts(vty, apn->v4.pool); + ippool_show_pdp_contexts(vty, apn->v6.pool); +} + +DEFUN(show_pdpctx, show_pdpctx_cmd, + "show pdp-context ggsn NAME [apn APN]", + SHOW_STR "Show PDP Context Information\n" + GGSN_STR "GGSN Name\n") // FIXME +{ + struct ggsn_ctx *ggsn; + struct apn_ctx *apn; + + ggsn = ggsn_find(argv[0]); + if (!ggsn) { + vty_out(vty, "%% No such GGSN '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (argc < 2) { + llist_for_each_entry(apn, &ggsn->apn_list, list) + apn_show_pdp_contexts(vty, apn); + } else { + apn = ggsn_find_apn(ggsn, argv[1]); + if (!apn) { + vty_out(vty, "%% No such APN '%s'%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + apn_show_pdp_contexts(vty, apn); + } + + return CMD_SUCCESS; +} + +static void show_apn(struct vty *vty, struct apn_ctx *apn) +{ + vty_out(vty, " APN: %s%s", apn->cfg.name, VTY_NEWLINE); + /* FIXME */ +} + +static void show_one_ggsn(struct vty *vty, struct ggsn_ctx *ggsn) +{ + struct apn_ctx *apn; + vty_out(vty, "GGSN %s: Bound to %s%s", ggsn->cfg.name, in46a_ntoa(&ggsn->cfg.listen_addr), + VTY_NEWLINE); + /* FIXME */ + + llist_for_each_entry(apn, &ggsn->apn_list, list) + show_apn(vty, apn); +} + +DEFUN(show_ggsn, show_ggsn_cmd, + "show ggsn [NAME]", + SHOW_STR "Display information on the GGSN\n") +{ + struct ggsn_ctx *ggsn; + + if (argc == 0) { + llist_for_each_entry(ggsn, &g_ggsn_list, list) + show_one_ggsn(vty, ggsn); + } else { + ggsn = ggsn_find(argv[0]); + if (!ggsn) + return CMD_WARNING; + show_one_ggsn(vty, ggsn); + } + + return CMD_SUCCESS; +} + +int ggsn_vty_init(void) +{ + install_element_ve(&show_pdpctx_cmd); + install_element_ve(&show_pdpctx_imsi_cmd); + install_element_ve(&show_ggsn_cmd); + + install_element(CONFIG_NODE, &cfg_ggsn_cmd); + install_element(CONFIG_NODE, &cfg_no_ggsn_cmd); + install_node(&ggsn_node, config_write_ggsn); + vty_install_default(GGSN_NODE); + install_element(GGSN_NODE, &cfg_description_cmd); + install_element(GGSN_NODE, &cfg_no_description_cmd); + install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); + install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); + install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_default_apn_cmd); + install_element(GGSN_NODE, &cfg_ggsn_no_default_apn_cmd); + + install_node(&apn_node, NULL); + vty_install_default(APN_NODE); + install_element(APN_NODE, &cfg_description_cmd); + install_element(APN_NODE, &cfg_no_description_cmd); + install_element(APN_NODE, &cfg_apn_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_no_shutdown_cmd); + install_element(APN_NODE, &cfg_apn_gtpu_mode_cmd); + install_element(APN_NODE, &cfg_apn_type_support_cmd); + install_element(APN_NODE, &cfg_apn_no_type_support_cmd); + install_element(APN_NODE, &cfg_apn_tun_dev_name_cmd); + install_element(APN_NODE, &cfg_apn_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipup_script_cmd); + install_element(APN_NODE, &cfg_apn_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_no_ipdown_script_cmd); + install_element(APN_NODE, &cfg_apn_ip_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_prefix_cmd); + install_element(APN_NODE, &cfg_apn_ip_dns_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_dns_cmd); + install_element(APN_NODE, &cfg_apn_no_dns_cmd); + install_element(APN_NODE, &cfg_apn_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + + return 0; +} + +static int ggsn_vty_is_config_node(struct vty *vty, int node) +{ + switch (node) { + case GGSN_NODE: + case APN_NODE: + return 1; + default: + return 0; + } +} + +static int ggsn_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + case GGSN_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + vty->index_sub = NULL; + break; + case APN_NODE: + vty->node = GGSN_NODE; + { + struct apn_ctx *apn = vty->index; + vty->index = apn->ggsn; + vty->index_sub = &apn->ggsn->cfg.description; + } + break; + } + + return vty->node; +} + +static const char ggsn_copyright[] = + "Copyright (C) 2011-2017 Harald Welte \r\n" + "Copyright (C) 2012-2017 Holger Hans Peter Freyther \r\n" + "Copyright (C) 2012-2017 sysmocom - s.f.m.c. GmbH\r\n" + "Copyright (C) 2002-2005 Mondru AB\r\n" + "License GPLv2: GNU GPL version 2 \r\n" + "This is free software: you are free to change and redistribute it.\r\n" + "There is NO WARRANTY, to the extent permitted by law.\r\n"; + +struct vty_app_info g_vty_info = { + .name = "OpenGGSN", + .version = PACKAGE_VERSION, + .copyright = ggsn_copyright, + .go_parent_cb = ggsn_vty_go_parent, + .is_config_node = ggsn_vty_is_config_node, +}; diff --git a/lib/tun.c b/lib/tun.c index e8368e5..76ac379 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -583,7 +583,7 @@ return tun_route(this, dst, gateway, mask, 1); } -int tun_new(struct tun_t **tun) +int tun_new(struct tun_t **tun, const char *dev_name) { #if defined(__linux__) @@ -615,6 +615,8 @@ /* Set device flags. For some weird reason this is also the method used to obtain the network interface name */ memset(&ifr, 0, sizeof(ifr)); + if (dev_name) + strcpy(ifr.ifr_name, dev_name); ifr.ifr_flags = IFF_TUN | IFF_NO_PI; /* Tun device, no packet info */ if (ioctl((*tun)->fd, TUNSETIFF, (void *)&ifr) < 0) { SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); diff --git a/lib/tun.h b/lib/tun.h index 67ef39d..50ac806 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -65,7 +65,7 @@ void *priv; }; -extern int tun_new(struct tun_t **tun); +extern int tun_new(struct tun_t **tun, const char *dev_name); extern int tun_free(struct tun_t *tun); extern int tun_decaps(struct tun_t *this); extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1f0b3f9..ed1fb93 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1461,7 +1461,7 @@ if (options.createif) { printf("Setting up interface\n"); /* Create a tunnel interface */ - if (tun_new((struct tun_t **)&tun)) { + if (tun_new((struct tun_t **)&tun, NULL)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Failed to create tun"); exit(1); -- To view, visit https://gerrit.osmocom.org/3857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 08:54:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 08:54:34 +0000 Subject: [PATCH] osmo-ggsn[master]: debian: Fix debian/copyright syntax Message-ID: Review at https://gerrit.osmocom.org/3865 debian: Fix debian/copyright syntax Change-Id: I819ca05440cca041f26e7800821f4763f887c08b --- M debian/copyright 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/65/3865/1 diff --git a/debian/copyright b/debian/copyright index a6507bd..e2a4b2d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,11 +3,11 @@ Source: https://osmocom.org/projects/openggsn Files: * -Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen -Copyright (C) 2010-2017 Harald Welte -Copyright (C) 2012-2016 Holger Hans Peter Freyther -Copyright (C) 2014-2016 Pablo Neira Ayuso -Copyright (C) 2014-2016 sysmocom - s.f.m.c. GmbH +Copyright: 2002-2004 Mondru AB, Author: Jens Jakobsen + 2010-2017 Harald Welte + 2012-2016 Holger Hans Peter Freyther + 2014-2016 Pablo Neira Ayuso + 2014-2016 sysmocom - s.f.m.c. GmbH License: GPL-2 Files: lib/getopt.c -- To view, visit https://gerrit.osmocom.org/3865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I819ca05440cca041f26e7800821f4763f887c08b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 08:54:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 08:54:34 +0000 Subject: [PATCH] osmo-ggsn[master]: debian: Remove no longer existing NEWS file from 'docs' Message-ID: Review at https://gerrit.osmocom.org/3866 debian: Remove no longer existing NEWS file from 'docs' Change-Id: Ieb319ea29179ed97d746e13a9e63b3ceea2b917a --- M debian/docs 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/66/3866/1 diff --git a/debian/docs b/debian/docs index 8913f46..b43bf86 100644 --- a/debian/docs +++ b/debian/docs @@ -1,2 +1 @@ -NEWS README.md -- To view, visit https://gerrit.osmocom.org/3866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb319ea29179ed97d746e13a9e63b3ceea2b917a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 08:54:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 08:54:35 +0000 Subject: [PATCH] osmo-ggsn[master]: debian: fix name of config file Message-ID: Review at https://gerrit.osmocom.org/3867 debian: fix name of config file Change-Id: I9e563d41b74c334fd98bb71fad946e93f214fa34 --- M debian/osmo-ggsn.examples 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/67/3867/1 diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples index 775b9cd..fe0136c 100644 --- a/debian/osmo-ggsn.examples +++ b/debian/osmo-ggsn.examples @@ -1,2 +1,2 @@ -doc/examples/osmo-ggsn.conf +doc/examples/osmo-ggsn.cfg doc/examples/sgsnemu.conf -- To view, visit https://gerrit.osmocom.org/3867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e563d41b74c334fd98bb71fad946e93f214fa34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 08:56:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 08:56:21 +0000 Subject: [PATCH] osmo-ci[master]: change from openggsn to osmo-ggsn in nightly nitb-split pack... Message-ID: Review at https://gerrit.osmocom.org/3868 change from openggsn to osmo-ggsn in nightly nitb-split packages Change-Id: Ie0d6d39ad0451733f6577844737f63028d087d8e --- M scripts/osmocom-nightly-nitb-split.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/68/3868/1 diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index c1a0052..3b547bf 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -90,7 +90,7 @@ checkout libasn1c checkout osmo-iuh checkout osmo-hlr - checkout openggsn + checkout osmo-ggsn checkout osmo-mgw checkout osmo-bsc checkout osmo-msc @@ -104,7 +104,7 @@ build libasn1c build osmo-iuh build osmo-hlr - build openggsn + build osmo-ggsn build osmo-mgw build osmo-bsc build osmo-msc -- To view, visit https://gerrit.osmocom.org/3868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0d6d39ad0451733f6577844737f63028d087d8e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 08:56:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 08:56:21 +0000 Subject: [PATCH] osmo-ci[master]: build both openggsn (old) and osmo-ggsn (new) in nightly feeds Message-ID: Review at https://gerrit.osmocom.org/3869 build both openggsn (old) and osmo-ggsn (new) in nightly feeds Change-Id: I310c6237ce5ec34e4cc008123a5219d5cadaf7a3 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/69/3869/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 3104b86..84cf6e4 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -15,6 +15,7 @@ git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 git clone git://git.osmocom.org/openggsn +git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap git clone git://git.osmocom.org/cellmgr-ng osmo-stp @@ -51,6 +52,7 @@ build libosmo-netif build libsmpp34 build openggsn +build osmo-ggsn build openbsc build osmo-pcap build osmo-stp -- To view, visit https://gerrit.osmocom.org/3869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I310c6237ce5ec34e4cc008123a5219d5cadaf7a3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 09:07:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 09:07:02 +0000 Subject: [PATCH] osmo-bsc[master]: Move channel state assignment to macro In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3828 to look at the new patch set (#3). Move channel state assignment to macro Previously we've used function so debug print always pointed to the same place which is not very useful. Replace it with macro so proper file:line is printed. Also, make sure that we always change state only through this macro and log only when the state has changed. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 --- M include/openbsc/abis_rsl.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/chan_alloc.c M src/libbsc/handover_logic.c 5 files changed, 21 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/28/3828/3 diff --git a/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h index f983fce..c419bb7 100644 --- a/include/openbsc/abis_rsl.h +++ b/include/openbsc/abis_rsl.h @@ -34,6 +34,14 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) +#define LCHAN_SET_ST(lch_, st_) \ + do { \ + if ((lch_)->state != st_) \ + DEBUGP(DRSL, "%s state %s -> %s\n", \ + gsm_lchan_name(lch_), gsm_lchans_name((lch_)->state), gsm_lchans_name(st_)); \ + (lch_)->state = st_; \ + } while (0) + int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); @@ -74,7 +82,6 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, enum rsl_rel_mode release_mode); -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); /* to be provided by external code */ diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 75229a5..fabb47a 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -79,7 +79,7 @@ osmo_timer_schedule(&lchan->error_timer, lchan->ts->trx->bts->network->T3111 + 2, 0); } else { - rsl_lchan_set_state(lchan, LCHAN_S_NONE); + LCHAN_SET_ST(lchan, LCHAN_S_NONE); } lchan_free(lchan); } @@ -509,7 +509,7 @@ * the calling code passes the correct lchan. */ OSMO_ASSERT(lchan == lchan->ts->lchan); - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_ACT_REQ); msg = rsl_msgb_alloc(); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); @@ -622,7 +622,7 @@ return rc; } - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_ACT_REQ); ta = lchan->rqd_ta; @@ -825,7 +825,7 @@ /* go back to the none state */ LOGP(DRSL, LOGL_INFO, "%s is back in operation.\n", gsm_lchan_name(lchan)); - rsl_lchan_set_state(lchan, LCHAN_S_NONE); + LCHAN_SET_ST(lchan, LCHAN_S_NONE); /* Put PDCH channel back into PDCH mode, if GPRS is enabled */ if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH @@ -896,7 +896,7 @@ /* * TODO: start T3109 now. */ - rsl_lchan_set_state(lchan, LCHAN_S_REL_ERR); + LCHAN_SET_ST(lchan, LCHAN_S_REL_ERR); } /* Start another timer or assume the BTS sends a ACK/NACK? */ @@ -1220,17 +1220,8 @@ { LOGP(DRSL, LOGL_ERROR, "%s %s lchan broken: %s\n", gsm_lchan_name(lchan), gsm_lchant_name(lchan->type), reason); - rsl_lchan_set_state(lchan, LCHAN_S_BROKEN); + LCHAN_SET_ST(lchan, LCHAN_S_BROKEN); lchan->broken_reason = reason; - return 0; -} - -int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) -{ - DEBUGP(DRSL, "%s state %s -> %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), - gsm_lchans_name(state)); - lchan->state = state; return 0; } @@ -1257,7 +1248,7 @@ talloc_free(lchan->rqd_ref); lchan->rqd_ref = NULL; lchan->rqd_ta = 0; - rsl_lchan_set_state(msg->lchan, LCHAN_S_ACTIVE); + LCHAN_SET_ST(msg->lchan, LCHAN_S_ACTIVE); if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) { /* * lchan_act_tmr_cb() already called @@ -1282,7 +1273,7 @@ LOGP(DRSL, LOGL_NOTICE, "%s CHAN ACT ACK, but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); - rsl_lchan_set_state(lchan, LCHAN_S_ACTIVE); + LCHAN_SET_ST(lchan, LCHAN_S_ACTIVE); if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) dyn_ts_switchover_complete(lchan); @@ -2614,7 +2605,7 @@ * rsl_rx_rf_chan_rel_ack(). PDCH is always on lchan[0]. */ if (ts->dyn.pchan_is == GSM_PCHAN_PDCH) { - rsl_lchan_set_state(ts->lchan, LCHAN_S_REL_REQ); + LCHAN_SET_ST(ts->lchan, LCHAN_S_REL_REQ); rc = rsl_rf_chan_release(ts->lchan, 0, SACCH_NONE); if (rc) { LOGP(DRSL, LOGL_ERROR, diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a0ba69a..2c64dde 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -246,7 +246,7 @@ conn->secondary_lchan = new_lchan; new_lchan->conn = conn; - rsl_lchan_set_state(new_lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(new_lchan, LCHAN_S_ACT_REQ); return 0; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 4192d65..8d31dcf 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -448,7 +448,7 @@ osmo_timer_del(&lchan->error_timer); lchan->type = GSM_LCHAN_NONE; - lchan->state = LCHAN_S_NONE; + LCHAN_SET_ST(lchan, LCHAN_S_NONE); if (lchan->abis_ip.rtp_socket) { rtp_socket_free(lchan->abis_ip.rtp_socket); @@ -485,7 +485,7 @@ int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode mode) { DEBUGP(DRLL, "%s starting release sequence\n", gsm_lchan_name(lchan)); - rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ); + LCHAN_SET_ST(lchan, LCHAN_S_REL_REQ); lchan->conn = NULL; _lchan_handle_release(lchan, sacch_deact, mode); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 8ced74f..5202cc9 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -152,7 +152,7 @@ return rc; } - rsl_lchan_set_state(new_lchan, LCHAN_S_ACT_REQ); + LCHAN_SET_ST(new_lchan, LCHAN_S_ACT_REQ); llist_add(&ho->list, &bsc_handovers); /* we continue in the SS_LCHAN handler / ho_chan_activ_ack */ -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 09:08:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 09:08:56 +0000 Subject: osmo-bsc[master]: Move channel state assignment to macro In-Reply-To: References: Message-ID: Patch Set 3: > to name the macro exactly like the function was named Fine by me, but lot's of people prefer to stick to "always capitalize preprocessor macro" convention so I'd like to get more opinions on that. -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 09:14:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 09:14:27 +0000 Subject: osmo-bts[master]: OML: print actual type of report sent to BSC In-Reply-To: References: Message-ID: Patch Set 1: I've tried to stick to convention of the code around: function name reflects the message type/format from spec, log reflects the content - what we use this message for. -- To view, visit https://gerrit.osmocom.org/3829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 09:30:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 09:30:54 +0000 Subject: osmo-ggsn[master]: debian: Fix debian/copyright syntax In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I819ca05440cca041f26e7800821f4763f887c08b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 09:31:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 09:31:37 +0000 Subject: osmo-ggsn[master]: debian: Remove no longer existing NEWS file from 'docs' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb319ea29179ed97d746e13a9e63b3ceea2b917a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 09:32:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 09:32:37 +0000 Subject: osmo-ggsn[master]: debian: fix name of config file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e563d41b74c334fd98bb71fad946e93f214fa34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:01:15 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 6 Sep 2017 10:01:15 +0000 Subject: osmo-bsc[master]: Move channel state assignment to macro In-Reply-To: References: Message-ID: Patch Set 3: Seems like a change to make a change. What issue was too difficult to debug? How much more time was used? E.g. most state transitions are static (if you transition toa ctive, there will be only a few call sites). Sure now __LINE__ points to the right place but you can not put a breakpoint on state changes anymore. -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:10:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 10:10:53 +0000 Subject: [PATCH] meta-telephony[laforge/nightly]: lksctp-tools: Use bb.utils.contains instead of deprecated ba... Message-ID: Review at https://gerrit.osmocom.org/3870 lksctp-tools: Use bb.utils.contains instead of deprecated base_contains Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 --- M recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/70/3870/1 diff --git a/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb b/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb index d3e6a5d..f69e71c 100644 --- a/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb +++ b/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb @@ -21,7 +21,7 @@ #| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version #| collect2: error: ld returned 1 exit status #| make[4]: *** [libsctp.la] Error 1 -PNBLACKLIST[lksctp-tools] ?= "${@base_contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}" +PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}" S = "${WORKDIR}/${BP}" -- To view, visit https://gerrit.osmocom.org/3870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:10:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 10:10:54 +0000 Subject: [PATCH] meta-telephony[laforge/nightly]: libosmo-abis: modify PV to match recent release Message-ID: Review at https://gerrit.osmocom.org/3871 libosmo-abis: modify PV to match recent release The upstream release commit is 7f17b8c45d094941292036143f3292a1d5789cf5. This should fix current issue with 201705/nightly package feed: $ opkg upgrade Not selecting libosmo-abis 0.3.2+gitr0+d3292913ac as installing it would break existing dependencies. $ opkg list_installed | grep libosmo-abis libosmo-abis - 0.3.2+gitr2+d3292913ac-r2.18.1.0 See that gitr in repos is 0 while the previously installed one has gitr2, which is higher. Explanations I can find for this: - PR server was somehow reset? - the value in gitr is calculated based on offset from latest tag. As new release introduced new tag, gitr may have been reset. In any case, updating PV to have the correct value should fix this issue. Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/71/3871/1 diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index c9c2077..8742df9 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -5,5 +5,5 @@ S = "${WORKDIR}/git" SRCREV = "35003ec2ea7de49d67e5332938a66fe92580b94d" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" -PV = "0.3.2+gitr${SRCPV}" +PV = "0.4.0+gitr${SRCPV}" PR = "${INC_PR}.1" -- To view, visit https://gerrit.osmocom.org/3871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:11:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 10:11:58 +0000 Subject: [ABANDON] meta-telephony[laforge/nightly]: lksctp-tools: Use bb.utils.contains instead of deprecated ba... In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: lksctp-tools: Use bb.utils.contains instead of deprecated base_contains ...................................................................... Abandoned This is already in 201705 and slipped in while pushing to laforge/nightly -- To view, visit https://gerrit.osmocom.org/3870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:04 +0000 Subject: [PATCH] osmo-ggsn[master]: clarify relationship of OsmoGGSN to OpenGGSN. Message-ID: Review at https://gerrit.osmocom.org/3872 clarify relationship of OsmoGGSN to OpenGGSN. Change-Id: If0e18fb02a7dcc472f5f5fbfaf53a107382ef7e5 --- M README.md 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/72/3872/1 diff --git a/README.md b/README.md index 42613cf..80126e0 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ networks such as GPRS, EDGE, UMTS or HSPA. OsmoGGSN is part of the [Osmocom](https://osmocom.org/) Open Source -Mobile Communications projects, even thogh it was previously developed -by Mondru AB. +Mobile Communications projects and the successor to OpenGGSN. +OpenGGSN was developed until 2004 by Mondru AB. Homepage -------- -- To view, visit https://gerrit.osmocom.org/3872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0e18fb02a7dcc472f5f5fbfaf53a107382ef7e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:26 +0000 Subject: osmo-ci[master]: change from openggsn to osmo-ggsn in nightly nitb-split pack... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0d6d39ad0451733f6577844737f63028d087d8e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:31 +0000 Subject: osmo-ci[master]: build both openggsn (old) and osmo-ggsn (new) in nightly feeds In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I310c6237ce5ec34e4cc008123a5219d5cadaf7a3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:42 +0000 Subject: osmo-ggsn[master]: debian: Fix debian/copyright syntax In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I819ca05440cca041f26e7800821f4763f887c08b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:44 +0000 Subject: osmo-ggsn[master]: debian: Remove no longer existing NEWS file from 'docs' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb319ea29179ed97d746e13a9e63b3ceea2b917a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:47 +0000 Subject: osmo-ggsn[master]: debian: fix name of config file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e563d41b74c334fd98bb71fad946e93f214fa34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:48 +0000 Subject: [MERGED] osmo-ggsn[master]: debian: fix name of config file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian: fix name of config file ...................................................................... debian: fix name of config file Change-Id: I9e563d41b74c334fd98bb71fad946e93f214fa34 --- M debian/osmo-ggsn.examples 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-ggsn.examples b/debian/osmo-ggsn.examples index 775b9cd..fe0136c 100644 --- a/debian/osmo-ggsn.examples +++ b/debian/osmo-ggsn.examples @@ -1,2 +1,2 @@ -doc/examples/osmo-ggsn.conf +doc/examples/osmo-ggsn.cfg doc/examples/sgsnemu.conf -- To view, visit https://gerrit.osmocom.org/3867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e563d41b74c334fd98bb71fad946e93f214fa34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:48 +0000 Subject: [MERGED] osmo-ggsn[master]: debian: Remove no longer existing NEWS file from 'docs' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian: Remove no longer existing NEWS file from 'docs' ...................................................................... debian: Remove no longer existing NEWS file from 'docs' Change-Id: Ieb319ea29179ed97d746e13a9e63b3ceea2b917a --- M debian/docs 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/docs b/debian/docs index 8913f46..b43bf86 100644 --- a/debian/docs +++ b/debian/docs @@ -1,2 +1 @@ -NEWS README.md -- To view, visit https://gerrit.osmocom.org/3866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb319ea29179ed97d746e13a9e63b3ceea2b917a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:48 +0000 Subject: [MERGED] osmo-ggsn[master]: debian: Fix debian/copyright syntax In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian: Fix debian/copyright syntax ...................................................................... debian: Fix debian/copyright syntax Change-Id: I819ca05440cca041f26e7800821f4763f887c08b --- M debian/copyright 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/copyright b/debian/copyright index a6507bd..e2a4b2d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,11 +3,11 @@ Source: https://osmocom.org/projects/openggsn Files: * -Copyright (C) 2002-2004 Mondru AB, Author: Jens Jakobsen -Copyright (C) 2010-2017 Harald Welte -Copyright (C) 2012-2016 Holger Hans Peter Freyther -Copyright (C) 2014-2016 Pablo Neira Ayuso -Copyright (C) 2014-2016 sysmocom - s.f.m.c. GmbH +Copyright: 2002-2004 Mondru AB, Author: Jens Jakobsen + 2010-2017 Harald Welte + 2012-2016 Holger Hans Peter Freyther + 2014-2016 Pablo Neira Ayuso + 2014-2016 sysmocom - s.f.m.c. GmbH License: GPL-2 Files: lib/getopt.c -- To view, visit https://gerrit.osmocom.org/3865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I819ca05440cca041f26e7800821f4763f887c08b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:12:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:12:53 +0000 Subject: osmo-ggsn[master]: clarify relationship of OsmoGGSN to OpenGGSN. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0e18fb02a7dcc472f5f5fbfaf53a107382ef7e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:13:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:13:00 +0000 Subject: [MERGED] osmo-ggsn[master]: clarify relationship of OsmoGGSN to OpenGGSN. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: clarify relationship of OsmoGGSN to OpenGGSN. ...................................................................... clarify relationship of OsmoGGSN to OpenGGSN. Change-Id: If0e18fb02a7dcc472f5f5fbfaf53a107382ef7e5 --- M README.md 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README.md b/README.md index 42613cf..80126e0 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ networks such as GPRS, EDGE, UMTS or HSPA. OsmoGGSN is part of the [Osmocom](https://osmocom.org/) Open Source -Mobile Communications projects, even thogh it was previously developed -by Mondru AB. +Mobile Communications projects and the successor to OpenGGSN. +OpenGGSN was developed until 2004 by Mondru AB. Homepage -------- -- To view, visit https://gerrit.osmocom.org/3872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0e18fb02a7dcc472f5f5fbfaf53a107382ef7e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:13:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 10:13:06 +0000 Subject: meta-telephony[laforge/nightly]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 1: As you can see, this is pushed against laforge/nightly, and should be moved to 201705 branch when updating that same branch to a newer libosmo-abis. -- To view, visit https://gerrit.osmocom.org/3871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:13:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:13:06 +0000 Subject: [MERGED] osmo-ci[master]: build both openggsn (old) and osmo-ggsn (new) in nightly feeds In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: build both openggsn (old) and osmo-ggsn (new) in nightly feeds ...................................................................... build both openggsn (old) and osmo-ggsn (new) in nightly feeds Change-Id: I310c6237ce5ec34e4cc008123a5219d5cadaf7a3 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 3104b86..84cf6e4 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -15,6 +15,7 @@ git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 git clone git://git.osmocom.org/openggsn +git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap git clone git://git.osmocom.org/cellmgr-ng osmo-stp @@ -51,6 +52,7 @@ build libosmo-netif build libsmpp34 build openggsn +build osmo-ggsn build openbsc build osmo-pcap build osmo-stp -- To view, visit https://gerrit.osmocom.org/3869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I310c6237ce5ec34e4cc008123a5219d5cadaf7a3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:13:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:13:06 +0000 Subject: [MERGED] osmo-ci[master]: change from openggsn to osmo-ggsn in nightly nitb-split pack... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: change from openggsn to osmo-ggsn in nightly nitb-split packages ...................................................................... change from openggsn to osmo-ggsn in nightly nitb-split packages Change-Id: Ie0d6d39ad0451733f6577844737f63028d087d8e --- M scripts/osmocom-nightly-nitb-split.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index c1a0052..3b547bf 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -90,7 +90,7 @@ checkout libasn1c checkout osmo-iuh checkout osmo-hlr - checkout openggsn + checkout osmo-ggsn checkout osmo-mgw checkout osmo-bsc checkout osmo-msc @@ -104,7 +104,7 @@ build libasn1c build osmo-iuh build osmo-hlr - build openggsn + build osmo-ggsn build osmo-mgw build osmo-bsc build osmo-msc -- To view, visit https://gerrit.osmocom.org/3868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0d6d39ad0451733f6577844737f63028d087d8e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:14:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:14:25 +0000 Subject: [PATCH] openggsn[master]: note OpenGGSN is obsoleted by OsmoGGSN Message-ID: Review at https://gerrit.osmocom.org/3873 note OpenGGSN is obsoleted by OsmoGGSN Change-Id: I477382cf3e015976401218b628b911580d935d53 --- M README.md 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/73/3873/1 diff --git a/README.md b/README.md index 8e4ceae..34e13a9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +** As of September 2017, OpenGGSN is obsoleted by OsmoGGSN, please use http://git.osmocom.org/osmo-ggsn/ instead** + OpenGGSN - Open Source GGSN =========================== @@ -9,6 +11,8 @@ Mobile Communications projects, even thogh it was previously developed by Mondru AB. +** As of September 2017, OpenGGSN is obsoleted by OsmoGGSN, please use http://git.osmocom.org/osmo-ggsn/ instead** + Homepage -------- @@ -18,6 +22,9 @@ GIT Repository -------------- +** As of September 2017, OpenGGSN is obsoleted by OsmoGGSN, please use http://git.osmocom.org/osmo-ggsn/ instead** + +Homepage You can clone from the official libosmocore.git repository using git clone git://git.osmocom.org/openggsn.git -- To view, visit https://gerrit.osmocom.org/3873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I477382cf3e015976401218b628b911580d935d53 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:23:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:23:28 +0000 Subject: [PATCH] osmo-ggsn[master]: libgtp: Bump major LIBVERSION for recent API/ABI breakage Message-ID: Review at https://gerrit.osmocom.org/3874 libgtp: Bump major LIBVERSION for recent API/ABI breakage in Change-Id I68ae49a765828fa681054c68bf7f5e74dbe48ad2 we introduced a new struct member that breks ABI and API. Change-Id: Ie631880155513b1b78d1e9dd473dc5dc50e05943 --- M gtp/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/74/3874/1 diff --git a/gtp/Makefile.am b/gtp/Makefile.am index 32025d6..7a0ff0a 100644 --- a/gtp/Makefile.am +++ b/gtp/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=1:0:0 +LIBVERSION=2:0:0 lib_LTLIBRARIES = libgtp.la include_HEADERS = gtp.h pdp.h gtpie.h -- To view, visit https://gerrit.osmocom.org/3874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie631880155513b1b78d1e9dd473dc5dc50e05943 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:23:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:23:28 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-ggsn=5Bmaster=5D=3A_Bump_version=3A_0=2E94=2E34-23e4_=E2=86=92_1=2E0=2E0?= Message-ID: Review at https://gerrit.osmocom.org/3875 Bump version: 0.94.34-23e4 ? 1.0.0 Change-Id: I00a00a7d537fd3c1ff8f8fe128c5bf82d39bda76 --- M debian/changelog 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/75/3875/1 diff --git a/debian/changelog b/debian/changelog index 7c82dbb..5953e6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -osmo-ggsn (0.94.0) UNRELEASED; urgency=medium +osmo-ggsn (1.0.0) unstable; urgency=medium * Transition to OsmoGGSN - -- Harald Welte Tue, 05 Sep 2017 09:34:20 +0200 + -- Harald Welte Wed, 06 Sep 2017 12:19:48 +0200 openggsn (0.94.0) UNRELEASED; urgency=medium -- To view, visit https://gerrit.osmocom.org/3875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00a00a7d537fd3c1ff8f8fe128c5bf82d39bda76 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:25:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:25:26 +0000 Subject: osmo-ggsn[master]: libgtp: Bump major LIBVERSION for recent API/ABI breakage In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie631880155513b1b78d1e9dd473dc5dc50e05943 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:25:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:25:28 +0000 Subject: [MERGED] osmo-ggsn[master]: libgtp: Bump major LIBVERSION for recent API/ABI breakage In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: Bump major LIBVERSION for recent API/ABI breakage ...................................................................... libgtp: Bump major LIBVERSION for recent API/ABI breakage in Change-Id I68ae49a765828fa681054c68bf7f5e74dbe48ad2 we introduced a new struct member that breks ABI and API. Change-Id: Ie631880155513b1b78d1e9dd473dc5dc50e05943 --- M gtp/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/Makefile.am b/gtp/Makefile.am index 32025d6..7a0ff0a 100644 --- a/gtp/Makefile.am +++ b/gtp/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=1:0:0 +LIBVERSION=2:0:0 lib_LTLIBRARIES = libgtp.la include_HEADERS = gtp.h pdp.h gtpie.h -- To view, visit https://gerrit.osmocom.org/3874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie631880155513b1b78d1e9dd473dc5dc50e05943 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:25:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:25:34 +0000 Subject: =?UTF-8?Q?osmo-ggsn=5Bmaster=5D=3A_Bump_version=3A_0=2E94=2E34-23e4_=E2=86=92_1=2E0=2E0?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00a00a7d537fd3c1ff8f8fe128c5bf82d39bda76 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:25:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:25:45 +0000 Subject: openggsn[master]: note OpenGGSN is obsoleted by OsmoGGSN In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I477382cf3e015976401218b628b911580d935d53 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:25:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:25:47 +0000 Subject: [MERGED] openggsn[master]: note OpenGGSN is obsoleted by OsmoGGSN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: note OpenGGSN is obsoleted by OsmoGGSN ...................................................................... note OpenGGSN is obsoleted by OsmoGGSN Change-Id: I477382cf3e015976401218b628b911580d935d53 --- M README.md 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README.md b/README.md index 8e4ceae..34e13a9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +** As of September 2017, OpenGGSN is obsoleted by OsmoGGSN, please use http://git.osmocom.org/osmo-ggsn/ instead** + OpenGGSN - Open Source GGSN =========================== @@ -9,6 +11,8 @@ Mobile Communications projects, even thogh it was previously developed by Mondru AB. +** As of September 2017, OpenGGSN is obsoleted by OsmoGGSN, please use http://git.osmocom.org/osmo-ggsn/ instead** + Homepage -------- @@ -18,6 +22,9 @@ GIT Repository -------------- +** As of September 2017, OpenGGSN is obsoleted by OsmoGGSN, please use http://git.osmocom.org/osmo-ggsn/ instead** + +Homepage You can clone from the official libosmocore.git repository using git clone git://git.osmocom.org/openggsn.git -- To view, visit https://gerrit.osmocom.org/3873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I477382cf3e015976401218b628b911580d935d53 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:25:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 10:25:59 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_osmo-ggsn=5Bmaster=5D=3A_Bump_version=3A_0=2E94=2E34-23e4_=E2=86=92_1=2E0=2E0?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 0.94.34-23e4 ? 1.0.0 ...................................................................... Bump version: 0.94.34-23e4 ? 1.0.0 Change-Id: I00a00a7d537fd3c1ff8f8fe128c5bf82d39bda76 --- M debian/changelog 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 7c82dbb..5953e6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -osmo-ggsn (0.94.0) UNRELEASED; urgency=medium +osmo-ggsn (1.0.0) unstable; urgency=medium * Transition to OsmoGGSN - -- Harald Welte Tue, 05 Sep 2017 09:34:20 +0200 + -- Harald Welte Wed, 06 Sep 2017 12:19:48 +0200 openggsn (0.94.0) UNRELEASED; urgency=medium -- To view, visit https://gerrit.osmocom.org/3875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00a00a7d537fd3c1ff8f8fe128c5bf82d39bda76 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 10:39:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 10:39:49 +0000 Subject: [PATCH] osmo-bsc[master]: Make TRX rf locking more visible Message-ID: Review at https://gerrit.osmocom.org/3876 Make TRX rf locking more visible * log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864 --- M include/openbsc/gsm_data.h M src/libbsc/abis_nm.c M src/libbsc/bsc_rf_ctrl.c M src/libbsc/bsc_vty.c 4 files changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/3876/1 diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 74970b9..9fd3f9a 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -662,7 +662,7 @@ void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason); bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index cf20d7c..f24f6bf 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -2791,9 +2791,13 @@ *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); } -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason) { - int new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + + LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, + get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), + get_value_string(abis_nm_adm_state_names, new_state), reason); trx->mo.nm_state.administrative = new_state; if (!trx->bts || !trx->bts->oml_link) diff --git a/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c index b7b6fc8..0e28600 100644 --- a/src/libbsc/bsc_rf_ctrl.c +++ b/src/libbsc/bsc_rf_ctrl.c @@ -123,7 +123,7 @@ } } -static int lock_each_trx(struct gsm_network *net, int lock) +static int lock_each_trx(struct gsm_network *net, bool lock) { struct gsm_bts *bts; @@ -138,7 +138,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_trx_lock_rf(trx, lock); + gsm_trx_lock_rf(trx, lock, "ctrl"); } } @@ -245,7 +245,7 @@ static int switch_rf_off(struct osmo_bsc_rf *rf) { - lock_each_trx(rf->gsm_network, 1); + lock_each_trx(rf->gsm_network, true); send_signal(rf, S_RF_OFF); return 0; @@ -289,7 +289,7 @@ case RF_CMD_ON: rf->last_state_command = "RF Direct On"; osmo_timer_del(&rf->grace_timeout); - lock_each_trx(rf->gsm_network, 0); + lock_each_trx(rf->gsm_network, false); send_signal(rf, S_RF_ON); osmo_timer_schedule(&rf->rf_check, 3, 0); break; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index abfff0c..b675d16 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3575,7 +3575,7 @@ int locked = atoi(argv[0]); struct gsm_bts_trx *trx = vty->index; - gsm_trx_lock_rf(trx, locked); + gsm_trx_lock_rf(trx, locked, "vty"); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:20:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 11:20:39 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: initial version of OsmoGGSN user manual Message-ID: Review at https://gerrit.osmocom.org/3877 initial version of OsmoGGSN user manual Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 --- M Makefile A OsmoGGSN/Makefile A OsmoGGSN/chapters/configuration.adoc A OsmoGGSN/chapters/overview.adoc A OsmoGGSN/chapters/running.adoc A OsmoGGSN/osmoggsn-usermanual-docinfo.xml A OsmoGGSN/osmoggsn-usermanual.adoc 7 files changed, 521 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/77/3877/1 diff --git a/Makefile b/Makefile index a870bef..c09dd58 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ cd OsmoBSC; $(MAKE) cd OsmoMGCP; $(MAKE) cd OsmoSGSN; $(MAKE) + cd OsmoGGSN; $(MAKE) cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) @@ -14,6 +15,7 @@ cd OsmoBSC; $(MAKE) clean cd OsmoMGCP; $(MAKE) clean cd OsmoSGSN; $(MAKE) clean + cd OsmoGGSN; $(MAKE) clean cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean @@ -24,6 +26,7 @@ cd OsmoBSC; $(MAKE) upload cd OsmoMGCP; $(MAKE) upload cd OsmoSGSN; $(MAKE) upload + cd OsmoGGSN; $(MAKE) upload cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload @@ -33,6 +36,7 @@ cd OsmoNITB; $(MAKE) check cd OsmoBSC; $(MAKE) check cd OsmoSGSN; $(MAKE) check + cd OsmoGGSN; $(MAKE) check cd OsmoPCU; $(MAKE) check # These don't use asciidoc, so they have no 'make check' target: #cd OsmoMGCP; $(MAKE) check diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile new file mode 100644 index 0000000..daf3597 --- /dev/null +++ b/OsmoGGSN/Makefile @@ -0,0 +1,13 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +TOPDIR := .. +ASCIIDOCS := osmoggsn-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmoggsn-usermanual.pdf: chapters/*.adoc + +clean: + rm -rf $(cleanfiles) diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc new file mode 100644 index 0000000..84444e4 --- /dev/null +++ b/OsmoGGSN/chapters/configuration.adoc @@ -0,0 +1,243 @@ +== Configuring OsmoGGSN + +All configuration of OsmoGGSN is performed using the VTY. For more +general information on the VTY interface, see FIXME. + +=== Configuring a virtual GGSN instance + +OsmoGGSN can run multiple GGSN instances inside one program/process. +Each GGSN instance binds to its own transport-layer GTP IP address and +has its own set of APNs and associated IP address pools + tun/gtp +devices. + +In most usage cases, yo will only have a single GGSN instance inside +your configuration file, like in below example: + +.Example: Single GGSN configuration section +---- +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown +---- + + +==== Creating/Editing a GGSN instance + +Creating/Editing a GGSN instance can be done by the following sequence +of VTY commands: + +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Create or edit the GGSN instance `ggsn0`. The name can be any ASCII + string, its significance is only to the local user. +<4> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: After creating a new GGSN instance, it is in `shutdown` mode. See +FIXME to take it out of shutdown, but make sure to configure it fully +before taking it out of shutdown. + +==== Configuring a GGSN instance + +The following two mandatory configuration statements have to be given +for every GGSN instance: + +---- +OsmoGGSN(config-ggsn)# gtp state-dir /var/lib/ggsn/ggsn0 <1> +OsmoGGSN(config-ggsn)# gtp bind-ip 127.0.0.6 <2> +---- +<1> Store the GSN restart state in the specified directory +<2> Bind the GGSN instance to the specified local IPv4 address + +There are some further configuration statements that can be used at the +GGSN node, some examples are given below. For a full list, see the +OpenGGSN VTY reference manual (FIXME). + +---- +OsmoGGSN(config-ggsn)# default-apn foobar <1> +---- +<1> Configure a default APN to be used if the user-requested APN is not + found. The named APN must previously be configured + + +==== Deleting a GGSN instance + +A GGSN instance can be removed like this + +.Example: Deleting a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# no ggsn ggsn0 <3> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Delete the GGSN instance + + +==== Taking a GGSN instance out of shutdown + +.Example: Taking a GGSN instance out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Take the GGSN instance out of shutdown + + +==== Shutting a GGSN instance down + +If you would like to take a GGSN instance out of service, you can +put it into shutdown mode. This will make the entire GGSN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Shut down the GGSN instance + + +=== Configuring an Access Point Name + +An Access Point Name (APN) represents a connection to an external packet +data network, such as the public Internet or private corporate networsk. + +APNs are selected by terminals (MS/UE) when establishing PDP contexts. + +Each OsmoGGSN GGSN instance can have any number of APNs configured. +Each APN is identified by a string name. + +==== Creating/Editing an APN + +.Example: Creating a new APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<4> Create or Edit an APN called `internet` +<5> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: The newly-create APN is created in `shutdown` mode. See FIXME to take it +out of shutdown. + + +==== Configuring an APN + +.Example: Configuring an APN +---- +OsmoGGSN(config-ggsn-apn)# gtpu-mode tun <1> +OsmoGGSN(config-ggsn-apn)# type-support v4 <2> +OsmoGGSN(config-ggsn-apn)# ip prefix dynamic 176.16.222.0/24 <3> +OsmoGGSN(config-ggsn-apn)# ip dns 0 192.168.100.1 <4> +OsmoGGSN(config-ggsn-apn)# ip dns 1 8.8.8.8 <5> +OsmoGGSN(config-ggsn-apn)# ip ifconfig 176.16.222.0/24 <6> +---- +<1> Use the userspace GTP-U handling using a TUN device +<2> Support (only) IPv4 Addresses +<3> Specify the pool of dynamic IPv4 addresses to be allocated to PDP + contexts +<4> Specify the primary DNS server to be provided using IPCP/PCO +<5> Specify the secondary DNS server to be provided using IPCP/PCO +<6> Request OsmoGGSN to configure the `tun4` device network/netmask + +NOTE:: If you use the optional `ip ifconfig` command to set the network +device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` +support. It might be better to configure related tun devices at system +startup and run OsmoGGSN as non-privileged user. See FIXME for more +details. + + +==== Deleting an APN + +An APN configuration can be removed like this + +.Example: Deleting an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no apn internet <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<3> Delete the APN `internet` + + +==== Taking an APN out of shutdown + +In order to bring a deactived APN in `shutdown` state into active +operation, use the `no shutdown` command at the APN node as explained in +the following example: + +.Example: Taking an APN out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# no shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Take the APN out of shutdown + + +==== Shutting an APN down + +If you would like to take an APN instance out of service, you can +put it into shutdown mode. This will make the APN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Shut down the APN + diff --git a/OsmoGGSN/chapters/overview.adoc b/OsmoGGSN/chapters/overview.adoc new file mode 100644 index 0000000..632db5e --- /dev/null +++ b/OsmoGGSN/chapters/overview.adoc @@ -0,0 +1,145 @@ +[[chapter_introduction]] +== Overview + +[[intro_overview]] +=== About OsmoGGSN + +OsmoGGSN is a Free / Open Source Software implementation of the GPRS +GGSN (Gateway GPRS support node) element in side the packet switched +core network of 2G and 3G cellular networks. + +The GGSN function is the tunnel endpoint on the core network side, +from where the external (IP) packet data network + +=== Software Components + +==== GTP Implementation (libgtp) + +The OsmoGGSN source code includes a shared library implementation of +the GTP protocol used on the GGSN-SGSN interface. This library +and associated header files are installed system-wide and are +available to other programs/applications. + +In fact, libgtp is what the OsmoSGSN also uses for its use of GTP. + +==== sgsnemu + +In order to test OsmoGGSN without running a SGSN and other elements +of a cellular network, there is a small command-line utility called +*sgsnemu* which is able to simulate the customary operations of a SGSN +towards the GGSN, such as a PDP Context Activation. + +*sgsnemu* can even be used for testing against other GGSNs, as the GTP +protocol is standardized across implementations. + +==== osmo-ggsn + +*osmo-ggsn* is the actual name of the OsmoGGSN executable program. It +implements the GGSN functionality. All parameters are set using the +configuration file, by default located in *./osmo-ggsn.cfg* + +==== systemd service file + +In *contrib/osmo-ggsn.service* you can find a sample service file for +OsmoGGSN which can be used with systemd. + +==== init script + +In *contrib/osmo-ggsn.init* you can find a sample init script to be used +on systems with classic init process. + +=== Limitations + +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +following tables the support of each individual message type is +detailed. The numbers before each feature indicates the relevant +section in the standard. + +==== GSM 09.60 (GTPv0) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +| Feature | gtplib | osmo-ggsn | sgsnemu | notes +5+<|*7.4 Path Management Messages* +|7.4.1 Echo Request |Supported |Supported |Supported | +|7.4.2 Echo Response |Supported |Supported |Supported | +|7.4.3 Version Not Supported |Supported |Supported |Supported | +5+<| *7.5 Tunnel Management Messages* +|7.5.1 Create PDP Context Request|Supported |Supported |Supported | +|7.5.2 Create PDP Context Response|Supported |Supported |Supported | +|7.5.3 Update PDP Context Request|Supported |Supported |Not | +|7.5.4 Update PDP Context Response|Supported |Supported |Not | +|7.5.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.5.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.5.7 Create AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.8 Create AA PDP Response|Unsupported |Unsupported |Unsupported | +|7.5.9 Delete AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.10 Delete AA PDP Context Response|Unsupported |Unsupported |Unsupported | +|7.5.11 Error Indication |Supported |Supported |Supported | +|7.5.12 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.5.13 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.5.14 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.5.15 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<| *7.6 Location Management Messages* +|7.6.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.6.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Request|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Response|Unsupported |Unsupported |Not applicable | +|7.6.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.6.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<| *7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable|Not applicable | +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable|Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|=== + +==== 3GPP 29.060 (GTPv1) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +|Feature |gtplib |osmo-ggsn |sgsnemu |notes +5+<|*7.2 Path Management Messages* +|7.2.1 Echo Request |Supported |Supported |Supported | +|7.2.2 Echo Response |Supported |Supported |Supported | +|7.2.3 Version Not Supported|Supported |Supported |Supported | +|7.2.4 Extension Headers Notification|Supported |Supported |Supported | +5+<|*7.3 Tunnel Management Messages* +|7.3.1 Create PDP Context Request|Supported |Supported |Supported |1 +|7.3.2 Create PDP Context Response|Supported |Supported |Supported | +|7.3.3 Update PDP Context Request|Supported |Supported |Not applicable|1 +|7.3.4 Update PDP Context Response|Supported |Supported |Not applicable| +|7.3.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.3.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.3.7 Error Indication |Supported |Supported |Supported | +|7.3.8 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.3.9 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<|*7.4 Location Management Messages* +|7.4.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.4.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.4.3 Failure Report Request|Unsupported |Unsupported |Not applicable| +|7.4.3 Failure Report Response|Unsupported |Unsupported |Not applicable| +|7.4.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.4.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<|*7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable |Not applicable| +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable |Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.6 Forward Relocation Request|Unsupported |Not applicable|Not applicable| +|7.5.7 Forward Relocation Response|Unsupported |Not applicable|Not applicable| +|7.5.8 Forward Relocation Complete|Unsupported |Not applicable|Not applicable| +|7.5.9 Relocation Cancel Request|Unsupported |Not applicable|Not applicable| +|7.5.10 Relocation Cancel Response|Unsupported |Not applicable|Not applicable| +|7.5.11 Forward Relocation Complete |Unsupported |Not applicable |Not applicable | +|7.5.12 Forward SRNS Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.13 Forward SRNS Context|Unsupported |Not applicable|Not applicable| +|=== + +Notes + +1) The "Secondary PDP Context Activation Procedure" is not supported. diff --git a/OsmoGGSN/chapters/running.adoc b/OsmoGGSN/chapters/running.adoc new file mode 100644 index 0000000..cff3f8d --- /dev/null +++ b/OsmoGGSN/chapters/running.adoc @@ -0,0 +1,41 @@ +== Running OsmoNITB + +The OsmoGGSN executable (`osmo-ggsn`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-ggsn* [-h|-V] [-D] [-c 'CONFIGFILE'] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `osmo-ggsn.cfg` in the current + working directory. + +=== Multiple instances + +Running multiple instances of `osmo-ggsn` is possible if all GGSN instances +are binding to different local IP addresse and all other interfaces (VTY, +OML) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different +IP addresses. + +The VTY and the control interface can be bound to IP addresses from the loopback +address range. + +.Example: Binding VTY and control interface to a specific ip-address +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- diff --git a/OsmoGGSN/osmoggsn-usermanual-docinfo.xml b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml new file mode 100644 index 0000000..c93d5e1 --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + August 2017 + HW + + Initial version. + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2013-2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoGGSN/osmoggsn-usermanual.adoc b/OsmoGGSN/osmoggsn-usermanual.adoc new file mode 100644 index 0000000..efa2c8f --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual.adoc @@ -0,0 +1,29 @@ +OsmoGGSN User Manual +==================== +Harald Welte + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +//include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + + +include::chapters/configuration.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] -- To view, visit https://gerrit.osmocom.org/3877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 11:20:50 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: initial version of OsmoGGSN user manual In-Reply-To: References: Message-ID: initial version of OsmoGGSN user manual Closes: OS#1721 Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 --- M Makefile A OsmoGGSN/Makefile A OsmoGGSN/chapters/configuration.adoc A OsmoGGSN/chapters/overview.adoc A OsmoGGSN/chapters/running.adoc A OsmoGGSN/osmoggsn-usermanual-docinfo.xml A OsmoGGSN/osmoggsn-usermanual.adoc 7 files changed, 521 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/77/3877/2 diff --git a/Makefile b/Makefile index a870bef..c09dd58 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ cd OsmoBSC; $(MAKE) cd OsmoMGCP; $(MAKE) cd OsmoSGSN; $(MAKE) + cd OsmoGGSN; $(MAKE) cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) @@ -14,6 +15,7 @@ cd OsmoBSC; $(MAKE) clean cd OsmoMGCP; $(MAKE) clean cd OsmoSGSN; $(MAKE) clean + cd OsmoGGSN; $(MAKE) clean cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean @@ -24,6 +26,7 @@ cd OsmoBSC; $(MAKE) upload cd OsmoMGCP; $(MAKE) upload cd OsmoSGSN; $(MAKE) upload + cd OsmoGGSN; $(MAKE) upload cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload @@ -33,6 +36,7 @@ cd OsmoNITB; $(MAKE) check cd OsmoBSC; $(MAKE) check cd OsmoSGSN; $(MAKE) check + cd OsmoGGSN; $(MAKE) check cd OsmoPCU; $(MAKE) check # These don't use asciidoc, so they have no 'make check' target: #cd OsmoMGCP; $(MAKE) check diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile new file mode 100644 index 0000000..daf3597 --- /dev/null +++ b/OsmoGGSN/Makefile @@ -0,0 +1,13 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +TOPDIR := .. +ASCIIDOCS := osmoggsn-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmoggsn-usermanual.pdf: chapters/*.adoc + +clean: + rm -rf $(cleanfiles) diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc new file mode 100644 index 0000000..84444e4 --- /dev/null +++ b/OsmoGGSN/chapters/configuration.adoc @@ -0,0 +1,243 @@ +== Configuring OsmoGGSN + +All configuration of OsmoGGSN is performed using the VTY. For more +general information on the VTY interface, see FIXME. + +=== Configuring a virtual GGSN instance + +OsmoGGSN can run multiple GGSN instances inside one program/process. +Each GGSN instance binds to its own transport-layer GTP IP address and +has its own set of APNs and associated IP address pools + tun/gtp +devices. + +In most usage cases, yo will only have a single GGSN instance inside +your configuration file, like in below example: + +.Example: Single GGSN configuration section +---- +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown +---- + + +==== Creating/Editing a GGSN instance + +Creating/Editing a GGSN instance can be done by the following sequence +of VTY commands: + +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Create or edit the GGSN instance `ggsn0`. The name can be any ASCII + string, its significance is only to the local user. +<4> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: After creating a new GGSN instance, it is in `shutdown` mode. See +FIXME to take it out of shutdown, but make sure to configure it fully +before taking it out of shutdown. + +==== Configuring a GGSN instance + +The following two mandatory configuration statements have to be given +for every GGSN instance: + +---- +OsmoGGSN(config-ggsn)# gtp state-dir /var/lib/ggsn/ggsn0 <1> +OsmoGGSN(config-ggsn)# gtp bind-ip 127.0.0.6 <2> +---- +<1> Store the GSN restart state in the specified directory +<2> Bind the GGSN instance to the specified local IPv4 address + +There are some further configuration statements that can be used at the +GGSN node, some examples are given below. For a full list, see the +OpenGGSN VTY reference manual (FIXME). + +---- +OsmoGGSN(config-ggsn)# default-apn foobar <1> +---- +<1> Configure a default APN to be used if the user-requested APN is not + found. The named APN must previously be configured + + +==== Deleting a GGSN instance + +A GGSN instance can be removed like this + +.Example: Deleting a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# no ggsn ggsn0 <3> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Delete the GGSN instance + + +==== Taking a GGSN instance out of shutdown + +.Example: Taking a GGSN instance out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Take the GGSN instance out of shutdown + + +==== Shutting a GGSN instance down + +If you would like to take a GGSN instance out of service, you can +put it into shutdown mode. This will make the entire GGSN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Shut down the GGSN instance + + +=== Configuring an Access Point Name + +An Access Point Name (APN) represents a connection to an external packet +data network, such as the public Internet or private corporate networsk. + +APNs are selected by terminals (MS/UE) when establishing PDP contexts. + +Each OsmoGGSN GGSN instance can have any number of APNs configured. +Each APN is identified by a string name. + +==== Creating/Editing an APN + +.Example: Creating a new APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<4> Create or Edit an APN called `internet` +<5> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: The newly-create APN is created in `shutdown` mode. See FIXME to take it +out of shutdown. + + +==== Configuring an APN + +.Example: Configuring an APN +---- +OsmoGGSN(config-ggsn-apn)# gtpu-mode tun <1> +OsmoGGSN(config-ggsn-apn)# type-support v4 <2> +OsmoGGSN(config-ggsn-apn)# ip prefix dynamic 176.16.222.0/24 <3> +OsmoGGSN(config-ggsn-apn)# ip dns 0 192.168.100.1 <4> +OsmoGGSN(config-ggsn-apn)# ip dns 1 8.8.8.8 <5> +OsmoGGSN(config-ggsn-apn)# ip ifconfig 176.16.222.0/24 <6> +---- +<1> Use the userspace GTP-U handling using a TUN device +<2> Support (only) IPv4 Addresses +<3> Specify the pool of dynamic IPv4 addresses to be allocated to PDP + contexts +<4> Specify the primary DNS server to be provided using IPCP/PCO +<5> Specify the secondary DNS server to be provided using IPCP/PCO +<6> Request OsmoGGSN to configure the `tun4` device network/netmask + +NOTE:: If you use the optional `ip ifconfig` command to set the network +device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` +support. It might be better to configure related tun devices at system +startup and run OsmoGGSN as non-privileged user. See FIXME for more +details. + + +==== Deleting an APN + +An APN configuration can be removed like this + +.Example: Deleting an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no apn internet <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<3> Delete the APN `internet` + + +==== Taking an APN out of shutdown + +In order to bring a deactived APN in `shutdown` state into active +operation, use the `no shutdown` command at the APN node as explained in +the following example: + +.Example: Taking an APN out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# no shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Take the APN out of shutdown + + +==== Shutting an APN down + +If you would like to take an APN instance out of service, you can +put it into shutdown mode. This will make the APN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Shut down the APN + diff --git a/OsmoGGSN/chapters/overview.adoc b/OsmoGGSN/chapters/overview.adoc new file mode 100644 index 0000000..632db5e --- /dev/null +++ b/OsmoGGSN/chapters/overview.adoc @@ -0,0 +1,145 @@ +[[chapter_introduction]] +== Overview + +[[intro_overview]] +=== About OsmoGGSN + +OsmoGGSN is a Free / Open Source Software implementation of the GPRS +GGSN (Gateway GPRS support node) element in side the packet switched +core network of 2G and 3G cellular networks. + +The GGSN function is the tunnel endpoint on the core network side, +from where the external (IP) packet data network + +=== Software Components + +==== GTP Implementation (libgtp) + +The OsmoGGSN source code includes a shared library implementation of +the GTP protocol used on the GGSN-SGSN interface. This library +and associated header files are installed system-wide and are +available to other programs/applications. + +In fact, libgtp is what the OsmoSGSN also uses for its use of GTP. + +==== sgsnemu + +In order to test OsmoGGSN without running a SGSN and other elements +of a cellular network, there is a small command-line utility called +*sgsnemu* which is able to simulate the customary operations of a SGSN +towards the GGSN, such as a PDP Context Activation. + +*sgsnemu* can even be used for testing against other GGSNs, as the GTP +protocol is standardized across implementations. + +==== osmo-ggsn + +*osmo-ggsn* is the actual name of the OsmoGGSN executable program. It +implements the GGSN functionality. All parameters are set using the +configuration file, by default located in *./osmo-ggsn.cfg* + +==== systemd service file + +In *contrib/osmo-ggsn.service* you can find a sample service file for +OsmoGGSN which can be used with systemd. + +==== init script + +In *contrib/osmo-ggsn.init* you can find a sample init script to be used +on systems with classic init process. + +=== Limitations + +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +following tables the support of each individual message type is +detailed. The numbers before each feature indicates the relevant +section in the standard. + +==== GSM 09.60 (GTPv0) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +| Feature | gtplib | osmo-ggsn | sgsnemu | notes +5+<|*7.4 Path Management Messages* +|7.4.1 Echo Request |Supported |Supported |Supported | +|7.4.2 Echo Response |Supported |Supported |Supported | +|7.4.3 Version Not Supported |Supported |Supported |Supported | +5+<| *7.5 Tunnel Management Messages* +|7.5.1 Create PDP Context Request|Supported |Supported |Supported | +|7.5.2 Create PDP Context Response|Supported |Supported |Supported | +|7.5.3 Update PDP Context Request|Supported |Supported |Not | +|7.5.4 Update PDP Context Response|Supported |Supported |Not | +|7.5.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.5.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.5.7 Create AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.8 Create AA PDP Response|Unsupported |Unsupported |Unsupported | +|7.5.9 Delete AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.10 Delete AA PDP Context Response|Unsupported |Unsupported |Unsupported | +|7.5.11 Error Indication |Supported |Supported |Supported | +|7.5.12 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.5.13 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.5.14 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.5.15 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<| *7.6 Location Management Messages* +|7.6.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.6.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Request|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Response|Unsupported |Unsupported |Not applicable | +|7.6.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.6.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<| *7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable|Not applicable | +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable|Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|=== + +==== 3GPP 29.060 (GTPv1) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +|Feature |gtplib |osmo-ggsn |sgsnemu |notes +5+<|*7.2 Path Management Messages* +|7.2.1 Echo Request |Supported |Supported |Supported | +|7.2.2 Echo Response |Supported |Supported |Supported | +|7.2.3 Version Not Supported|Supported |Supported |Supported | +|7.2.4 Extension Headers Notification|Supported |Supported |Supported | +5+<|*7.3 Tunnel Management Messages* +|7.3.1 Create PDP Context Request|Supported |Supported |Supported |1 +|7.3.2 Create PDP Context Response|Supported |Supported |Supported | +|7.3.3 Update PDP Context Request|Supported |Supported |Not applicable|1 +|7.3.4 Update PDP Context Response|Supported |Supported |Not applicable| +|7.3.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.3.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.3.7 Error Indication |Supported |Supported |Supported | +|7.3.8 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.3.9 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<|*7.4 Location Management Messages* +|7.4.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.4.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.4.3 Failure Report Request|Unsupported |Unsupported |Not applicable| +|7.4.3 Failure Report Response|Unsupported |Unsupported |Not applicable| +|7.4.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.4.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<|*7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable |Not applicable| +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable |Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.6 Forward Relocation Request|Unsupported |Not applicable|Not applicable| +|7.5.7 Forward Relocation Response|Unsupported |Not applicable|Not applicable| +|7.5.8 Forward Relocation Complete|Unsupported |Not applicable|Not applicable| +|7.5.9 Relocation Cancel Request|Unsupported |Not applicable|Not applicable| +|7.5.10 Relocation Cancel Response|Unsupported |Not applicable|Not applicable| +|7.5.11 Forward Relocation Complete |Unsupported |Not applicable |Not applicable | +|7.5.12 Forward SRNS Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.13 Forward SRNS Context|Unsupported |Not applicable|Not applicable| +|=== + +Notes + +1) The "Secondary PDP Context Activation Procedure" is not supported. diff --git a/OsmoGGSN/chapters/running.adoc b/OsmoGGSN/chapters/running.adoc new file mode 100644 index 0000000..cff3f8d --- /dev/null +++ b/OsmoGGSN/chapters/running.adoc @@ -0,0 +1,41 @@ +== Running OsmoNITB + +The OsmoGGSN executable (`osmo-ggsn`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-ggsn* [-h|-V] [-D] [-c 'CONFIGFILE'] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `osmo-ggsn.cfg` in the current + working directory. + +=== Multiple instances + +Running multiple instances of `osmo-ggsn` is possible if all GGSN instances +are binding to different local IP addresse and all other interfaces (VTY, +OML) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different +IP addresses. + +The VTY and the control interface can be bound to IP addresses from the loopback +address range. + +.Example: Binding VTY and control interface to a specific ip-address +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- diff --git a/OsmoGGSN/osmoggsn-usermanual-docinfo.xml b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml new file mode 100644 index 0000000..c93d5e1 --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + August 2017 + HW + + Initial version. + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2013-2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoGGSN/osmoggsn-usermanual.adoc b/OsmoGGSN/osmoggsn-usermanual.adoc new file mode 100644 index 0000000..efa2c8f --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual.adoc @@ -0,0 +1,29 @@ +OsmoGGSN User Manual +==================== +Harald Welte + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +//include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + + +include::chapters/configuration.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] -- To view, visit https://gerrit.osmocom.org/3877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:23:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 11:23:07 +0000 Subject: meta-telephony[laforge/nightly]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 11:32:00 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: initial version of OsmoGGSN user manual In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3877 to look at the new patch set (#3). initial version of OsmoGGSN user manual Closes: OS#1721 Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 --- M Makefile A OsmoGGSN/Makefile A OsmoGGSN/chapters/configuration.adoc A OsmoGGSN/chapters/overview.adoc A OsmoGGSN/chapters/running.adoc A OsmoGGSN/osmoggsn-usermanual-docinfo.xml A OsmoGGSN/osmoggsn-usermanual.adoc 7 files changed, 521 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/77/3877/3 diff --git a/Makefile b/Makefile index a870bef..c09dd58 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ cd OsmoBSC; $(MAKE) cd OsmoMGCP; $(MAKE) cd OsmoSGSN; $(MAKE) + cd OsmoGGSN; $(MAKE) cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) @@ -14,6 +15,7 @@ cd OsmoBSC; $(MAKE) clean cd OsmoMGCP; $(MAKE) clean cd OsmoSGSN; $(MAKE) clean + cd OsmoGGSN; $(MAKE) clean cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean @@ -24,6 +26,7 @@ cd OsmoBSC; $(MAKE) upload cd OsmoMGCP; $(MAKE) upload cd OsmoSGSN; $(MAKE) upload + cd OsmoGGSN; $(MAKE) upload cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload @@ -33,6 +36,7 @@ cd OsmoNITB; $(MAKE) check cd OsmoBSC; $(MAKE) check cd OsmoSGSN; $(MAKE) check + cd OsmoGGSN; $(MAKE) check cd OsmoPCU; $(MAKE) check # These don't use asciidoc, so they have no 'make check' target: #cd OsmoMGCP; $(MAKE) check diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile new file mode 100644 index 0000000..daf3597 --- /dev/null +++ b/OsmoGGSN/Makefile @@ -0,0 +1,13 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +TOPDIR := .. +ASCIIDOCS := osmoggsn-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmoggsn-usermanual.pdf: chapters/*.adoc + +clean: + rm -rf $(cleanfiles) diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc new file mode 100644 index 0000000..e37b709 --- /dev/null +++ b/OsmoGGSN/chapters/configuration.adoc @@ -0,0 +1,243 @@ +== Configuring OsmoGGSN + +All configuration of OsmoGGSN is performed using the VTY. For more +general information on the VTY interface, see FIXME. + +=== Configuring a virtual GGSN instance + +OsmoGGSN can run multiple GGSN instances inside one program/process. +Each GGSN instance binds to its own transport-layer GTP IP address and +has its own set of APNs and associated IP address pools + tun/gtp +devices. + +In most usage cases, yo will only have a single GGSN instance inside +your configuration file, like in below example: + +.Example: Single GGSN configuration section +---- +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown +---- + + +==== Creating/Editing a GGSN instance + +Creating/Editing a GGSN instance can be done by the following sequence +of VTY commands: + +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Create or edit the GGSN instance `ggsn0`. The name can be any ASCII + string, its significance is only to the local user. +<4> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: After creating a new GGSN instance, it is in `shutdown` mode. See +FIXME to take it out of shutdown, but make sure to configure it fully +before taking it out of shutdown. + +==== Configuring a GGSN instance + +The following two mandatory configuration statements have to be given +for every GGSN instance: + +---- +OsmoGGSN(config-ggsn)# gtp state-dir /var/lib/ggsn/ggsn0 <1> +OsmoGGSN(config-ggsn)# gtp bind-ip 127.0.0.6 <2> +---- +<1> Store the GSN restart state in the specified directory +<2> Bind the GGSN instance to the specified local IPv4 address + +There are some further configuration statements that can be used at the +GGSN node, some examples are given below. For a full list, see the +OpenGGSN VTY reference manual (FIXME). + +---- +OsmoGGSN(config-ggsn)# default-apn foobar <1> +---- +<1> Configure a default APN to be used if the user-requested APN is not + found. The named APN must previously be configured + + +==== Deleting a GGSN instance + +A GGSN instance can be removed like this + +.Example: Deleting a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# no ggsn ggsn0 <3> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Delete the GGSN instance + + +==== Taking a GGSN instance out of shutdown + +.Example: Taking a GGSN instance out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Take the GGSN instance out of shutdown + + +==== Shutting a GGSN instance down + +If you would like to take a GGSN instance out of service, you can +put it into shutdown mode. This will make the entire GGSN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Shut down the GGSN instance + + +=== Configuring an Access Point Name + +An Access Point Name (APN) represents a connection to an external packet +data network, such as the public Internet or private corporate networsk. + +APNs are selected by terminals (MS/UE) when establishing PDP contexts. + +Each OsmoGGSN GGSN instance can have any number of APNs configured. +Each APN is identified by a string name. + +==== Creating/Editing an APN + +.Example: Creating a new APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<4> Create or Edit an APN called `internet` +<5> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: The newly-create APN is created in `shutdown` mode. See FIXME to take it +out of shutdown. + + +==== Configuring an APN + +.Example: Configuring an APN +---- +OsmoGGSN(config-ggsn-apn)# gtpu-mode tun <1> +OsmoGGSN(config-ggsn-apn)# type-support v4 <2> +OsmoGGSN(config-ggsn-apn)# ip prefix dynamic 176.16.222.0/24 <3> +OsmoGGSN(config-ggsn-apn)# ip dns 0 192.168.100.1 <4> +OsmoGGSN(config-ggsn-apn)# ip dns 1 8.8.8.8 <5> +OsmoGGSN(config-ggsn-apn)# ip ifconfig 176.16.222.0/24 <6> +---- +<1> Use the userspace GTP-U handling using a TUN device +<2> Support (only) IPv4 Addresses +<3> Specify the pool of dynamic IPv4 addresses to be allocated to PDP + contexts +<4> Specify the primary DNS server to be provided using IPCP/PCO +<5> Specify the secondary DNS server to be provided using IPCP/PCO +<6> Request OsmoGGSN to configure the `tun4` device network/netmask + +NOTE:: If you use the optional `ip ifconfig` command to set the network +device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` +support. It might be better to configure related tun devices at system +startup and run OsmoGGSN as non-privileged user. See FIXME for more +details. + + +==== Deleting an APN + +An APN configuration can be removed like this + +.Example: Deleting an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no apn internet <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<4> Delete the APN `internet` + + +==== Taking an APN out of shutdown + +In order to bring a deactived APN in `shutdown` state into active +operation, use the `no shutdown` command at the APN node as explained in +the following example: + +.Example: Taking an APN out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# no shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Take the APN out of shutdown + + +==== Shutting an APN down + +If you would like to take an APN instance out of service, you can +put it into shutdown mode. This will make the APN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Shut down the APN + diff --git a/OsmoGGSN/chapters/overview.adoc b/OsmoGGSN/chapters/overview.adoc new file mode 100644 index 0000000..632db5e --- /dev/null +++ b/OsmoGGSN/chapters/overview.adoc @@ -0,0 +1,145 @@ +[[chapter_introduction]] +== Overview + +[[intro_overview]] +=== About OsmoGGSN + +OsmoGGSN is a Free / Open Source Software implementation of the GPRS +GGSN (Gateway GPRS support node) element in side the packet switched +core network of 2G and 3G cellular networks. + +The GGSN function is the tunnel endpoint on the core network side, +from where the external (IP) packet data network + +=== Software Components + +==== GTP Implementation (libgtp) + +The OsmoGGSN source code includes a shared library implementation of +the GTP protocol used on the GGSN-SGSN interface. This library +and associated header files are installed system-wide and are +available to other programs/applications. + +In fact, libgtp is what the OsmoSGSN also uses for its use of GTP. + +==== sgsnemu + +In order to test OsmoGGSN without running a SGSN and other elements +of a cellular network, there is a small command-line utility called +*sgsnemu* which is able to simulate the customary operations of a SGSN +towards the GGSN, such as a PDP Context Activation. + +*sgsnemu* can even be used for testing against other GGSNs, as the GTP +protocol is standardized across implementations. + +==== osmo-ggsn + +*osmo-ggsn* is the actual name of the OsmoGGSN executable program. It +implements the GGSN functionality. All parameters are set using the +configuration file, by default located in *./osmo-ggsn.cfg* + +==== systemd service file + +In *contrib/osmo-ggsn.service* you can find a sample service file for +OsmoGGSN which can be used with systemd. + +==== init script + +In *contrib/osmo-ggsn.init* you can find a sample init script to be used +on systems with classic init process. + +=== Limitations + +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +following tables the support of each individual message type is +detailed. The numbers before each feature indicates the relevant +section in the standard. + +==== GSM 09.60 (GTPv0) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +| Feature | gtplib | osmo-ggsn | sgsnemu | notes +5+<|*7.4 Path Management Messages* +|7.4.1 Echo Request |Supported |Supported |Supported | +|7.4.2 Echo Response |Supported |Supported |Supported | +|7.4.3 Version Not Supported |Supported |Supported |Supported | +5+<| *7.5 Tunnel Management Messages* +|7.5.1 Create PDP Context Request|Supported |Supported |Supported | +|7.5.2 Create PDP Context Response|Supported |Supported |Supported | +|7.5.3 Update PDP Context Request|Supported |Supported |Not | +|7.5.4 Update PDP Context Response|Supported |Supported |Not | +|7.5.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.5.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.5.7 Create AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.8 Create AA PDP Response|Unsupported |Unsupported |Unsupported | +|7.5.9 Delete AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.10 Delete AA PDP Context Response|Unsupported |Unsupported |Unsupported | +|7.5.11 Error Indication |Supported |Supported |Supported | +|7.5.12 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.5.13 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.5.14 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.5.15 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<| *7.6 Location Management Messages* +|7.6.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.6.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Request|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Response|Unsupported |Unsupported |Not applicable | +|7.6.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.6.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<| *7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable|Not applicable | +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable|Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|=== + +==== 3GPP 29.060 (GTPv1) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +|Feature |gtplib |osmo-ggsn |sgsnemu |notes +5+<|*7.2 Path Management Messages* +|7.2.1 Echo Request |Supported |Supported |Supported | +|7.2.2 Echo Response |Supported |Supported |Supported | +|7.2.3 Version Not Supported|Supported |Supported |Supported | +|7.2.4 Extension Headers Notification|Supported |Supported |Supported | +5+<|*7.3 Tunnel Management Messages* +|7.3.1 Create PDP Context Request|Supported |Supported |Supported |1 +|7.3.2 Create PDP Context Response|Supported |Supported |Supported | +|7.3.3 Update PDP Context Request|Supported |Supported |Not applicable|1 +|7.3.4 Update PDP Context Response|Supported |Supported |Not applicable| +|7.3.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.3.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.3.7 Error Indication |Supported |Supported |Supported | +|7.3.8 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.3.9 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<|*7.4 Location Management Messages* +|7.4.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.4.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.4.3 Failure Report Request|Unsupported |Unsupported |Not applicable| +|7.4.3 Failure Report Response|Unsupported |Unsupported |Not applicable| +|7.4.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.4.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<|*7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable |Not applicable| +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable |Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.6 Forward Relocation Request|Unsupported |Not applicable|Not applicable| +|7.5.7 Forward Relocation Response|Unsupported |Not applicable|Not applicable| +|7.5.8 Forward Relocation Complete|Unsupported |Not applicable|Not applicable| +|7.5.9 Relocation Cancel Request|Unsupported |Not applicable|Not applicable| +|7.5.10 Relocation Cancel Response|Unsupported |Not applicable|Not applicable| +|7.5.11 Forward Relocation Complete |Unsupported |Not applicable |Not applicable | +|7.5.12 Forward SRNS Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.13 Forward SRNS Context|Unsupported |Not applicable|Not applicable| +|=== + +Notes + +1) The "Secondary PDP Context Activation Procedure" is not supported. diff --git a/OsmoGGSN/chapters/running.adoc b/OsmoGGSN/chapters/running.adoc new file mode 100644 index 0000000..cff3f8d --- /dev/null +++ b/OsmoGGSN/chapters/running.adoc @@ -0,0 +1,41 @@ +== Running OsmoNITB + +The OsmoGGSN executable (`osmo-ggsn`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-ggsn* [-h|-V] [-D] [-c 'CONFIGFILE'] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `osmo-ggsn.cfg` in the current + working directory. + +=== Multiple instances + +Running multiple instances of `osmo-ggsn` is possible if all GGSN instances +are binding to different local IP addresse and all other interfaces (VTY, +OML) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different +IP addresses. + +The VTY and the control interface can be bound to IP addresses from the loopback +address range. + +.Example: Binding VTY and control interface to a specific ip-address +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- diff --git a/OsmoGGSN/osmoggsn-usermanual-docinfo.xml b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml new file mode 100644 index 0000000..c93d5e1 --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + August 2017 + HW + + Initial version. + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2013-2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoGGSN/osmoggsn-usermanual.adoc b/OsmoGGSN/osmoggsn-usermanual.adoc new file mode 100644 index 0000000..efa2c8f --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual.adoc @@ -0,0 +1,29 @@ +OsmoGGSN User Manual +==================== +Harald Welte + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +//include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + + +include::chapters/configuration.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] -- To view, visit https://gerrit.osmocom.org/3877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:49:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 11:49:39 +0000 Subject: osmo-gsm-manuals[master]: initial version of OsmoGGSN user manual In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:49:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 11:49:40 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: initial version of OsmoGGSN user manual In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: initial version of OsmoGGSN user manual ...................................................................... initial version of OsmoGGSN user manual Closes: OS#1721 Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 --- M Makefile A OsmoGGSN/Makefile A OsmoGGSN/chapters/configuration.adoc A OsmoGGSN/chapters/overview.adoc A OsmoGGSN/chapters/running.adoc A OsmoGGSN/osmoggsn-usermanual-docinfo.xml A OsmoGGSN/osmoggsn-usermanual.adoc 7 files changed, 521 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile b/Makefile index a870bef..c09dd58 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ cd OsmoBSC; $(MAKE) cd OsmoMGCP; $(MAKE) cd OsmoSGSN; $(MAKE) + cd OsmoGGSN; $(MAKE) cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) @@ -14,6 +15,7 @@ cd OsmoBSC; $(MAKE) clean cd OsmoMGCP; $(MAKE) clean cd OsmoSGSN; $(MAKE) clean + cd OsmoGGSN; $(MAKE) clean cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean @@ -24,6 +26,7 @@ cd OsmoBSC; $(MAKE) upload cd OsmoMGCP; $(MAKE) upload cd OsmoSGSN; $(MAKE) upload + cd OsmoGGSN; $(MAKE) upload cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload @@ -33,6 +36,7 @@ cd OsmoNITB; $(MAKE) check cd OsmoBSC; $(MAKE) check cd OsmoSGSN; $(MAKE) check + cd OsmoGGSN; $(MAKE) check cd OsmoPCU; $(MAKE) check # These don't use asciidoc, so they have no 'make check' target: #cd OsmoMGCP; $(MAKE) check diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile new file mode 100644 index 0000000..daf3597 --- /dev/null +++ b/OsmoGGSN/Makefile @@ -0,0 +1,13 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +TOPDIR := .. +ASCIIDOCS := osmoggsn-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmoggsn-usermanual.pdf: chapters/*.adoc + +clean: + rm -rf $(cleanfiles) diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc new file mode 100644 index 0000000..e37b709 --- /dev/null +++ b/OsmoGGSN/chapters/configuration.adoc @@ -0,0 +1,243 @@ +== Configuring OsmoGGSN + +All configuration of OsmoGGSN is performed using the VTY. For more +general information on the VTY interface, see FIXME. + +=== Configuring a virtual GGSN instance + +OsmoGGSN can run multiple GGSN instances inside one program/process. +Each GGSN instance binds to its own transport-layer GTP IP address and +has its own set of APNs and associated IP address pools + tun/gtp +devices. + +In most usage cases, yo will only have a single GGSN instance inside +your configuration file, like in below example: + +.Example: Single GGSN configuration section +---- +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown +---- + + +==== Creating/Editing a GGSN instance + +Creating/Editing a GGSN instance can be done by the following sequence +of VTY commands: + +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Create or edit the GGSN instance `ggsn0`. The name can be any ASCII + string, its significance is only to the local user. +<4> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: After creating a new GGSN instance, it is in `shutdown` mode. See +FIXME to take it out of shutdown, but make sure to configure it fully +before taking it out of shutdown. + +==== Configuring a GGSN instance + +The following two mandatory configuration statements have to be given +for every GGSN instance: + +---- +OsmoGGSN(config-ggsn)# gtp state-dir /var/lib/ggsn/ggsn0 <1> +OsmoGGSN(config-ggsn)# gtp bind-ip 127.0.0.6 <2> +---- +<1> Store the GSN restart state in the specified directory +<2> Bind the GGSN instance to the specified local IPv4 address + +There are some further configuration statements that can be used at the +GGSN node, some examples are given below. For a full list, see the +OpenGGSN VTY reference manual (FIXME). + +---- +OsmoGGSN(config-ggsn)# default-apn foobar <1> +---- +<1> Configure a default APN to be used if the user-requested APN is not + found. The named APN must previously be configured + + +==== Deleting a GGSN instance + +A GGSN instance can be removed like this + +.Example: Deleting a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# no ggsn ggsn0 <3> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Delete the GGSN instance + + +==== Taking a GGSN instance out of shutdown + +.Example: Taking a GGSN instance out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Take the GGSN instance out of shutdown + + +==== Shutting a GGSN instance down + +If you would like to take a GGSN instance out of service, you can +put it into shutdown mode. This will make the entire GGSN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down a GGSN instance +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# shutdown ggsn <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Shut down the GGSN instance + + +=== Configuring an Access Point Name + +An Access Point Name (APN) represents a connection to an external packet +data network, such as the public Internet or private corporate networsk. + +APNs are selected by terminals (MS/UE) when establishing PDP contexts. + +Each OsmoGGSN GGSN instance can have any number of APNs configured. +Each APN is identified by a string name. + +==== Creating/Editing an APN + +.Example: Creating a new APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<4> Create or Edit an APN called `internet` +<5> Your prompt is now in the `ggsn` config node, where you can + configure the properties of this GGSN instance. + +NOTE:: The newly-create APN is created in `shutdown` mode. See FIXME to take it +out of shutdown. + + +==== Configuring an APN + +.Example: Configuring an APN +---- +OsmoGGSN(config-ggsn-apn)# gtpu-mode tun <1> +OsmoGGSN(config-ggsn-apn)# type-support v4 <2> +OsmoGGSN(config-ggsn-apn)# ip prefix dynamic 176.16.222.0/24 <3> +OsmoGGSN(config-ggsn-apn)# ip dns 0 192.168.100.1 <4> +OsmoGGSN(config-ggsn-apn)# ip dns 1 8.8.8.8 <5> +OsmoGGSN(config-ggsn-apn)# ip ifconfig 176.16.222.0/24 <6> +---- +<1> Use the userspace GTP-U handling using a TUN device +<2> Support (only) IPv4 Addresses +<3> Specify the pool of dynamic IPv4 addresses to be allocated to PDP + contexts +<4> Specify the primary DNS server to be provided using IPCP/PCO +<5> Specify the secondary DNS server to be provided using IPCP/PCO +<6> Request OsmoGGSN to configure the `tun4` device network/netmask + +NOTE:: If you use the optional `ip ifconfig` command to set the network +device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` +support. It might be better to configure related tun devices at system +startup and run OsmoGGSN as non-privileged user. See FIXME for more +details. + + +==== Deleting an APN + +An APN configuration can be removed like this + +.Example: Deleting an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# no apn internet <4> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config node of the GGSN instance `ggsn0` +<4> Delete the APN `internet` + + +==== Taking an APN out of shutdown + +In order to bring a deactived APN in `shutdown` state into active +operation, use the `no shutdown` command at the APN node as explained in +the following example: + +.Example: Taking an APN out of shutdown +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# no shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Take the APN out of shutdown + + +==== Shutting an APN down + +If you would like to take an APN instance out of service, you can +put it into shutdown mode. This will make the APN unavailable +to user traffic and permit you to e.g. reconfigure it before taking it +out of shutdown again. + +.Example: Shutting down an APN +---- +OsmoGGSN> enable <1> +OsmoGGSN# configure terminal <2> +OsmoGGSN(config)# ggsn ggsn0 <3> +OsmoGGSN(config-ggsn)# apn internet <4> +OsmoGGSN(config-ggsn-apn)# shutdown <5> +---- +<1> Change into privileged mode +<2> Enter the interactive configuration mode +<3> Enter the config ndoe of the GGSN instance `ggsn0` +<4> Enter the config ndoe of the APN `internet` +<5> Shut down the APN + diff --git a/OsmoGGSN/chapters/overview.adoc b/OsmoGGSN/chapters/overview.adoc new file mode 100644 index 0000000..632db5e --- /dev/null +++ b/OsmoGGSN/chapters/overview.adoc @@ -0,0 +1,145 @@ +[[chapter_introduction]] +== Overview + +[[intro_overview]] +=== About OsmoGGSN + +OsmoGGSN is a Free / Open Source Software implementation of the GPRS +GGSN (Gateway GPRS support node) element in side the packet switched +core network of 2G and 3G cellular networks. + +The GGSN function is the tunnel endpoint on the core network side, +from where the external (IP) packet data network + +=== Software Components + +==== GTP Implementation (libgtp) + +The OsmoGGSN source code includes a shared library implementation of +the GTP protocol used on the GGSN-SGSN interface. This library +and associated header files are installed system-wide and are +available to other programs/applications. + +In fact, libgtp is what the OsmoSGSN also uses for its use of GTP. + +==== sgsnemu + +In order to test OsmoGGSN without running a SGSN and other elements +of a cellular network, there is a small command-line utility called +*sgsnemu* which is able to simulate the customary operations of a SGSN +towards the GGSN, such as a PDP Context Activation. + +*sgsnemu* can even be used for testing against other GGSNs, as the GTP +protocol is standardized across implementations. + +==== osmo-ggsn + +*osmo-ggsn* is the actual name of the OsmoGGSN executable program. It +implements the GGSN functionality. All parameters are set using the +configuration file, by default located in *./osmo-ggsn.cfg* + +==== systemd service file + +In *contrib/osmo-ggsn.service* you can find a sample service file for +OsmoGGSN which can be used with systemd. + +==== init script + +In *contrib/osmo-ggsn.init* you can find a sample init script to be used +on systems with classic init process. + +=== Limitations + +OsmoGGSN supports both GTP0 (GSM 09.60) and GTP1 (3GPP 29.060). In the +following tables the support of each individual message type is +detailed. The numbers before each feature indicates the relevant +section in the standard. + +==== GSM 09.60 (GTPv0) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +| Feature | gtplib | osmo-ggsn | sgsnemu | notes +5+<|*7.4 Path Management Messages* +|7.4.1 Echo Request |Supported |Supported |Supported | +|7.4.2 Echo Response |Supported |Supported |Supported | +|7.4.3 Version Not Supported |Supported |Supported |Supported | +5+<| *7.5 Tunnel Management Messages* +|7.5.1 Create PDP Context Request|Supported |Supported |Supported | +|7.5.2 Create PDP Context Response|Supported |Supported |Supported | +|7.5.3 Update PDP Context Request|Supported |Supported |Not | +|7.5.4 Update PDP Context Response|Supported |Supported |Not | +|7.5.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.5.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.5.7 Create AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.8 Create AA PDP Response|Unsupported |Unsupported |Unsupported | +|7.5.9 Delete AA PDP Context Request|Unsupported |Unsupported |Unsupported | +|7.5.10 Delete AA PDP Context Response|Unsupported |Unsupported |Unsupported | +|7.5.11 Error Indication |Supported |Supported |Supported | +|7.5.12 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.5.13 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.5.14 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.5.15 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<| *7.6 Location Management Messages* +|7.6.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.6.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Request|Unsupported |Unsupported |Not applicable | +|7.6.3 Failure Report Response|Unsupported |Unsupported |Not applicable | +|7.6.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.6.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<| *7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable|Not applicable | +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable|Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|=== + +==== 3GPP 29.060 (GTPv1) + +[options="header",cols="50%,15%,15%,15%,5%"] +|=== +|Feature |gtplib |osmo-ggsn |sgsnemu |notes +5+<|*7.2 Path Management Messages* +|7.2.1 Echo Request |Supported |Supported |Supported | +|7.2.2 Echo Response |Supported |Supported |Supported | +|7.2.3 Version Not Supported|Supported |Supported |Supported | +|7.2.4 Extension Headers Notification|Supported |Supported |Supported | +5+<|*7.3 Tunnel Management Messages* +|7.3.1 Create PDP Context Request|Supported |Supported |Supported |1 +|7.3.2 Create PDP Context Response|Supported |Supported |Supported | +|7.3.3 Update PDP Context Request|Supported |Supported |Not applicable|1 +|7.3.4 Update PDP Context Response|Supported |Supported |Not applicable| +|7.3.5 Delete PDP Context Request|Supported |Supported |Supported | +|7.3.6 Delete PDP Context Response|Supported |Supported |Supported | +|7.3.7 Error Indication |Supported |Supported |Supported | +|7.3.8 PDU Notification Request|Unsupported |Unsupported |Unsupported | +|7.3.9 PDU Notification Response|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Request|Unsupported |Unsupported |Unsupported | +|7.3.10 PDU Notification Reject Response|Unsupported |Unsupported |Unsupported | +5+<|*7.4 Location Management Messages* +|7.4.1 Send Routeing Information for GPRS Request|Unsupported |Unsupported |Not applicable | +|7.4.2 Send Routeing Information for GPRS Response|Unsupported |Unsupported |Not applicable | +|7.4.3 Failure Report Request|Unsupported |Unsupported |Not applicable| +|7.4.3 Failure Report Response|Unsupported |Unsupported |Not applicable| +|7.4.5 Note MS GPRS Present Request|Unsupported |Unsupported |Not applicable| +|7.4.6 Note MS GPRS Present Response|Unsupported |Unsupported |Not applicable| +5+<|*7.5 Mobility Management Messages* +|7.5.1 Identification Request|Unsupported |Not applicable|Not applicable| +|7.5.2 Identification Response|Unsupported |Not applicable |Not applicable| +|7.5.3 SGSN Context Request|Unsupported |Not applicable|Not applicable| +|7.5.4 SGSN Context Response|Unsupported |Not applicable |Not applicable| +|7.5.5 SGSN Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.6 Forward Relocation Request|Unsupported |Not applicable|Not applicable| +|7.5.7 Forward Relocation Response|Unsupported |Not applicable|Not applicable| +|7.5.8 Forward Relocation Complete|Unsupported |Not applicable|Not applicable| +|7.5.9 Relocation Cancel Request|Unsupported |Not applicable|Not applicable| +|7.5.10 Relocation Cancel Response|Unsupported |Not applicable|Not applicable| +|7.5.11 Forward Relocation Complete |Unsupported |Not applicable |Not applicable | +|7.5.12 Forward SRNS Context Acknowledge|Unsupported |Not applicable|Not applicable| +|7.5.13 Forward SRNS Context|Unsupported |Not applicable|Not applicable| +|=== + +Notes + +1) The "Secondary PDP Context Activation Procedure" is not supported. diff --git a/OsmoGGSN/chapters/running.adoc b/OsmoGGSN/chapters/running.adoc new file mode 100644 index 0000000..cff3f8d --- /dev/null +++ b/OsmoGGSN/chapters/running.adoc @@ -0,0 +1,41 @@ +== Running OsmoNITB + +The OsmoGGSN executable (`osmo-ggsn`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-ggsn* [-h|-V] [-D] [-c 'CONFIGFILE'] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `osmo-ggsn.cfg` in the current + working directory. + +=== Multiple instances + +Running multiple instances of `osmo-ggsn` is possible if all GGSN instances +are binding to different local IP addresse and all other interfaces (VTY, +OML) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different +IP addresses. + +The VTY and the control interface can be bound to IP addresses from the loopback +address range. + +.Example: Binding VTY and control interface to a specific ip-address +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- diff --git a/OsmoGGSN/osmoggsn-usermanual-docinfo.xml b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml new file mode 100644 index 0000000..c93d5e1 --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + August 2017 + HW + + Initial version. + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2013-2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoGGSN/osmoggsn-usermanual.adoc b/OsmoGGSN/osmoggsn-usermanual.adoc new file mode 100644 index 0000000..efa2c8f --- /dev/null +++ b/OsmoGGSN/osmoggsn-usermanual.adoc @@ -0,0 +1,29 @@ +OsmoGGSN User Manual +==================== +Harald Welte + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +//include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + + +include::chapters/configuration.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] -- To view, visit https://gerrit.osmocom.org/3877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7cdf150e8dd4f9dfc5e6d28e780d05dc1e1e5458 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:50:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 11:50:33 +0000 Subject: meta-telephony[laforge/nightly]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 11:52:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 11:52:34 +0000 Subject: osmo-bsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Patch Set 1: "more visible" should also include it being printed in "show trx" -- To view, visit https://gerrit.osmocom.org/3876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 12:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 12:02:37 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Add ability to specify local IP addresses for GTP-C an... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Add ability to specify local IP addresses for GTP-C and GTP-U ...................................................................... ggsn: Add ability to specify local IP addresses for GTP-C and GTP-U In case the GGSN is behind some kind of DNAT, the public GTP-C and GTP-U IP addresses as exposed inside the GTP payload information elements are different from the (internal, behind-nat) IP address to which it listens/binds. Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 50 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0b877cf..46850a6 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -693,6 +693,14 @@ } ggsn->gsn->priv = ggsn; + /* patch in different addresses to use (in case we're behind NAT, the listen + * address is different from what we advertise externally) */ + if (ggsn->cfg.gtpc_addr.v4.s_addr) + ggsn->gsn->gsnc = ggsn->cfg.gtpc_addr.v4; + + if (ggsn->cfg.gtpu_addr.v4.s_addr) + ggsn->gsn->gsnu = ggsn->cfg.gtpu_addr.v4; + /* Register File Descriptors */ osmo_fd_setup(&ggsn->gtp_fd0, ggsn->gsn->fd0, BSC_FD_READ, ggsn_gtp_fd_cb, ggsn, 0); rc = osmo_fd_register(&ggsn->gtp_fd0); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index bab6cf7..2dd963c 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -99,6 +99,10 @@ struct apn_ctx *default_apn; /* ADdress to which we listen for GTP */ struct in46_addr listen_addr; + /* Local GTP-C address advertised in GTP */ + struct in46_addr gtpc_addr; + /* Local GTP-U address advertised in GTP */ + struct in46_addr gtpu_addr; /* directory for state file */ char *state_dir; /* administratively shut-down (true) or not (false) */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 4a3e753..d7bd9a7 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -165,8 +165,8 @@ return CMD_SUCCESS; } -DEFUN(cfg_ggsn_local_ip, cfg_ggsn_local_ip_cmd, - "gtp local-ip A.B.C.D", +DEFUN(cfg_ggsn_bind_ip, cfg_ggsn_bind_ip_cmd, + "gtp bind-ip A.B.C.D", "GTP Parameters\n" "Set the IP address for the local GTP bind\n" "IPv4 Address\n") @@ -175,6 +175,34 @@ size_t t; ippool_aton(&ggsn->cfg.listen_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpc_ip, cfg_ggsn_gtpc_ip_cmd, + "gtp control-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-C messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpc_addr, &t, argv[0], 0); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ggsn_gtpu_ip, cfg_ggsn_gtpu_ip_cmd, + "gtp user-ip A.B.C.D", + "GTP Parameters\n" + "Set the IP address states as local IP in GTP-U messages\n" + "IPv4 Address\n") +{ + struct ggsn_ctx *ggsn = (struct ggsn_ctx *) vty->index; + size_t t; + + ippool_aton(&ggsn->cfg.gtpu_addr, &t, argv[0], 0); return CMD_SUCCESS; } @@ -633,7 +661,11 @@ if (ggsn->cfg.description) vty_out(vty, " description %s%s", ggsn->cfg.description, VTY_NEWLINE); vty_out(vty, " gtp state-dir %s%s", ggsn->cfg.state_dir, VTY_NEWLINE); - vty_out(vty, " gtp local-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + vty_out(vty, " gtp bind-ip %s%s", in46a_ntoa(&ggsn->cfg.listen_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpc_addr.v4.s_addr) + vty_out(vty, " gtp control-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpc_addr), VTY_NEWLINE); + if (ggsn->cfg.gtpu_addr.v4.s_addr) + vty_out(vty, " gtp user-ip %s%s", in46a_ntoa(&ggsn->cfg.gtpu_addr), VTY_NEWLINE); llist_for_each_entry(apn, &ggsn->apn_list, list) config_write_apn(vty, apn); if (ggsn->cfg.default_apn) @@ -806,7 +838,9 @@ install_element(GGSN_NODE, &cfg_no_description_cmd); install_element(GGSN_NODE, &cfg_ggsn_shutdown_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_shutdown_cmd); - install_element(GGSN_NODE, &cfg_ggsn_local_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_bind_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpc_ip_cmd); + install_element(GGSN_NODE, &cfg_ggsn_gtpu_ip_cmd); install_element(GGSN_NODE, &cfg_ggsn_state_dir_cmd); install_element(GGSN_NODE, &cfg_ggsn_apn_cmd); install_element(GGSN_NODE, &cfg_ggsn_no_apn_cmd); -- To view, visit https://gerrit.osmocom.org/3863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 13:30:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 13:30:46 +0000 Subject: [PATCH] osmo-bts[master]: Check return value to prevent crash Message-ID: Review at https://gerrit.osmocom.org/3878 Check return value to prevent crash Previously result of readv() was used unconditionally so when it failed and returned negative value it was treated like very large positive which lead to memory corruption. Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Related: SYS#3865 --- M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-sysmo/l1_transp_hw.c 2 files changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/3878/1 diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 6381864..f349dd9 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -204,8 +204,13 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); + if (rc < 0) { + for (i = count; i < ARRAY_SIZE(iov); ++i) + msgb_free(msg[i]); + return 0; + } + count = rc / prim_size; for (i = 0; i < count; ++i) { diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index da8ac3f..7903c94 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -215,8 +215,13 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); + if (rc < 0) { + for (i = count; i < ARRAY_SIZE(iov); ++i) + msgb_free(msg[i]); + return 0; + } + count = rc / prim_size; for (i = 0; i < count; ++i) { -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 6 13:32:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 13:32:34 +0000 Subject: osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 1: I'm not sure what's the proper return value from callback in error case - could not find any examples or docs about it. Please double-check. -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 13:41:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 13:41:03 +0000 Subject: osmo-bsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Patch Set 1: It is printed in 'sh trx' but not in 'sh bts'. Not sure if it's worth adding it there. On the one hand it'll make 'sh bts 0' output bigger and harder to glance over, on the other hand maybe I'm not the only idiot who forget about 'sh trx' existence. What do you think? Shall we include it, or not, or only if it's locked? -- To view, visit https://gerrit.osmocom.org/3876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 13:43:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 13:43:01 +0000 Subject: [PATCH] osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3878 to look at the new patch set (#2). Check return value to prevent crash Previously result of readv() was used unconditionally so when it failed and returned negative value it was treated like very large positive which lead to memory corruption. Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Related: SYS#3865 --- M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-sysmo/l1_transp_hw.c 2 files changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/3878/2 diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 6381864..6b00292 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -204,8 +204,13 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); + if (rc < 0) { + for (i = 0; i < ARRAY_SIZE(iov); ++i) + msgb_free(msg[i]); + return 0; + } + count = rc / prim_size; for (i = 0; i < count; ++i) { diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index da8ac3f..1ebedd9 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -215,8 +215,13 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); + if (rc < 0) { + for (i = 0; i < ARRAY_SIZE(iov); ++i) + msgb_free(msg[i]); + return 0; + } + count = rc / prim_size; for (i = 0; i < count; ++i) { -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Sep 6 13:52:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 13:52:01 +0000 Subject: osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (3 comments) https://gerrit.osmocom.org/#/c/3878/2/src/osmo-bts-litecell15/l1_transp_hw.c File src/osmo-bts-litecell15/l1_transp_hw.c: Line 208: if (rc < 0) { is count == 0 a valid case? check 'rc <= 0' here? ...or now that I look at it, below loop frees remaining msgbs, so rc <= 0 could just set count = 0, no need to dup the msgb free loop. Line 211: return 0; I notice that previously this function always returned 1. Is 'return 0' used by a caller? https://gerrit.osmocom.org/#/c/3878/2/src/osmo-bts-sysmo/l1_transp_hw.c File src/osmo-bts-sysmo/l1_transp_hw.c: Line 219: if (rc < 0) { (same 3 questions) -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 13:53:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 13:53:07 +0000 Subject: osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 2: > Please double-check. who, me? :) :) -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 13:58:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 13:58:27 +0000 Subject: osmo-bsc[master]: Move channel state assignment to macro In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 > Seems like a change to make a change. What issue was too difficult > to debug? I remember during dyn TS and the following BROKEN_UNUSABLE recovery issue seeing state changes and spending time to figure out where those transitions came from. I think logging the line nrs is super handy and desirable. > call sites). Sure now __LINE__ points to the right place but you > can not put a breakpoint on state changes anymore. That is a valid point. This could be solved by using the scheme we have in place e.g. with the FSMs: https://git.osmocom.org/libosmocore/tree/include/osmocom/core/fsm.h#n169 #define osmo_fsm_inst_state_chg(fi, new_state, timeout_secs, T) \ _osmo_fsm_inst_state_chg(fi, new_state, timeout_secs, T, \ __BASE_FILE__, __LINE__) int _osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, unsigned long timeout_secs, int T, const char *file, int line); i.e. still have an actual function, but provide a macro wrapper to add line info. -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:00:19 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 6 Sep 2017 14:00:19 +0000 Subject: osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3878/2/src/osmo-bts-litecell15/l1_transp_hw.c File src/osmo-bts-litecell15/l1_transp_hw.c: Line 211: return 0; > I notice that previously this function always returned 1. Is 'return 0' use This is just a callback for osmo_fd. osmo_select_main() doesn't check the return value at all. -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:14:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:14:02 +0000 Subject: osmo-bts[master]: OML: print actual type of report sent to BSC In-Reply-To: References: Message-ID: Patch Set 1: > I've tried to stick to convention of the code around: function name > reflects the message type/format from spec, log reflects the > content - what we use this message for. Current patch e.g. Sending Unknown message to BSC: ... vs something like Sending FAILURE ("Unknown message") to BSC: ... The former can be confusing to the uninformed reader (Why are we sending an unknown message?) -- rather clarify a failure message with a cause reporting the error of receiving and unknown message...? -- To view, visit https://gerrit.osmocom.org/3829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:27:21 +0000 Subject: [PATCH] osmo-bsc[master]: rewrite README In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3794 to look at the new patch set (#4). rewrite README Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d --- M README 1 file changed, 20 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/94/3794/4 diff --git a/README b/README index d01b2cf..e84849b 100644 --- a/README +++ b/README @@ -1,39 +1,26 @@ -About OpenBSC +About OsmoBSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoBSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoBSC was one of the parts split off from the old openbsc.git. Before, it +worked as a standalone osmo-bsc binary as well as a combination of libbsc and +libmsc, i.e. the old OsmoNITB. Since the standalone OsmoMSC with a true A +interface (and IuCS for 3G support) is available, OsmoBSC exists only as a +separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoBSC exposes +- A over IP towards an MSC (e.g. OsmoMSC); +- Abis interfaces towards various kinds of BTS; +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. +Find OsmoBSC issue tracker and wiki online at +https://osmocom.org/projects/osmobsc +https://osmocom.org/projects/osmobsc/wiki - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +OsmoBSC-NAT is a specialized solution to navigating RTP streams through a NAT. +(Todo: describe in more detail) -- To view, visit https://gerrit.osmocom.org/3794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:27:21 +0000 Subject: [PATCH] osmo-bsc[master]: move include/openbsc to include/osmocom/bsc In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3813 to look at the new patch set (#2). move include/openbsc to include/osmocom/bsc Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 --- M configure.ac M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/bsc/Makefile.am R include/osmocom/bsc/a_reset.h R include/osmocom/bsc/abis_nm.h R include/osmocom/bsc/abis_om2000.h R include/osmocom/bsc/abis_rsl.h R include/osmocom/bsc/arfcn_range_encode.h R include/osmocom/bsc/auth.h R include/osmocom/bsc/bsc_api.h R include/osmocom/bsc/bsc_msc.h R include/osmocom/bsc/bsc_msc_data.h R include/osmocom/bsc/bsc_msg_filter.h R include/osmocom/bsc/bsc_nat.h R include/osmocom/bsc/bsc_nat_callstats.h R include/osmocom/bsc/bsc_nat_sccp.h R include/osmocom/bsc/bsc_rll.h R include/osmocom/bsc/bsc_subscriber.h R include/osmocom/bsc/bss.h R include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h R include/osmocom/bsc/chan_alloc.h R include/osmocom/bsc/common.h R include/osmocom/bsc/common_bsc.h R include/osmocom/bsc/common_cs.h R include/osmocom/bsc/crc24.h R include/osmocom/bsc/ctrl.h R include/osmocom/bsc/debug.h R include/osmocom/bsc/e1_config.h R include/osmocom/bsc/gsm_04_08_utils.h R include/osmocom/bsc/gsm_04_80.h R include/osmocom/bsc/gsm_data.h R include/osmocom/bsc/gsm_data_shared.h R include/osmocom/bsc/gsm_subscriber.h R include/osmocom/bsc/handover.h R include/osmocom/bsc/handover_decision.h R include/osmocom/bsc/ipaccess.h R include/osmocom/bsc/iu_dummy.h R include/osmocom/bsc/meas_feed.h R include/osmocom/bsc/meas_rep.h R include/osmocom/bsc/misdn.h R include/osmocom/bsc/mncc.h R include/osmocom/bsc/mncc_int.h R include/osmocom/bsc/msc_ifaces.h R include/osmocom/bsc/nat_rewrite_trie.h R include/osmocom/bsc/network_listen.h R include/osmocom/bsc/openbscdefines.h R include/osmocom/bsc/osmo_bsc.h R include/osmocom/bsc/osmo_bsc_grace.h R include/osmocom/bsc/osmo_bsc_reset.h R include/osmocom/bsc/osmo_bsc_rf.h R include/osmocom/bsc/osmo_bsc_sigtran.h R include/osmocom/bsc/osmo_msc.h R include/osmocom/bsc/osmux.h R include/osmocom/bsc/paging.h R include/osmocom/bsc/pcu_if.h R include/osmocom/bsc/pcuif_proto.h R include/osmocom/bsc/rest_octets.h R include/osmocom/bsc/rrlp.h R include/osmocom/bsc/rs232.h R include/osmocom/bsc/rtp_proxy.h R include/osmocom/bsc/sgsn.h R include/osmocom/bsc/signal.h R include/osmocom/bsc/silent_call.h R include/osmocom/bsc/smpp.h R include/osmocom/bsc/sms_queue.h R include/osmocom/bsc/socket.h R include/osmocom/bsc/system_information.h R include/osmocom/bsc/transaction.h R include/osmocom/bsc/trau_mux.h R include/osmocom/bsc/trau_upqueue.h R include/osmocom/bsc/ussd.h R include/osmocom/bsc/vty.h M src/ipaccess/abisip-find.c M src/ipaccess/ipaccess-config.c M src/ipaccess/ipaccess-firmware.c M src/ipaccess/ipaccess-proxy.c M src/ipaccess/network_listen.c M src/libbsc/abis_nm.c M src/libbsc/abis_nm_vty.c M src/libbsc/abis_om2000.c M src/libbsc/abis_om2000_vty.c M src/libbsc/abis_rsl.c M src/libbsc/arfcn_range_encode.c M src/libbsc/bsc_api.c M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_ctrl_lookup.c M src/libbsc/bsc_dyn_ts.c M src/libbsc/bsc_init.c M src/libbsc/bsc_msc.c M src/libbsc/bsc_rf_ctrl.c M src/libbsc/bsc_rll.c M src/libbsc/bsc_subscriber.c M src/libbsc/bsc_vty.c M src/libbsc/bts_ericsson_rbs2000.c M src/libbsc/bts_init.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/bts_ipaccess_nanobts_omlattr.c M src/libbsc/bts_nokia_site.c M src/libbsc/bts_siemens_bs11.c M src/libbsc/bts_sysmobts.c M src/libbsc/bts_unknown.c M src/libbsc/chan_alloc.c M src/libbsc/e1_config.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/gsm_04_80_utils.c M src/libbsc/handover_decision.c M src/libbsc/handover_logic.c M src/libbsc/meas_proc.c M src/libbsc/meas_rep.c M src/libbsc/net_init.c M src/libbsc/paging.c M src/libbsc/pcu_sock.c M src/libbsc/rest_octets.c M src/libbsc/system_information.c M src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/socket.c M src/libfilter/bsc_msg_acc.c M src/libfilter/bsc_msg_filter.c M src/libfilter/bsc_msg_vty.c M src/libtrau/rtp_proxy.c M src/libtrau/trau_mux.c M src/libtrau/trau_upqueue.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c M src/osmo-bsc/osmo_bsc_reset.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_nat/bsc_filter.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_filter.c M src/osmo-bsc_nat/bsc_nat_rewrite.c M src/osmo-bsc_nat/bsc_nat_rewrite_trie.c M src/osmo-bsc_nat/bsc_nat_utils.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_sccp.c M src/osmo-bsc_nat/bsc_ussd.c M src/utils/bs11_config.c M src/utils/meas_db.c M src/utils/meas_json.c M src/utils/meas_pcap2db.c M src/utils/meas_udp2db.c M src/utils/meas_vis.c M tests/abis/abis_test.c M tests/bsc-nat-trie/bsc_nat_trie_test.c M tests/bsc-nat/bsc_nat_test.c M tests/bsc/bsc_test.c M tests/channel/channel_test.c M tests/gsm0408/gsm0408_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c M tests/subscr/bsc_subscr_test.c M tests/trau/trau_test.c 167 files changed, 515 insertions(+), 511 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/13/3813/2 diff --git a/configure.ac b/configure.ac index 8107047..930d1d3 100644 --- a/configure.ac +++ b/configure.ac @@ -126,8 +126,9 @@ AC_OUTPUT( osmo-bsc.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/bsc/Makefile src/Makefile src/libtrau/Makefile src/libbsc/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 3234e62..740e088 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) noinst_HEADERS = \ diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..cf24c62 --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + bsc \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/bsc/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/bsc/Makefile.am diff --git a/include/openbsc/a_reset.h b/include/osmocom/bsc/a_reset.h similarity index 100% rename from include/openbsc/a_reset.h rename to include/osmocom/bsc/a_reset.h diff --git a/include/openbsc/abis_nm.h b/include/osmocom/bsc/abis_nm.h similarity index 99% rename from include/openbsc/abis_nm.h rename to include/osmocom/bsc/abis_nm.h index db2a659..34f16a9 100644 --- a/include/openbsc/abis_nm.h +++ b/include/osmocom/bsc/abis_nm.h @@ -26,7 +26,7 @@ #include #include -#include +#include /* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ #define MAX_BTS_ATTR 5 diff --git a/include/openbsc/abis_om2000.h b/include/osmocom/bsc/abis_om2000.h similarity index 100% rename from include/openbsc/abis_om2000.h rename to include/osmocom/bsc/abis_om2000.h diff --git a/include/openbsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h similarity index 100% rename from include/openbsc/abis_rsl.h rename to include/osmocom/bsc/abis_rsl.h diff --git a/include/openbsc/arfcn_range_encode.h b/include/osmocom/bsc/arfcn_range_encode.h similarity index 100% rename from include/openbsc/arfcn_range_encode.h rename to include/osmocom/bsc/arfcn_range_encode.h diff --git a/include/openbsc/auth.h b/include/osmocom/bsc/auth.h similarity index 100% rename from include/openbsc/auth.h rename to include/osmocom/bsc/auth.h diff --git a/include/openbsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h similarity index 100% rename from include/openbsc/bsc_api.h rename to include/osmocom/bsc/bsc_api.h diff --git a/include/openbsc/bsc_msc.h b/include/osmocom/bsc/bsc_msc.h similarity index 98% rename from include/openbsc/bsc_msc.h rename to include/osmocom/bsc/bsc_msc.h index 380eb17..ceaea53 100644 --- a/include/openbsc/bsc_msc.h +++ b/include/osmocom/bsc/bsc_msc.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/include/openbsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h similarity index 100% rename from include/openbsc/bsc_msc_data.h rename to include/osmocom/bsc/bsc_msc_data.h diff --git a/include/openbsc/bsc_msg_filter.h b/include/osmocom/bsc/bsc_msg_filter.h similarity index 100% rename from include/openbsc/bsc_msg_filter.h rename to include/osmocom/bsc/bsc_msg_filter.h diff --git a/include/openbsc/bsc_nat.h b/include/osmocom/bsc/bsc_nat.h similarity index 100% rename from include/openbsc/bsc_nat.h rename to include/osmocom/bsc/bsc_nat.h diff --git a/include/openbsc/bsc_nat_callstats.h b/include/osmocom/bsc/bsc_nat_callstats.h similarity index 100% rename from include/openbsc/bsc_nat_callstats.h rename to include/osmocom/bsc/bsc_nat_callstats.h diff --git a/include/openbsc/bsc_nat_sccp.h b/include/osmocom/bsc/bsc_nat_sccp.h similarity index 100% rename from include/openbsc/bsc_nat_sccp.h rename to include/osmocom/bsc/bsc_nat_sccp.h diff --git a/include/openbsc/bsc_rll.h b/include/osmocom/bsc/bsc_rll.h similarity index 92% rename from include/openbsc/bsc_rll.h rename to include/osmocom/bsc/bsc_rll.h index 729ba60..3afe4a8 100644 --- a/include/openbsc/bsc_rll.h +++ b/include/osmocom/bsc/bsc_rll.h @@ -1,7 +1,7 @@ #ifndef _BSC_RLL_H #define _BSC_RLL_H -#include +#include enum bsc_rllr_ind { BSC_RLLR_IND_EST_CONF, diff --git a/include/openbsc/bsc_subscriber.h b/include/osmocom/bsc/bsc_subscriber.h similarity index 100% rename from include/openbsc/bsc_subscriber.h rename to include/osmocom/bsc/bsc_subscriber.h diff --git a/include/openbsc/bss.h b/include/osmocom/bsc/bss.h similarity index 93% rename from include/openbsc/bss.h rename to include/osmocom/bsc/bss.h index 9f16bf7..b12487d 100644 --- a/include/openbsc/bss.h +++ b/include/osmocom/bsc/bss.h @@ -1,7 +1,7 @@ #ifndef _BSS_H_ #define _BSS_H_ -#include +#include struct msgb; diff --git a/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h diff --git a/include/openbsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h similarity index 100% rename from include/openbsc/chan_alloc.h rename to include/osmocom/bsc/chan_alloc.h diff --git a/include/openbsc/common.h b/include/osmocom/bsc/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/bsc/common.h diff --git a/include/openbsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h similarity index 83% rename from include/openbsc/common_bsc.h rename to include/osmocom/bsc/common_bsc.h index 7960383..08394e9 100644 --- a/include/openbsc/common_bsc.h +++ b/include/osmocom/bsc/common_bsc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/include/openbsc/common_cs.h b/include/osmocom/bsc/common_cs.h similarity index 100% rename from include/openbsc/common_cs.h rename to include/osmocom/bsc/common_cs.h diff --git a/include/openbsc/crc24.h b/include/osmocom/bsc/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/bsc/crc24.h diff --git a/include/openbsc/ctrl.h b/include/osmocom/bsc/ctrl.h similarity index 100% rename from include/openbsc/ctrl.h rename to include/osmocom/bsc/ctrl.h diff --git a/include/openbsc/debug.h b/include/osmocom/bsc/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/bsc/debug.h diff --git a/include/openbsc/e1_config.h b/include/osmocom/bsc/e1_config.h similarity index 83% rename from include/openbsc/e1_config.h rename to include/osmocom/bsc/e1_config.h index 538c0b0..909e3cc 100644 --- a/include/openbsc/e1_config.h +++ b/include/osmocom/bsc/e1_config.h @@ -1,7 +1,7 @@ #ifndef _E1_CONFIG_H #define _E1_CONFIG_H -#include +#include int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); int e1_reconfig_trx(struct gsm_bts_trx *trx); diff --git a/include/openbsc/gsm_04_08_utils.h b/include/osmocom/bsc/gsm_04_08_utils.h similarity index 100% rename from include/openbsc/gsm_04_08_utils.h rename to include/osmocom/bsc/gsm_04_08_utils.h diff --git a/include/openbsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h similarity index 100% rename from include/openbsc/gsm_04_80.h rename to include/osmocom/bsc/gsm_04_80.h diff --git a/include/openbsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h similarity index 99% rename from include/openbsc/gsm_data.h rename to include/osmocom/bsc/gsm_data.h index 74970b9..ef041d6 100644 --- a/include/openbsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -14,9 +14,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h similarity index 99% rename from include/openbsc/gsm_data_shared.h rename to include/osmocom/bsc/gsm_data_shared.h index bef4504..6ce571e 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -24,8 +24,8 @@ #include #endif -#include -#include +#include +#include /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ diff --git a/include/openbsc/gsm_subscriber.h b/include/osmocom/bsc/gsm_subscriber.h similarity index 97% rename from include/openbsc/gsm_subscriber.h rename to include/osmocom/bsc/gsm_subscriber.h index d88e32a..ca66d47 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/osmocom/bsc/gsm_subscriber.h @@ -6,7 +6,7 @@ #include #include -#include +#include #define GSM_NAME_LENGTH 160 diff --git a/include/openbsc/handover.h b/include/osmocom/bsc/handover.h similarity index 100% rename from include/openbsc/handover.h rename to include/osmocom/bsc/handover.h diff --git a/include/openbsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h similarity index 100% rename from include/openbsc/handover_decision.h rename to include/osmocom/bsc/handover_decision.h diff --git a/include/openbsc/ipaccess.h b/include/osmocom/bsc/ipaccess.h similarity index 100% rename from include/openbsc/ipaccess.h rename to include/osmocom/bsc/ipaccess.h diff --git a/include/openbsc/iu_dummy.h b/include/osmocom/bsc/iu_dummy.h similarity index 100% rename from include/openbsc/iu_dummy.h rename to include/osmocom/bsc/iu_dummy.h diff --git a/include/openbsc/meas_feed.h b/include/osmocom/bsc/meas_feed.h similarity index 95% rename from include/openbsc/meas_feed.h rename to include/osmocom/bsc/meas_feed.h index f77ee07..55bce09 100644 --- a/include/openbsc/meas_feed.h +++ b/include/osmocom/bsc/meas_feed.h @@ -3,7 +3,7 @@ #include -#include +#include struct meas_feed_hdr { uint8_t msg_type; diff --git a/include/openbsc/meas_rep.h b/include/osmocom/bsc/meas_rep.h similarity index 100% rename from include/openbsc/meas_rep.h rename to include/osmocom/bsc/meas_rep.h diff --git a/include/openbsc/misdn.h b/include/osmocom/bsc/misdn.h similarity index 100% rename from include/openbsc/misdn.h rename to include/osmocom/bsc/misdn.h diff --git a/include/openbsc/mncc.h b/include/osmocom/bsc/mncc.h similarity index 100% rename from include/openbsc/mncc.h rename to include/osmocom/bsc/mncc.h diff --git a/include/openbsc/mncc_int.h b/include/osmocom/bsc/mncc_int.h similarity index 100% rename from include/openbsc/mncc_int.h rename to include/osmocom/bsc/mncc_int.h diff --git a/include/openbsc/msc_ifaces.h b/include/osmocom/bsc/msc_ifaces.h similarity index 97% rename from include/openbsc/msc_ifaces.h rename to include/osmocom/bsc/msc_ifaces.h index a1071ae..dadb828 100644 --- a/include/openbsc/msc_ifaces.h +++ b/include/osmocom/bsc/msc_ifaces.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/openbsc/nat_rewrite_trie.h b/include/osmocom/bsc/nat_rewrite_trie.h similarity index 100% rename from include/openbsc/nat_rewrite_trie.h rename to include/osmocom/bsc/nat_rewrite_trie.h diff --git a/include/openbsc/network_listen.h b/include/osmocom/bsc/network_listen.h similarity index 92% rename from include/openbsc/network_listen.h rename to include/osmocom/bsc/network_listen.h index 67d1f4e..68d0709 100644 --- a/include/openbsc/network_listen.h +++ b/include/osmocom/bsc/network_listen.h @@ -2,7 +2,7 @@ #define _OPENBSC_NWL_H #include -#include +#include void ipac_nwl_init(void); diff --git a/include/openbsc/openbscdefines.h b/include/osmocom/bsc/openbscdefines.h similarity index 100% rename from include/openbsc/openbscdefines.h rename to include/osmocom/bsc/openbscdefines.h diff --git a/include/openbsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h similarity index 100% rename from include/openbsc/osmo_bsc.h rename to include/osmocom/bsc/osmo_bsc.h diff --git a/include/openbsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h similarity index 94% rename from include/openbsc/osmo_bsc_grace.h rename to include/osmocom/bsc/osmo_bsc_grace.h index 5a81cd1..b7950ce 100644 --- a/include/openbsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -21,8 +21,8 @@ #ifndef OSMO_BSC_GRACE_H #define OSMO_BSC_GRACE_H -#include -#include +#include +#include struct bsc_msc_data; diff --git a/include/openbsc/osmo_bsc_reset.h b/include/osmocom/bsc/osmo_bsc_reset.h similarity index 100% rename from include/openbsc/osmo_bsc_reset.h rename to include/osmocom/bsc/osmo_bsc_reset.h diff --git a/include/openbsc/osmo_bsc_rf.h b/include/osmocom/bsc/osmo_bsc_rf.h similarity index 97% rename from include/openbsc/osmo_bsc_rf.h rename to include/osmocom/bsc/osmo_bsc_rf.h index 19ccd08..56ac980 100644 --- a/include/openbsc/osmo_bsc_rf.h +++ b/include/osmocom/bsc/osmo_bsc_rf.h @@ -1,7 +1,7 @@ #ifndef OSMO_BSC_RF #define OSMO_BSC_RF -#include +#include #include #include diff --git a/include/openbsc/osmo_bsc_sigtran.h b/include/osmocom/bsc/osmo_bsc_sigtran.h similarity index 95% rename from include/openbsc/osmo_bsc_sigtran.h rename to include/osmocom/bsc/osmo_bsc_sigtran.h index fbcfcb3..8964903 100644 --- a/include/openbsc/osmo_bsc_sigtran.h +++ b/include/osmocom/bsc/osmo_bsc_sigtran.h @@ -20,8 +20,8 @@ #pragma once -#include -#include +#include +#include /* Allocate resources to make a new connection oriented sigtran connection * (not the connection ittself!) */ diff --git a/include/openbsc/osmo_msc.h b/include/osmocom/bsc/osmo_msc.h similarity index 98% rename from include/openbsc/osmo_msc.h rename to include/osmocom/bsc/osmo_msc.h index cdfd27f..c08cb26 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/osmocom/bsc/osmo_msc.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "bsc_api.h" diff --git a/include/openbsc/osmux.h b/include/osmocom/bsc/osmux.h similarity index 100% rename from include/openbsc/osmux.h rename to include/osmocom/bsc/osmux.h diff --git a/include/openbsc/paging.h b/include/osmocom/bsc/paging.h similarity index 96% rename from include/openbsc/paging.h rename to include/osmocom/bsc/paging.h index 7dd8500..e917772 100644 --- a/include/openbsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include /** * A pending paging request diff --git a/include/openbsc/pcu_if.h b/include/osmocom/bsc/pcu_if.h similarity index 100% rename from include/openbsc/pcu_if.h rename to include/osmocom/bsc/pcu_if.h diff --git a/include/openbsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h similarity index 100% rename from include/openbsc/pcuif_proto.h rename to include/osmocom/bsc/pcuif_proto.h diff --git a/include/openbsc/rest_octets.h b/include/osmocom/bsc/rest_octets.h similarity index 100% rename from include/openbsc/rest_octets.h rename to include/osmocom/bsc/rest_octets.h diff --git a/include/openbsc/rrlp.h b/include/osmocom/bsc/rrlp.h similarity index 100% rename from include/openbsc/rrlp.h rename to include/osmocom/bsc/rrlp.h diff --git a/include/openbsc/rs232.h b/include/osmocom/bsc/rs232.h similarity index 100% rename from include/openbsc/rs232.h rename to include/osmocom/bsc/rs232.h diff --git a/include/openbsc/rtp_proxy.h b/include/osmocom/bsc/rtp_proxy.h similarity index 98% rename from include/openbsc/rtp_proxy.h rename to include/osmocom/bsc/rtp_proxy.h index 52ffefd..918420c 100644 --- a/include/openbsc/rtp_proxy.h +++ b/include/osmocom/bsc/rtp_proxy.h @@ -27,7 +27,7 @@ #include #include -#include +#include #define RTP_PT_GSM_FULL 3 #define RTP_PT_GSM_HALF 96 diff --git a/include/openbsc/sgsn.h b/include/osmocom/bsc/sgsn.h similarity index 97% rename from include/openbsc/sgsn.h rename to include/osmocom/bsc/sgsn.h index f371dc6..f71b649 100644 --- a/include/openbsc/sgsn.h +++ b/include/osmocom/bsc/sgsn.h @@ -5,9 +5,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/signal.h b/include/osmocom/bsc/signal.h similarity index 99% rename from include/openbsc/signal.h rename to include/osmocom/bsc/signal.h index 49f86d6..feab246 100644 --- a/include/openbsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include diff --git a/include/openbsc/silent_call.h b/include/osmocom/bsc/silent_call.h similarity index 100% rename from include/openbsc/silent_call.h rename to include/osmocom/bsc/silent_call.h diff --git a/include/openbsc/smpp.h b/include/osmocom/bsc/smpp.h similarity index 100% rename from include/openbsc/smpp.h rename to include/osmocom/bsc/smpp.h diff --git a/include/openbsc/sms_queue.h b/include/osmocom/bsc/sms_queue.h similarity index 100% rename from include/openbsc/sms_queue.h rename to include/osmocom/bsc/sms_queue.h diff --git a/include/openbsc/socket.h b/include/osmocom/bsc/socket.h similarity index 100% rename from include/openbsc/socket.h rename to include/osmocom/bsc/socket.h diff --git a/include/openbsc/system_information.h b/include/osmocom/bsc/system_information.h similarity index 94% rename from include/openbsc/system_information.h rename to include/osmocom/bsc/system_information.h index 71bea26..29f639d 100644 --- a/include/openbsc/system_information.h +++ b/include/osmocom/bsc/system_information.h @@ -3,7 +3,7 @@ #include -#include +#include struct gsm_bts; diff --git a/include/openbsc/transaction.h b/include/osmocom/bsc/transaction.h similarity index 95% rename from include/openbsc/transaction.h rename to include/osmocom/bsc/transaction.h index 1e93fff..5465548 100644 --- a/include/openbsc/transaction.h +++ b/include/osmocom/bsc/transaction.h @@ -1,10 +1,10 @@ #ifndef _TRANSACT_H #define _TRANSACT_H -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/include/openbsc/trau_mux.h b/include/osmocom/bsc/trau_mux.h similarity index 97% rename from include/openbsc/trau_mux.h rename to include/osmocom/bsc/trau_mux.h index 75c359b..eeceff5 100644 --- a/include/openbsc/trau_mux.h +++ b/include/osmocom/bsc/trau_mux.h @@ -29,8 +29,8 @@ */ #include -#include -#include +#include +#include struct decoded_trau_frame; diff --git a/include/openbsc/trau_upqueue.h b/include/osmocom/bsc/trau_upqueue.h similarity index 100% rename from include/openbsc/trau_upqueue.h rename to include/osmocom/bsc/trau_upqueue.h diff --git a/include/openbsc/ussd.h b/include/osmocom/bsc/ussd.h similarity index 100% rename from include/openbsc/ussd.h rename to include/osmocom/bsc/ussd.h diff --git a/include/openbsc/vty.h b/include/osmocom/bsc/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/bsc/vty.h diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c index 21d9f22..c459161 100644 --- a/src/ipaccess/abisip-find.c +++ b/src/ipaccess/abisip-find.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include static int udp_sock(const char *ifname) { diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index 6822c06..c68e3ea 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -37,19 +37,19 @@ #include #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/ipaccess/ipaccess-firmware.c b/src/ipaccess/ipaccess-firmware.c index 5f55bb5..515cc75 100644 --- a/src/ipaccess/ipaccess-firmware.c +++ b/src/ipaccess/ipaccess-firmware.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c index d367442..b45b543 100644 --- a/src/ipaccess/ipaccess-proxy.c +++ b/src/ipaccess/ipaccess-proxy.c @@ -37,7 +37,7 @@ #define _GNU_SOURCE #include -#include +#include #include #include #include @@ -45,9 +45,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include /* one instance of an ip.access protocol proxy */ diff --git a/src/ipaccess/network_listen.c b/src/ipaccess/network_listen.c index 3b44ceb..dd6cb4b 100644 --- a/src/ipaccess/network_listen.c +++ b/src/ipaccess/network_listen.c @@ -33,10 +33,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #define WHITELIST_MAX_SIZE ((NUM_ARFCNS*2)+2+1) diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index cf20d7c..3a48dee 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -34,17 +34,17 @@ #include #include -#include -#include +#include +#include #include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include #define OM_ALLOC_SIZE 1024 diff --git a/src/libbsc/abis_nm_vty.c b/src/libbsc/abis_nm_vty.c index 6ec0a4a..a0d72c2 100644 --- a/src/libbsc/abis_nm_vty.c +++ b/src/libbsc/abis_nm_vty.c @@ -28,14 +28,14 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/abis_om2000.c b/src/libbsc/abis_om2000.c index 82a14b2..756cc89 100644 --- a/src/libbsc/abis_om2000.c +++ b/src/libbsc/abis_om2000.c @@ -36,12 +36,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include /* FIXME: move to libosmocore */ diff --git a/src/libbsc/abis_om2000_vty.c b/src/libbsc/abis_om2000_vty.c index a6bc4c7..b75d420 100644 --- a/src/libbsc/abis_om2000_vty.c +++ b/src/libbsc/abis_om2000_vty.c @@ -26,14 +26,14 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 75229a5..09fb14b 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -27,26 +27,26 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include #define RSL_ALLOC_SIZE 1024 #define RSL_ALLOC_HEADROOM 128 diff --git a/src/libbsc/arfcn_range_encode.c b/src/libbsc/arfcn_range_encode.c index 9ca4840..ae99fd9 100644 --- a/src/libbsc/arfcn_range_encode.c +++ b/src/libbsc/arfcn_range_encode.c @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a0ba69a..b42c382 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -21,17 +21,17 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index 641fe2b..7c2bfb5 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -22,13 +22,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define CTRL_CMD_VTY_STRING(cmdname, cmdstr, dtype, element) \ CTRL_HELPER_GET_STRING(cmdname, dtype, element) \ diff --git a/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c index a8a8cf5..d1d9b0a 100644 --- a/src/libbsc/bsc_ctrl_lookup.c +++ b/src/libbsc/bsc_ctrl_lookup.c @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include extern vector ctrl_node_vec; diff --git a/src/libbsc/bsc_dyn_ts.c b/src/libbsc/bsc_dyn_ts.c index e5422fc..aa3c252 100644 --- a/src/libbsc/bsc_dyn_ts.c +++ b/src/libbsc/bsc_dyn_ts.c @@ -19,9 +19,9 @@ */ #include -#include -#include -#include +#include +#include +#include void tchf_pdch_ts_init(struct gsm_bts_trx_ts *ts) { diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index a99eea2..5b6530d 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -19,25 +19,25 @@ * */ -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include /* global pointer to the gsm network data structure */ diff --git a/src/libbsc/bsc_msc.c b/src/libbsc/bsc_msc.c index 82a572d..648b3e6 100644 --- a/src/libbsc/bsc_msc.c +++ b/src/libbsc/bsc_msc.c @@ -19,8 +19,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c index b7b6fc8..20115e1 100644 --- a/src/libbsc/bsc_rf_ctrl.c +++ b/src/libbsc/bsc_rf_ctrl.c @@ -20,12 +20,12 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/bsc_rll.c b/src/libbsc/bsc_rll.c index bb488da..ebf9b88 100644 --- a/src/libbsc/bsc_rll.c +++ b/src/libbsc/bsc_rll.c @@ -22,15 +22,15 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include struct bsc_rll_req { struct llist_head list; diff --git a/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c index 73e61e8..d9d90ba 100644 --- a/src/libbsc/bsc_subscriber.c +++ b/src/libbsc/bsc_subscriber.c @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include static struct bsc_subscr *bsc_subscr_alloc(struct llist_head *list) { diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index abfff0c..42c16e8 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -36,28 +36,28 @@ #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libbsc/bts_ericsson_rbs2000.c b/src/libbsc/bts_ericsson_rbs2000.c index 99da4e7..5ee2760 100644 --- a/src/libbsc/bts_ericsson_rbs2000.c +++ b/src/libbsc/bts_ericsson_rbs2000.c @@ -22,12 +22,12 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include diff --git a/src/libbsc/bts_init.c b/src/libbsc/bts_init.c index d6b152a..18f1ed4 100644 --- a/src/libbsc/bts_init.c +++ b/src/libbsc/bts_init.c @@ -16,7 +16,7 @@ * along with this program. If not, see . * */ -#include +#include int bts_init(void) { diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..1f203f5 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -23,23 +23,23 @@ #include -#include -#include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include -#include +#include +#include extern struct gsm_network *bsc_gsmnet; diff --git a/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 473e1ca..22ae484 100644 --- a/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include static void patch_16(uint8_t *data, const uint16_t val) { diff --git a/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c index 3ca76c0..392cd17 100644 --- a/src/libbsc/bts_nokia_site.c +++ b/src/libbsc/bts_nokia_site.c @@ -30,11 +30,11 @@ #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include diff --git a/src/libbsc/bts_siemens_bs11.c b/src/libbsc/bts_siemens_bs11.c index c083b1e..e01c258 100644 --- a/src/libbsc/bts_siemens_bs11.c +++ b/src/libbsc/bts_siemens_bs11.c @@ -22,11 +22,11 @@ #include -#include -#include -#include +#include +#include +#include #include -#include +#include static int bts_model_bs11_start(struct gsm_network *net); diff --git a/src/libbsc/bts_sysmobts.c b/src/libbsc/bts_sysmobts.c index e4b6cdc..2982074 100644 --- a/src/libbsc/bts_sysmobts.c +++ b/src/libbsc/bts_sysmobts.c @@ -23,17 +23,17 @@ #include -#include -#include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/src/libbsc/bts_unknown.c b/src/libbsc/bts_unknown.c index f113529..5ecf875 100644 --- a/src/libbsc/bts_unknown.c +++ b/src/libbsc/bts_unknown.c @@ -20,9 +20,9 @@ */ -#include +#include #include -#include +#include static struct gsm_bts_model model_unknown = { .type = GSM_BTS_TYPE_UNKNOWN, diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 4192d65..679ad42 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -25,14 +25,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index d57dec5..1923efd 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -23,15 +23,15 @@ #include -#include +#include #include #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include #define SAPI_L2ML 0 #define SAPI_OML 62 diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 109beda..7fc696f 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -30,13 +30,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ diff --git a/src/libbsc/gsm_04_80_utils.c b/src/libbsc/gsm_04_80_utils.c index e0db81e..d67f3c5 100644 --- a/src/libbsc/gsm_04_80_utils.c +++ b/src/libbsc/gsm_04_80_utils.c @@ -20,7 +20,7 @@ */ #include -#include +#include int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text) diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 8d7e047..09c7eaa 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -25,12 +25,12 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include /* Get reference to a neighbor cell on a given BCCH ARFCN */ diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 8ced74f..ace8ac3 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -29,18 +29,18 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include struct bsc_handover { struct llist_head list; diff --git a/src/libbsc/meas_proc.c b/src/libbsc/meas_proc.c index 5b97e74..efc3fd0 100644 --- a/src/libbsc/meas_proc.c +++ b/src/libbsc/meas_proc.c @@ -24,10 +24,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include /* process an already parsed measurement report */ static int process_meas_rep(struct gsm_meas_rep *mr) diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c index 808103d..cb8379e 100644 --- a/src/libbsc/meas_rep.c +++ b/src/libbsc/meas_rep.c @@ -20,8 +20,8 @@ */ -#include -#include +#include +#include static int get_field(const struct gsm_meas_rep *rep, enum meas_rep_field field) diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 0dd3753..a71662c 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -17,10 +17,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index 02212a3..b8f9043 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -42,14 +42,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include void *tall_paging_ctx; diff --git a/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c index 98e12fa..40dd68d 100644 --- a/src/libbsc/pcu_sock.c +++ b/src/libbsc/pcu_sock.c @@ -37,12 +37,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg); uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index fdab70a..ae04225 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -26,13 +26,13 @@ #include #include -#include -#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include /* generate SI1 rest octets */ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net) diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index fe0b23d..c0df8bb 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -33,12 +33,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* * DCS1800 and PCS1900 have overlapping ARFCNs. We would need to set the diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c0294c7..c40bc41 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index fbcfa1d..16d51a1 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -25,11 +25,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 1791687..fd10836 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -25,10 +25,10 @@ #include #include -#include +#include -#include -#include +#include +#include struct cmd_node net_node = { GSMNET_NODE, diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 1443791..d4d5fb5 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,12 +23,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..68fc597 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 077029a..e085aa6 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -34,9 +34,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..84a71cb 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index a2f6b2d..a746c24 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..78aacdb 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c index a42206d..d7b737b 100644 --- a/src/libfilter/bsc_msg_acc.c +++ b/src/libfilter/bsc_msg_acc.c @@ -18,9 +18,9 @@ * */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c index 338db72..fc87e88 100644 --- a/src/libfilter/bsc_msg_filter.c +++ b/src/libfilter/bsc_msg_filter.c @@ -21,14 +21,14 @@ * */ -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c index c342fdc..52e0da5 100644 --- a/src/libfilter/bsc_msg_vty.c +++ b/src/libfilter/bsc_msg_vty.c @@ -17,9 +17,9 @@ * */ -#include -#include -#include +#include +#include +#include #include diff --git a/src/libtrau/rtp_proxy.c b/src/libtrau/rtp_proxy.c index 6b38ee5..5b1ca79 100644 --- a/src/libtrau/rtp_proxy.c +++ b/src/libtrau/rtp_proxy.c @@ -30,13 +30,13 @@ #include #include -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/libtrau/trau_mux.c b/src/libtrau/trau_mux.c index b37c765..e570b93 100644 --- a/src/libtrau/trau_mux.c +++ b/src/libtrau/trau_mux.c @@ -22,16 +22,16 @@ #include #include -#include +#include #include -#include +#include #include #include -#include +#include #include -#include +#include #include -#include +#include /* this corresponds to the bit-lengths of the individual codec * parameters as indicated in Table 1.1 of TS 06.10 */ diff --git a/src/libtrau/trau_upqueue.c b/src/libtrau/trau_upqueue.c index f8edaf0..c1c0003 100644 --- a/src/libtrau/trau_upqueue.c +++ b/src/libtrau/trau_upqueue.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include void trau_tx_to_mncc(struct gsm_network *net, struct msgb *msg) { diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index 8e47069..c388f5b 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -17,12 +17,12 @@ * */ -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include #include -#include +#include #define return_when_not_connected(conn) \ if (!conn->sccp_con) {\ diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index b4ffa88..94aa350 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -20,15 +20,15 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 3417783..4311250 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -18,22 +18,22 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include #include #include #include -#include -#include +#include +#include #include #define IP_V4_ADDR_LEN 4 diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index c23ed21..2446312 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -19,13 +19,13 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c index 2a9820d..7f9671a 100644 --- a/src/osmo-bsc/osmo_bsc_filter.c +++ b/src/osmo-bsc/osmo_bsc_filter.c @@ -19,13 +19,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 63afa20..a310079 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts *bts) { diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 61ef33c..5e8f45e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -18,17 +18,17 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c index 351fd2c..0e5777e 100644 --- a/src/osmo-bsc/osmo_bsc_msc.c +++ b/src/osmo-bsc/osmo_bsc_msc.c @@ -20,15 +20,15 @@ * */ -#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c index 0baf080..d28f548 100644 --- a/src/osmo-bsc/osmo_bsc_reset.c +++ b/src/osmo-bsc/osmo_bsc_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 0f6ca33..48796c1 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -26,13 +26,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 8edcbf3..0e7003f 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_filter.c b/src/osmo-bsc_nat/bsc_filter.c index 6a9e99f..8d4a680 100644 --- a/src/osmo-bsc_nat/bsc_filter.c +++ b/src/osmo-bsc_nat/bsc_filter.c @@ -20,10 +20,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c index 49050fc..bf6d0ad 100644 --- a/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -42,15 +42,15 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index 401288d..1548ea3 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -39,15 +39,15 @@ #define _GNU_SOURCE #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c index ff6a739..93cdff3 100644 --- a/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -27,12 +27,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_filter.c b/src/osmo-bsc_nat/bsc_nat_filter.c index e735290..cd7ca25 100644 --- a/src/osmo-bsc_nat/bsc_nat_filter.c +++ b/src/osmo-bsc_nat/bsc_nat_filter.c @@ -18,10 +18,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_nat_rewrite.c b/src/osmo-bsc_nat/bsc_nat_rewrite.c index 943e1fa..75ed4ec 100644 --- a/src/osmo-bsc_nat/bsc_nat_rewrite.c +++ b/src/osmo-bsc_nat/bsc_nat_rewrite.c @@ -21,13 +21,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c index 633fa87..af346ef 100644 --- a/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c +++ b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c @@ -19,9 +19,9 @@ * */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c index c12b29f..a9906b9 100644 --- a/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/src/osmo-bsc_nat/bsc_nat_utils.c @@ -21,14 +21,14 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_vty.c b/src/osmo-bsc_nat/bsc_nat_vty.c index 875cefb..5f7cbc8 100644 --- a/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/src/osmo-bsc_nat/bsc_nat_vty.c @@ -18,23 +18,23 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include #include #include -#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_sccp.c b/src/osmo-bsc_nat/bsc_sccp.c index c6c265f..bb882a6 100644 --- a/src/osmo-bsc_nat/bsc_sccp.c +++ b/src/osmo-bsc_nat/bsc_sccp.c @@ -19,9 +19,9 @@ * */ -#include -#include -#include +#include +#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c index 29b4fee..20df8d1 100644 --- a/src/osmo-bsc_nat/bsc_ussd.c +++ b/src/osmo-bsc_nat/bsc_ussd.c @@ -20,12 +20,12 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/utils/bs11_config.c b/src/utils/bs11_config.c index a0f3cb7..6487df2 100644 --- a/src/utils/bs11_config.c +++ b/src/utils/bs11_config.c @@ -32,14 +32,14 @@ #include -#include -#include +#include +#include #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/src/utils/meas_db.c b/src/utils/meas_db.c index d81efca..7233dcd 100644 --- a/src/utils/meas_db.c +++ b/src/utils/meas_db.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_json.c b/src/utils/meas_json.c index 51eb6c7..4623ee0 100644 --- a/src/utils/meas_json.c +++ b/src/utils/meas_json.c @@ -37,9 +37,9 @@ #include -#include -#include -#include +#include +#include +#include static void print_meas_rep_uni_json(struct gsm_meas_rep_unidir *mru) { diff --git a/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c index b874ac4..db00fae 100644 --- a/src/utils/meas_pcap2db.c +++ b/src/utils/meas_pcap2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include diff --git a/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c index 5032d0c..34f8385 100644 --- a/src/utils/meas_udp2db.c +++ b/src/utils/meas_udp2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 77194de..851aa03 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -16,7 +16,7 @@ #include -#include +#include struct ms_state_uni { CDKSLIDER *cdk; diff --git a/tests/abis/abis_test.c b/tests/abis/abis_test.c index 591f835..461f24e 100644 --- a/tests/abis/abis_test.c +++ b/tests/abis/abis_test.c @@ -24,9 +24,9 @@ #include #include -#include -#include -#include +#include +#include +#include static const uint8_t load_config[] = { 0x42, 0x12, 0x00, 0x08, 0x31, 0x36, 0x38, 0x64, diff --git a/tests/bsc-nat-trie/bsc_nat_trie_test.c b/tests/bsc-nat-trie/bsc_nat_trie_test.c index 4b4df2f..3c04a9f 100644 --- a/tests/bsc-nat-trie/bsc_nat_trie_test.c +++ b/tests/bsc-nat-trie/bsc_nat_trie_test.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/tests/bsc-nat/bsc_nat_test.c b/tests/bsc-nat/bsc_nat_test.c index 2914a01..a61da00 100644 --- a/tests/bsc-nat/bsc_nat_test.c +++ b/tests/bsc-nat/bsc_nat_test.c @@ -22,12 +22,12 @@ */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 20ed5b4..aedc018 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -24,13 +24,13 @@ */ -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index e66bed3..ec2927e 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -25,10 +25,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include void test_bts_debug_print(void) { diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index d9ff305..974ebe5 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -24,13 +24,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 96d56ef..3b5429c 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -19,9 +19,9 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c index 60d687d..934684f 100644 --- a/tests/subscr/bsc_subscr_test.c +++ b/tests/subscr/bsc_subscr_test.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/tests/trau/trau_test.c b/tests/trau/trau_test.c index c74e6db..c8c9a5e 100644 --- a/tests/trau/trau_test.c +++ b/tests/trau/trau_test.c @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/3813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:27:21 +0000 Subject: [PATCH] osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3832 to look at the new patch set (#2). doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg Now osmo-bsc.cfg's SCCP addresses work by internal defaults, while osmo-bsc_custom-sccp.cfg shows how to use custom STP IP address and SCCP point codes. Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd --- M doc/examples/osmo-bsc/osmo-bsc.cfg A doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg M osmoappdesc.py 3 files changed, 128 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/3832/2 diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index 7c10e9d..47123ec 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -1,11 +1,5 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login +! osmo-bsc default configuration +! (assumes STP to run on 127.0.0.1 and uses default point codes) ! e1_input e1_line 0 driver ipa @@ -15,12 +9,14 @@ short name OsmoBSC long name OsmoBSC auth policy closed + authorized-regexp .* location updating reject cause 13 encryption a5 0 - neci 1 + authentication optional + neci 0 paging any use tch 0 rrlp mode none - mm info 1 + mm info 0 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 @@ -28,21 +24,25 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 bts 0 - type nanobts + type sysmobts band DCS1800 cell_identity 0 location_area_code 1 - training_sequence_code 7 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 + radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 - dtx uplink force - dtx downlink + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden ip.access unit_id 0 0 oml ip.access stream_id 255 line 0 neighbor-list mode manual-si5 @@ -50,12 +50,14 @@ neighbor-list add arfcn 200 si5 neighbor-list add arfcn 10 si5 neighbor-list add arfcn 20 + codec-support fr gprs mode none + no force-combined-si trx 0 rf_locked 0 arfcn 871 nominal power 23 - max_power_red 20 + max_power_red 0 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 @@ -81,21 +83,24 @@ timeslot 7 phys_chan_config TCH/F hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote +msc 0 ip.access rtp-base 4000 timeout-ping 20 timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name + no timeout-ping advanced + no bsc-welcome-text + no bsc-msc-lost-text + no bsc-grace-text + type normal + allow-emergency allow + amr-config 12_2k forbidden + amr-config 10_2k forbidden + amr-config 7_95k forbidden + amr-config 7_40k forbidden + amr-config 6_70k forbidden + amr-config 5_90k allowed + amr-config 5_15k forbidden + amr-config 4_75k forbidden bsc - no access-list-name - access-list-name bsc-list + mid-call-timeout 0 + no missing-msc-text diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg b/doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg new file mode 100644 index 0000000..f9c0a3c --- /dev/null +++ b/doc/examples/osmo-bsc/osmo-bsc_custom-scpp.cfg @@ -0,0 +1,92 @@ +! osmo-bsc configuration example for custom SCCP addresses +! +e1_input + e1_line 0 driver ipa +network + network country code 1 + mobile network code 1 + short name OsmoBSC + long name OsmoBSC + auth policy closed + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + authentication optional + neci 0 + paging any use tch 0 + rrlp mode none + mm info 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 + bts 0 + type sysmobts + band DCS1800 + cell_identity 0 + location_area_code 1 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 0 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +cs7 instance 0 + point-code 0.42.1 + !asp asp-clnt-OsmoBSC 2905 0 m3ua + ! remote-ip 10.23.24.1 ! where to reach the STP + sccp-address msc_remote + point-code 0.23.1 +msc 0 + msc-addr msc_remote diff --git a/osmoappdesc.py b/osmoappdesc.py index 36eb1a7..338239c 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -15,7 +15,8 @@ # along with this program. If not, see app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg", + "doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:27:21 +0000 Subject: [PATCH] osmo-bsc[master]: drop MGCP client from osmo-bsc In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3789 to look at the new patch set (#2). drop MGCP client from osmo-bsc After osmo-mgw change I8e0b2d2a399b77086a36606f5e427271c6242df1, there now is a separated libosmo-mgcp-client, and osmo-bsc needs adjusting. But besides having an unused struct in gsm_network, osmo-bsc does not yet use its MGCP client; these are merely plans for the future. Until we do, let's just drop the dependency entirely. Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/89/3789/2 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ef041d6..0aeb535 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -17,7 +17,6 @@ #include #include #include -#include /** annotations for msgb ownership */ @@ -485,11 +484,6 @@ /* Periodic location update default value */ uint8_t t3212; - - struct { - struct mgcpgw_client_conf conf; - struct mgcpgw_client *client; - } mgcpgw; struct { /* CS7 instance id number (set via VTY) */ -- To view, visit https://gerrit.osmocom.org/3789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:28:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:28:20 +0000 Subject: osmo-bsc[master]: move include/openbsc to include/osmocom/bsc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 reinstate previous +2, merely minor conflict resolution after changing the order of patches -- To view, visit https://gerrit.osmocom.org/3813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:29:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:29:04 +0000 Subject: osmo-bsc[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 reinstate previous +2 after rebase -- To view, visit https://gerrit.osmocom.org/3794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:29:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:29:20 +0000 Subject: [MERGED] osmo-msc[master]: configure.ac: fix to "AC_INIT[osmo-msc]" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: fix to "AC_INIT[osmo-msc]" ...................................................................... configure.ac: fix to "AC_INIT[osmo-msc]" Change-Id: I3c0dea06e341ccd944448b133381a390fc500c32 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 1942614..cd2af00 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT([openbsc], +AC_INIT([osmo-msc], m4_esyscmd([./git-version-gen .tarball-version]), [openbsc at lists.osmocom.org]) -- To view, visit https://gerrit.osmocom.org/3785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3c0dea06e341ccd944448b133381a390fc500c32 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:34:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:34:26 +0000 Subject: [ABANDON] osmo-msc[master]: --enable-iu by default In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: --enable-iu by default ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1c937cb0dea001e501714cf71bfc91ec5c3cda9f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:35:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:35:38 +0000 Subject: [PATCH] osmo-msc[master]: rewrite README In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3800 to look at the new patch set (#5). rewrite README Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 --- M README 1 file changed, 19 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/00/3800/5 diff --git a/README b/README index d01b2cf..a45ef95 100644 --- a/README +++ b/README @@ -1,39 +1,24 @@ -About OpenBSC +About OsmoMSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoMSC was one of the parts split off from the old openbsc.git. Before, it was +the libmsc part of the old OsmoNITB. Since a true A interface and IuCS for 3G +support is available, OsmoMSC exists only as a separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoMSC exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoMSC issue tracker and wiki online at +https://osmocom.org/projects/osmomsc +https://osmocom.org/projects/osmomsc/wiki -- To view, visit https://gerrit.osmocom.org/3800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:43:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:43:17 +0000 Subject: [PATCH] osmo-msc[master]: rename include/openbsc to include/osmocom/msc In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3811 to look at the new patch set (#2). rename include/openbsc to include/osmocom/msc Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 --- M configure.ac M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/msc/Makefile.am R include/osmocom/msc/a_iface.h R include/osmocom/msc/a_iface_bssap.h R include/osmocom/msc/a_reset.h R include/osmocom/msc/abis_nm.h R include/osmocom/msc/abis_om2000.h R include/osmocom/msc/abis_rsl.h R include/osmocom/msc/arfcn_range_encode.h R include/osmocom/msc/auth.h R include/osmocom/msc/bsc_api.h R include/osmocom/msc/bsc_msc.h R include/osmocom/msc/bsc_msc_data.h R include/osmocom/msc/bsc_msg_filter.h R include/osmocom/msc/bsc_rll.h R include/osmocom/msc/bss.h R include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h R include/osmocom/msc/chan_alloc.h R include/osmocom/msc/common.h R include/osmocom/msc/common_bsc.h R include/osmocom/msc/common_cs.h R include/osmocom/msc/crc24.h R include/osmocom/msc/ctrl.h R include/osmocom/msc/db.h R include/osmocom/msc/debug.h R include/osmocom/msc/e1_config.h R include/osmocom/msc/gsm_04_08.h R include/osmocom/msc/gsm_04_11.h R include/osmocom/msc/gsm_04_14.h R include/osmocom/msc/gsm_04_80.h R include/osmocom/msc/gsm_data.h R include/osmocom/msc/gsm_data_shared.h R include/osmocom/msc/gsm_subscriber.h R include/osmocom/msc/gsup_client.h R include/osmocom/msc/gtphub.h R include/osmocom/msc/handover.h R include/osmocom/msc/handover_decision.h R include/osmocom/msc/ipaccess.h R include/osmocom/msc/iu_dummy.h R include/osmocom/msc/iucs.h R include/osmocom/msc/iucs_ranap.h R include/osmocom/msc/meas_feed.h R include/osmocom/msc/meas_rep.h R include/osmocom/msc/misdn.h R include/osmocom/msc/mncc.h R include/osmocom/msc/mncc_int.h R include/osmocom/msc/msc_ifaces.h R include/osmocom/msc/network_listen.h R include/osmocom/msc/oap_client.h R include/osmocom/msc/openbscdefines.h R include/osmocom/msc/osmo_bsc.h R include/osmocom/msc/osmo_bsc_grace.h R include/osmocom/msc/osmo_bsc_reset.h R include/osmocom/msc/osmo_bsc_rf.h R include/osmocom/msc/osmo_bsc_sigtran.h R include/osmocom/msc/osmo_msc.h R include/osmocom/msc/osmux.h R include/osmocom/msc/paging.h R include/osmocom/msc/rest_octets.h R include/osmocom/msc/rrlp.h R include/osmocom/msc/rs232.h R include/osmocom/msc/rtp_proxy.h R include/osmocom/msc/signal.h R include/osmocom/msc/silent_call.h R include/osmocom/msc/slhc.h R include/osmocom/msc/smpp.h R include/osmocom/msc/sms_queue.h R include/osmocom/msc/socket.h R include/osmocom/msc/system_information.h R include/osmocom/msc/transaction.h R include/osmocom/msc/trau_mux.h R include/osmocom/msc/trau_upqueue.h R include/osmocom/msc/ussd.h R include/osmocom/msc/vlr.h R include/osmocom/msc/vty.h M src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libcommon/oap_client.c M src/libcommon/socket.c M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/meas_feed.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c M src/libmsc/mncc_sock.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.c M src/libmsc/smpp_utils.c M src/libmsc/smpp_vty.c M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_auth_fsm.c M src/libvlr/vlr_core.h M src/libvlr/vlr_lu_fsm.c M src/osmo-msc/msc_main.c M src/utils/meas_db.c M src/utils/meas_json.c M src/utils/meas_pcap2db.c M src/utils/meas_udp2db.c M src/utils/meas_vis.c M src/utils/smpp_mirror.c M tests/db/db_test.c M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp/smpp_test.c M tests/sms_queue/sms_queue_test.c 137 files changed, 349 insertions(+), 345 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/3811/2 diff --git a/configure.ac b/configure.ac index 8d646d3..dd61e52 100644 --- a/configure.ac +++ b/configure.ac @@ -204,8 +204,9 @@ AC_OUTPUT( osmo-msc.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/msc/Makefile src/Makefile src/libmsc/Makefile src/libvlr/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 677eec3..9d963a0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,3 +1,3 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..4d80637 --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + msc \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/msc/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/msc/Makefile.am diff --git a/include/openbsc/a_iface.h b/include/osmocom/msc/a_iface.h similarity index 98% rename from include/openbsc/a_iface.h rename to include/osmocom/msc/a_iface.h index 149f1c7..a49ede2 100644 --- a/include/openbsc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -20,7 +20,7 @@ #pragma once -#include +#include /* A struct to keep a context information about the BSCs we are associated with */ struct bsc_context { diff --git a/include/openbsc/a_iface_bssap.h b/include/osmocom/msc/a_iface_bssap.h similarity index 100% rename from include/openbsc/a_iface_bssap.h rename to include/osmocom/msc/a_iface_bssap.h diff --git a/include/openbsc/a_reset.h b/include/osmocom/msc/a_reset.h similarity index 100% rename from include/openbsc/a_reset.h rename to include/osmocom/msc/a_reset.h diff --git a/include/openbsc/abis_nm.h b/include/osmocom/msc/abis_nm.h similarity index 99% rename from include/openbsc/abis_nm.h rename to include/osmocom/msc/abis_nm.h index db2a659..2581962 100644 --- a/include/openbsc/abis_nm.h +++ b/include/osmocom/msc/abis_nm.h @@ -26,7 +26,7 @@ #include #include -#include +#include /* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ #define MAX_BTS_ATTR 5 diff --git a/include/openbsc/abis_om2000.h b/include/osmocom/msc/abis_om2000.h similarity index 100% rename from include/openbsc/abis_om2000.h rename to include/osmocom/msc/abis_om2000.h diff --git a/include/openbsc/abis_rsl.h b/include/osmocom/msc/abis_rsl.h similarity index 100% rename from include/openbsc/abis_rsl.h rename to include/osmocom/msc/abis_rsl.h diff --git a/include/openbsc/arfcn_range_encode.h b/include/osmocom/msc/arfcn_range_encode.h similarity index 100% rename from include/openbsc/arfcn_range_encode.h rename to include/osmocom/msc/arfcn_range_encode.h diff --git a/include/openbsc/auth.h b/include/osmocom/msc/auth.h similarity index 100% rename from include/openbsc/auth.h rename to include/osmocom/msc/auth.h diff --git a/include/openbsc/bsc_api.h b/include/osmocom/msc/bsc_api.h similarity index 100% rename from include/openbsc/bsc_api.h rename to include/osmocom/msc/bsc_api.h diff --git a/include/openbsc/bsc_msc.h b/include/osmocom/msc/bsc_msc.h similarity index 98% rename from include/openbsc/bsc_msc.h rename to include/osmocom/msc/bsc_msc.h index 380eb17..d649f76 100644 --- a/include/openbsc/bsc_msc.h +++ b/include/osmocom/msc/bsc_msc.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/include/openbsc/bsc_msc_data.h b/include/osmocom/msc/bsc_msc_data.h similarity index 100% rename from include/openbsc/bsc_msc_data.h rename to include/osmocom/msc/bsc_msc_data.h diff --git a/include/openbsc/bsc_msg_filter.h b/include/osmocom/msc/bsc_msg_filter.h similarity index 100% rename from include/openbsc/bsc_msg_filter.h rename to include/osmocom/msc/bsc_msg_filter.h diff --git a/include/openbsc/bsc_rll.h b/include/osmocom/msc/bsc_rll.h similarity index 92% rename from include/openbsc/bsc_rll.h rename to include/osmocom/msc/bsc_rll.h index 729ba60..93c80e7 100644 --- a/include/openbsc/bsc_rll.h +++ b/include/osmocom/msc/bsc_rll.h @@ -1,7 +1,7 @@ #ifndef _BSC_RLL_H #define _BSC_RLL_H -#include +#include enum bsc_rllr_ind { BSC_RLLR_IND_EST_CONF, diff --git a/include/openbsc/bss.h b/include/osmocom/msc/bss.h similarity index 93% rename from include/openbsc/bss.h rename to include/osmocom/msc/bss.h index 9f16bf7..0904334 100644 --- a/include/openbsc/bss.h +++ b/include/osmocom/msc/bss.h @@ -1,7 +1,7 @@ #ifndef _BSS_H_ #define _BSS_H_ -#include +#include struct msgb; diff --git a/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h diff --git a/include/openbsc/chan_alloc.h b/include/osmocom/msc/chan_alloc.h similarity index 100% rename from include/openbsc/chan_alloc.h rename to include/osmocom/msc/chan_alloc.h diff --git a/include/openbsc/common.h b/include/osmocom/msc/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/msc/common.h diff --git a/include/openbsc/common_bsc.h b/include/osmocom/msc/common_bsc.h similarity index 83% rename from include/openbsc/common_bsc.h rename to include/osmocom/msc/common_bsc.h index 7960383..821298c 100644 --- a/include/openbsc/common_bsc.h +++ b/include/osmocom/msc/common_bsc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/include/openbsc/common_cs.h b/include/osmocom/msc/common_cs.h similarity index 100% rename from include/openbsc/common_cs.h rename to include/osmocom/msc/common_cs.h diff --git a/include/openbsc/crc24.h b/include/osmocom/msc/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/msc/crc24.h diff --git a/include/openbsc/ctrl.h b/include/osmocom/msc/ctrl.h similarity index 100% rename from include/openbsc/ctrl.h rename to include/osmocom/msc/ctrl.h diff --git a/include/openbsc/db.h b/include/osmocom/msc/db.h similarity index 100% rename from include/openbsc/db.h rename to include/osmocom/msc/db.h diff --git a/include/openbsc/debug.h b/include/osmocom/msc/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/msc/debug.h diff --git a/include/openbsc/e1_config.h b/include/osmocom/msc/e1_config.h similarity index 83% rename from include/openbsc/e1_config.h rename to include/osmocom/msc/e1_config.h index 538c0b0..ac5fbb1 100644 --- a/include/openbsc/e1_config.h +++ b/include/osmocom/msc/e1_config.h @@ -1,7 +1,7 @@ #ifndef _E1_CONFIG_H #define _E1_CONFIG_H -#include +#include int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); int e1_reconfig_trx(struct gsm_bts_trx *trx); diff --git a/include/openbsc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h similarity index 98% rename from include/openbsc/gsm_04_08.h rename to include/osmocom/msc/gsm_04_08.h index ca251b0..c99fc86 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -5,7 +5,7 @@ #include #include -#include +#include struct msgb; struct gsm_bts; diff --git a/include/openbsc/gsm_04_11.h b/include/osmocom/msc/gsm_04_11.h similarity index 100% rename from include/openbsc/gsm_04_11.h rename to include/osmocom/msc/gsm_04_11.h diff --git a/include/openbsc/gsm_04_14.h b/include/osmocom/msc/gsm_04_14.h similarity index 100% rename from include/openbsc/gsm_04_14.h rename to include/osmocom/msc/gsm_04_14.h diff --git a/include/openbsc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h similarity index 100% rename from include/openbsc/gsm_04_80.h rename to include/osmocom/msc/gsm_04_80.h diff --git a/include/openbsc/gsm_data.h b/include/osmocom/msc/gsm_data.h similarity index 99% rename from include/openbsc/gsm_data.h rename to include/osmocom/msc/gsm_data.h index 88a4f10..9343c31 100644 --- a/include/openbsc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -14,9 +14,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h similarity index 99% rename from include/openbsc/gsm_data_shared.h rename to include/osmocom/msc/gsm_data_shared.h index bed46d2..5028a26 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -24,7 +24,7 @@ #include #endif -#include +#include /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ diff --git a/include/openbsc/gsm_subscriber.h b/include/osmocom/msc/gsm_subscriber.h similarity index 97% rename from include/openbsc/gsm_subscriber.h rename to include/osmocom/msc/gsm_subscriber.h index d88e32a..6b0e3da 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/osmocom/msc/gsm_subscriber.h @@ -6,7 +6,7 @@ #include #include -#include +#include #define GSM_NAME_LENGTH 160 diff --git a/include/openbsc/gsup_client.h b/include/osmocom/msc/gsup_client.h similarity index 97% rename from include/openbsc/gsup_client.h rename to include/osmocom/msc/gsup_client.h index 4a25490..3d1dce0 100644 --- a/include/openbsc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 diff --git a/include/openbsc/gtphub.h b/include/osmocom/msc/gtphub.h similarity index 99% rename from include/openbsc/gtphub.h rename to include/osmocom/msc/gtphub.h index 9cb7605..d7b6f1b 100644 --- a/include/openbsc/gtphub.h +++ b/include/osmocom/msc/gtphub.h @@ -28,7 +28,7 @@ #include #include -#include +#include /* support */ diff --git a/include/openbsc/handover.h b/include/osmocom/msc/handover.h similarity index 100% rename from include/openbsc/handover.h rename to include/osmocom/msc/handover.h diff --git a/include/openbsc/handover_decision.h b/include/osmocom/msc/handover_decision.h similarity index 100% rename from include/openbsc/handover_decision.h rename to include/osmocom/msc/handover_decision.h diff --git a/include/openbsc/ipaccess.h b/include/osmocom/msc/ipaccess.h similarity index 100% rename from include/openbsc/ipaccess.h rename to include/osmocom/msc/ipaccess.h diff --git a/include/openbsc/iu_dummy.h b/include/osmocom/msc/iu_dummy.h similarity index 100% rename from include/openbsc/iu_dummy.h rename to include/osmocom/msc/iu_dummy.h diff --git a/include/openbsc/iucs.h b/include/osmocom/msc/iucs.h similarity index 100% rename from include/openbsc/iucs.h rename to include/osmocom/msc/iucs.h diff --git a/include/openbsc/iucs_ranap.h b/include/osmocom/msc/iucs_ranap.h similarity index 100% rename from include/openbsc/iucs_ranap.h rename to include/osmocom/msc/iucs_ranap.h diff --git a/include/openbsc/meas_feed.h b/include/osmocom/msc/meas_feed.h similarity index 95% rename from include/openbsc/meas_feed.h rename to include/osmocom/msc/meas_feed.h index f77ee07..02b7d95 100644 --- a/include/openbsc/meas_feed.h +++ b/include/osmocom/msc/meas_feed.h @@ -3,7 +3,7 @@ #include -#include +#include struct meas_feed_hdr { uint8_t msg_type; diff --git a/include/openbsc/meas_rep.h b/include/osmocom/msc/meas_rep.h similarity index 100% rename from include/openbsc/meas_rep.h rename to include/osmocom/msc/meas_rep.h diff --git a/include/openbsc/misdn.h b/include/osmocom/msc/misdn.h similarity index 100% rename from include/openbsc/misdn.h rename to include/osmocom/msc/misdn.h diff --git a/include/openbsc/mncc.h b/include/osmocom/msc/mncc.h similarity index 100% rename from include/openbsc/mncc.h rename to include/osmocom/msc/mncc.h diff --git a/include/openbsc/mncc_int.h b/include/osmocom/msc/mncc_int.h similarity index 100% rename from include/openbsc/mncc_int.h rename to include/osmocom/msc/mncc_int.h diff --git a/include/openbsc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h similarity index 97% rename from include/openbsc/msc_ifaces.h rename to include/osmocom/msc/msc_ifaces.h index a1071ae..d46dfe9 100644 --- a/include/openbsc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/openbsc/network_listen.h b/include/osmocom/msc/network_listen.h similarity index 92% rename from include/openbsc/network_listen.h rename to include/osmocom/msc/network_listen.h index 67d1f4e..05fbb2f 100644 --- a/include/openbsc/network_listen.h +++ b/include/osmocom/msc/network_listen.h @@ -2,7 +2,7 @@ #define _OPENBSC_NWL_H #include -#include +#include void ipac_nwl_init(void); diff --git a/include/openbsc/oap_client.h b/include/osmocom/msc/oap_client.h similarity index 100% rename from include/openbsc/oap_client.h rename to include/osmocom/msc/oap_client.h diff --git a/include/openbsc/openbscdefines.h b/include/osmocom/msc/openbscdefines.h similarity index 100% rename from include/openbsc/openbscdefines.h rename to include/osmocom/msc/openbscdefines.h diff --git a/include/openbsc/osmo_bsc.h b/include/osmocom/msc/osmo_bsc.h similarity index 100% rename from include/openbsc/osmo_bsc.h rename to include/osmocom/msc/osmo_bsc.h diff --git a/include/openbsc/osmo_bsc_grace.h b/include/osmocom/msc/osmo_bsc_grace.h similarity index 94% rename from include/openbsc/osmo_bsc_grace.h rename to include/osmocom/msc/osmo_bsc_grace.h index 5a81cd1..6232ffd 100644 --- a/include/openbsc/osmo_bsc_grace.h +++ b/include/osmocom/msc/osmo_bsc_grace.h @@ -21,8 +21,8 @@ #ifndef OSMO_BSC_GRACE_H #define OSMO_BSC_GRACE_H -#include -#include +#include +#include struct bsc_msc_data; diff --git a/include/openbsc/osmo_bsc_reset.h b/include/osmocom/msc/osmo_bsc_reset.h similarity index 100% rename from include/openbsc/osmo_bsc_reset.h rename to include/osmocom/msc/osmo_bsc_reset.h diff --git a/include/openbsc/osmo_bsc_rf.h b/include/osmocom/msc/osmo_bsc_rf.h similarity index 97% rename from include/openbsc/osmo_bsc_rf.h rename to include/osmocom/msc/osmo_bsc_rf.h index 19ccd08..a81ebd7 100644 --- a/include/openbsc/osmo_bsc_rf.h +++ b/include/osmocom/msc/osmo_bsc_rf.h @@ -1,7 +1,7 @@ #ifndef OSMO_BSC_RF #define OSMO_BSC_RF -#include +#include #include #include diff --git a/include/openbsc/osmo_bsc_sigtran.h b/include/osmocom/msc/osmo_bsc_sigtran.h similarity index 95% rename from include/openbsc/osmo_bsc_sigtran.h rename to include/osmocom/msc/osmo_bsc_sigtran.h index fbcfcb3..7015edb 100644 --- a/include/openbsc/osmo_bsc_sigtran.h +++ b/include/osmocom/msc/osmo_bsc_sigtran.h @@ -20,8 +20,8 @@ #pragma once -#include -#include +#include +#include /* Allocate resources to make a new connection oriented sigtran connection * (not the connection ittself!) */ diff --git a/include/openbsc/osmo_msc.h b/include/osmocom/msc/osmo_msc.h similarity index 98% rename from include/openbsc/osmo_msc.h rename to include/osmocom/msc/osmo_msc.h index cdfd27f..5f4713e 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/osmocom/msc/osmo_msc.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "bsc_api.h" diff --git a/include/openbsc/osmux.h b/include/osmocom/msc/osmux.h similarity index 100% rename from include/openbsc/osmux.h rename to include/osmocom/msc/osmux.h diff --git a/include/openbsc/paging.h b/include/osmocom/msc/paging.h similarity index 98% rename from include/openbsc/paging.h rename to include/osmocom/msc/paging.h index 049da14..b856dcd 100644 --- a/include/openbsc/paging.h +++ b/include/osmocom/msc/paging.h @@ -26,7 +26,7 @@ #include #include -#include +#include /** * A pending paging request diff --git a/include/openbsc/rest_octets.h b/include/osmocom/msc/rest_octets.h similarity index 98% rename from include/openbsc/rest_octets.h rename to include/osmocom/msc/rest_octets.h index 49a2312..49857b7 100644 --- a/include/openbsc/rest_octets.h +++ b/include/osmocom/msc/rest_octets.h @@ -2,7 +2,7 @@ #define _REST_OCTETS_H #include -#include +#include #include /* generate SI1 rest octets */ diff --git a/include/openbsc/rrlp.h b/include/osmocom/msc/rrlp.h similarity index 100% rename from include/openbsc/rrlp.h rename to include/osmocom/msc/rrlp.h diff --git a/include/openbsc/rs232.h b/include/osmocom/msc/rs232.h similarity index 100% rename from include/openbsc/rs232.h rename to include/osmocom/msc/rs232.h diff --git a/include/openbsc/rtp_proxy.h b/include/osmocom/msc/rtp_proxy.h similarity index 98% rename from include/openbsc/rtp_proxy.h rename to include/osmocom/msc/rtp_proxy.h index 52ffefd..3cd8cac 100644 --- a/include/openbsc/rtp_proxy.h +++ b/include/osmocom/msc/rtp_proxy.h @@ -27,7 +27,7 @@ #include #include -#include +#include #define RTP_PT_GSM_FULL 3 #define RTP_PT_GSM_HALF 96 diff --git a/include/openbsc/signal.h b/include/osmocom/msc/signal.h similarity index 99% rename from include/openbsc/signal.h rename to include/osmocom/msc/signal.h index 49f86d6..14c76f8 100644 --- a/include/openbsc/signal.h +++ b/include/osmocom/msc/signal.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include diff --git a/include/openbsc/silent_call.h b/include/osmocom/msc/silent_call.h similarity index 100% rename from include/openbsc/silent_call.h rename to include/osmocom/msc/silent_call.h diff --git a/include/openbsc/slhc.h b/include/osmocom/msc/slhc.h similarity index 100% rename from include/openbsc/slhc.h rename to include/osmocom/msc/slhc.h diff --git a/include/openbsc/smpp.h b/include/osmocom/msc/smpp.h similarity index 100% rename from include/openbsc/smpp.h rename to include/osmocom/msc/smpp.h diff --git a/include/openbsc/sms_queue.h b/include/osmocom/msc/sms_queue.h similarity index 100% rename from include/openbsc/sms_queue.h rename to include/osmocom/msc/sms_queue.h diff --git a/include/openbsc/socket.h b/include/osmocom/msc/socket.h similarity index 100% rename from include/openbsc/socket.h rename to include/osmocom/msc/socket.h diff --git a/include/openbsc/system_information.h b/include/osmocom/msc/system_information.h similarity index 94% rename from include/openbsc/system_information.h rename to include/osmocom/msc/system_information.h index 71bea26..854b7e3 100644 --- a/include/openbsc/system_information.h +++ b/include/osmocom/msc/system_information.h @@ -3,7 +3,7 @@ #include -#include +#include struct gsm_bts; diff --git a/include/openbsc/transaction.h b/include/osmocom/msc/transaction.h similarity index 94% rename from include/openbsc/transaction.h rename to include/osmocom/msc/transaction.h index 4930fbd..272fb3b 100644 --- a/include/openbsc/transaction.h +++ b/include/osmocom/msc/transaction.h @@ -1,11 +1,11 @@ #ifndef _TRANSACT_H #define _TRANSACT_H -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include diff --git a/include/openbsc/trau_mux.h b/include/osmocom/msc/trau_mux.h similarity index 97% rename from include/openbsc/trau_mux.h rename to include/osmocom/msc/trau_mux.h index 75c359b..08863bf 100644 --- a/include/openbsc/trau_mux.h +++ b/include/osmocom/msc/trau_mux.h @@ -29,8 +29,8 @@ */ #include -#include -#include +#include +#include struct decoded_trau_frame; diff --git a/include/openbsc/trau_upqueue.h b/include/osmocom/msc/trau_upqueue.h similarity index 100% rename from include/openbsc/trau_upqueue.h rename to include/osmocom/msc/trau_upqueue.h diff --git a/include/openbsc/ussd.h b/include/osmocom/msc/ussd.h similarity index 100% rename from include/openbsc/ussd.h rename to include/osmocom/msc/ussd.h diff --git a/include/openbsc/vlr.h b/include/osmocom/msc/vlr.h similarity index 99% rename from include/openbsc/vlr.h rename to include/osmocom/msc/vlr.h index 619971a..e9afde3 100644 --- a/include/openbsc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -7,9 +7,9 @@ #include #include #include -#include +#include // for GSM_NAME_LENGTH -#include +#include struct log_target; diff --git a/include/openbsc/vty.h b/include/osmocom/msc/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/msc/vty.h diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c0294c7..9a226ac 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index d6dff95..8a28b72 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -24,11 +24,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 1791687..cdefa09 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -25,10 +25,10 @@ #include #include -#include +#include -#include -#include +#include +#include struct cmd_node net_node = { GSMNET_NODE, diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 7157e00..6037dda 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,10 +23,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..612e215 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7be2240..f4f6e5d 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..9382889 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index 018ed21..58a6ff0 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index fd65e7b..b5f2e68 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -21,14 +21,14 @@ * */ -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index b6a8d6b..5576292 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include static struct gsup_client *g_gc; diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c index 5128ac1..39055ab 100644 --- a/src/libcommon/oap_client.c +++ b/src/libcommon/oap_client.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include int oap_client_init(struct oap_client_config *config, struct oap_client_state *state) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..2793bcf 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index e473b75..7a6000a 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -29,16 +29,16 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include /* A pointer to the GSM network we work with. By the current paradigm, * there can only be one gsm_network per MSC. The pointer is set once diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index e8a2293..1cd6723 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -25,13 +25,13 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #define IP_V4_ADDR_LEN 4 diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c index 9064ce6..7b5367b 100644 --- a/src/libmsc/auth.c +++ b/src/libmsc/auth.c @@ -20,10 +20,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index 9d1f0d4..7e445aa 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -21,11 +21,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/src/libmsc/db.c b/src/libmsc/db.c index ae7e287..4e4477b 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -29,12 +29,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 90a0431..2ef0b30 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -35,33 +35,33 @@ #include "bscconfig.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #include #include @@ -76,8 +76,8 @@ #include #endif -#include -#include +#include +#include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 574fe28..99adbf7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -43,21 +43,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef BUILD_SMPP #include "smpp_smsc.h" diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c index b529f4c..5f49574 100644 --- a/src/libmsc/gsm_04_14.c +++ b/src/libmsc/gsm_04_14.c @@ -26,12 +26,12 @@ #include "bscconfig.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index bec1d26..37e058c 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 09540c1..8bc060f 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -37,20 +37,20 @@ #ifdef BUILD_IU #include #else -#include +#include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param) diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index e9d335e..4191c5a 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,7 +26,7 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include +#include #include #include diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index 04b9ece..c89e412 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -26,12 +26,12 @@ #include #include -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index 45de1ca..abf1812 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -29,13 +29,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* To continue authorization after a Security Mode Complete */ int gsm0408_authorize(struct gsm_subscriber_connection *conn); diff --git a/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c index 1e7b4cd..3daebee 100644 --- a/src/libmsc/meas_feed.c +++ b/src/libmsc/meas_feed.c @@ -13,12 +13,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "meas_feed.h" diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 8110ead..4e88bc6 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -29,12 +29,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static const struct value_string mncc_names[] = { diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index ac6e734..84623df 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -27,14 +27,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include void *tall_call_ctx; diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 0c696f2..05c9439 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -35,9 +35,9 @@ #include #include -#include -#include -#include +#include +#include +#include struct mncc_sock_state { struct gsm_network *net; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 161a100..b191e0d 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -20,15 +20,15 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #include "../../bscconfig.h" @@ -39,7 +39,7 @@ uint16_t rtp_port, bool use_x213_nsap); #else -#include +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 50679aa..2f0f056 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -32,10 +32,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include static struct cmd_node msc_node = { MSC_NODE, diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 4d24f22..db24757 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -21,22 +21,22 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include #include "../../bscconfig.h" #ifdef BUILD_IU #include #else -#include +#include #endif /* Receive a SAPI-N-REJECT from BSC */ diff --git a/src/libmsc/rrlp.c b/src/libmsc/rrlp.c index cd3da06..7428893 100644 --- a/src/libmsc/rrlp.c +++ b/src/libmsc/rrlp.c @@ -21,10 +21,10 @@ -#include -#include -#include -#include +#include +#include +#include +#include /* RRLP msPositionReq, nsBased, * Accuracy=60, Method=gps, ResponseTime=2, oneSet */ diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index 7af7a80..5b19700 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -25,14 +25,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /* paging of the requested subscriber has completed */ static int paging_cb_silent(unsigned int hooknum, unsigned int event, diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 431cb4d..3ea5ddd 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -36,16 +36,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "smpp_smsc.h" diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 04afc49..88cecfc 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -41,8 +41,8 @@ #include "smpp_smsc.h" -#include -#include +#include +#include /*! \brief Ugly wrapper. libsmpp34 should do this itself! */ #define SMPP34_UNPACK(rc, type, str, data, len) \ diff --git a/src/libmsc/smpp_utils.c b/src/libmsc/smpp_utils.c index d0850d8..7208e25 100644 --- a/src/libmsc/smpp_utils.c +++ b/src/libmsc/smpp_utils.c @@ -19,7 +19,7 @@ #include "smpp_smsc.h" -#include +#include int smpp_determine_scheme(uint8_t dcs, uint8_t *data_coding, int *mode) diff --git a/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c index 13467f1..c0309d6 100644 --- a/src/libmsc/smpp_vty.c +++ b/src/libmsc/smpp_vty.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include "smpp_smsc.h" diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index fe7a608..609a0db 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -30,15 +30,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index bcab8e4..336637c 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -25,12 +25,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 28e0914..bac31a1 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -18,16 +18,16 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include void *tall_trans_ctx; diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index 81a3566..e3263d2 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -29,11 +29,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index b4c9450..484e9d5 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -31,30 +31,30 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include "meas_feed.h" diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a5ea0f6..a9aacbd 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -25,10 +25,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index f9ed0b5..9d9e4c1 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c index 0eb86e7..1c9e191 100644 --- a/src/libvlr/vlr_auth_fsm.c +++ b/src/libvlr/vlr_auth_fsm.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h index 0e63c7e..6ca54e8 100644 --- a/src/libvlr/vlr_core.h +++ b/src/libvlr/vlr_core.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #define LOGGSUPP(level, gsup, fmt, args...) \ LOGP(DVLR, level, "GSUP(%s) " fmt, \ diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index 94bea56..c9223f8 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 30b11d9..41dfedb 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -37,32 +37,32 @@ /* build switches from the configure script */ #include "../../bscconfig.h" -#include +#include #include #include #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -70,10 +70,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include static const char * const osmomsc_copyright = "OsmoMSC - Osmocom Circuit-Switched Core Network implementation\r\n" diff --git a/src/utils/meas_db.c b/src/utils/meas_db.c index d81efca..8cf27df 100644 --- a/src/utils/meas_db.c +++ b/src/utils/meas_db.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_json.c b/src/utils/meas_json.c index 51eb6c7..8db7791 100644 --- a/src/utils/meas_json.c +++ b/src/utils/meas_json.c @@ -37,9 +37,9 @@ #include -#include -#include -#include +#include +#include +#include static void print_meas_rep_uni_json(struct gsm_meas_rep_unidir *mru) { diff --git a/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c index b874ac4..0644521 100644 --- a/src/utils/meas_pcap2db.c +++ b/src/utils/meas_pcap2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include diff --git a/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c index 5032d0c..c2b5ace 100644 --- a/src/utils/meas_udp2db.c +++ b/src/utils/meas_udp2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 77194de..5efb300 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -16,7 +16,7 @@ #include -#include +#include struct ms_state_uni { CDKSLIDER *cdk; diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index c570505..248396a 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -18,7 +18,7 @@ #include #include -#include +#include /* FIXME: merge with smpp_smsc.c */ #define SMPP_SYS_ID_LEN 16 diff --git a/tests/db/db_test.c b/tests/db/db_test.c index a0c1e79..63099f6 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -18,11 +18,11 @@ * */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 4b10e49..d05aa29 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -30,15 +30,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include #if BUILD_IU -#include +#include #include #else -#include +#include #endif #include "msc_vlr_tests.h" diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h index c2c5a58..1cd3914 100644 --- a/tests/msc_vlr/msc_vlr_tests.h +++ b/tests/msc_vlr/msc_vlr_tests.h @@ -26,9 +26,9 @@ #include #include -#include -#include -#include +#include +#include +#include extern bool _log_lines; #define _log(fmt, args...) do { \ diff --git a/tests/smpp/smpp_test.c b/tests/smpp/smpp_test.c index 62fa9d2..5f5f2d6 100644 --- a/tests/smpp/smpp_test.c +++ b/tests/smpp/smpp_test.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c index af25b06..0d073db 100644 --- a/tests/sms_queue/sms_queue_test.c +++ b/tests/sms_queue/sms_queue_test.c @@ -23,8 +23,8 @@ #include -#include -#include +#include +#include static void *talloc_ctx = NULL; -- To view, visit https://gerrit.osmocom.org/3811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:43:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:43:17 +0000 Subject: [PATCH] osmo-msc[master]: use separated libosmo-mgcp-client, apply rename to mgcp_clie... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3787 to look at the new patch set (#4). use separated libosmo-mgcp-client, apply rename to mgcp_client_* After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*. Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is used to contact the MGW (Media Gateway). Depends: I8e0b2d2a399b77086a36606f5e427271c6242df1 (osmo-mgw) I99f7faab637cfcc22ece64a1dbcbe590f2042187 (osmo-mgw) Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d --- M configure.ac M include/osmocom/msc/gsm_data.h M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 11 files changed, 41 insertions(+), 69 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3787/4 diff --git a/configure.ac b/configure.ac index dd61e52..8f8bdb9 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -125,33 +125,6 @@ COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" AC_SUBST([COVERAGE_CFLAGS]) AC_SUBST([COVERAGE_LDFLAGS]) -fi - -AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ - AC_CACHE_CHECK( - [whether libosmo-legacy-mgcp needs -lgsm], - libosmo_cv_legacy_mgcp_needs_libgsm, [ - SAVE_LDFLAGS="${LDFLAGS}" - LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([ - #include - ], [ - mgcpgw_client_init(0, 0); - ])], - [libosmo_cv_legacy_mgcp_needs_libgsm=no], - [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) - LDFLAGS="${SAVE_LDFLAGS}" - ]) - ]) -CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM -if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], - [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi fi AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 9343c31..5d3d5ca 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include /** annotations for msgb ownership */ @@ -486,9 +486,9 @@ uint8_t t3212; struct { - struct mgcpgw_client_conf conf; - struct mgcpgw_client *client; - } mgcpgw; + struct mgcp_client_conf conf; + struct mgcp_client *client; + } mgw; struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 7a6000a..3d2013e 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -401,7 +401,7 @@ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcpgw_client_remote_addr_n(gsm_network->mgcpgw.client)); + rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 1cd6723..34d03e3 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -557,7 +557,7 @@ { struct gsm_network *network = a_conn_info->network; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct tlv_parsed tp; struct sockaddr_storage rtp_addr; struct sockaddr_in *rtp_addr_in; @@ -567,7 +567,7 @@ if (!conn) goto fail; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; OSMO_ASSERT(mgcp); LOGP(DMSC, LOGL_NOTICE, "BSC sends assignment complete message (conn_id=%i)\n", conn->a.conn_id); diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 2ef0b30..84f52c6 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -2667,7 +2667,7 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcpgw_client_remote_addr_n(net->mgcpgw.client); + uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); uint16_t port = trans->conn->rtp.port_cn; /* FIXME: This has to be set to some meaningful value, diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index b191e0d..7a04153 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -192,7 +192,7 @@ conn->rtp.port_cn = r->audio_port; - rtp_ip = mgcpgw_client_remote_addr_n(conn->network->mgcpgw.client); + rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ @@ -222,7 +222,7 @@ int msc_call_assignment(struct gsm_trans *trans) { struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; uint16_t bts_base; @@ -232,7 +232,7 @@ return -EINVAL; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; #ifdef BUILD_IU /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ @@ -242,14 +242,14 @@ #endif conn->rtp.mgcp_rtp_endpoint = - mgcpgw_client_next_endpoint(conn->network->mgcpgw.client); + mgcp_client_next_endpoint(conn->network->mgw.client); /* This will calculate the port we assign to the BTS via AoIP * assignment command (or rab-assignment on 3G) The BTS will send * its RTP traffic to that port on the MGCPGW side. The MGCPGW only * gets the endpoint ID via the CRCX. It will do the same calculation * on his side too to get knowledge of the rtp port. */ - bts_base = mgcpgw_client_conf_actual(mgcp)->bts_base; + bts_base = mgcp_client_conf_actual(mgcp)->bts_base; conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; /* Establish the RTP stream first as looping back to the originator. @@ -257,7 +257,7 @@ * tone instead. */ msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcpgw_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); + return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); } static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); @@ -268,7 +268,7 @@ { struct gsm_subscriber_connection *conn1 = from->conn; struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcpgw_client *mgcp = conn1->network->mgcpgw.client; + struct mgcp_client *mgcp = conn1->network->mgw.client; const char *ip; struct msgb *msg; @@ -278,13 +278,13 @@ from->bridge.state = state; /* Loop back to the same MGCP GW */ - ip = mgcpgw_client_remote_addr_str(mgcp); + ip = mgcp_client_remote_addr_str(mgcp); msg = mgcp_msg_mdcx(mgcp, conn1->rtp.mgcp_rtp_endpoint, ip, conn2->rtp.port_cn, mode); - if (mgcpgw_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) + if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(from->vsub)); @@ -346,7 +346,7 @@ * is in use */ struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; if (!trans) @@ -355,10 +355,10 @@ return -EINVAL; if (!trans->conn->network) return -EINVAL; - if (!trans->conn->network->mgcpgw.client) + if (!trans->conn->network->mgw.client) return -EINVAL; - mgcp = trans->conn->network->mgcpgw.client; + mgcp = trans->conn->network->mgw.client; struct in_addr ip_addr; ip_addr.s_addr = ntohl(ip); @@ -368,7 +368,7 @@ msg = mgcp_msg_mdcx(mgcp, conn->rtp.mgcp_rtp_endpoint, inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcpgw_client_tx(mgcp, msg, NULL, trans)) + if (mgcp_client_tx(mgcp, msg, NULL, trans)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(trans->vsub)); @@ -398,7 +398,7 @@ { struct msgb *msg; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; if (!trans) return; @@ -408,16 +408,16 @@ return; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; /* Send DLCX */ msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint); - if (mgcpgw_client_tx(mgcp, msg, NULL, NULL)) + if (mgcp_client_tx(mgcp, msg, NULL, NULL)) LOGP(DMGCP, LOGL_ERROR, "Failed to send DLCX message for %s\n", vlr_subscr_name(trans->vsub)); /* Release endpoint id */ - mgcpgw_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); + mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 2f0f056..5c9539d 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -101,7 +101,7 @@ vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); - mgcpgw_client_config_write(vty, " "); + mgcp_client_config_write(vty, " "); #ifdef BUILD_IU ranap_iu_vty_config_write(vty, " "); #endif @@ -155,7 +155,7 @@ install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd); - mgcpgw_client_vty_init(msc_network, MSC_NODE, &msc_network->mgcpgw.conf); + mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf); #ifdef BUILD_IU ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index a26b4bd..85a5a5a 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -17,7 +17,7 @@ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -45,8 +45,7 @@ $(LIBSMPP34_LIBS) \ $(LIBCRYPTO_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBRARY_GSM) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ -ldbi \ $(NULL) if BUILD_IU diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 41dfedb..75ba19c 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -64,7 +64,7 @@ #include #include #include -#include +#include #ifdef BUILD_IU #include @@ -251,7 +251,7 @@ MSC_HLR_REMOTE_IP_DEFAULT); net->gsup_server_port = MSC_HLR_REMOTE_PORT_DEFAULT; - mgcpgw_client_conf_init(&net->mgcpgw.conf); + mgcp_client_conf_init(&net->mgw.conf); return net; } @@ -553,10 +553,10 @@ if (sms_queue_start(msc_network, 20) != 0) return -1; - msc_network->mgcpgw.client = mgcpgw_client_init( - msc_network, &msc_network->mgcpgw.conf); + msc_network->mgw.client = mgcp_client_init( + msc_network, &msc_network->mgw.conf); - if (mgcpgw_client_connect(msc_network->mgcpgw.client)) { + if (mgcp_client_connect(msc_network->mgw.client)) { printf("MGCPGW connect failed\n"); return 7; } diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index fb4857f..aa2b3fe 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -15,7 +15,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1d3b9da..1f8ee7b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -14,7 +14,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) EXTRA_DIST = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ -- To view, visit https://gerrit.osmocom.org/3787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:43:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:43:59 +0000 Subject: [MERGED] osmo-bsc[master]: move include/openbsc to include/osmocom/bsc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move include/openbsc to include/osmocom/bsc ...................................................................... move include/openbsc to include/osmocom/bsc Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 --- M configure.ac M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/bsc/Makefile.am R include/osmocom/bsc/a_reset.h R include/osmocom/bsc/abis_nm.h R include/osmocom/bsc/abis_om2000.h R include/osmocom/bsc/abis_rsl.h R include/osmocom/bsc/arfcn_range_encode.h R include/osmocom/bsc/auth.h R include/osmocom/bsc/bsc_api.h R include/osmocom/bsc/bsc_msc.h R include/osmocom/bsc/bsc_msc_data.h R include/osmocom/bsc/bsc_msg_filter.h R include/osmocom/bsc/bsc_nat.h R include/osmocom/bsc/bsc_nat_callstats.h R include/osmocom/bsc/bsc_nat_sccp.h R include/osmocom/bsc/bsc_rll.h R include/osmocom/bsc/bsc_subscriber.h R include/osmocom/bsc/bss.h R include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h R include/osmocom/bsc/chan_alloc.h R include/osmocom/bsc/common.h R include/osmocom/bsc/common_bsc.h R include/osmocom/bsc/common_cs.h R include/osmocom/bsc/crc24.h R include/osmocom/bsc/ctrl.h R include/osmocom/bsc/debug.h R include/osmocom/bsc/e1_config.h R include/osmocom/bsc/gsm_04_08_utils.h R include/osmocom/bsc/gsm_04_80.h R include/osmocom/bsc/gsm_data.h R include/osmocom/bsc/gsm_data_shared.h R include/osmocom/bsc/gsm_subscriber.h R include/osmocom/bsc/handover.h R include/osmocom/bsc/handover_decision.h R include/osmocom/bsc/ipaccess.h R include/osmocom/bsc/iu_dummy.h R include/osmocom/bsc/meas_feed.h R include/osmocom/bsc/meas_rep.h R include/osmocom/bsc/misdn.h R include/osmocom/bsc/mncc.h R include/osmocom/bsc/mncc_int.h R include/osmocom/bsc/msc_ifaces.h R include/osmocom/bsc/nat_rewrite_trie.h R include/osmocom/bsc/network_listen.h R include/osmocom/bsc/openbscdefines.h R include/osmocom/bsc/osmo_bsc.h R include/osmocom/bsc/osmo_bsc_grace.h R include/osmocom/bsc/osmo_bsc_reset.h R include/osmocom/bsc/osmo_bsc_rf.h R include/osmocom/bsc/osmo_bsc_sigtran.h R include/osmocom/bsc/osmo_msc.h R include/osmocom/bsc/osmux.h R include/osmocom/bsc/paging.h R include/osmocom/bsc/pcu_if.h R include/osmocom/bsc/pcuif_proto.h R include/osmocom/bsc/rest_octets.h R include/osmocom/bsc/rrlp.h R include/osmocom/bsc/rs232.h R include/osmocom/bsc/rtp_proxy.h R include/osmocom/bsc/sgsn.h R include/osmocom/bsc/signal.h R include/osmocom/bsc/silent_call.h R include/osmocom/bsc/smpp.h R include/osmocom/bsc/sms_queue.h R include/osmocom/bsc/socket.h R include/osmocom/bsc/system_information.h R include/osmocom/bsc/transaction.h R include/osmocom/bsc/trau_mux.h R include/osmocom/bsc/trau_upqueue.h R include/osmocom/bsc/ussd.h R include/osmocom/bsc/vty.h M src/ipaccess/abisip-find.c M src/ipaccess/ipaccess-config.c M src/ipaccess/ipaccess-firmware.c M src/ipaccess/ipaccess-proxy.c M src/ipaccess/network_listen.c M src/libbsc/abis_nm.c M src/libbsc/abis_nm_vty.c M src/libbsc/abis_om2000.c M src/libbsc/abis_om2000_vty.c M src/libbsc/abis_rsl.c M src/libbsc/arfcn_range_encode.c M src/libbsc/bsc_api.c M src/libbsc/bsc_ctrl_commands.c M src/libbsc/bsc_ctrl_lookup.c M src/libbsc/bsc_dyn_ts.c M src/libbsc/bsc_init.c M src/libbsc/bsc_msc.c M src/libbsc/bsc_rf_ctrl.c M src/libbsc/bsc_rll.c M src/libbsc/bsc_subscriber.c M src/libbsc/bsc_vty.c M src/libbsc/bts_ericsson_rbs2000.c M src/libbsc/bts_init.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/bts_ipaccess_nanobts_omlattr.c M src/libbsc/bts_nokia_site.c M src/libbsc/bts_siemens_bs11.c M src/libbsc/bts_sysmobts.c M src/libbsc/bts_unknown.c M src/libbsc/chan_alloc.c M src/libbsc/e1_config.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/gsm_04_80_utils.c M src/libbsc/handover_decision.c M src/libbsc/handover_logic.c M src/libbsc/meas_proc.c M src/libbsc/meas_rep.c M src/libbsc/net_init.c M src/libbsc/paging.c M src/libbsc/pcu_sock.c M src/libbsc/rest_octets.c M src/libbsc/system_information.c M src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/socket.c M src/libfilter/bsc_msg_acc.c M src/libfilter/bsc_msg_filter.c M src/libfilter/bsc_msg_vty.c M src/libtrau/rtp_proxy.c M src/libtrau/trau_mux.c M src/libtrau/trau_upqueue.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c M src/osmo-bsc/osmo_bsc_reset.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_nat/bsc_filter.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_filter.c M src/osmo-bsc_nat/bsc_nat_rewrite.c M src/osmo-bsc_nat/bsc_nat_rewrite_trie.c M src/osmo-bsc_nat/bsc_nat_utils.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_sccp.c M src/osmo-bsc_nat/bsc_ussd.c M src/utils/bs11_config.c M src/utils/meas_db.c M src/utils/meas_json.c M src/utils/meas_pcap2db.c M src/utils/meas_udp2db.c M src/utils/meas_vis.c M tests/abis/abis_test.c M tests/bsc-nat-trie/bsc_nat_trie_test.c M tests/bsc-nat/bsc_nat_test.c M tests/bsc/bsc_test.c M tests/channel/channel_test.c M tests/gsm0408/gsm0408_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c M tests/subscr/bsc_subscr_test.c M tests/trau/trau_test.c 167 files changed, 515 insertions(+), 511 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 8107047..930d1d3 100644 --- a/configure.ac +++ b/configure.ac @@ -126,8 +126,9 @@ AC_OUTPUT( osmo-bsc.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/bsc/Makefile src/Makefile src/libtrau/Makefile src/libbsc/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 3234e62..740e088 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) noinst_HEADERS = \ diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..cf24c62 --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + bsc \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/bsc/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/bsc/Makefile.am diff --git a/include/openbsc/a_reset.h b/include/osmocom/bsc/a_reset.h similarity index 100% rename from include/openbsc/a_reset.h rename to include/osmocom/bsc/a_reset.h diff --git a/include/openbsc/abis_nm.h b/include/osmocom/bsc/abis_nm.h similarity index 99% rename from include/openbsc/abis_nm.h rename to include/osmocom/bsc/abis_nm.h index db2a659..34f16a9 100644 --- a/include/openbsc/abis_nm.h +++ b/include/osmocom/bsc/abis_nm.h @@ -26,7 +26,7 @@ #include #include -#include +#include /* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ #define MAX_BTS_ATTR 5 diff --git a/include/openbsc/abis_om2000.h b/include/osmocom/bsc/abis_om2000.h similarity index 100% rename from include/openbsc/abis_om2000.h rename to include/osmocom/bsc/abis_om2000.h diff --git a/include/openbsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h similarity index 100% rename from include/openbsc/abis_rsl.h rename to include/osmocom/bsc/abis_rsl.h diff --git a/include/openbsc/arfcn_range_encode.h b/include/osmocom/bsc/arfcn_range_encode.h similarity index 100% rename from include/openbsc/arfcn_range_encode.h rename to include/osmocom/bsc/arfcn_range_encode.h diff --git a/include/openbsc/auth.h b/include/osmocom/bsc/auth.h similarity index 100% rename from include/openbsc/auth.h rename to include/osmocom/bsc/auth.h diff --git a/include/openbsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h similarity index 100% rename from include/openbsc/bsc_api.h rename to include/osmocom/bsc/bsc_api.h diff --git a/include/openbsc/bsc_msc.h b/include/osmocom/bsc/bsc_msc.h similarity index 98% rename from include/openbsc/bsc_msc.h rename to include/osmocom/bsc/bsc_msc.h index 380eb17..ceaea53 100644 --- a/include/openbsc/bsc_msc.h +++ b/include/osmocom/bsc/bsc_msc.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/include/openbsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h similarity index 100% rename from include/openbsc/bsc_msc_data.h rename to include/osmocom/bsc/bsc_msc_data.h diff --git a/include/openbsc/bsc_msg_filter.h b/include/osmocom/bsc/bsc_msg_filter.h similarity index 100% rename from include/openbsc/bsc_msg_filter.h rename to include/osmocom/bsc/bsc_msg_filter.h diff --git a/include/openbsc/bsc_nat.h b/include/osmocom/bsc/bsc_nat.h similarity index 100% rename from include/openbsc/bsc_nat.h rename to include/osmocom/bsc/bsc_nat.h diff --git a/include/openbsc/bsc_nat_callstats.h b/include/osmocom/bsc/bsc_nat_callstats.h similarity index 100% rename from include/openbsc/bsc_nat_callstats.h rename to include/osmocom/bsc/bsc_nat_callstats.h diff --git a/include/openbsc/bsc_nat_sccp.h b/include/osmocom/bsc/bsc_nat_sccp.h similarity index 100% rename from include/openbsc/bsc_nat_sccp.h rename to include/osmocom/bsc/bsc_nat_sccp.h diff --git a/include/openbsc/bsc_rll.h b/include/osmocom/bsc/bsc_rll.h similarity index 92% rename from include/openbsc/bsc_rll.h rename to include/osmocom/bsc/bsc_rll.h index 729ba60..3afe4a8 100644 --- a/include/openbsc/bsc_rll.h +++ b/include/osmocom/bsc/bsc_rll.h @@ -1,7 +1,7 @@ #ifndef _BSC_RLL_H #define _BSC_RLL_H -#include +#include enum bsc_rllr_ind { BSC_RLLR_IND_EST_CONF, diff --git a/include/openbsc/bsc_subscriber.h b/include/osmocom/bsc/bsc_subscriber.h similarity index 100% rename from include/openbsc/bsc_subscriber.h rename to include/osmocom/bsc/bsc_subscriber.h diff --git a/include/openbsc/bss.h b/include/osmocom/bsc/bss.h similarity index 93% rename from include/openbsc/bss.h rename to include/osmocom/bsc/bss.h index 9f16bf7..b12487d 100644 --- a/include/openbsc/bss.h +++ b/include/osmocom/bsc/bss.h @@ -1,7 +1,7 @@ #ifndef _BSS_H_ #define _BSS_H_ -#include +#include struct msgb; diff --git a/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/osmocom/bsc/bts_ipaccess_nanobts_omlattr.h diff --git a/include/openbsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h similarity index 100% rename from include/openbsc/chan_alloc.h rename to include/osmocom/bsc/chan_alloc.h diff --git a/include/openbsc/common.h b/include/osmocom/bsc/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/bsc/common.h diff --git a/include/openbsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h similarity index 83% rename from include/openbsc/common_bsc.h rename to include/osmocom/bsc/common_bsc.h index 7960383..08394e9 100644 --- a/include/openbsc/common_bsc.h +++ b/include/osmocom/bsc/common_bsc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/include/openbsc/common_cs.h b/include/osmocom/bsc/common_cs.h similarity index 100% rename from include/openbsc/common_cs.h rename to include/osmocom/bsc/common_cs.h diff --git a/include/openbsc/crc24.h b/include/osmocom/bsc/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/bsc/crc24.h diff --git a/include/openbsc/ctrl.h b/include/osmocom/bsc/ctrl.h similarity index 100% rename from include/openbsc/ctrl.h rename to include/osmocom/bsc/ctrl.h diff --git a/include/openbsc/debug.h b/include/osmocom/bsc/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/bsc/debug.h diff --git a/include/openbsc/e1_config.h b/include/osmocom/bsc/e1_config.h similarity index 83% rename from include/openbsc/e1_config.h rename to include/osmocom/bsc/e1_config.h index 538c0b0..909e3cc 100644 --- a/include/openbsc/e1_config.h +++ b/include/osmocom/bsc/e1_config.h @@ -1,7 +1,7 @@ #ifndef _E1_CONFIG_H #define _E1_CONFIG_H -#include +#include int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); int e1_reconfig_trx(struct gsm_bts_trx *trx); diff --git a/include/openbsc/gsm_04_08_utils.h b/include/osmocom/bsc/gsm_04_08_utils.h similarity index 100% rename from include/openbsc/gsm_04_08_utils.h rename to include/osmocom/bsc/gsm_04_08_utils.h diff --git a/include/openbsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h similarity index 100% rename from include/openbsc/gsm_04_80.h rename to include/osmocom/bsc/gsm_04_80.h diff --git a/include/openbsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h similarity index 99% rename from include/openbsc/gsm_data.h rename to include/osmocom/bsc/gsm_data.h index 74970b9..ef041d6 100644 --- a/include/openbsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -14,9 +14,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h similarity index 99% rename from include/openbsc/gsm_data_shared.h rename to include/osmocom/bsc/gsm_data_shared.h index bef4504..6ce571e 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -24,8 +24,8 @@ #include #endif -#include -#include +#include +#include /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ diff --git a/include/openbsc/gsm_subscriber.h b/include/osmocom/bsc/gsm_subscriber.h similarity index 97% rename from include/openbsc/gsm_subscriber.h rename to include/osmocom/bsc/gsm_subscriber.h index d88e32a..ca66d47 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/osmocom/bsc/gsm_subscriber.h @@ -6,7 +6,7 @@ #include #include -#include +#include #define GSM_NAME_LENGTH 160 diff --git a/include/openbsc/handover.h b/include/osmocom/bsc/handover.h similarity index 100% rename from include/openbsc/handover.h rename to include/osmocom/bsc/handover.h diff --git a/include/openbsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h similarity index 100% rename from include/openbsc/handover_decision.h rename to include/osmocom/bsc/handover_decision.h diff --git a/include/openbsc/ipaccess.h b/include/osmocom/bsc/ipaccess.h similarity index 100% rename from include/openbsc/ipaccess.h rename to include/osmocom/bsc/ipaccess.h diff --git a/include/openbsc/iu_dummy.h b/include/osmocom/bsc/iu_dummy.h similarity index 100% rename from include/openbsc/iu_dummy.h rename to include/osmocom/bsc/iu_dummy.h diff --git a/include/openbsc/meas_feed.h b/include/osmocom/bsc/meas_feed.h similarity index 95% rename from include/openbsc/meas_feed.h rename to include/osmocom/bsc/meas_feed.h index f77ee07..55bce09 100644 --- a/include/openbsc/meas_feed.h +++ b/include/osmocom/bsc/meas_feed.h @@ -3,7 +3,7 @@ #include -#include +#include struct meas_feed_hdr { uint8_t msg_type; diff --git a/include/openbsc/meas_rep.h b/include/osmocom/bsc/meas_rep.h similarity index 100% rename from include/openbsc/meas_rep.h rename to include/osmocom/bsc/meas_rep.h diff --git a/include/openbsc/misdn.h b/include/osmocom/bsc/misdn.h similarity index 100% rename from include/openbsc/misdn.h rename to include/osmocom/bsc/misdn.h diff --git a/include/openbsc/mncc.h b/include/osmocom/bsc/mncc.h similarity index 100% rename from include/openbsc/mncc.h rename to include/osmocom/bsc/mncc.h diff --git a/include/openbsc/mncc_int.h b/include/osmocom/bsc/mncc_int.h similarity index 100% rename from include/openbsc/mncc_int.h rename to include/osmocom/bsc/mncc_int.h diff --git a/include/openbsc/msc_ifaces.h b/include/osmocom/bsc/msc_ifaces.h similarity index 97% rename from include/openbsc/msc_ifaces.h rename to include/osmocom/bsc/msc_ifaces.h index a1071ae..dadb828 100644 --- a/include/openbsc/msc_ifaces.h +++ b/include/osmocom/bsc/msc_ifaces.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/openbsc/nat_rewrite_trie.h b/include/osmocom/bsc/nat_rewrite_trie.h similarity index 100% rename from include/openbsc/nat_rewrite_trie.h rename to include/osmocom/bsc/nat_rewrite_trie.h diff --git a/include/openbsc/network_listen.h b/include/osmocom/bsc/network_listen.h similarity index 92% rename from include/openbsc/network_listen.h rename to include/osmocom/bsc/network_listen.h index 67d1f4e..68d0709 100644 --- a/include/openbsc/network_listen.h +++ b/include/osmocom/bsc/network_listen.h @@ -2,7 +2,7 @@ #define _OPENBSC_NWL_H #include -#include +#include void ipac_nwl_init(void); diff --git a/include/openbsc/openbscdefines.h b/include/osmocom/bsc/openbscdefines.h similarity index 100% rename from include/openbsc/openbscdefines.h rename to include/osmocom/bsc/openbscdefines.h diff --git a/include/openbsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h similarity index 100% rename from include/openbsc/osmo_bsc.h rename to include/osmocom/bsc/osmo_bsc.h diff --git a/include/openbsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h similarity index 94% rename from include/openbsc/osmo_bsc_grace.h rename to include/osmocom/bsc/osmo_bsc_grace.h index 5a81cd1..b7950ce 100644 --- a/include/openbsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -21,8 +21,8 @@ #ifndef OSMO_BSC_GRACE_H #define OSMO_BSC_GRACE_H -#include -#include +#include +#include struct bsc_msc_data; diff --git a/include/openbsc/osmo_bsc_reset.h b/include/osmocom/bsc/osmo_bsc_reset.h similarity index 100% rename from include/openbsc/osmo_bsc_reset.h rename to include/osmocom/bsc/osmo_bsc_reset.h diff --git a/include/openbsc/osmo_bsc_rf.h b/include/osmocom/bsc/osmo_bsc_rf.h similarity index 97% rename from include/openbsc/osmo_bsc_rf.h rename to include/osmocom/bsc/osmo_bsc_rf.h index 19ccd08..56ac980 100644 --- a/include/openbsc/osmo_bsc_rf.h +++ b/include/osmocom/bsc/osmo_bsc_rf.h @@ -1,7 +1,7 @@ #ifndef OSMO_BSC_RF #define OSMO_BSC_RF -#include +#include #include #include diff --git a/include/openbsc/osmo_bsc_sigtran.h b/include/osmocom/bsc/osmo_bsc_sigtran.h similarity index 95% rename from include/openbsc/osmo_bsc_sigtran.h rename to include/osmocom/bsc/osmo_bsc_sigtran.h index fbcfcb3..8964903 100644 --- a/include/openbsc/osmo_bsc_sigtran.h +++ b/include/osmocom/bsc/osmo_bsc_sigtran.h @@ -20,8 +20,8 @@ #pragma once -#include -#include +#include +#include /* Allocate resources to make a new connection oriented sigtran connection * (not the connection ittself!) */ diff --git a/include/openbsc/osmo_msc.h b/include/osmocom/bsc/osmo_msc.h similarity index 98% rename from include/openbsc/osmo_msc.h rename to include/osmocom/bsc/osmo_msc.h index cdfd27f..c08cb26 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/osmocom/bsc/osmo_msc.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "bsc_api.h" diff --git a/include/openbsc/osmux.h b/include/osmocom/bsc/osmux.h similarity index 100% rename from include/openbsc/osmux.h rename to include/osmocom/bsc/osmux.h diff --git a/include/openbsc/paging.h b/include/osmocom/bsc/paging.h similarity index 96% rename from include/openbsc/paging.h rename to include/osmocom/bsc/paging.h index 7dd8500..e917772 100644 --- a/include/openbsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include /** * A pending paging request diff --git a/include/openbsc/pcu_if.h b/include/osmocom/bsc/pcu_if.h similarity index 100% rename from include/openbsc/pcu_if.h rename to include/osmocom/bsc/pcu_if.h diff --git a/include/openbsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h similarity index 100% rename from include/openbsc/pcuif_proto.h rename to include/osmocom/bsc/pcuif_proto.h diff --git a/include/openbsc/rest_octets.h b/include/osmocom/bsc/rest_octets.h similarity index 100% rename from include/openbsc/rest_octets.h rename to include/osmocom/bsc/rest_octets.h diff --git a/include/openbsc/rrlp.h b/include/osmocom/bsc/rrlp.h similarity index 100% rename from include/openbsc/rrlp.h rename to include/osmocom/bsc/rrlp.h diff --git a/include/openbsc/rs232.h b/include/osmocom/bsc/rs232.h similarity index 100% rename from include/openbsc/rs232.h rename to include/osmocom/bsc/rs232.h diff --git a/include/openbsc/rtp_proxy.h b/include/osmocom/bsc/rtp_proxy.h similarity index 98% rename from include/openbsc/rtp_proxy.h rename to include/osmocom/bsc/rtp_proxy.h index 52ffefd..918420c 100644 --- a/include/openbsc/rtp_proxy.h +++ b/include/osmocom/bsc/rtp_proxy.h @@ -27,7 +27,7 @@ #include #include -#include +#include #define RTP_PT_GSM_FULL 3 #define RTP_PT_GSM_HALF 96 diff --git a/include/openbsc/sgsn.h b/include/osmocom/bsc/sgsn.h similarity index 97% rename from include/openbsc/sgsn.h rename to include/osmocom/bsc/sgsn.h index f371dc6..f71b649 100644 --- a/include/openbsc/sgsn.h +++ b/include/osmocom/bsc/sgsn.h @@ -5,9 +5,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/signal.h b/include/osmocom/bsc/signal.h similarity index 99% rename from include/openbsc/signal.h rename to include/osmocom/bsc/signal.h index 49f86d6..feab246 100644 --- a/include/openbsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include diff --git a/include/openbsc/silent_call.h b/include/osmocom/bsc/silent_call.h similarity index 100% rename from include/openbsc/silent_call.h rename to include/osmocom/bsc/silent_call.h diff --git a/include/openbsc/smpp.h b/include/osmocom/bsc/smpp.h similarity index 100% rename from include/openbsc/smpp.h rename to include/osmocom/bsc/smpp.h diff --git a/include/openbsc/sms_queue.h b/include/osmocom/bsc/sms_queue.h similarity index 100% rename from include/openbsc/sms_queue.h rename to include/osmocom/bsc/sms_queue.h diff --git a/include/openbsc/socket.h b/include/osmocom/bsc/socket.h similarity index 100% rename from include/openbsc/socket.h rename to include/osmocom/bsc/socket.h diff --git a/include/openbsc/system_information.h b/include/osmocom/bsc/system_information.h similarity index 94% rename from include/openbsc/system_information.h rename to include/osmocom/bsc/system_information.h index 71bea26..29f639d 100644 --- a/include/openbsc/system_information.h +++ b/include/osmocom/bsc/system_information.h @@ -3,7 +3,7 @@ #include -#include +#include struct gsm_bts; diff --git a/include/openbsc/transaction.h b/include/osmocom/bsc/transaction.h similarity index 95% rename from include/openbsc/transaction.h rename to include/osmocom/bsc/transaction.h index 1e93fff..5465548 100644 --- a/include/openbsc/transaction.h +++ b/include/osmocom/bsc/transaction.h @@ -1,10 +1,10 @@ #ifndef _TRANSACT_H #define _TRANSACT_H -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/include/openbsc/trau_mux.h b/include/osmocom/bsc/trau_mux.h similarity index 97% rename from include/openbsc/trau_mux.h rename to include/osmocom/bsc/trau_mux.h index 75c359b..eeceff5 100644 --- a/include/openbsc/trau_mux.h +++ b/include/osmocom/bsc/trau_mux.h @@ -29,8 +29,8 @@ */ #include -#include -#include +#include +#include struct decoded_trau_frame; diff --git a/include/openbsc/trau_upqueue.h b/include/osmocom/bsc/trau_upqueue.h similarity index 100% rename from include/openbsc/trau_upqueue.h rename to include/osmocom/bsc/trau_upqueue.h diff --git a/include/openbsc/ussd.h b/include/osmocom/bsc/ussd.h similarity index 100% rename from include/openbsc/ussd.h rename to include/osmocom/bsc/ussd.h diff --git a/include/openbsc/vty.h b/include/osmocom/bsc/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/bsc/vty.h diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c index 21d9f22..c459161 100644 --- a/src/ipaccess/abisip-find.c +++ b/src/ipaccess/abisip-find.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include static int udp_sock(const char *ifname) { diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index 6822c06..c68e3ea 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -37,19 +37,19 @@ #include #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/ipaccess/ipaccess-firmware.c b/src/ipaccess/ipaccess-firmware.c index 5f55bb5..515cc75 100644 --- a/src/ipaccess/ipaccess-firmware.c +++ b/src/ipaccess/ipaccess-firmware.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c index d367442..b45b543 100644 --- a/src/ipaccess/ipaccess-proxy.c +++ b/src/ipaccess/ipaccess-proxy.c @@ -37,7 +37,7 @@ #define _GNU_SOURCE #include -#include +#include #include #include #include @@ -45,9 +45,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include /* one instance of an ip.access protocol proxy */ diff --git a/src/ipaccess/network_listen.c b/src/ipaccess/network_listen.c index 3b44ceb..dd6cb4b 100644 --- a/src/ipaccess/network_listen.c +++ b/src/ipaccess/network_listen.c @@ -33,10 +33,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #define WHITELIST_MAX_SIZE ((NUM_ARFCNS*2)+2+1) diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index cf20d7c..3a48dee 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -34,17 +34,17 @@ #include #include -#include -#include +#include +#include #include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include #define OM_ALLOC_SIZE 1024 diff --git a/src/libbsc/abis_nm_vty.c b/src/libbsc/abis_nm_vty.c index 6ec0a4a..a0d72c2 100644 --- a/src/libbsc/abis_nm_vty.c +++ b/src/libbsc/abis_nm_vty.c @@ -28,14 +28,14 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/abis_om2000.c b/src/libbsc/abis_om2000.c index 82a14b2..756cc89 100644 --- a/src/libbsc/abis_om2000.c +++ b/src/libbsc/abis_om2000.c @@ -36,12 +36,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include /* FIXME: move to libosmocore */ diff --git a/src/libbsc/abis_om2000_vty.c b/src/libbsc/abis_om2000_vty.c index a6bc4c7..b75d420 100644 --- a/src/libbsc/abis_om2000_vty.c +++ b/src/libbsc/abis_om2000_vty.c @@ -26,14 +26,14 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 75229a5..09fb14b 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -27,26 +27,26 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include #define RSL_ALLOC_SIZE 1024 #define RSL_ALLOC_HEADROOM 128 diff --git a/src/libbsc/arfcn_range_encode.c b/src/libbsc/arfcn_range_encode.c index 9ca4840..ae99fd9 100644 --- a/src/libbsc/arfcn_range_encode.c +++ b/src/libbsc/arfcn_range_encode.c @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a0ba69a..b42c382 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -21,17 +21,17 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c index 641fe2b..7c2bfb5 100644 --- a/src/libbsc/bsc_ctrl_commands.c +++ b/src/libbsc/bsc_ctrl_commands.c @@ -22,13 +22,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define CTRL_CMD_VTY_STRING(cmdname, cmdstr, dtype, element) \ CTRL_HELPER_GET_STRING(cmdname, dtype, element) \ diff --git a/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c index a8a8cf5..d1d9b0a 100644 --- a/src/libbsc/bsc_ctrl_lookup.c +++ b/src/libbsc/bsc_ctrl_lookup.c @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include extern vector ctrl_node_vec; diff --git a/src/libbsc/bsc_dyn_ts.c b/src/libbsc/bsc_dyn_ts.c index e5422fc..aa3c252 100644 --- a/src/libbsc/bsc_dyn_ts.c +++ b/src/libbsc/bsc_dyn_ts.c @@ -19,9 +19,9 @@ */ #include -#include -#include -#include +#include +#include +#include void tchf_pdch_ts_init(struct gsm_bts_trx_ts *ts) { diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index a99eea2..5b6530d 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -19,25 +19,25 @@ * */ -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include /* global pointer to the gsm network data structure */ diff --git a/src/libbsc/bsc_msc.c b/src/libbsc/bsc_msc.c index 82a572d..648b3e6 100644 --- a/src/libbsc/bsc_msc.c +++ b/src/libbsc/bsc_msc.c @@ -19,8 +19,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c index b7b6fc8..20115e1 100644 --- a/src/libbsc/bsc_rf_ctrl.c +++ b/src/libbsc/bsc_rf_ctrl.c @@ -20,12 +20,12 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libbsc/bsc_rll.c b/src/libbsc/bsc_rll.c index bb488da..ebf9b88 100644 --- a/src/libbsc/bsc_rll.c +++ b/src/libbsc/bsc_rll.c @@ -22,15 +22,15 @@ #include -#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include struct bsc_rll_req { struct llist_head list; diff --git a/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c index 73e61e8..d9d90ba 100644 --- a/src/libbsc/bsc_subscriber.c +++ b/src/libbsc/bsc_subscriber.c @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include static struct bsc_subscr *bsc_subscr_alloc(struct llist_head *list) { diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index abfff0c..42c16e8 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -36,28 +36,28 @@ #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libbsc/bts_ericsson_rbs2000.c b/src/libbsc/bts_ericsson_rbs2000.c index 99da4e7..5ee2760 100644 --- a/src/libbsc/bts_ericsson_rbs2000.c +++ b/src/libbsc/bts_ericsson_rbs2000.c @@ -22,12 +22,12 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include diff --git a/src/libbsc/bts_init.c b/src/libbsc/bts_init.c index d6b152a..18f1ed4 100644 --- a/src/libbsc/bts_init.c +++ b/src/libbsc/bts_init.c @@ -16,7 +16,7 @@ * along with this program. If not, see . * */ -#include +#include int bts_init(void) { diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..1f203f5 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -23,23 +23,23 @@ #include -#include -#include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include -#include +#include +#include extern struct gsm_network *bsc_gsmnet; diff --git a/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 473e1ca..22ae484 100644 --- a/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include static void patch_16(uint8_t *data, const uint16_t val) { diff --git a/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c index 3ca76c0..392cd17 100644 --- a/src/libbsc/bts_nokia_site.c +++ b/src/libbsc/bts_nokia_site.c @@ -30,11 +30,11 @@ #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include diff --git a/src/libbsc/bts_siemens_bs11.c b/src/libbsc/bts_siemens_bs11.c index c083b1e..e01c258 100644 --- a/src/libbsc/bts_siemens_bs11.c +++ b/src/libbsc/bts_siemens_bs11.c @@ -22,11 +22,11 @@ #include -#include -#include -#include +#include +#include +#include #include -#include +#include static int bts_model_bs11_start(struct gsm_network *net); diff --git a/src/libbsc/bts_sysmobts.c b/src/libbsc/bts_sysmobts.c index e4b6cdc..2982074 100644 --- a/src/libbsc/bts_sysmobts.c +++ b/src/libbsc/bts_sysmobts.c @@ -23,17 +23,17 @@ #include -#include -#include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/src/libbsc/bts_unknown.c b/src/libbsc/bts_unknown.c index f113529..5ecf875 100644 --- a/src/libbsc/bts_unknown.c +++ b/src/libbsc/bts_unknown.c @@ -20,9 +20,9 @@ */ -#include +#include #include -#include +#include static struct gsm_bts_model model_unknown = { .type = GSM_BTS_TYPE_UNKNOWN, diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 4192d65..679ad42 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -25,14 +25,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index d57dec5..1923efd 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -23,15 +23,15 @@ #include -#include +#include #include #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include #define SAPI_L2ML 0 #define SAPI_OML 62 diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 109beda..7fc696f 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -30,13 +30,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ diff --git a/src/libbsc/gsm_04_80_utils.c b/src/libbsc/gsm_04_80_utils.c index e0db81e..d67f3c5 100644 --- a/src/libbsc/gsm_04_80_utils.c +++ b/src/libbsc/gsm_04_80_utils.c @@ -20,7 +20,7 @@ */ #include -#include +#include int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text) diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 8d7e047..09c7eaa 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -25,12 +25,12 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include /* Get reference to a neighbor cell on a given BCCH ARFCN */ diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 8ced74f..ace8ac3 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -29,18 +29,18 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include struct bsc_handover { struct llist_head list; diff --git a/src/libbsc/meas_proc.c b/src/libbsc/meas_proc.c index 5b97e74..efc3fd0 100644 --- a/src/libbsc/meas_proc.c +++ b/src/libbsc/meas_proc.c @@ -24,10 +24,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include /* process an already parsed measurement report */ static int process_meas_rep(struct gsm_meas_rep *mr) diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c index 808103d..cb8379e 100644 --- a/src/libbsc/meas_rep.c +++ b/src/libbsc/meas_rep.c @@ -20,8 +20,8 @@ */ -#include -#include +#include +#include static int get_field(const struct gsm_meas_rep *rep, enum meas_rep_field field) diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 0dd3753..a71662c 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -17,10 +17,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index 02212a3..b8f9043 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -42,14 +42,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include void *tall_paging_ctx; diff --git a/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c index 98e12fa..40dd68d 100644 --- a/src/libbsc/pcu_sock.c +++ b/src/libbsc/pcu_sock.c @@ -37,12 +37,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg); uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index fdab70a..ae04225 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -26,13 +26,13 @@ #include #include -#include -#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include /* generate SI1 rest octets */ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net) diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index fe0b23d..c0df8bb 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -33,12 +33,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* * DCS1800 and PCS1900 have overlapping ARFCNs. We would need to set the diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c0294c7..c40bc41 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index fbcfa1d..16d51a1 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -25,11 +25,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 1791687..fd10836 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -25,10 +25,10 @@ #include #include -#include +#include -#include -#include +#include +#include struct cmd_node net_node = { GSMNET_NODE, diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 1443791..d4d5fb5 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,12 +23,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..68fc597 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 077029a..e085aa6 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -34,9 +34,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..84a71cb 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index a2f6b2d..a746c24 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..78aacdb 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c index a42206d..d7b737b 100644 --- a/src/libfilter/bsc_msg_acc.c +++ b/src/libfilter/bsc_msg_acc.c @@ -18,9 +18,9 @@ * */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c index 338db72..fc87e88 100644 --- a/src/libfilter/bsc_msg_filter.c +++ b/src/libfilter/bsc_msg_filter.c @@ -21,14 +21,14 @@ * */ -#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libfilter/bsc_msg_vty.c b/src/libfilter/bsc_msg_vty.c index c342fdc..52e0da5 100644 --- a/src/libfilter/bsc_msg_vty.c +++ b/src/libfilter/bsc_msg_vty.c @@ -17,9 +17,9 @@ * */ -#include -#include -#include +#include +#include +#include #include diff --git a/src/libtrau/rtp_proxy.c b/src/libtrau/rtp_proxy.c index 6b38ee5..5b1ca79 100644 --- a/src/libtrau/rtp_proxy.c +++ b/src/libtrau/rtp_proxy.c @@ -30,13 +30,13 @@ #include #include -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/libtrau/trau_mux.c b/src/libtrau/trau_mux.c index b37c765..e570b93 100644 --- a/src/libtrau/trau_mux.c +++ b/src/libtrau/trau_mux.c @@ -22,16 +22,16 @@ #include #include -#include +#include #include -#include +#include #include #include -#include +#include #include -#include +#include #include -#include +#include /* this corresponds to the bit-lengths of the individual codec * parameters as indicated in Table 1.1 of TS 06.10 */ diff --git a/src/libtrau/trau_upqueue.c b/src/libtrau/trau_upqueue.c index f8edaf0..c1c0003 100644 --- a/src/libtrau/trau_upqueue.c +++ b/src/libtrau/trau_upqueue.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include void trau_tx_to_mncc(struct gsm_network *net, struct msgb *msg) { diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index 8e47069..c388f5b 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -17,12 +17,12 @@ * */ -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include #include -#include +#include #define return_when_not_connected(conn) \ if (!conn->sccp_con) {\ diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index b4ffa88..94aa350 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -20,15 +20,15 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 3417783..4311250 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -18,22 +18,22 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include #include #include #include -#include -#include +#include +#include #include #define IP_V4_ADDR_LEN 4 diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index c23ed21..2446312 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -19,13 +19,13 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c index 2a9820d..7f9671a 100644 --- a/src/osmo-bsc/osmo_bsc_filter.c +++ b/src/osmo-bsc/osmo_bsc_filter.c @@ -19,13 +19,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 63afa20..a310079 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts *bts) { diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 61ef33c..5e8f45e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -18,17 +18,17 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c index 351fd2c..0e5777e 100644 --- a/src/osmo-bsc/osmo_bsc_msc.c +++ b/src/osmo-bsc/osmo_bsc_msc.c @@ -20,15 +20,15 @@ * */ -#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c index 0baf080..d28f548 100644 --- a/src/osmo-bsc/osmo_bsc_reset.c +++ b/src/osmo-bsc/osmo_bsc_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 0f6ca33..48796c1 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -26,13 +26,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* A pointer to a list with all involved MSCs * (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */ diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index 8edcbf3..0e7003f 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_filter.c b/src/osmo-bsc_nat/bsc_filter.c index 6a9e99f..8d4a680 100644 --- a/src/osmo-bsc_nat/bsc_filter.c +++ b/src/osmo-bsc_nat/bsc_filter.c @@ -20,10 +20,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c index 49050fc..bf6d0ad 100644 --- a/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -42,15 +42,15 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index 401288d..1548ea3 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -39,15 +39,15 @@ #define _GNU_SOURCE #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_ctrl.c b/src/osmo-bsc_nat/bsc_nat_ctrl.c index ff6a739..93cdff3 100644 --- a/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -27,12 +27,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_filter.c b/src/osmo-bsc_nat/bsc_nat_filter.c index e735290..cd7ca25 100644 --- a/src/osmo-bsc_nat/bsc_nat_filter.c +++ b/src/osmo-bsc_nat/bsc_nat_filter.c @@ -18,10 +18,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_nat_rewrite.c b/src/osmo-bsc_nat/bsc_nat_rewrite.c index 943e1fa..75ed4ec 100644 --- a/src/osmo-bsc_nat/bsc_nat_rewrite.c +++ b/src/osmo-bsc_nat/bsc_nat_rewrite.c @@ -21,13 +21,13 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c index 633fa87..af346ef 100644 --- a/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c +++ b/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c @@ -19,9 +19,9 @@ * */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_utils.c b/src/osmo-bsc_nat/bsc_nat_utils.c index c12b29f..a9906b9 100644 --- a/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/src/osmo-bsc_nat/bsc_nat_utils.c @@ -21,14 +21,14 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/osmo-bsc_nat/bsc_nat_vty.c b/src/osmo-bsc_nat/bsc_nat_vty.c index 875cefb..5f7cbc8 100644 --- a/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/src/osmo-bsc_nat/bsc_nat_vty.c @@ -18,23 +18,23 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include #include #include -#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_sccp.c b/src/osmo-bsc_nat/bsc_sccp.c index c6c265f..bb882a6 100644 --- a/src/osmo-bsc_nat/bsc_sccp.c +++ b/src/osmo-bsc_nat/bsc_sccp.c @@ -19,9 +19,9 @@ * */ -#include -#include -#include +#include +#include +#include #include diff --git a/src/osmo-bsc_nat/bsc_ussd.c b/src/osmo-bsc_nat/bsc_ussd.c index 29b4fee..20df8d1 100644 --- a/src/osmo-bsc_nat/bsc_ussd.c +++ b/src/osmo-bsc_nat/bsc_ussd.c @@ -20,12 +20,12 @@ * */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/utils/bs11_config.c b/src/utils/bs11_config.c index a0f3cb7..6487df2 100644 --- a/src/utils/bs11_config.c +++ b/src/utils/bs11_config.c @@ -32,14 +32,14 @@ #include -#include -#include +#include +#include #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/src/utils/meas_db.c b/src/utils/meas_db.c index d81efca..7233dcd 100644 --- a/src/utils/meas_db.c +++ b/src/utils/meas_db.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_json.c b/src/utils/meas_json.c index 51eb6c7..4623ee0 100644 --- a/src/utils/meas_json.c +++ b/src/utils/meas_json.c @@ -37,9 +37,9 @@ #include -#include -#include -#include +#include +#include +#include static void print_meas_rep_uni_json(struct gsm_meas_rep_unidir *mru) { diff --git a/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c index b874ac4..db00fae 100644 --- a/src/utils/meas_pcap2db.c +++ b/src/utils/meas_pcap2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include diff --git a/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c index 5032d0c..34f8385 100644 --- a/src/utils/meas_udp2db.c +++ b/src/utils/meas_udp2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 77194de..851aa03 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -16,7 +16,7 @@ #include -#include +#include struct ms_state_uni { CDKSLIDER *cdk; diff --git a/tests/abis/abis_test.c b/tests/abis/abis_test.c index 591f835..461f24e 100644 --- a/tests/abis/abis_test.c +++ b/tests/abis/abis_test.c @@ -24,9 +24,9 @@ #include #include -#include -#include -#include +#include +#include +#include static const uint8_t load_config[] = { 0x42, 0x12, 0x00, 0x08, 0x31, 0x36, 0x38, 0x64, diff --git a/tests/bsc-nat-trie/bsc_nat_trie_test.c b/tests/bsc-nat-trie/bsc_nat_trie_test.c index 4b4df2f..3c04a9f 100644 --- a/tests/bsc-nat-trie/bsc_nat_trie_test.c +++ b/tests/bsc-nat-trie/bsc_nat_trie_test.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/tests/bsc-nat/bsc_nat_test.c b/tests/bsc-nat/bsc_nat_test.c index 2914a01..a61da00 100644 --- a/tests/bsc-nat/bsc_nat_test.c +++ b/tests/bsc-nat/bsc_nat_test.c @@ -22,12 +22,12 @@ */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 20ed5b4..aedc018 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -24,13 +24,13 @@ */ -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index e66bed3..ec2927e 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -25,10 +25,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include void test_bts_debug_print(void) { diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index d9ff305..974ebe5 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -24,13 +24,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 96d56ef..3b5429c 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -19,9 +19,9 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c index 60d687d..934684f 100644 --- a/tests/subscr/bsc_subscr_test.c +++ b/tests/subscr/bsc_subscr_test.c @@ -18,8 +18,8 @@ * */ -#include -#include +#include +#include #include #include diff --git a/tests/trau/trau_test.c b/tests/trau/trau_test.c index c74e6db..c8c9a5e 100644 --- a/tests/trau/trau_test.c +++ b/tests/trau/trau_test.c @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/3813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:44:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:44:00 +0000 Subject: [MERGED] osmo-bsc[master]: rewrite README In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rewrite README ...................................................................... rewrite README Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d --- M README 1 file changed, 20 insertions(+), 33 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/README b/README index d01b2cf..e84849b 100644 --- a/README +++ b/README @@ -1,39 +1,26 @@ -About OpenBSC +About OsmoBSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoBSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoBSC was one of the parts split off from the old openbsc.git. Before, it +worked as a standalone osmo-bsc binary as well as a combination of libbsc and +libmsc, i.e. the old OsmoNITB. Since the standalone OsmoMSC with a true A +interface (and IuCS for 3G support) is available, OsmoBSC exists only as a +separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoBSC exposes +- A over IP towards an MSC (e.g. OsmoMSC); +- Abis interfaces towards various kinds of BTS; +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. +Find OsmoBSC issue tracker and wiki online at +https://osmocom.org/projects/osmobsc +https://osmocom.org/projects/osmobsc/wiki - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +OsmoBSC-NAT is a specialized solution to navigating RTP streams through a NAT. +(Todo: describe in more detail) -- To view, visit https://gerrit.osmocom.org/3794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2487ddbd37f989eb29b45bbf07beb5be468b867d Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:44:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:44:00 +0000 Subject: [MERGED] osmo-bsc[master]: rename openbsc.pc to osmo-bsc.pc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rename openbsc.pc to osmo-bsc.pc ...................................................................... rename openbsc.pc to osmo-bsc.pc Change-Id: I99ab9fea01c11841437b587dffd4e1fff17a291f --- M Makefile.am M configure.ac R osmo-bsc.pc.in 3 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 536b3f4..0f0141b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = openbsc.pc +pkgconfig_DATA = osmo-bsc.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 5d684ef..8107047 100644 --- a/configure.ac +++ b/configure.ac @@ -125,7 +125,7 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - openbsc.pc + osmo-bsc.pc include/openbsc/Makefile include/Makefile src/Makefile diff --git a/openbsc.pc.in b/osmo-bsc.pc.in similarity index 70% rename from openbsc.pc.in rename to osmo-bsc.pc.in index 17e265d..f9b0d24 100644 --- a/openbsc.pc.in +++ b/osmo-bsc.pc.in @@ -3,8 +3,8 @@ libdir=@libdir@ includedir=@includedir@/ -Name: OpenBSC -Description: OpenBSC base station controller +Name: OsmoBSC +Description: OsmoBSC base station controller Requires: Version: @VERSION@ Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/3792 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99ab9fea01c11841437b587dffd4e1fff17a291f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:44:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:44:00 +0000 Subject: [MERGED] osmo-bsc[master]: drop files unrelated to osmo-bsc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: drop files unrelated to osmo-bsc ...................................................................... drop files unrelated to osmo-bsc These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-bsc. Empty out contrib: remove things that are either obviously unrelated to osmo-bsc, or seem old and/or esoteric. osmoappdesc.py: drop nitb_e1_configs (and some ws) Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a --- D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/mgcp_server.py D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/systemd/osmo-bsc-mgcp.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D doc/call-routing.txt D doc/channel_release.txt D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/gsm-hopping.txt D doc/ipa-sccp.txt D doc/oml-interface.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt D include/openbsc/gsm_04_14.h M osmoappdesc.py D src/libcommon/oap_client.c D src/libmsc/gsm_04_14.c D tools/hlrstat.pl 56 files changed, 0 insertions(+), 3,037 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/bsc-test/README b/contrib/bsc-test/README deleted file mode 100644 index adb222e..0000000 --- a/contrib/bsc-test/README +++ /dev/null @@ -1 +0,0 @@ -Some crazy scripts call testing... and MSC link failure simulation diff --git a/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial deleted file mode 100644 index 96e5f00..0000000 --- a/contrib/bsc-test/all_dial +++ /dev/null @@ -1,8 +0,0 @@ -ABORT BUSY -ABORT 'NO CARRIER' -ABORT 'OK' - -'' AT -SAY "Dialing a number\n" -'OK' ATD05660066; - diff --git a/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh deleted file mode 100755 index e5e19f6..0000000 --- a/contrib/bsc-test/dial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Evil dial script.. - -while true; -do - chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0 - sleep 5s - chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0 - sleep 2s -done - diff --git a/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh deleted file mode 100755 index 84eead7..0000000 --- a/contrib/bsc-test/drop-oml.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -sleep 3 -echo "enable" -sleep 1 -echo "drop bts connection 0 oml" -sleep 1 diff --git a/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh deleted file mode 100755 index c7b66ba..0000000 --- a/contrib/bsc-test/drop.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Going to drop the OML connection" - ./drop-oml.sh | telnet 127.0.0.1 4242 - sleep 58m -done diff --git a/contrib/bsc-test/hangup b/contrib/bsc-test/hangup deleted file mode 100644 index cad6870..0000000 --- a/contrib/bsc-test/hangup +++ /dev/null @@ -1,4 +0,0 @@ -TIMEOUT 10 -'' ^Z -SAY "Waiting for hangup confirm\n" -'' ATH; diff --git a/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh deleted file mode 100755 index bec011d..0000000 --- a/contrib/bsc-test/msc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` - sleep 58s -done diff --git a/contrib/bt.py b/contrib/bt.py deleted file mode 100755 index 1b111ef..0000000 --- a/contrib/bt.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os - -f = open("unbalanced") -lines = [] -for line in f: - lines.append(line) - -filenames = {} - -output = [] -for line in lines: - if "[0x" in line: - start = line.find("[") - end = line.find("]") - addr = line[start+1:end] - try: - file = filenames[addr] - except KeyError: - r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr) - all = r.read().replace("\n", ",") - file = all - filenames[addr] = file - - line = line.replace(addr, file) - output.append(line) - -g = open("unbalanced.2", "w") -g.write("".join(output)) - - - diff --git a/contrib/convert_to_enum.py b/contrib/convert_to_enum.py deleted file mode 100755 index bcd6f2c..0000000 --- a/contrib/convert_to_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# -# Convert ETSI documents to an enum -# - -import re, sys - -def convert(string): - string = string.strip().replace(" ", "").rjust(8, "0") - var = 0 - offset = 7 - for char in string: - assert offset >= 0 - var = var | (int(char) << offset) - offset = offset - 1 - - return var - -def string(name): - name = name.replace(" ", "_") - name = name.replace('"', "") - name = name.replace('/', '_') - name = name.replace('(', '_') - name = name.replace(')', '_') - return "%s_%s" % (sys.argv[2], name.upper()) - -file = open(sys.argv[1]) - - -for line in file: - m = re.match(r"[ \t]*(?P[01 ]+)[ ]+(?P[a-zA-Z /0-9()]+)", line[:-1]) - - if m: - print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"])) - else: - print line[:-1] diff --git a/contrib/ctrl2sse.py b/contrib/ctrl2sse.py deleted file mode 100755 index 8b630ec..0000000 --- a/contrib/ctrl2sse.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python2 - -mod_license = ''' -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -''' - -import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control -from eventsource import listener, request - -''' -N. B: this is not an example of building proper REST API or building secure web application. -It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API. -Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem -from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that. -''' - -token = None -stream = None -url = None - -''' -Returns json according to following schema - see http://json-schema.org/documentation.html for details: -{ - "title": "Ctrl Schema", - "type": "object", - "properties": { - "variable": { - "type": "string" - }, - "varlue": { - "type": "string" - } - }, - "required": ["interface", "variable", "value"] -} -Example validation from command-line: -json validate --schema-file=schema.json --document-file=data.json -The interface is represented as string because it might look different for IPv4 vs v6. -''' - -def read_header(data): - t_length = bsc_control.ipa_ctrl_header(data) - if (t_length): - stream.read_bytes(t_length - 1, callback = read_trap) - else: - print >> sys.stderr, "protocol error: length missing in %s!" % data - - at tornado.gen.coroutine -def read_trap(data): - (t, z, v, p) = data.split() - if (t != 'TRAP' or int(z) != 0): - print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z)) - else: - yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token), - method = 'POST', - headers = {'Content-Type': 'application/json'}, - body = tornado.escape.json_encode({ 'variable' : v, 'value' : p }))) - stream.read_bytes(4, callback = read_header) - - at tornado.gen.coroutine -def trap_setup(host, port, target_host, target_port, tk): - global stream - global url - global token - token = tk - url = "http://%s:%s/sse" % (host, port) - stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port) - stream.read_bytes(4, callback = read_header) - -def get_v(s, v): - return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) } - -class CtrlHandler(tornado.web.RequestHandler): - def initialize(self): - self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port']) - - def get(self, v): - self.write(get_v(self.skt, v)) - - def post(self): - self.write(get_v(self.skt, self.get_argument("variable"))) - -class SetCtrl(CtrlHandler): - def get(self, var, val): - bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val)) - super(SetCtrl, self).get(tornado.escape.native_str(var)) - - def post(self): - bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value"))) - super(SetCtrl, self).post() - -class Slash(tornado.web.RequestHandler): - def get(self): - self.write('%sUsing Tornado framework v%s' - '
' - '' - '' - '
' - '
' - '' - '' - '' - '
' - '' % ("Osmocom Control Interface Proxy", tornado.version)) - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.') - p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port") - p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress") - p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface") - p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface") - p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)") - p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value") - p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000") - args = p.parse_args() - random.seed() - tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver - logging.basicConfig() - application = tornado.web.Application([ - (r"/", Slash), - (r"/get", CtrlHandler), - (r"/get/(.*)", CtrlHandler), - (r"/set", SetCtrl), - (r"/set/(.*)/(.*)", SetCtrl), - (r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)), - ], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port) - application.listen(address = args.host, port = args.port) - trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token) - tornado.ioloop.IOLoop.instance().start() diff --git a/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py deleted file mode 100755 index 0cd4b87..0000000 --- a/contrib/gprs/gb-proxy-unblock-bug.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -""" -demonstrate a unblock bug on the GB Proxy.. -""" - -bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7" -ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7" - -bts_ns_unblock = "\x06" -ns_unblock_ack = "\x07" - -bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02" -ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00" - -bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40" - - -import socket -socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -socket.bind(("0.0.0.0", 0)) -socket.setblocking(1) - - -import sys -port = int(sys.argv[1]) -print "Sending data to port: %d" % port - -def send_and_receive(packet): - socket.sendto(packet, ("127.0.0.1", port)) - - try: - data, addr = socket.recvfrom(4096) - except socket.error, e: - print "ERROR", e - import sys - sys.exit(0) - return data - -#send stuff once - -to_send = [ - (bts_ns_reset, ns_reset_ack, "reset ack"), - (bts_ns_unblock, ns_unblock_ack, "unblock ack"), - (bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"), -] - - -for (out, inp, type) in to_send: - res = send_and_receive(out) - if res != inp: - print "Failed to get the %s" % type - sys.exit(-1) - -import time -time.sleep(3) -res = send_and_receive(bts_bvc_reset_8167) -print "Sent all messages... check wireshark for the last response" diff --git a/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua deleted file mode 100644 index b1ab5df..0000000 --- a/contrib/gprs/gprs-bssgp-histogram.lua +++ /dev/null @@ -1,78 +0,0 @@ --- Simple LUA script to print the size of BSSGP messages over their type... - -do - local ip_bucket = {} - - local pdu_types = {} - pdu_types[ 6] = "PAGING" - pdu_types[11] = "SUSPEND" - pdu_types[12] = "SUSPEND-ACK" - pdu_types[32] = "BVC-BLOCK" - pdu_types[33] = "BVC-BLOCK-ACK" - pdu_types[34] = "BVC-RESET" - pdu_types[35] = "BVC-RESET-ACK" - pdu_types[36] = "UNBLOCK" - pdu_types[37] = "UNBLOCK-ACK" - pdu_types[38] = "FLOW-CONTROL-BVC" - pdu_types[39] = "FLOW-CONTROL-BVC-ACK" - pdu_types[40] = "FLOW-CONTROL-MS" - pdu_types[41] = "FLOW-CONTROL-MS-ACK" - pdu_types[44] = "LLC-DISCARDED" - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local udp_length_get = Field.new("udp.length") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = udp_length_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - pdu = tostring(pdu) - if tonumber(pdu) == 0 or tonumber(pdu) == 1 then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_histo = ip_bucket[ip_src] - if not bssgp_histo then - bssgp_histo = {} - ip_bucket[ip_src] = bssgp_histo - end - - local key = pdu - local bucket = bssgp_histo[key] - if not bucket then - bucket = {} - bssgp_histo[key] = bucket - end - - table.insert(bucket, tostring(len)) - print("IP: " .. ip_src .. " PDU: " .. pdu_types[tonumber(pdu)] .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua deleted file mode 100644 index ca8864a..0000000 --- a/contrib/gprs/gprs-buffer-count.lua +++ /dev/null @@ -1,80 +0,0 @@ --- I count the buffer space needed for LLC PDUs in the worse case and print it - -do - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local bssgp_delay_get = Field.new("bssgp.delay_val") - local llcgprs_get = Field.new("llcgprs") - local pdus = nil - - print("START...") - - local tap = Listener.new("ip", "udp.port == 23000 && bssgp.pdu_type == 0") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = llcgprs_get().len - local delay = bssgp_delay_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - if tonumber(tostring(delay)) == 65535 then - pdus = { next = pdus, - len = len, - expires = -1 } - else - local off = tonumber(tostring(delay)) / 100.0 - pdus = { next = pdus, - len = len, - expires = pinfo.rel_ts + off } - end - local now_time = tonumber(tostring(pinfo.rel_ts)) - local now_size = 0 - local l = pdus - local prev = nil - local count = 0 - while l do - if now_time < l.expires or l.expires == -1 then - now_size = now_size + l.len - prev = l - l = l.next - count = count + 1 - else - -- delete things - if prev == nil then - pdus = nil - l = nil - else - prev.next = l.next - l = l.next - end - end - end --- print("TOTAL: " .. now_time .. " PDU_SIZE: " .. now_size) - print(now_time .. " " .. now_size / 1024.0 .. " " .. count) --- print("NOW: " .. tostring(pinfo.rel_ts) .. " Delay: " .. tostring(delay) .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - print("END") - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua deleted file mode 100644 index 018c377..0000000 --- a/contrib/gprs/gprs-split-trace-by-tlli.lua +++ /dev/null @@ -1,46 +0,0 @@ --- Create a file named by_ip/''ip_addess''.cap with all ip traffic of each ip host. (works for tshark only) --- Dump files are created for both source and destination hosts -do - local dir = "by_tlli" - local dumpers = {} - local function init_listener() - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - local field_tlli = Field.new("bssgp.tlli") - local tap = Listener.new("ip", "udp.port == 23000") - - -- we will be called once for every IP Header. - -- If there's more than one IP header in a given packet we'll dump the packet once per every header - function tap.packet(pinfo,tvb,ip) - local tlli = field_tlli() - if not tlli then - return - end - - local tlli_str = tostring(tlli) - tlli_dmp = dumpers[tlli_str] - if not tlli_dmp then - local tlli_hex = string.format("0x%x", tonumber(tlli_str)) - print("Creating dump for TLLI " .. tlli_hex) - tlli_dmp = Dumper.new_for_current(dir .. "/" .. tlli_hex .. ".pcap") - dumpers[tlli_str] = tlli_dmp - end - tlli_dmp:dump_current() - tlli_dmp:flush() - end - function tap.draw() - for tlli,dumper in pairs(dumpers) do - dumper:flush() - end - end - function tap.reset() - for tlli,dumper in pairs(dumpers) do - dumper:close() - end - dumpers = {} - end - end - init_listener() -end diff --git a/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua deleted file mode 100644 index e44fdd1..0000000 --- a/contrib/gprs/gprs-verify-nu.lua +++ /dev/null @@ -1,59 +0,0 @@ --- This script verifies that the N(U) is increasing... --- -do - local nu_state_src = {} - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- we want to look here... - local llc_sapi_get = Field.new("llcgprs.sapib") - local llc_nu_get = Field.new("llcgprs.nu") - local bssgp_tlli_get = Field.new("bssgp.tlli") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local llc_sapi = llc_sapi_get() - local llc_nu = llc_nu_get() - local bssgp_tlli = bssgp_tlli_get() - - if not llc_sapi or not llc_nu or not bssgp_tlli then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_tlli = tostring(bssgp_tlli) - local llc_nu = tostring(llc_nu) - local llc_sapi = tostring(llc_sapi) - - local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi - local last_nu = nu_state_src[src_key] - if not last_nu then - -- print("Establishing mapping for " .. src_key) - nu_state_src[src_key] = llc_nu - return - end - - local function tohex(number) - return string.format("0x%x", tonumber(number)) - end - - nu_state_src[src_key] = llc_nu - if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then - print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src) - print("\t last: " .. last_nu .. " now: " .. llc_nu) - end - end - - function tap.draw() - end - - function tap.reset() - end - end - init_listener() -end - diff --git a/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql deleted file mode 100644 index 626a331..0000000 --- a/contrib/hlr-remove-old.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Remove old data from the database -DELETE FROM Subscriber - WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1; -DELETE FROM Equipment - WHERE datetime('now', '-10 days') > updated; -DELETE FROM EquipmentWatch - WHERE datetime('now', '-10 days') > updated; -DELETE FROM SMS - WHERE datetime('now', '-10 days') > created; -DELETE FROM VLR - WHERE datetime('now', '-10 days') > updated; -DELETE FROM ApduBlobs - WHERE datetime('now', '-10 days') > created; -DELETE FROM Counters - WHERE datetime('now', '-10 days') > timestamp; -DELETE FROM RateCounters - WHERE datetime('now', '-10 days') > timestamp; -VACUUM; diff --git a/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py deleted file mode 100755 index e4a4955..0000000 --- a/contrib/hlrsync/hlrsync.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python2.5 - -from __future__ import with_statement - -from pysqlite2 import dbapi2 as sqlite3 -import sys - -hlr = sqlite3.connect(sys.argv[1]) -web = sqlite3.connect(sys.argv[2]) - -# switch to autocommit -hlr.isolation_level = None -web.isolation_level = None - -hlr.row_factory = sqlite3.Row -web.row_factory = sqlite3.Row - -with hlr: - hlr_subscrs = hlr.execute(""" - SELECT * FROM Subscriber - """).fetchall() - hlr_tokens = hlr.execute(""" - SELECT * FROM AuthToken - """).fetchall() - -with web: - web_tokens = web.execute(""" - SELECT * FROM reg_tokens - """).fetchall() - web_sms = web.execute(""" - SELECT * FROM sms_queue - """).fetchall() - -# index by subscr id -hlr_subscrs_by_id = {} -hlr_subscrs_by_ext = {} -hlr_tokens_by_subscr_id = {} -for x in hlr_subscrs: - hlr_subscrs_by_id[x['id']] = x - hlr_subscrs_by_ext[x['extension']] = x -del hlr_subscrs -for x in hlr_tokens: - hlr_tokens_by_subscr_id[x['subscriber_id']] = x -del hlr_tokens - -web_tokens_by_subscr_id = {} -for x in web_tokens: - web_tokens_by_subscr_id[x['subscriber_id']] = x -del web_tokens - -# remove leftover web_tokens and correct inconsistent fields -with web: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - web.execute(""" - DELETE FROM reg_tokens WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del web_tokens_by_subscr_id[x['subscriber_id']] - continue - if str(x['imsi']) != str(subscr['imsi']) or \ - x['extension'] != subscr['extension'] or \ - x['tmsi'] != subscr['tmsi'] or \ - x['lac'] != subscr['lac']: - web.execute(""" - UPDATE reg_tokens - SET imsi = ?, extension = ?, tmsi = ?, lac = ? - WHERE subscriber_id = ? - """, (str(subscr['imsi']), subscr['extension'], - subscr['tmsi'], subscr['lac'], x['subscriber_id'])) - -# add missing web_tokens -with web: - for x in hlr_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - hlr.execute(""" - DELETE FROM AuthToken WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del hlr_tokens_by_subscr_id[x['subscriber_id']] - continue - webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None) - if webtoken is None: - web.execute(""" - INSERT INTO reg_tokens - (subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi) - VALUES - (?, ?, 0, ?, '', ?, ?, ?, ?) - """, (x['subscriber_id'], subscr['extension'], subscr['name'], - subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi'])) - -# authorize subscribers -with hlr: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if x['reg_completed'] and not subscr['authorized']: - hlr.execute(""" - UPDATE Subscriber - SET authorized = 1 - WHERE id = ? - """, (x['subscriber_id'],)) - -# Sync SMS from web to hlr -with hlr: - for sms in web_sms: - subscr = hlr_subscrs_by_ext.get(sms['receiver_ext']) - if subscr is None: - print '%s not found' % sms['receiver_ext'] - continue - hlr.execute(""" - INSERT INTO SMS - (created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text) - VALUES - (?, 1, ?, 0, 0, 0, 0, 0, ?) - """, (sms['created'], subscr['id'], sms['text'])) -with web: - for sms in web_sms: - web.execute(""" - DELETE FROM sms_queue WHERE id = ? - """, (sms['id'],)) - - -hlr.close() -web.close() - diff --git a/contrib/mgcp_server.py b/contrib/mgcp_server.py deleted file mode 100755 index 05c489d..0000000 --- a/contrib/mgcp_server.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Simple server for mgcp... send audit, receive response.. - -import socket, time - -MGCP_GATEWAY_PORT = 2427 -MGCP_CALLAGENT_PORT = 2727 - -rsip_resp = """200 321321332\r\n""" -audit_packet = """AUEP %d 13 at mgw MGCP 1.0\r\n""" -crcx_packet = """CRCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n""" -dlcx_packet = """DLCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\n""" -mdcx_packet = """MDCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 258696477 0 IN IP4 172.16.1.107\r\ns=-\r\nc=IN IP4 172.16.1.107\r\nt=0 0\r\nm=audio 6666 RTP/AVP 127\r\na=rtpmap:127 GSM-EFR/8000/1\r\na=ptime:20\r\na=recvonly\r\nm=image 4402 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n""" - -def hexdump(src, length=8): - """Recipe is from http://code.activestate.com/recipes/142812/""" - result = [] - digits = 4 if isinstance(src, unicode) else 2 - for i in xrange(0, len(src), length): - s = src[i:i+length] - hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s]) - text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) - result.append( b"%04X %-*s %s" % (i, length*(digits + 1), hexa, text) ) - return b'\n'.join(result) - -server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -server_socket.bind(("127.0.0.1", MGCP_CALLAGENT_PORT)) -server_socket.setblocking(1) - -last_ci = 1 -def send_and_receive(packet): - global last_ci - server_socket.sendto(packet, ("127.0.0.1", MGCP_GATEWAY_PORT)) - try: - data, addr = server_socket.recvfrom(4096) - - # attempt to store the CI of the response - list = data.split("\n") - for item in list: - if item.startswith("I: "): - last_ci = int(item[3:]) - - print hexdump(data), addr - except socket.error, e: - print e - pass - -def generate_tid(): - import random - return random.randint(0, 65123) - - - -while True: - send_and_receive(audit_packet % generate_tid()) - send_and_receive(crcx_packet % generate_tid() ) - send_and_receive(mdcx_packet % (generate_tid(), last_ci)) - send_and_receive(dlcx_packet % (generate_tid(), last_ci)) - - time.sleep(3) diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c deleted file mode 100644 index 808a703..0000000 --- a/contrib/nat/test_regexp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* make test_regexp */ -#include -#include -#include - - -int main(int argc, char **argv) -{ - regex_t reg; - regmatch_t matches[2]; - - if (argc != 4) { - printf("Invoke with: test_regexp REGEXP REPLACE NR\n"); - return -1; - } - - if (regcomp(®, argv[1], REG_EXTENDED) != 0) { - fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]); - return -1; - } - - if (regexec(®, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1) - printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]); - else - printf("No match.\n"); - - regfree(®); - - return 0; -} diff --git a/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py deleted file mode 100644 index 8f7a58d..0000000 --- a/contrib/nat/ussd_example.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2.7 - -""" -AGPLv3+ 2016 Copyright Holger Hans Peter Freyther - -Example of how to connect to the USSD side-channel and how to respond -with a fixed message. -""" - -import socket -import struct - -ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ussdSocket.connect(('127.0.0.1', 5001)) - -def send_dt1(dstref, data): - dlen = struct.pack('B', len(data)).encode('hex') - hex = '06' + dstref.encode('hex') + '00' + '01' + dlen + data.encode('hex') - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def send_rel(srcref, dstref): - hex = '04' + dstref.encode('hex') + srcref.encode('hex') + '000100' - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def recv_one(): - plen = ussdSocket.recv(3) - (plen,ptype) = struct.unpack(">HB", plen) - data = ussdSocket.recv(plen) - - return ptype, data - -# Assume this is the ID request -data = ussdSocket.recv(4) -ussdSocket.send("\x00\x08\xfe\x05\x00" + "\x05\x01" + "ussd") -# ^len ^len of tag ... and ignore - -# Expect a fake message. see struct ipac_msgt_sccp_state -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) -(srcref, dstref, transid, invokeid) = struct.unpack("<3s3sBB", data[1:9]) -print("New transID %d invoke %d" % (transid, invokeid)) - -# Expect a the invocation.. todo.. extract invoke id -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) - -# Reply with BSSAP + GSM 04.08 + MAP portion -# 00 == invoke id 0f == DCS -res = "01002a9b2a0802e1901c22a220020100301b02013b301604010f041155e7d2f9bc3a41412894991c06a9c9a713" -send_dt1(dstref, res.decode('hex')) - -clear = "000420040109" -send_dt1(dstref, clear.decode('hex')) - -# should be the clear complete -send_rel(srcref, dstref) - -# Give it some time to handle connection shutdown properly -print("Gracefully sleeping") -import time -time.sleep(3) diff --git a/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl deleted file mode 100755 index 47839c1..0000000 --- a/contrib/rtp/gen_rtp_header.erl +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- -%%! -smp disable --module(gen_rtp_header). - -% -mode(compile). - --define(VERSION, "0.1"). - --export([main/1]). - --record(rtp_packet, - { - version = 2, - padding = 0, - marker = 0, - payload_type = 0, - seqno = 0, - timestamp = 0, - ssrc = 0, - csrcs = [], - extension = <<>>, - payload = <<>>, - realtime - }). - - -main(Args) -> - DefaultOpts = [{format, state}, - {ssrc, 16#11223344}, - {rate, 8000}, - {pt, 98}], - {PosArgs, Opts} = getopts_checked(Args, DefaultOpts), - log(debug, fun (Dev) -> - io:format(Dev, "Initial options:~n", []), - dump_opts(Dev, Opts), - io:format(Dev, "~s: ~p~n", ["Args", PosArgs]) - end, [], Opts), - main(PosArgs, Opts). - -main([First | RemArgs], Opts) -> - try - F = list_to_integer(First), - Format = proplists:get_value(format, Opts, state), - PayloadData = proplists:get_value(payload, Opts, undef), - InFile = proplists:get_value(file, Opts, undef), - - Payload = case {PayloadData, InFile} of - {undef, undef} -> - % use default value - #rtp_packet{}#rtp_packet.payload; - {P, undef} -> P; - {_, File} -> - log(info, "Loading file '~s'~n", [File], Opts), - {ok, InDev} = file:open(File, [read]), - DS = [ Pl#rtp_packet.payload || {_T, Pl} <- read_packets(InDev, Opts)], - file:close(InDev), - log(debug, "File '~s' closed, ~w packets read.~n", [File, length(DS)], Opts), - DS - end, - Dev = standard_io, - write_packet_pre(Dev, Format), - do_groups(Dev, Payload, F, RemArgs, Opts), - write_packet_post(Dev, Format), - 0 - catch - _:_ -> - log(debug, "~p~n", [hd(erlang:get_stacktrace())], Opts), - usage(), - halt(1) - end - ; - -main(_, _Opts) -> - usage(), - halt(1). - -%%% group (count + offset) handling %%% - -do_groups(_Dev, _Pl, _F, [], _Opts) -> - ok; - -do_groups(Dev, Pl, F, [L], Opts) -> - do_groups(Dev, Pl, F, [L, 0], Opts); - -do_groups(Dev, Pl, First, [L, O | Args], Opts) -> - Ssrc = proplists:get_value(ssrc, Opts, #rtp_packet.ssrc), - PT = proplists:get_value(pt, Opts, #rtp_packet.payload_type), - Len = list_to_num(L), - Offs = list_to_num(O), - log(info, "Starting group: Ssrc=~.16B, PT=~B, First=~B, Len=~B, Offs=~B~n", - [Ssrc, PT, First, Len, Offs], Opts), - Pkg = #rtp_packet{ssrc = Ssrc, payload_type = PT}, - Pl2 = write_packets(Dev, Pl, Pkg, First, Len, Offs, Opts), - {Args2, Opts2} = getopts_checked(Args, Opts), - log(debug, fun (Io) -> - io:format(Io, "Changed options:~n", []), - dump_opts(Io, Opts2 -- Opts) - end, [], Opts), - do_groups(Dev, Pl2, First+Len, Args2, Opts2). - -%%% error handling helpers %%% - -getopts_checked(Args, Opts) -> - try - getopts(Args, Opts) - catch - C:R -> - log(error, "~s~n", - [explain_error(C, R, erlang:get_stacktrace(), Opts)], Opts), - usage(), - halt(1) - end. - -explain_error(error, badarg, [{erlang,list_to_integer,[S,B]} | _ ], _Opts) -> - io_lib:format("Invalid number '~s' (base ~B)", [S, B]); -explain_error(error, badarg, [{erlang,list_to_integer,[S]} | _ ], _Opts) -> - io_lib:format("Invalid decimal number '~s'", [S]); -explain_error(C, R, [Hd | _ ], _Opts) -> - io_lib:format("~p, ~p:~p", [Hd, C, R]); -explain_error(_, _, [], _Opts) -> - "". - -%%% usage and options %%% - -myname() -> - filename:basename(escript:script_name()). - -usage(Text) -> - io:format(standard_error, "~s: ~s~n", [myname(), Text]), - usage(). - -usage() -> - io:format(standard_error, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n", - [myname()]). - -show_version() -> - io:format(standard_io, - "~s ~s~n", [myname(), ?VERSION]). - -show_help() -> - io:format(standard_io, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n~n" ++ - "Options:~n" ++ - " -h, --help this text~n" ++ - " --version show version info~n" ++ - " -i, --file=FILE reads payload from file (state format by default)~n" ++ - " -f, --frame-size=N read payload as binary frames of size N instead~n" ++ - " -p, --payload=HEX set constant payload~n" ++ - " --verbose=N set verbosity~n" ++ - " -v increase verbosity~n" ++ - " --format=state use state format for output (default)~n" ++ - " -C, --format=c use simple C lines for output~n" ++ - " --format=carray use a C array for output~n" ++ - " -s, --ssrc=SSRC set the SSRC~n" ++ - " -t, --type=N set the payload type~n" ++ - " -r, --rate=N set the RTP rate [8000]~n" ++ - " -D, --duration=N set the packet duration in RTP time units [160]~n" ++ - " -d, --delay=FLOAT add offset to playout timestamp~n" ++ - "~n" ++ - "Arguments:~n" ++ - " Start initial packet (sequence) number~n" ++ - " Count number of packets~n" ++ - " Offs timestamp offset (in RTP units)~n" ++ - "", [myname()]). - -getopts([ "--file=" ++ File | R], Opts) -> - getopts(R, [{file, File} | Opts]); -getopts([ "-i" ++ T | R], Opts) -> - getopts_alias_arg("--file", T, R, Opts); -getopts([ "--frame-size=" ++ N | R], Opts) -> - Size = list_to_integer(N), - getopts(R, [{frame_size, Size}, {in_format, bin} | Opts]); -getopts([ "-f" ++ T | R], Opts) -> - getopts_alias_arg("--frame-size", T, R, Opts); -getopts([ "--duration=" ++ N | R], Opts) -> - Duration = list_to_integer(N), - getopts(R, [{duration, Duration} | Opts]); -getopts([ "-D" ++ T | R], Opts) -> - getopts_alias_arg("--duration", T, R, Opts); -getopts([ "--rate=" ++ N | R], Opts) -> - Rate = list_to_integer(N), - getopts(R, [{rate, Rate} | Opts]); -getopts([ "-r" ++ T | R], Opts) -> - getopts_alias_arg("--rate", T, R, Opts); -getopts([ "--version" | _], _Opts) -> - show_version(), - halt(0); -getopts([ "--help" | _], _Opts) -> - show_help(), - halt(0); -getopts([ "-h" ++ T | R], Opts) -> - getopts_alias_no_arg("--help", T, R, Opts); -getopts([ "--verbose=" ++ V | R], Opts) -> - Verbose = list_to_integer(V), - getopts(R, [{verbose, Verbose} | Opts]); -getopts([ "-v" ++ T | R], Opts) -> - Verbose = proplists:get_value(verbose, Opts, 0), - getopts_short_no_arg(T, R, [ {verbose, Verbose+1} | Opts]); -getopts([ "--format=state" | R], Opts) -> - getopts(R, [{format, state} | Opts]); -getopts([ "--format=c" | R], Opts) -> - getopts(R, [{format, c} | Opts]); -getopts([ "-C" ++ T | R], Opts) -> - getopts_alias_no_arg("--format=c", T, R, Opts); -getopts([ "--format=carray" | R], Opts) -> - getopts(R, [{format, carray} | Opts]); -getopts([ "--payload=" ++ Hex | R], Opts) -> - getopts(R, [{payload, hex_to_bin(Hex)} | Opts]); -getopts([ "--ssrc=" ++ Num | R], Opts) -> - getopts(R, [{ssrc, list_to_num(Num)} | Opts]); -getopts([ "-s" ++ T | R], Opts) -> - getopts_alias_arg("--ssrc", T, R, Opts); -getopts([ "--type=" ++ Num | R], Opts) -> - getopts(R, [{pt, list_to_num(Num)} | Opts]); -getopts([ "-t" ++ T | R], Opts) -> - getopts_alias_arg("--type", T, R, Opts); -getopts([ "--delay=" ++ Num | R], Opts) -> - getopts(R, [{delay, list_to_float(Num)} | Opts]); -getopts([ "-d" ++ T | R], Opts) -> - getopts_alias_arg("--delay", T, R, Opts); - -% parsing helpers -getopts([ "--" | R], Opts) -> - {R, normalize_opts(Opts)}; -getopts([ O = "--" ++ _ | _], _Opts) -> - usage("Invalid option: " ++ O), - halt(1); -getopts([ [ $-, C | _] | _], _Opts) when C < $0; C > $9 -> - usage("Invalid option: -" ++ [C]), - halt(1); - -getopts(R, Opts) -> - {R, normalize_opts(Opts)}. - -getopts_short_no_arg([], R, Opts) -> getopts(R, Opts); -getopts_short_no_arg(T, R, Opts) -> getopts([ "-" ++ T | R], Opts). - -getopts_alias_no_arg(A, [], R, Opts) -> getopts([A | R], Opts); -getopts_alias_no_arg(A, T, R, Opts) -> getopts([A, "-" ++ T | R], Opts). - -getopts_alias_arg(A, [], [T | R], Opts) -> getopts([A ++ "=" ++ T | R], Opts); -getopts_alias_arg(A, T, R, Opts) -> getopts([A ++ "=" ++ T | R], Opts). - -normalize_opts(Opts) -> - [ proplists:lookup(E, Opts) || E <- proplists:get_keys(Opts) ]. - -%%% conversions %%% - -bin_to_hex(Bin) -> [hd(integer_to_list(N,16)) || <> <= Bin]. -hex_to_bin(Hex) -> << <<(list_to_integer([Nib],16)):4>> || Nib <- Hex>>. - -list_to_num("-" ++ Str) -> -list_to_num(Str); -list_to_num("0x" ++ Str) -> list_to_integer(Str, 16); -list_to_num("0b" ++ Str) -> list_to_integer(Str, 2); -list_to_num(Str = [ $0 | _ ]) -> list_to_integer(Str, 8); -list_to_num(Str) -> list_to_integer(Str, 10). - -%%% dumping data %%% - -dump_opts(Dev, Opts) -> - dump_opts2(Dev, Opts, proplists:get_keys(Opts)). - -dump_opts2(Dev, Opts, [OptName | R]) -> - io:format(Dev, " ~-10s: ~p~n", - [OptName, proplists:get_value(OptName, Opts)]), - dump_opts2(Dev, Opts, R); -dump_opts2(_Dev, _Opts, []) -> ok. - -%%% logging %%% - -log(L, Fmt, Args, Opts) when is_list(Opts) -> - log(L, Fmt, Args, proplists:get_value(verbose, Opts, 0), Opts). - -log(debug, Fmt, Args, V, Opts) when V > 2 -> log2("DEBUG", Fmt, Args, Opts); -log(info, Fmt, Args, V, Opts) when V > 1 -> log2("INFO", Fmt, Args, Opts); -log(notice, Fmt, Args, V, Opts) when V > 0 -> log2("NOTICE", Fmt, Args, Opts); -log(warn, Fmt, Args, _V, Opts) -> log2("WARNING", Fmt, Args, Opts); -log(error, Fmt, Args, _V, Opts) -> log2("ERROR", Fmt, Args, Opts); - -log(Lvl, Fmt, Args, V, Opts) when V >= Lvl -> log2("", Fmt, Args, Opts); - -log(_, _, _, _i, _) -> ok. - -log2(Type, Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, "~s: " ++ Fmt, [Type | Args]); -log2("", Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, Fmt, Args); -log2(_Type, Fun, _Args, _Opts) when is_function(Fun, 1) -> - Fun(standard_error). - -%%% RTP packets %%% - -make_rtp_packet(P = #rtp_packet{version = 2}) -> - << (P#rtp_packet.version):2, - 0:1, % P - 0:1, % X - 0:4, % CC - (P#rtp_packet.marker):1, - (P#rtp_packet.payload_type):7, - (P#rtp_packet.seqno):16, - (P#rtp_packet.timestamp):32, - (P#rtp_packet.ssrc):32, - (P#rtp_packet.payload)/bytes - >>. - -parse_rtp_packet( - << 2:2, % Version 2 - 0:1, % P (not supported yet) - 0:1, % X (not supported yet) - 0:4, % CC (not supported yet) - M:1, - PT:7, - SeqNo: 16, - TS:32, - Ssrc:32, - Payload/bytes >>) -> - #rtp_packet{ - version = 0, - marker = M, - payload_type = PT, - seqno = SeqNo, - timestamp = TS, - ssrc = Ssrc, - payload = Payload}. - -%%% payload generation %%% - -next_payload(F) when is_function(F) -> - {F(), F}; -next_payload({F, D}) when is_function(F) -> - {P, D2} = F(D), - {P, {F, D2}}; -next_payload([P | R]) -> - {P, R}; -next_payload([]) -> - undef; -next_payload(Bin = <<_/bytes>>) -> - {Bin, Bin}. - -%%% real writing work %%% - -write_packets(_Dev, DS, _P, _F, 0, _O, _Opts) -> - DS; -write_packets(Dev, DataSource, P = #rtp_packet{}, F, L, O, Opts) -> - Format = proplists:get_value(format, Opts, state), - Ptime = proplists:get_value(duration, Opts, 160), - Delay = proplists:get_value(delay, Opts, 0), - Rate = proplists:get_value(rate, Opts, 8000), - case next_payload(DataSource) of - {Payload, DataSource2} -> - write_packet(Dev, Ptime * F / Rate + Delay, - P#rtp_packet{seqno = F, timestamp = F*Ptime+O, - payload = Payload}, - Format), - write_packets(Dev, DataSource2, P, F+1, L-1, O, Opts); - Other -> Other - end. - -write_packet(Dev, Time, P = #rtp_packet{}, Format) -> - Bin = make_rtp_packet(P), - - write_packet_line(Dev, Time, P, Bin, Format). - -write_packet_pre(Dev, carray) -> - io:format(Dev, - "struct {float t; int len; char *data;} packets[] = {~n", []); - -write_packet_pre(_Dev, _) -> ok. - -write_packet_post(Dev, carray) -> - io:format(Dev, "};~n", []); - -write_packet_post(_Dev, _) -> ok. - -write_packet_line(Dev, Time, _P, Bin, state) -> - io:format(Dev, "~f ~s~n", [Time, bin_to_hex(Bin)]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, c) -> - ByteList = [ [ $0, $x | integer_to_list(Byte, 16) ] || <> <= Bin ], - ByteStr = string:join(ByteList, ", "), - io:format(Dev, "/* time=~f, SeqNo=~B, TS=~B */ {~s}~n", [Time, N, TS, ByteStr]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, carray) -> - io:format(Dev, " /* RTP: SeqNo=~B, TS=~B */~n", [N, TS]), - io:format(Dev, " {~f, ~B, \"", [Time, size(Bin)]), - [ io:format(Dev, "\\x~2.16.0B", [Byte]) || <> <= Bin ], - io:format(Dev, "\"},~n", []). - -%%% real reading work %%% - -read_packets(Dev, Opts) -> - Format = proplists:get_value(in_format, Opts, state), - - read_packets(Dev, Opts, Format). - -read_packets(Dev, Opts, Format) -> - case read_packet(Dev, Opts, Format) of - eof -> []; - Tuple -> [Tuple | read_packets(Dev, Opts, Format)] - end. - -read_packet(Dev, Opts, bin) -> - Size = proplists:get_value(frame_size, Opts), - case file:read(Dev, Size) of - {ok, Data} -> {0, #rtp_packet{payload = iolist_to_binary(Data)}}; - eof -> eof - end; -read_packet(Dev, _Opts, Format) -> - case read_packet_line(Dev, Format) of - {Time, Bin} -> {Time, parse_rtp_packet(Bin)}; - eof -> eof - end. - -read_packet_line(Dev, state) -> - case io:fread(Dev, "", "~f ~s") of - {ok, [Time, Hex]} -> {Time, hex_to_bin(Hex)}; - eof -> eof - end. diff --git a/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st deleted file mode 100644 index e26d073..0000000 --- a/contrib/rtp/rtp_replay.st +++ /dev/null @@ -1,21 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. -FileStream fileIn: 'rtp_replay_shared.st'. - - -Eval [ - | replay file host dport | - - file := Smalltalk arguments at: 1 ifAbsent: [ 'rtpstream.state' ]. - host := Smalltalk arguments at: 2 ifAbsent: [ '127.0.0.1' ]. - dport := (Smalltalk arguments at: 3 ifAbsent: [ '4000' ]) asInteger. - sport := (Smalltalk arguments at: 4 ifAbsent: [ '0' ]) asInteger. - - replay := RTPReplay on: file fromPort: sport. - - Transcript nextPutAll: 'Going to stream now'; nl. - replay streamAudio: host port: dport. -] diff --git a/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st deleted file mode 100644 index 7b68c0f..0000000 --- a/contrib/rtp/rtp_replay_shared.st +++ /dev/null @@ -1,118 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. - -Object subclass: SDPUtils [ - "Look into using PetitParser." - SDPUtils class >> findPort: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'm=audio ') ifTrue: [ - | stream | - stream := line readStream - skip: 'm=audio ' size; - yourself. - ^ Number readFrom: stream. - ] - ]. - - ^ self error: 'Not found'. - ] - - SDPUtils class >> findHost: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'c=IN IP4 ') ifTrue: [ - | stream | - ^ stream := line readStream - skip: 'c=IN IP4 ' size; - upToEnd. - ] - ]. - - ^ self error: 'Not found'. - ] -] - -Object subclass: RTPReplay [ - | filename socket | - RTPReplay class >> on: aFile [ - ^ self new - initialize; - file: aFile; yourself - ] - - RTPReplay class >> on: aFile fromPort: aPort [ - ^ self new - initialize: aPort; - file: aFile; yourself - ] - - initialize [ - self initialize: 0. - ] - - initialize: aPort [ - socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort. - ] - - file: aFile [ - filename := aFile - ] - - localPort [ - ^ socket port - ] - - streamAudio: aHost port: aPort [ - | file last_time last_image udp_send dest | - - last_time := nil. - last_image := nil. - file := FileStream open: filename mode: #read. - - "Send the payload" - dest := Sockets.SocketAddress byName: aHost. - udp_send := [:payload | | datagram | - datagram := Sockets.Datagram data: payload contents address: dest port: aPort. - socket nextPut: datagram - ]. - - [file atEnd] whileFalse: [ - | lineStream time data now_image | - lineStream := file nextLine readStream. - - "Read the time, skip the blank, parse the data" - time := Number readFrom: lineStream. - lineStream skip: 1. - - data := WriteStream on: (ByteArray new: 30). - [lineStream atEnd] whileFalse: [ - | hex | - hex := lineStream next: 2. - data nextPut: (Number readFrom: hex readStream radix: 16). - ]. - - last_time isNil - ifTrue: [ - "First time, send it right now" - last_time := time. - last_image := Time millisecondClockValue. - udp_send value: data. - ] - ifFalse: [ - | wait_image new_image_time | - - "How long to wait?" - wait_image := last_image + ((time - last_time) * 1000). - [ wait_image > Time millisecondClockValue ] - whileTrue: [Processor yield]. - - udp_send value: data. - last_time := time. - last_image := wait_image. - ] - ] - ] -] - diff --git a/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st deleted file mode 100644 index 5f844df..0000000 --- a/contrib/rtp/rtp_replay_sip.st +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create a SIP connection and then stream... -""" - -PackageLoader - fileInPackage: #OsmoSIP. - -"Load for the replay code" -FileStream fileIn: 'rtp_replay_shared.st'. - - -Osmo.SIPCall subclass: StreamCall [ - | sem stream | - - createCall: aSDP [ - | sdp | - stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'. - sdp := aSDP % {stream localPort}. - ^ super createCall: sdp. - ] - - sem: aSemaphore [ - sem := aSemaphore - ] - - sessionNew [ - | host port | - Transcript nextPutAll: 'The call has started'; nl. - Transcript nextPutAll: sdp_result; nl. - - host := SDPUtils findHost: sdp_result. - port := SDPUtils findPort: sdp_result. - - [ - stream streamAudio: host port: port. - Transcript nextPutAll: 'Streaming has finished.'; nl. - ] fork. - ] - - sessionFailed [ - sem signal - ] - - sessionEnd [ - sem signal - ] -] - -Eval [ - | transport agent call sem sdp_fr sdp_amr | - - - sdp_fr := (WriteStream on: String new) - nextPutAll: 'v=0'; cr; nl; - nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 's=-'; cr; nl; - nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 't=0 0'; cr; nl; - nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl; - nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl; - nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl; - nextPutAll: 'a=fmtp:101 0-15'; cr; nl; - nextPutAll: 'a=ptime:20'; cr; nl; - contents. - - sem := Semaphore new. - transport := Osmo.SIPUdpTransport - startOn: '0.0.0.0' port: 5066. - agent := Osmo.SIPUserAgent createOn: transport. - transport start. - - call := (StreamCall - fromUser: 'sip:1000 at sip.zecke.osmocom.org' - host: '127.0.0.1' - port: 5060 - to: 'sip:123456 at 127.0.0.1' - on: agent) - sem: sem; yourself. - - call createCall: sdp_fr. - - - "Wait for the stream to have ended" - sem wait. - - (Delay forSeconds: 4) wait. -] diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua deleted file mode 100644 index c18a06b..0000000 --- a/contrib/rtp/timestamp_rtp.lua +++ /dev/null @@ -1,28 +0,0 @@ -print("Ni hao") - - -do - local tap = Listener.new("ip", "rtp") - local rtp_ssrc = Field.new("rtp.ssrc") - local frame_time = Field.new("frame.time_relative") - local rtp = Field.new("rtp") - - function tap.packet(pinfo, tvb, ip) - local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) - local rtp_data = rtp() - local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" - local f = io.open(filename, "a") - - f:write(tostring(frame_time()) .. " ") - f:write(tostring(rtp_data.value)) - f:write("\n") - f:close() - end - - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end -end diff --git a/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st deleted file mode 100644 index da0643e..0000000 --- a/contrib/sms/fill-hlr.st +++ /dev/null @@ -1,66 +0,0 @@ -"I create output for some simple SQL statements for the HLR db" - - -Eval [ - -"Create tables if they don't exist" -Transcript show: 'CREATE TABLE SMS ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - sent TIMESTAMP, - sender_id INTEGER NOT NULL, - receiver_id INTEGER NOT NULL, - deliver_attempts INTEGER NOT NULL DEFAULT 0, - valid_until TIMESTAMP, - reply_path_req INTEGER NOT NULL, - status_rep_req INTEGER NOT NULL, - protocol_id INTEGER NOT NULL, - data_coding_scheme INTEGER NOT NULL, - ud_hdr_ind INTEGER NOT NULL, - dest_addr TEXT, - user_data BLOB, - header BLOB, - text TEXT);'; nl; - show: 'CREATE TABLE Subscriber ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - updated TIMESTAMP NOT NULL, - imsi NUMERIC UNIQUE NOT NULL, - name TEXT, - extension TEXT UNIQUE, - authorized INTEGER NOT NULL DEFAULT 0, - tmsi TEXT UNIQUE, - lac INTEGER NOT NULL DEFAULT 0);'; nl. - -"Create some dummy subscribers" -num_sub := 1000. -num_sms := 30. -lac := 1. - -Transcript show: 'BEGIN;'; nl. - -1 to: num_sub do: [:each | - Transcript show: 'INSERT INTO Subscriber - (imsi, created, updated, authorized, lac, extension) - VALUES - (%1, datetime(''now''), datetime(''now''), 1, %2, %3);' % - {(274090000000000 + each). lac. each}; nl. -]. - -1 to: num_sms do: [:sms | - 1 to: num_sub do: [:sub | - Transcript show: 'INSERT INTO SMS - (created, sender_id, receiver_id, valid_until, - reply_path_req, status_rep_req, protocol_id, - data_coding_scheme, ud_hdr_ind, dest_addr, - text) VALUES - (datetime(''now''), 1, %1, ''2222-2-2'', - 0, 0, 0, - 0, 0, ''123456'', - ''abc'');' % {sub}; nl. - ] -]. - -Transcript show: 'COMMIT;'; nl. - -] diff --git a/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st deleted file mode 100644 index bd3f97a..0000000 --- a/contrib/sms/hlr-query.st +++ /dev/null @@ -1,10 +0,0 @@ -"Query for one SMS" - -Eval [ -1 to: 100 do: [:each | - Transcript show: 'SELECT SMS.* FROM SMS - JOIN Subscriber ON SMS.receiver_id = Subscriber.id - WHERE SMS.id >= 1 AND SMS.sent IS NULL AND Subscriber.lac > 0 - ORDER BY SMS.id LIMIT 1;'; nl. -]. -] diff --git a/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d deleted file mode 100644 index e75cdfc..0000000 --- a/contrib/sms/sqlite-probe.tap.d +++ /dev/null @@ -1,5 +0,0 @@ -probe process("/usr/lib/libsqlite3.so.0.8.6").function("sqlite3_get_table") -{ - a = user_string($zSql); - printf("sqlite3_get_table called '%s'\n", a); -} diff --git a/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service deleted file mode 100644 index c040e60..0000000 --- a/contrib/systemd/osmo-bsc-mgcp.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC MGCP - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service deleted file mode 100644 index a0b7829..0000000 --- a/contrib/systemd/osmo-gbproxy.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Osmocom Gb proxy - -[Service] -Type=simple -ExecStart=/usr/bin/osmo-gbproxy -c /etc/osmocom/osmo-gbproxy.cfg -Restart=always -RestartSec=2 -RestartPreventExitStatus=1 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service deleted file mode 100644 index 7cebb14..0000000 --- a/contrib/systemd/osmo-msc.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Osmocom Mobile Switching Center (MSC) -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service deleted file mode 100644 index 377497e..0000000 --- a/contrib/systemd/osmo-nitb.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC Network In the Box (NITB) - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3 -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service deleted file mode 100644 index bf6a8e0..0000000 --- a/contrib/systemd/osmo-sgsn.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=OpenBSC SGSN -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-sgsn -c /etc/osmocom/osmo-sgsn.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/testconv/Makefile b/contrib/testconv/Makefile deleted file mode 100644 index bb856f7..0000000 --- a/contrib/testconv/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -OBJS = testconv_main.o - -CC = gcc -CFLAGS = -O0 -ggdb -Wall -LDFLAGS = -CPPFLAGS = -I../.. -I../../include $(shell pkg-config --cflags libosmocore) $(shell pkg-config --cflags libbcg729) -LIBS = ../../src/libmgcp/libmgcp.a ../../src/libcommon/libcommon.a $(shell pkg-config --libs libosmocore) $(shell pkg-config --libs libbcg729) -lgsm -lrt - -testconv: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) - -testconv_main.o: testconv_main.c - -$(OBJS): - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c deleted file mode 100644 index 6c95c55..0000000 --- a/contrib/testconv/testconv_main.c +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "bscconfig.h" -#ifndef BUILD_MGCP_TRANSCODING -#error "Requires MGCP transcoding enabled (see --enable-mgcp-transcoding)" -#endif - -#include "openbsc/mgcp_transcode.h" - -static int audio_name_to_type(const char *name) -{ - if (!strcasecmp(name, "gsm")) - return 3; -#ifdef HAVE_BCG729 - else if (!strcasecmp(name, "g729")) - return 18; -#endif - else if (!strcasecmp(name, "pcma")) - return 8; - else if (!strcasecmp(name, "l16")) - return 11; - return -1; -} - -int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst); - -int main(int argc, char **argv) -{ - char buf[4096] = {0x80, 0}; - int cc, rc; - struct mgcp_rtp_end *dst_end; - struct mgcp_rtp_end *src_end; - struct mgcp_trunk_config tcfg = {{0}}; - struct mgcp_endpoint endp = {0}; - struct mgcp_process_rtp_state *state; - int in_size; - int in_samples = 160; - int out_samples = 0; - uint32_t ts = 0; - uint16_t seq = 0; - - osmo_init_logging(&log_info); - - tcfg.endpoints = &endp; - tcfg.number_endpoints = 1; - endp.tcfg = &tcfg; - mgcp_initialize_endp(&endp); - - dst_end = &endp.bts_end; - src_end = &endp.net_end; - - if (argc <= 2) - errx(1, "Usage: {gsm|g729|pcma|l16} {gsm|g729|pcma|l16} [SPP]"); - - if ((src_end->codec.payload_type = audio_name_to_type(argv[1])) == -1) - errx(1, "invalid input format '%s'", argv[1]); - if ((dst_end->codec.payload_type = audio_name_to_type(argv[2])) == -1) - errx(1, "invalid output format '%s'", argv[2]); - if (argc > 3) - out_samples = atoi(argv[3]); - - if (out_samples) { - dst_end->codec.frame_duration_den = dst_end->codec.rate; - dst_end->codec.frame_duration_num = out_samples; - dst_end->frames_per_packet = 1; - } - - rc = mgcp_transcoding_setup(&endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); - - state = dst_end->rtp_process_data; - OSMO_ASSERT(state != NULL); - - in_size = mgcp_transcoding_get_frame_size(state, in_samples, 0); - OSMO_ASSERT(sizeof(buf) >= in_size + 12); - - buf[1] = src_end->codec.payload_type; - *(uint16_t*)(buf+2) = htons(1); - *(uint32_t*)(buf+4) = htonl(0); - *(uint32_t*)(buf+8) = htonl(0xaabbccdd); - - while ((cc = read(0, buf + 12, in_size))) { - int cont; - int len; - - if (cc != in_size) - err(1, "read"); - - *(uint16_t*)(buf+2) = htonl(seq); - *(uint32_t*)(buf+4) = htonl(ts); - - seq += 1; - ts += in_samples; - - cc += 12; /* include RTP header */ - - len = cc; - - do { - cont = mgcp_transcoding_process_rtp(&endp, dst_end, - buf, &len, sizeof(buf)); - if (cont == -EAGAIN) { - fprintf(stderr, "Got EAGAIN\n"); - break; - } - - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); - - len -= 12; /* ignore RTP header */ - - if (write(1, buf + 12, len) != len) - err(1, "write"); - - len = cont; - } while (len > 0); - } - return 0; -} - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/channel_release.txt b/doc/channel_release.txt deleted file mode 100644 index c9cdfeb..0000000 --- a/doc/channel_release.txt +++ /dev/null @@ -1,95 +0,0 @@ - -GSM 04.08 7.1.7 / 9.1.7 RR CHANNEL RELESE - -RSL 08.58 3.4 / ? RLL Link Release Request - -RSL 08.58 4.6 / 8.4.5 DEACTivate SACCH - * Deactivate SACCH according to Channel Release Proc 04.08 - * to be sent after RR CHANNEL RELEASE is sent to MS - -RSL 08.58 4.7 / 8.4.14 RF CHANnel RELease - * tells the BTS to release a radio channel - * "when an activated radio channel is no longer needed" - * BTS responds with RF CHANnel RELease ACKnowledge - - -GSM 04.08 3.4.13: RR connection release procedure - -* network sends RR CHANNEL RELEASE to MS on the DCCH - * start T3109 - * deactivate SACCH -* MS disconnects main signalling link (by sending DISC) - * all other data links are disconnected by local end link release -* network receives DISC (BTS sends RLL REL IND to BSC) - * stop T3109 - * start T3111 -* when T3111 times out, the network can reuse the channls -* if T3109 times out, the network deactivates the channels - and can reuse them - * this probably means simply RF CHANnel RELease - - -== Implementation in OpenBSC == - -There are two possible reasons a gsm_subscriber_connection -will be released. One is a network failure, the other is -the completion of an operation/transaction. - -=== Failure === -The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback -and the MSC part will release all transactions, operations and such -and the channels will be released as error case. - -=== Success === -Every time an 'operation' or 'transaction' is finished msc_release_connection -will be called and it will determine if the gsm_subscriber_connection can -be released. - -In case it can be released bsc_api.c:gsm0808_clear will be called -which will release all lchan's associated with the connection. For the -primary channel a SACH Deactivate will be send with the release -reason NORMAL RELEASE. - - -bsc_api.c:gsm0808_clear - * Release a channel used for handover - * Release the primary lchan with normal release, SACH deactivate - -chan_alloc.c:lchan_release(chan, sacch_deactivate, reason) - * Start the release procedure. It is working in steps with callbacks - coming from the abis_rsl.c code. - * Release all SAPI's > 0 as local end (The BTS should send a - REL_CONF a message) - * Send SACH Deactivate on SAPI=0 if required. - * Start T3109 (stop it when the main signalling link is disconnected) - or when the channel released. On timeout start the error handling. - * abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are - released and after T3111 has timed out or there is an error. - -RX of RELease INDication: - * Calls internal rsl_handle_release which might release the RF. - -RX of RELease CONFirmation: - * Calls internal rsl_handle_release which might release the RF. - -* RX of RF_CHAN_REL_ACK - * call lchan_free() - - -=== Integration with SMS === - -* RX of CP_ERROR or unimplemented MT - * trigger trans_free() which will msc_release_connection() - -* CP TC1* expired while waiting for CP-ACK - * trigger trans_free() which will msc_release_connection() - -* RX of RP_ERROR - * trigger trans_free() which will msc_release_connection() - -* TX of CP-ACK in MT DELIVER - * trigger trans_free() which will msc_release_connection() - -* RX of CP-ACK in MO SUBMIT - * trigger trans_free() which will msc_release_connection() - diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg deleted file mode 100644 index 3c43f1f..0000000 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! MGCP configuration hand edited -! ! -password foo -! -line vty - no login -! -mgcp - !local ip 10.23.24.2 - !bts ip 10.24.24.1 - !bind ip 10.23.24.1 - bind port 2427 - rtp base 4000 - rtp force-ptime 20 - sdp audio payload number 98 - sdp audio payload name AMR/8000 - number endpoints 31 - no rtcp-omit diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg deleted file mode 100644 index 15fd74a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg +++ /dev/null @@ -1,44 +0,0 @@ -! -! OsmoGbProxy (UNKNOWN) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -ns - nse 666 nsvci 666 - nse 666 remote-role sgsn -! nse 666 encapsulation framerelay-gre -! nse 666 remote-ip 172.16.1.70 -! nse 666 fr-dlci 666 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-port 23000 -! encapsulation framerelay-gre enabled 1 -gbproxy - sgsn nsei 666 - core-mobile-country-code 666 - core-mobile-network-code 6 - core-access-point-name none match-imsi ^666066|^66607 - tlli-list max-length 200 diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg deleted file mode 100644 index 0c3917a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty -!! -! -line vty - no login -! -gbproxy - sgsn nsei 101 -ns - nse 101 nsvci 101 - nse 101 remote-role sgsn - nse 101 encapsulation udp - nse 101 remote-ip 192.168.100.239 - nse 101 remote-port 7777 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation framerelay-gre enabled 0 - encapsulation framerelay-gre local-ip 0.0.0.0 - encapsulation udp local-port 23000 diff --git a/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt deleted file mode 100644 index 9c65f92..0000000 --- a/doc/examples/osmo-gtphub/gtphub-example.txt +++ /dev/null @@ -1,90 +0,0 @@ -Here is a simple setup to test GTPHub operations. The IP addresses picked will -work well only on a system that creates local addresses (127.0.0.123) on the -fly (like linux) -- you may pick of course different IP addresses. - -Overview of the example setup: - - sgsnemu gtphub ggsn - 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 - -Prerequisites: openggsn. - -Have a local directory where you store config files and from which you launch -the GSNs and the hub (they will store restart counter files in that dir). -In it, have these config files: - -ggsn.conf: - - # GGSN local address - listen 127.0.0.2 - - # End User Addresses are picked from this range - net 10.23.42.0/24 - - pcodns1 8.8.8.8 - - logfile /tmp/foo - -gtphub.conf: - - gtphub - bind-to-sgsns 127.0.0.3 - bind-to-ggsns 127.0.0.4 - ggsn-proxy 127.0.0.2 - end - - -( -You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX -address and GGSN IP address to /etc/hosts something like: - - 127.0.0.2 internet.mnc070.mcc901.gprs - -) - - -Once the config files are in place, start the programs, in separate terminals. -GGSN and SGSN need to be started with root priviliges to be able to create tun -interfaces. GTPHub may run as unprivileged user. - -The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. - - -1. GGSN: - - sudo -s - cd - LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf - -2. GTPHub: - - cd - path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level - -3. SGSN tests: - - sudo -s - cd - /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --imsi 420001214365100 --contexts=3 - -Add more SGSNs using different IMSIs and local ports (if the same IMSI is used, -the GGSN will reuse TEIs and tunnels will be discarded automatically): - - /usr/local/bin/sgsnemu --createif -l 127.0.0.11 -r 127.0.0.3 --imsi 420001214365300 --contexts=3 - -This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu -still needs some effort to announce a mobile subscriber or the like (I have -used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). - -The core capability of GTPHub is to manage more than two GSNs, e.g. an SGSN -contacting various GGSNs over the single GTPHub link. You would configure the -SGSN to use one fixed GGSN (sending to gtphub) and gtphub will resolve the -GGSNs once it has received the messages. So the SGSN may be behind NAT (add -"sgsn-use-sender" to gtphub.conf) and communicate to various GGSNs over a -single link to gtphub. - -I hope this helps to get you going. -Any suggestions/patches are welcome! - -~Neels - diff --git a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg deleted file mode 100644 index 3913d2c..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! -! This file is used for VTY tests, referenced by openbsc/osmoappdesc.py -! For the test, try to use most config commands. -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, both on one interface. - ! The side towards SGSN uses nonstandard ports. - bind-to-sgsns ctrl 127.0.0.1 12123 user 127.0.0.1 12153 - ! The GGSN side with standard ports. - bind-to-ggsns 127.0.0.1 - - ! Proxy: unconditionally direct all traffic to... - sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg deleted file mode 100644 index 0dc4150..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, each on standard ports - ! 2123 and 2152. Setting these addresses is mandatory. - bind-to-sgsns 127.0.0.1 - bind-to-ggsns 127.0.0.2 - - ! Local nonstandard ports or separate IPs: - !bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223 - - ! Proxy: unconditionally direct all traffic to... - !ggsn-proxy 127.0.0.3 - !sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - !ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - !grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg deleted file mode 100644 index 1b1d192..0000000 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! OsmoMSC configuration saved from vty -! -line vty - no login -! -network - network country code 1 - mobile network code 1 - short name OsmoMSC - long name OsmoMSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - rrlp mode none - mm info 1 -msc - mgcpgw remote-ip 10.23.24.1 - assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg deleted file mode 100644 index 5e64342..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ /dev/null @@ -1,27 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy accept-all -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg deleted file mode 100644 index 06f035f..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ /dev/null @@ -1,29 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy remote - gsup remote-ip 127.0.0.1 - gsup remote-port 4222 -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/oml-interface.txt b/doc/oml-interface.txt deleted file mode 100644 index 02bead7..0000000 --- a/doc/oml-interface.txt +++ /dev/null @@ -1,22 +0,0 @@ -oml interface design notes - -problems: - -* there is no way how to tag a command sent to the BTS, with the response - having the same tag to identify the originator of the command -* therefore, we can have e.g. both the BSC and the OML interface send a - SET ATTRIBUTE message, where the responses would end up at the wrong - query. -* The BTS has 10s to ACK/NACK a command. We do not run any timers. - -the only possible solutions i can imagine: -* have some kind of exclusive locking, where the OML interface gets blocked - from the BSC and is exclusively assigned to the OML console until all commands - of the OML console have terminated. This can either be done explicitly - dynamically or on demand - -* use the OML interface synchronously, i.e. always wait for the response from - the BTS before - -* unilateral / unsolicited messages need to be broadcasted to both the BSC and - the OML console diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h deleted file mode 100644 index 3cdbe04..0000000 --- a/include/openbsc/gsm_04_14.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode); -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs); -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology); - -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg); diff --git a/osmoappdesc.py b/osmoappdesc.py index 021bf5b..36eb1a7 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -14,24 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see - -# Most systems won't be able to use these, so they're separated out -nitb_e1_configs = [ - "doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc.cfg", - "doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg", - "doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", - "doc/examples/osmo-nitb/rbs2308/openbsc.cfg" -] - - app_configs = { "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } - apps = [(4242, "src/osmo-bsc/osmo-bsc", "OsmoBSC", "osmo-bsc"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c deleted file mode 100644 index 5128ac1..0000000 --- a/src/libcommon/oap_client.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures ++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c deleted file mode 100644 index b529f4c..0000000 --- a/src/libmsc/gsm_04_14.c +++ /dev/null @@ -1,133 +0,0 @@ -/* GSM MS Testing Layer 3 messages - * 3GPP TS 44.014 / GSM TS 04.14 */ - -/* (C) 2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include "bscconfig.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static struct msgb *create_gsm0414_msg(uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_TEST; - gh->msg_type = msg_type; - return msg; -} - -static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - return msc_tx_dtap(conn, msg); -} - -static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) -{ - struct msgb *msg = create_gsm0414_msg(msg_type); - - return gsm0414_conn_sendmsg(conn, msg); -} - - -/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); - uint8_t subch; - - subch = (loop_mode << 1); - msgb_put_u8(msg, subch); - - msg->lchan = conn->lchan; - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a OPEN_LOOP_CMD according to Section 8.3 */ -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); -} - -/* Send a ACT_EMMI_CMD according to Section 8.8 */ -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); -} - -/* Send a DEACT_EMMI_CMD according to Section 8.10 */ -int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); -} - -/* Send a TEST_INTERFACE according to Section 8.11 */ -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); - msgb_put_u8(msg, tested_devs); - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); - msgb_put_u8(msg, technology); - return gsm0414_conn_sendmsg(conn, msg); -} - - - -/* Entry point for incoming GSM48_PDISC_TEST received from MS */ -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - - if (msgb_l3len(msg) < sizeof(*gh)) - return -1; - - LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", - get_value_string(gsm414_msgt_names, gh->msg_type)); - - return 0; -} diff --git a/tools/hlrstat.pl b/tools/hlrstat.pl deleted file mode 100755 index 668fc9a..0000000 --- a/tools/hlrstat.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -use strict; -use DBI; -my $dbh = DBI->connect("dbi:SQLite:dbname=hlr.sqlite3","",""); - - -my %mcc_names; -my %mcc_mnc_names; - -sub get_mcc_mnc_name($) -{ - my $mcc_mnc = shift; - my $ret = $mcc_mnc; - - if ($mcc_mnc_names{$mcc_mnc} ne '') { - $ret = $mcc_mnc_names{$mcc_mnc}; - } - - return $ret; -} - -sub read_networks($) -{ - my $filename = shift; - my $cur_name; - - open(INFILE, $filename); - while (my $l = ) { - chomp($l); - if ($l =~ /^#/) { - next; - } - if ($l =~ /^\t/) { - my ($mcc, $mnc, $brand, $r) = split(' ', $l, 4); - #printf("%s|%s|%s\n", $mcc, $mnc, $brand); - $mcc_mnc_names{"$mcc-$mnc"} = $brand; - $mcc_names{$mcc} = $cur_name; - } elsif ($l =~ /^(\w\w)\t(.*)/) { - #printf("%s|%s\n", $1, $2); - $cur_name = $2; - } - } - close(INFILE); -} - -read_networks("networks.tab"); - -my %oper_count; -my %country_count; - -#my $sth = $dbh->prepare("SELECT imsi FROM subscriber where authorized=1"); -my $sth = $dbh->prepare("SELECT imsi FROM subscriber"); - -$sth->execute(); - -while (my $href = $sth->fetchrow_hashref) { - my ($mcc, $mnc) = $$href{imsi} =~ /(\d{3})(\d{2}).*/; - #printf("%s %s-%s \n", $$href{imsi}, $mcc, $mnc); - $oper_count{"$mcc-$mnc"}++; - $country_count{$mcc}++; -} - - -foreach my $c (sort{$country_count{$b} <=> $country_count{$a}} keys %country_count) { - printf("%s: %d\n", $mcc_names{$c}, $country_count{$c}); - - foreach my $k (sort{$oper_count{$b} <=> $oper_count{$a}} keys %oper_count) { - if ($k =~ /^$c-/) { - printf("\t%s: %d\n", get_mcc_mnc_name($k), $oper_count{$k}); - } - } -} -- To view, visit https://gerrit.osmocom.org/3795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:45:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:45:10 +0000 Subject: osmo-msc[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 reinstate previous +2 after rebase and minor punctuation fix -- To view, visit https://gerrit.osmocom.org/3800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:45:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:45:29 +0000 Subject: [MERGED] osmo-msc[master]: rewrite README In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rewrite README ...................................................................... rewrite README Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 --- M README 1 file changed, 19 insertions(+), 34 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/README b/README index d01b2cf..a45ef95 100644 --- a/README +++ b/README @@ -1,39 +1,24 @@ -About OpenBSC +About OsmoMSC ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoMSC was one of the parts split off from the old openbsc.git. Before, it was +the libmsc part of the old OsmoNITB. Since a true A interface and IuCS for 3G +support is available, OsmoMSC exists only as a separate standalone entity. -Various interfaces towards the BTS are supported, among which are: +OsmoMSC exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoMSC issue tracker and wiki online at +https://osmocom.org/projects/osmomsc +https://osmocom.org/projects/osmomsc/wiki -- To view, visit https://gerrit.osmocom.org/3800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2bdcf42c2f3340fe0d33ecd85368904312127cb9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:45:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:45:29 +0000 Subject: [MERGED] osmo-msc[master]: drop files unrelated to osmo-msc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: drop files unrelated to osmo-msc ...................................................................... drop files unrelated to osmo-msc These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-msc. Empty out contrib: remove things that are either obviously unrelated to osmo-msc, or seem old and/or esoteric. Change-Id: I49957769e09eed6d723bf7c3777024b62b3480fd --- D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/mgcp_server.py D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/systemd/osmo-bsc-mgcp.service D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D doc/call-routing.txt D doc/e1-data-model.txt D doc/examples/osmo-bsc_nat/bscs.cfg D doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg D doc/gsm-hopping.txt D doc/handover.txt D doc/ipa-sccp.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt M osmoappdesc.py 47 files changed, 0 insertions(+), 2,705 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua deleted file mode 100644 index f5d5502..0000000 --- a/contrib/a-link/sccp-split-by-con.lua +++ /dev/null @@ -1,170 +0,0 @@ --- Split trace based on SCCP Source --- There are still bugs to find... bugs bugs bugs... hmm -do - local function init_listener() - print("CREATED LISTENER") - local tap = Listener.new("ip", "sccp && (ip.src == 172.16.1.81 || ip.dst == 172.16.1.81)") - local sccp_type_field = Field.new("sccp.message_type") - local sccp_src_field = Field.new("sccp.slr") - local sccp_dst_field = Field.new("sccp.dlr") - local msg_type_field = Field.new("gsm_a.dtap_msg_mm_type") - local lu_rej_field = Field.new("gsm_a.dtap.rej_cause") - local ip_src_field = Field.new("ip.src") - local ip_dst_field = Field.new("ip.dst") - - -- - local bssmap_msgtype_field = Field.new("gsm_a.bssmap_msgtype") - -- assignment failure 0x03 - -- - - -- - local dtap_cause_field = Field.new("gsm_a_dtap.cause") - local dtap_cc_field = Field.new("gsm_a.dtap_msg_cc_type") - - local connections = {} - - function check_failure(con) - check_lu_reject(con) - check_disconnect(con) - check_failures(con) - end - - -- cipher mode reject - function check_failures(con) - local msgtype = bssmap_msgtype_field() - if not msgtype then - return - end - - msgtype = tonumber(msgtype) - if msgtype == 89 then - print("Cipher mode reject") - con[4] = true - elseif msgtype == 0x03 then - print("Assignment failure") - con[4] = true - elseif msgtype == 0x22 then - print("Clear Request... RF failure?") - con[4] = true - end - end - - -- check if a DISCONNECT is normal - function check_disconnect(con) - local msg_type = dtap_cc_field() - if not msg_type then - return - end - - if tonumber(msg_type) ~= 0x25 then - return - end - - local cause = dtap_cause_field() - if not cause then - return - end - - cause = tonumber(cause) - if cause ~= 0x10 then - print("DISCONNECT != Normal") - con[4] = true - end - end - - -- check if we have a LU Reject - function check_lu_reject(con) - local msg_type = msg_type_field() - if not msg_type then - return - end - - msg_type = tonumber(tostring(msg_type)) - if msg_type == 0x04 then - print("LU REJECT with " .. tostring(lu_rej_field())) - con[4] = true - end - end - - function tap.packet(pinfo,tvb,ip) - local ip_src = tostring(ip_src_field()) - local ip_dst = tostring(ip_dst_field()) - local sccp_type = tonumber(tostring(sccp_type_field())) - local sccp_src = sccp_src_field() - local sccp_dst = sccp_dst_field() - - local con - - if sccp_type == 0x01 then - elseif sccp_type == 0x2 then - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local datestring = os.date("%Y%m%d%H%M%S") - local pcap_name = string.format("alink_trace_%s-%s_%s.pcap", src, dst, datestring) - local dumper = Dumper.new_for_current(pcap_name) - - local con = { ip_src, tostring(sccp_src), tostring(sccp_dst), false, dumper, pcap_name } - - dumper:dump_current() - connections[src] = con - connections[dst] = con - elseif sccp_type == 0x4 then - -- close a connection... remove it from the list - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - - local con = connections[src] - if not con then - return - end - - con[5]:dump_current() - con[5]:flush() - - -- this causes a crash on unpacted wireshark - con[5]:close() - - -- the connection had a failure - if con[4] == true then - local datestring = os.date("%Y%m%d%H%M%S") - local new_name = string.format("alink_failure_%s_%s-%s.pcap", datestring, con[2], con[3]) - os.rename(con[6], new_name) - else - os.remove(con[6]) - end - - - -- clear the old connection - connections[src] = nil - connections[dst] = nil - - elseif sccp_type == 0x5 then - -- not handled yet... we should verify stuff here... - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - return - end - con[5]:dump_current() - elseif sccp_type == 0x6 then - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - print("DON'T KNOW THIS CONNECTION for " .. ip_dst) - return - end - con[5]:dump_current() - check_failure(con) - end - - end - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end - end - - init_listener() -end diff --git a/contrib/bsc-test/README b/contrib/bsc-test/README deleted file mode 100644 index adb222e..0000000 --- a/contrib/bsc-test/README +++ /dev/null @@ -1 +0,0 @@ -Some crazy scripts call testing... and MSC link failure simulation diff --git a/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial deleted file mode 100644 index 96e5f00..0000000 --- a/contrib/bsc-test/all_dial +++ /dev/null @@ -1,8 +0,0 @@ -ABORT BUSY -ABORT 'NO CARRIER' -ABORT 'OK' - -'' AT -SAY "Dialing a number\n" -'OK' ATD05660066; - diff --git a/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh deleted file mode 100755 index e5e19f6..0000000 --- a/contrib/bsc-test/dial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Evil dial script.. - -while true; -do - chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0 - sleep 5s - chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0 - sleep 2s -done - diff --git a/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh deleted file mode 100755 index 84eead7..0000000 --- a/contrib/bsc-test/drop-oml.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -sleep 3 -echo "enable" -sleep 1 -echo "drop bts connection 0 oml" -sleep 1 diff --git a/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh deleted file mode 100755 index c7b66ba..0000000 --- a/contrib/bsc-test/drop.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Going to drop the OML connection" - ./drop-oml.sh | telnet 127.0.0.1 4242 - sleep 58m -done diff --git a/contrib/bsc-test/hangup b/contrib/bsc-test/hangup deleted file mode 100644 index cad6870..0000000 --- a/contrib/bsc-test/hangup +++ /dev/null @@ -1,4 +0,0 @@ -TIMEOUT 10 -'' ^Z -SAY "Waiting for hangup confirm\n" -'' ATH; diff --git a/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh deleted file mode 100755 index bec011d..0000000 --- a/contrib/bsc-test/msc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` - sleep 58s -done diff --git a/contrib/bsc_control.py b/contrib/bsc_control.py deleted file mode 100755 index c1b09ce..0000000 --- a/contrib/bsc_control.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/python -# -*- mode: python-mode; py-indent-tabs-mode: nil -*- -""" -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -""" - -from optparse import OptionParser -from ipa import Ctrl -import socket - -verbose = False - -def connect(host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - return sck - -def do_set_get(sck, var, value = None): - (r, c) = Ctrl().cmd(var, value) - sck.send(c) - answer = Ctrl().rem_header(sck.recv(4096)) - return (answer,) + Ctrl().verify(answer, r, var, value) - -def set_var(sck, var, val): - (a, _, _) = do_set_get(sck, var, val) - return a - -def get_var(sck, var): - (_, _, v) = do_set_get(sck, var) - return v - -def _leftovers(sck, fl): - """ - Read outstanding data if any according to flags - """ - try: - data = sck.recv(1024, fl) - except socket.error as (s_errno, strerror): - return False - if len(data) != 0: - tail = data - while True: - (head, tail) = Ctrl().split_combined(tail) - print "Got message:", Ctrl().rem_header(head) - if len(tail) == 0: - break - return True - return False - -if __name__ == '__main__': - parser = OptionParser("Usage: %prog [options] var [value]") - parser.add_option("-d", "--host", dest="host", - help="connect to HOST", metavar="HOST") - parser.add_option("-p", "--port", dest="port", type="int", - help="use PORT", metavar="PORT", default=4249) - parser.add_option("-g", "--get", action="store_true", - dest="cmd_get", help="perform GET operation") - parser.add_option("-s", "--set", action="store_true", - dest="cmd_set", help="perform SET operation") - parser.add_option("-v", "--verbose", action="store_true", - dest="verbose", help="be verbose", default=False) - parser.add_option("-m", "--monitor", action="store_true", - dest="monitor", help="monitor the connection for traps", default=False) - - (options, args) = parser.parse_args() - - verbose = options.verbose - - if options.cmd_set and options.cmd_get: - parser.error("Get and set options are mutually exclusive!") - - if not (options.cmd_get or options.cmd_set or options.monitor): - parser.error("One of -m, -g, or -s must be set") - - if not (options.host): - parser.error("Destination host and port required!") - - sock = connect(options.host, options.port) - - if options.cmd_set: - if len(args) < 2: - parser.error("Set requires var and value arguments") - _leftovers(sock, socket.MSG_DONTWAIT) - print "Got message:", set_var(sock, args[0], ' '.join(args[1:])) - - if options.cmd_get: - if len(args) != 1: - parser.error("Get requires the var argument") - _leftovers(sock, socket.MSG_DONTWAIT) - (a, _, _) = do_set_get(sock, args[0]) - print "Got message:", a - - if options.monitor: - while True: - if not _leftovers(sock, 0): - print "Connection is gone." - break - sock.close() diff --git a/contrib/bt.py b/contrib/bt.py deleted file mode 100755 index 1b111ef..0000000 --- a/contrib/bt.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os - -f = open("unbalanced") -lines = [] -for line in f: - lines.append(line) - -filenames = {} - -output = [] -for line in lines: - if "[0x" in line: - start = line.find("[") - end = line.find("]") - addr = line[start+1:end] - try: - file = filenames[addr] - except KeyError: - r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr) - all = r.read().replace("\n", ",") - file = all - filenames[addr] = file - - line = line.replace(addr, file) - output.append(line) - -g = open("unbalanced.2", "w") -g.write("".join(output)) - - - diff --git a/contrib/convert_to_enum.py b/contrib/convert_to_enum.py deleted file mode 100755 index bcd6f2c..0000000 --- a/contrib/convert_to_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# -# Convert ETSI documents to an enum -# - -import re, sys - -def convert(string): - string = string.strip().replace(" ", "").rjust(8, "0") - var = 0 - offset = 7 - for char in string: - assert offset >= 0 - var = var | (int(char) << offset) - offset = offset - 1 - - return var - -def string(name): - name = name.replace(" ", "_") - name = name.replace('"', "") - name = name.replace('/', '_') - name = name.replace('(', '_') - name = name.replace(')', '_') - return "%s_%s" % (sys.argv[2], name.upper()) - -file = open(sys.argv[1]) - - -for line in file: - m = re.match(r"[ \t]*(?P[01 ]+)[ ]+(?P[a-zA-Z /0-9()]+)", line[:-1]) - - if m: - print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"])) - else: - print line[:-1] diff --git a/contrib/ctrl2sse.py b/contrib/ctrl2sse.py deleted file mode 100755 index 8b630ec..0000000 --- a/contrib/ctrl2sse.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python2 - -mod_license = ''' -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -''' - -import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control -from eventsource import listener, request - -''' -N. B: this is not an example of building proper REST API or building secure web application. -It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API. -Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem -from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that. -''' - -token = None -stream = None -url = None - -''' -Returns json according to following schema - see http://json-schema.org/documentation.html for details: -{ - "title": "Ctrl Schema", - "type": "object", - "properties": { - "variable": { - "type": "string" - }, - "varlue": { - "type": "string" - } - }, - "required": ["interface", "variable", "value"] -} -Example validation from command-line: -json validate --schema-file=schema.json --document-file=data.json -The interface is represented as string because it might look different for IPv4 vs v6. -''' - -def read_header(data): - t_length = bsc_control.ipa_ctrl_header(data) - if (t_length): - stream.read_bytes(t_length - 1, callback = read_trap) - else: - print >> sys.stderr, "protocol error: length missing in %s!" % data - - at tornado.gen.coroutine -def read_trap(data): - (t, z, v, p) = data.split() - if (t != 'TRAP' or int(z) != 0): - print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z)) - else: - yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token), - method = 'POST', - headers = {'Content-Type': 'application/json'}, - body = tornado.escape.json_encode({ 'variable' : v, 'value' : p }))) - stream.read_bytes(4, callback = read_header) - - at tornado.gen.coroutine -def trap_setup(host, port, target_host, target_port, tk): - global stream - global url - global token - token = tk - url = "http://%s:%s/sse" % (host, port) - stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port) - stream.read_bytes(4, callback = read_header) - -def get_v(s, v): - return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) } - -class CtrlHandler(tornado.web.RequestHandler): - def initialize(self): - self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port']) - - def get(self, v): - self.write(get_v(self.skt, v)) - - def post(self): - self.write(get_v(self.skt, self.get_argument("variable"))) - -class SetCtrl(CtrlHandler): - def get(self, var, val): - bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val)) - super(SetCtrl, self).get(tornado.escape.native_str(var)) - - def post(self): - bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value"))) - super(SetCtrl, self).post() - -class Slash(tornado.web.RequestHandler): - def get(self): - self.write('%sUsing Tornado framework v%s' - '
' - '' - '' - '
' - '
' - '' - '' - '' - '
' - '' % ("Osmocom Control Interface Proxy", tornado.version)) - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.') - p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port") - p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress") - p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface") - p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface") - p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)") - p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value") - p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000") - args = p.parse_args() - random.seed() - tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver - logging.basicConfig() - application = tornado.web.Application([ - (r"/", Slash), - (r"/get", CtrlHandler), - (r"/get/(.*)", CtrlHandler), - (r"/set", SetCtrl), - (r"/set/(.*)/(.*)", SetCtrl), - (r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)), - ], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port) - application.listen(address = args.host, port = args.port) - trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token) - tornado.ioloop.IOLoop.instance().start() diff --git a/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py deleted file mode 100755 index 0cd4b87..0000000 --- a/contrib/gprs/gb-proxy-unblock-bug.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -""" -demonstrate a unblock bug on the GB Proxy.. -""" - -bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7" -ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7" - -bts_ns_unblock = "\x06" -ns_unblock_ack = "\x07" - -bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02" -ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00" - -bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40" - - -import socket -socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -socket.bind(("0.0.0.0", 0)) -socket.setblocking(1) - - -import sys -port = int(sys.argv[1]) -print "Sending data to port: %d" % port - -def send_and_receive(packet): - socket.sendto(packet, ("127.0.0.1", port)) - - try: - data, addr = socket.recvfrom(4096) - except socket.error, e: - print "ERROR", e - import sys - sys.exit(0) - return data - -#send stuff once - -to_send = [ - (bts_ns_reset, ns_reset_ack, "reset ack"), - (bts_ns_unblock, ns_unblock_ack, "unblock ack"), - (bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"), -] - - -for (out, inp, type) in to_send: - res = send_and_receive(out) - if res != inp: - print "Failed to get the %s" % type - sys.exit(-1) - -import time -time.sleep(3) -res = send_and_receive(bts_bvc_reset_8167) -print "Sent all messages... check wireshark for the last response" diff --git a/contrib/gprs/gprs-bssgp-histogram.lua b/contrib/gprs/gprs-bssgp-histogram.lua deleted file mode 100644 index b1ab5df..0000000 --- a/contrib/gprs/gprs-bssgp-histogram.lua +++ /dev/null @@ -1,78 +0,0 @@ --- Simple LUA script to print the size of BSSGP messages over their type... - -do - local ip_bucket = {} - - local pdu_types = {} - pdu_types[ 6] = "PAGING" - pdu_types[11] = "SUSPEND" - pdu_types[12] = "SUSPEND-ACK" - pdu_types[32] = "BVC-BLOCK" - pdu_types[33] = "BVC-BLOCK-ACK" - pdu_types[34] = "BVC-RESET" - pdu_types[35] = "BVC-RESET-ACK" - pdu_types[36] = "UNBLOCK" - pdu_types[37] = "UNBLOCK-ACK" - pdu_types[38] = "FLOW-CONTROL-BVC" - pdu_types[39] = "FLOW-CONTROL-BVC-ACK" - pdu_types[40] = "FLOW-CONTROL-MS" - pdu_types[41] = "FLOW-CONTROL-MS-ACK" - pdu_types[44] = "LLC-DISCARDED" - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local udp_length_get = Field.new("udp.length") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = udp_length_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - pdu = tostring(pdu) - if tonumber(pdu) == 0 or tonumber(pdu) == 1 then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_histo = ip_bucket[ip_src] - if not bssgp_histo then - bssgp_histo = {} - ip_bucket[ip_src] = bssgp_histo - end - - local key = pdu - local bucket = bssgp_histo[key] - if not bucket then - bucket = {} - bssgp_histo[key] = bucket - end - - table.insert(bucket, tostring(len)) - print("IP: " .. ip_src .. " PDU: " .. pdu_types[tonumber(pdu)] .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-buffer-count.lua b/contrib/gprs/gprs-buffer-count.lua deleted file mode 100644 index ca8864a..0000000 --- a/contrib/gprs/gprs-buffer-count.lua +++ /dev/null @@ -1,80 +0,0 @@ --- I count the buffer space needed for LLC PDUs in the worse case and print it - -do - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- bssgp filters - local bssgp_pdu_get = Field.new("bssgp.pdu_type") - local bssgp_delay_get = Field.new("bssgp.delay_val") - local llcgprs_get = Field.new("llcgprs") - local pdus = nil - - print("START...") - - local tap = Listener.new("ip", "udp.port == 23000 && bssgp.pdu_type == 0") - function tap.packet(pinfo,tvb,ip) - local pdu = bssgp_pdu_get() - local len = llcgprs_get().len - local delay = bssgp_delay_get() - - -- only handle bssgp, but we also want the IP frame - if not pdu then - return - end - - if tonumber(tostring(delay)) == 65535 then - pdus = { next = pdus, - len = len, - expires = -1 } - else - local off = tonumber(tostring(delay)) / 100.0 - pdus = { next = pdus, - len = len, - expires = pinfo.rel_ts + off } - end - local now_time = tonumber(tostring(pinfo.rel_ts)) - local now_size = 0 - local l = pdus - local prev = nil - local count = 0 - while l do - if now_time < l.expires or l.expires == -1 then - now_size = now_size + l.len - prev = l - l = l.next - count = count + 1 - else - -- delete things - if prev == nil then - pdus = nil - l = nil - else - prev.next = l.next - l = l.next - end - end - end --- print("TOTAL: " .. now_time .. " PDU_SIZE: " .. now_size) - print(now_time .. " " .. now_size / 1024.0 .. " " .. count) --- print("NOW: " .. tostring(pinfo.rel_ts) .. " Delay: " .. tostring(delay) .. " Length: " .. tostring(len)) - end - - function tap.draw() - -- well... this will not be called... --- for ip,bssgp_histo in pairs(dumpers) do --- print("IP " .. ip) --- end - print("END") - end - - function tap.reset() - -- well... this will not be called... - end - end - - init_listener() -end diff --git a/contrib/gprs/gprs-split-trace-by-tlli.lua b/contrib/gprs/gprs-split-trace-by-tlli.lua deleted file mode 100644 index 018c377..0000000 --- a/contrib/gprs/gprs-split-trace-by-tlli.lua +++ /dev/null @@ -1,46 +0,0 @@ --- Create a file named by_ip/''ip_addess''.cap with all ip traffic of each ip host. (works for tshark only) --- Dump files are created for both source and destination hosts -do - local dir = "by_tlli" - local dumpers = {} - local function init_listener() - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - local field_tlli = Field.new("bssgp.tlli") - local tap = Listener.new("ip", "udp.port == 23000") - - -- we will be called once for every IP Header. - -- If there's more than one IP header in a given packet we'll dump the packet once per every header - function tap.packet(pinfo,tvb,ip) - local tlli = field_tlli() - if not tlli then - return - end - - local tlli_str = tostring(tlli) - tlli_dmp = dumpers[tlli_str] - if not tlli_dmp then - local tlli_hex = string.format("0x%x", tonumber(tlli_str)) - print("Creating dump for TLLI " .. tlli_hex) - tlli_dmp = Dumper.new_for_current(dir .. "/" .. tlli_hex .. ".pcap") - dumpers[tlli_str] = tlli_dmp - end - tlli_dmp:dump_current() - tlli_dmp:flush() - end - function tap.draw() - for tlli,dumper in pairs(dumpers) do - dumper:flush() - end - end - function tap.reset() - for tlli,dumper in pairs(dumpers) do - dumper:close() - end - dumpers = {} - end - end - init_listener() -end diff --git a/contrib/gprs/gprs-verify-nu.lua b/contrib/gprs/gprs-verify-nu.lua deleted file mode 100644 index e44fdd1..0000000 --- a/contrib/gprs/gprs-verify-nu.lua +++ /dev/null @@ -1,59 +0,0 @@ --- This script verifies that the N(U) is increasing... --- -do - local nu_state_src = {} - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- we want to look here... - local llc_sapi_get = Field.new("llcgprs.sapib") - local llc_nu_get = Field.new("llcgprs.nu") - local bssgp_tlli_get = Field.new("bssgp.tlli") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local llc_sapi = llc_sapi_get() - local llc_nu = llc_nu_get() - local bssgp_tlli = bssgp_tlli_get() - - if not llc_sapi or not llc_nu or not bssgp_tlli then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_tlli = tostring(bssgp_tlli) - local llc_nu = tostring(llc_nu) - local llc_sapi = tostring(llc_sapi) - - local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi - local last_nu = nu_state_src[src_key] - if not last_nu then - -- print("Establishing mapping for " .. src_key) - nu_state_src[src_key] = llc_nu - return - end - - local function tohex(number) - return string.format("0x%x", tonumber(number)) - end - - nu_state_src[src_key] = llc_nu - if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then - print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src) - print("\t last: " .. last_nu .. " now: " .. llc_nu) - end - end - - function tap.draw() - end - - function tap.reset() - end - end - init_listener() -end - diff --git a/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql deleted file mode 100644 index 626a331..0000000 --- a/contrib/hlr-remove-old.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Remove old data from the database -DELETE FROM Subscriber - WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1; -DELETE FROM Equipment - WHERE datetime('now', '-10 days') > updated; -DELETE FROM EquipmentWatch - WHERE datetime('now', '-10 days') > updated; -DELETE FROM SMS - WHERE datetime('now', '-10 days') > created; -DELETE FROM VLR - WHERE datetime('now', '-10 days') > updated; -DELETE FROM ApduBlobs - WHERE datetime('now', '-10 days') > created; -DELETE FROM Counters - WHERE datetime('now', '-10 days') > timestamp; -DELETE FROM RateCounters - WHERE datetime('now', '-10 days') > timestamp; -VACUUM; diff --git a/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py deleted file mode 100755 index e4a4955..0000000 --- a/contrib/hlrsync/hlrsync.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python2.5 - -from __future__ import with_statement - -from pysqlite2 import dbapi2 as sqlite3 -import sys - -hlr = sqlite3.connect(sys.argv[1]) -web = sqlite3.connect(sys.argv[2]) - -# switch to autocommit -hlr.isolation_level = None -web.isolation_level = None - -hlr.row_factory = sqlite3.Row -web.row_factory = sqlite3.Row - -with hlr: - hlr_subscrs = hlr.execute(""" - SELECT * FROM Subscriber - """).fetchall() - hlr_tokens = hlr.execute(""" - SELECT * FROM AuthToken - """).fetchall() - -with web: - web_tokens = web.execute(""" - SELECT * FROM reg_tokens - """).fetchall() - web_sms = web.execute(""" - SELECT * FROM sms_queue - """).fetchall() - -# index by subscr id -hlr_subscrs_by_id = {} -hlr_subscrs_by_ext = {} -hlr_tokens_by_subscr_id = {} -for x in hlr_subscrs: - hlr_subscrs_by_id[x['id']] = x - hlr_subscrs_by_ext[x['extension']] = x -del hlr_subscrs -for x in hlr_tokens: - hlr_tokens_by_subscr_id[x['subscriber_id']] = x -del hlr_tokens - -web_tokens_by_subscr_id = {} -for x in web_tokens: - web_tokens_by_subscr_id[x['subscriber_id']] = x -del web_tokens - -# remove leftover web_tokens and correct inconsistent fields -with web: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - web.execute(""" - DELETE FROM reg_tokens WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del web_tokens_by_subscr_id[x['subscriber_id']] - continue - if str(x['imsi']) != str(subscr['imsi']) or \ - x['extension'] != subscr['extension'] or \ - x['tmsi'] != subscr['tmsi'] or \ - x['lac'] != subscr['lac']: - web.execute(""" - UPDATE reg_tokens - SET imsi = ?, extension = ?, tmsi = ?, lac = ? - WHERE subscriber_id = ? - """, (str(subscr['imsi']), subscr['extension'], - subscr['tmsi'], subscr['lac'], x['subscriber_id'])) - -# add missing web_tokens -with web: - for x in hlr_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - hlr.execute(""" - DELETE FROM AuthToken WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del hlr_tokens_by_subscr_id[x['subscriber_id']] - continue - webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None) - if webtoken is None: - web.execute(""" - INSERT INTO reg_tokens - (subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi) - VALUES - (?, ?, 0, ?, '', ?, ?, ?, ?) - """, (x['subscriber_id'], subscr['extension'], subscr['name'], - subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi'])) - -# authorize subscribers -with hlr: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if x['reg_completed'] and not subscr['authorized']: - hlr.execute(""" - UPDATE Subscriber - SET authorized = 1 - WHERE id = ? - """, (x['subscriber_id'],)) - -# Sync SMS from web to hlr -with hlr: - for sms in web_sms: - subscr = hlr_subscrs_by_ext.get(sms['receiver_ext']) - if subscr is None: - print '%s not found' % sms['receiver_ext'] - continue - hlr.execute(""" - INSERT INTO SMS - (created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text) - VALUES - (?, 1, ?, 0, 0, 0, 0, 0, ?) - """, (sms['created'], subscr['id'], sms['text'])) -with web: - for sms in web_sms: - web.execute(""" - DELETE FROM sms_queue WHERE id = ? - """, (sms['id'],)) - - -hlr.close() -web.close() - diff --git a/contrib/mgcp_server.py b/contrib/mgcp_server.py deleted file mode 100755 index 05c489d..0000000 --- a/contrib/mgcp_server.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Simple server for mgcp... send audit, receive response.. - -import socket, time - -MGCP_GATEWAY_PORT = 2427 -MGCP_CALLAGENT_PORT = 2727 - -rsip_resp = """200 321321332\r\n""" -audit_packet = """AUEP %d 13 at mgw MGCP 1.0\r\n""" -crcx_packet = """CRCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n""" -dlcx_packet = """DLCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\n""" -mdcx_packet = """MDCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 258696477 0 IN IP4 172.16.1.107\r\ns=-\r\nc=IN IP4 172.16.1.107\r\nt=0 0\r\nm=audio 6666 RTP/AVP 127\r\na=rtpmap:127 GSM-EFR/8000/1\r\na=ptime:20\r\na=recvonly\r\nm=image 4402 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n""" - -def hexdump(src, length=8): - """Recipe is from http://code.activestate.com/recipes/142812/""" - result = [] - digits = 4 if isinstance(src, unicode) else 2 - for i in xrange(0, len(src), length): - s = src[i:i+length] - hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s]) - text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) - result.append( b"%04X %-*s %s" % (i, length*(digits + 1), hexa, text) ) - return b'\n'.join(result) - -server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -server_socket.bind(("127.0.0.1", MGCP_CALLAGENT_PORT)) -server_socket.setblocking(1) - -last_ci = 1 -def send_and_receive(packet): - global last_ci - server_socket.sendto(packet, ("127.0.0.1", MGCP_GATEWAY_PORT)) - try: - data, addr = server_socket.recvfrom(4096) - - # attempt to store the CI of the response - list = data.split("\n") - for item in list: - if item.startswith("I: "): - last_ci = int(item[3:]) - - print hexdump(data), addr - except socket.error, e: - print e - pass - -def generate_tid(): - import random - return random.randint(0, 65123) - - - -while True: - send_and_receive(audit_packet % generate_tid()) - send_and_receive(crcx_packet % generate_tid() ) - send_and_receive(mdcx_packet % (generate_tid(), last_ci)) - send_and_receive(dlcx_packet % (generate_tid(), last_ci)) - - time.sleep(3) diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c deleted file mode 100644 index 808a703..0000000 --- a/contrib/nat/test_regexp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* make test_regexp */ -#include -#include -#include - - -int main(int argc, char **argv) -{ - regex_t reg; - regmatch_t matches[2]; - - if (argc != 4) { - printf("Invoke with: test_regexp REGEXP REPLACE NR\n"); - return -1; - } - - if (regcomp(®, argv[1], REG_EXTENDED) != 0) { - fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]); - return -1; - } - - if (regexec(®, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1) - printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]); - else - printf("No match.\n"); - - regfree(®); - - return 0; -} diff --git a/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py deleted file mode 100644 index 8f7a58d..0000000 --- a/contrib/nat/ussd_example.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2.7 - -""" -AGPLv3+ 2016 Copyright Holger Hans Peter Freyther - -Example of how to connect to the USSD side-channel and how to respond -with a fixed message. -""" - -import socket -import struct - -ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ussdSocket.connect(('127.0.0.1', 5001)) - -def send_dt1(dstref, data): - dlen = struct.pack('B', len(data)).encode('hex') - hex = '06' + dstref.encode('hex') + '00' + '01' + dlen + data.encode('hex') - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def send_rel(srcref, dstref): - hex = '04' + dstref.encode('hex') + srcref.encode('hex') + '000100' - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def recv_one(): - plen = ussdSocket.recv(3) - (plen,ptype) = struct.unpack(">HB", plen) - data = ussdSocket.recv(plen) - - return ptype, data - -# Assume this is the ID request -data = ussdSocket.recv(4) -ussdSocket.send("\x00\x08\xfe\x05\x00" + "\x05\x01" + "ussd") -# ^len ^len of tag ... and ignore - -# Expect a fake message. see struct ipac_msgt_sccp_state -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) -(srcref, dstref, transid, invokeid) = struct.unpack("<3s3sBB", data[1:9]) -print("New transID %d invoke %d" % (transid, invokeid)) - -# Expect a the invocation.. todo.. extract invoke id -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) - -# Reply with BSSAP + GSM 04.08 + MAP portion -# 00 == invoke id 0f == DCS -res = "01002a9b2a0802e1901c22a220020100301b02013b301604010f041155e7d2f9bc3a41412894991c06a9c9a713" -send_dt1(dstref, res.decode('hex')) - -clear = "000420040109" -send_dt1(dstref, clear.decode('hex')) - -# should be the clear complete -send_rel(srcref, dstref) - -# Give it some time to handle connection shutdown properly -print("Gracefully sleeping") -import time -time.sleep(3) diff --git a/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl deleted file mode 100755 index 47839c1..0000000 --- a/contrib/rtp/gen_rtp_header.erl +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- -%%! -smp disable --module(gen_rtp_header). - -% -mode(compile). - --define(VERSION, "0.1"). - --export([main/1]). - --record(rtp_packet, - { - version = 2, - padding = 0, - marker = 0, - payload_type = 0, - seqno = 0, - timestamp = 0, - ssrc = 0, - csrcs = [], - extension = <<>>, - payload = <<>>, - realtime - }). - - -main(Args) -> - DefaultOpts = [{format, state}, - {ssrc, 16#11223344}, - {rate, 8000}, - {pt, 98}], - {PosArgs, Opts} = getopts_checked(Args, DefaultOpts), - log(debug, fun (Dev) -> - io:format(Dev, "Initial options:~n", []), - dump_opts(Dev, Opts), - io:format(Dev, "~s: ~p~n", ["Args", PosArgs]) - end, [], Opts), - main(PosArgs, Opts). - -main([First | RemArgs], Opts) -> - try - F = list_to_integer(First), - Format = proplists:get_value(format, Opts, state), - PayloadData = proplists:get_value(payload, Opts, undef), - InFile = proplists:get_value(file, Opts, undef), - - Payload = case {PayloadData, InFile} of - {undef, undef} -> - % use default value - #rtp_packet{}#rtp_packet.payload; - {P, undef} -> P; - {_, File} -> - log(info, "Loading file '~s'~n", [File], Opts), - {ok, InDev} = file:open(File, [read]), - DS = [ Pl#rtp_packet.payload || {_T, Pl} <- read_packets(InDev, Opts)], - file:close(InDev), - log(debug, "File '~s' closed, ~w packets read.~n", [File, length(DS)], Opts), - DS - end, - Dev = standard_io, - write_packet_pre(Dev, Format), - do_groups(Dev, Payload, F, RemArgs, Opts), - write_packet_post(Dev, Format), - 0 - catch - _:_ -> - log(debug, "~p~n", [hd(erlang:get_stacktrace())], Opts), - usage(), - halt(1) - end - ; - -main(_, _Opts) -> - usage(), - halt(1). - -%%% group (count + offset) handling %%% - -do_groups(_Dev, _Pl, _F, [], _Opts) -> - ok; - -do_groups(Dev, Pl, F, [L], Opts) -> - do_groups(Dev, Pl, F, [L, 0], Opts); - -do_groups(Dev, Pl, First, [L, O | Args], Opts) -> - Ssrc = proplists:get_value(ssrc, Opts, #rtp_packet.ssrc), - PT = proplists:get_value(pt, Opts, #rtp_packet.payload_type), - Len = list_to_num(L), - Offs = list_to_num(O), - log(info, "Starting group: Ssrc=~.16B, PT=~B, First=~B, Len=~B, Offs=~B~n", - [Ssrc, PT, First, Len, Offs], Opts), - Pkg = #rtp_packet{ssrc = Ssrc, payload_type = PT}, - Pl2 = write_packets(Dev, Pl, Pkg, First, Len, Offs, Opts), - {Args2, Opts2} = getopts_checked(Args, Opts), - log(debug, fun (Io) -> - io:format(Io, "Changed options:~n", []), - dump_opts(Io, Opts2 -- Opts) - end, [], Opts), - do_groups(Dev, Pl2, First+Len, Args2, Opts2). - -%%% error handling helpers %%% - -getopts_checked(Args, Opts) -> - try - getopts(Args, Opts) - catch - C:R -> - log(error, "~s~n", - [explain_error(C, R, erlang:get_stacktrace(), Opts)], Opts), - usage(), - halt(1) - end. - -explain_error(error, badarg, [{erlang,list_to_integer,[S,B]} | _ ], _Opts) -> - io_lib:format("Invalid number '~s' (base ~B)", [S, B]); -explain_error(error, badarg, [{erlang,list_to_integer,[S]} | _ ], _Opts) -> - io_lib:format("Invalid decimal number '~s'", [S]); -explain_error(C, R, [Hd | _ ], _Opts) -> - io_lib:format("~p, ~p:~p", [Hd, C, R]); -explain_error(_, _, [], _Opts) -> - "". - -%%% usage and options %%% - -myname() -> - filename:basename(escript:script_name()). - -usage(Text) -> - io:format(standard_error, "~s: ~s~n", [myname(), Text]), - usage(). - -usage() -> - io:format(standard_error, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n", - [myname()]). - -show_version() -> - io:format(standard_io, - "~s ~s~n", [myname(), ?VERSION]). - -show_help() -> - io:format(standard_io, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n~n" ++ - "Options:~n" ++ - " -h, --help this text~n" ++ - " --version show version info~n" ++ - " -i, --file=FILE reads payload from file (state format by default)~n" ++ - " -f, --frame-size=N read payload as binary frames of size N instead~n" ++ - " -p, --payload=HEX set constant payload~n" ++ - " --verbose=N set verbosity~n" ++ - " -v increase verbosity~n" ++ - " --format=state use state format for output (default)~n" ++ - " -C, --format=c use simple C lines for output~n" ++ - " --format=carray use a C array for output~n" ++ - " -s, --ssrc=SSRC set the SSRC~n" ++ - " -t, --type=N set the payload type~n" ++ - " -r, --rate=N set the RTP rate [8000]~n" ++ - " -D, --duration=N set the packet duration in RTP time units [160]~n" ++ - " -d, --delay=FLOAT add offset to playout timestamp~n" ++ - "~n" ++ - "Arguments:~n" ++ - " Start initial packet (sequence) number~n" ++ - " Count number of packets~n" ++ - " Offs timestamp offset (in RTP units)~n" ++ - "", [myname()]). - -getopts([ "--file=" ++ File | R], Opts) -> - getopts(R, [{file, File} | Opts]); -getopts([ "-i" ++ T | R], Opts) -> - getopts_alias_arg("--file", T, R, Opts); -getopts([ "--frame-size=" ++ N | R], Opts) -> - Size = list_to_integer(N), - getopts(R, [{frame_size, Size}, {in_format, bin} | Opts]); -getopts([ "-f" ++ T | R], Opts) -> - getopts_alias_arg("--frame-size", T, R, Opts); -getopts([ "--duration=" ++ N | R], Opts) -> - Duration = list_to_integer(N), - getopts(R, [{duration, Duration} | Opts]); -getopts([ "-D" ++ T | R], Opts) -> - getopts_alias_arg("--duration", T, R, Opts); -getopts([ "--rate=" ++ N | R], Opts) -> - Rate = list_to_integer(N), - getopts(R, [{rate, Rate} | Opts]); -getopts([ "-r" ++ T | R], Opts) -> - getopts_alias_arg("--rate", T, R, Opts); -getopts([ "--version" | _], _Opts) -> - show_version(), - halt(0); -getopts([ "--help" | _], _Opts) -> - show_help(), - halt(0); -getopts([ "-h" ++ T | R], Opts) -> - getopts_alias_no_arg("--help", T, R, Opts); -getopts([ "--verbose=" ++ V | R], Opts) -> - Verbose = list_to_integer(V), - getopts(R, [{verbose, Verbose} | Opts]); -getopts([ "-v" ++ T | R], Opts) -> - Verbose = proplists:get_value(verbose, Opts, 0), - getopts_short_no_arg(T, R, [ {verbose, Verbose+1} | Opts]); -getopts([ "--format=state" | R], Opts) -> - getopts(R, [{format, state} | Opts]); -getopts([ "--format=c" | R], Opts) -> - getopts(R, [{format, c} | Opts]); -getopts([ "-C" ++ T | R], Opts) -> - getopts_alias_no_arg("--format=c", T, R, Opts); -getopts([ "--format=carray" | R], Opts) -> - getopts(R, [{format, carray} | Opts]); -getopts([ "--payload=" ++ Hex | R], Opts) -> - getopts(R, [{payload, hex_to_bin(Hex)} | Opts]); -getopts([ "--ssrc=" ++ Num | R], Opts) -> - getopts(R, [{ssrc, list_to_num(Num)} | Opts]); -getopts([ "-s" ++ T | R], Opts) -> - getopts_alias_arg("--ssrc", T, R, Opts); -getopts([ "--type=" ++ Num | R], Opts) -> - getopts(R, [{pt, list_to_num(Num)} | Opts]); -getopts([ "-t" ++ T | R], Opts) -> - getopts_alias_arg("--type", T, R, Opts); -getopts([ "--delay=" ++ Num | R], Opts) -> - getopts(R, [{delay, list_to_float(Num)} | Opts]); -getopts([ "-d" ++ T | R], Opts) -> - getopts_alias_arg("--delay", T, R, Opts); - -% parsing helpers -getopts([ "--" | R], Opts) -> - {R, normalize_opts(Opts)}; -getopts([ O = "--" ++ _ | _], _Opts) -> - usage("Invalid option: " ++ O), - halt(1); -getopts([ [ $-, C | _] | _], _Opts) when C < $0; C > $9 -> - usage("Invalid option: -" ++ [C]), - halt(1); - -getopts(R, Opts) -> - {R, normalize_opts(Opts)}. - -getopts_short_no_arg([], R, Opts) -> getopts(R, Opts); -getopts_short_no_arg(T, R, Opts) -> getopts([ "-" ++ T | R], Opts). - -getopts_alias_no_arg(A, [], R, Opts) -> getopts([A | R], Opts); -getopts_alias_no_arg(A, T, R, Opts) -> getopts([A, "-" ++ T | R], Opts). - -getopts_alias_arg(A, [], [T | R], Opts) -> getopts([A ++ "=" ++ T | R], Opts); -getopts_alias_arg(A, T, R, Opts) -> getopts([A ++ "=" ++ T | R], Opts). - -normalize_opts(Opts) -> - [ proplists:lookup(E, Opts) || E <- proplists:get_keys(Opts) ]. - -%%% conversions %%% - -bin_to_hex(Bin) -> [hd(integer_to_list(N,16)) || <> <= Bin]. -hex_to_bin(Hex) -> << <<(list_to_integer([Nib],16)):4>> || Nib <- Hex>>. - -list_to_num("-" ++ Str) -> -list_to_num(Str); -list_to_num("0x" ++ Str) -> list_to_integer(Str, 16); -list_to_num("0b" ++ Str) -> list_to_integer(Str, 2); -list_to_num(Str = [ $0 | _ ]) -> list_to_integer(Str, 8); -list_to_num(Str) -> list_to_integer(Str, 10). - -%%% dumping data %%% - -dump_opts(Dev, Opts) -> - dump_opts2(Dev, Opts, proplists:get_keys(Opts)). - -dump_opts2(Dev, Opts, [OptName | R]) -> - io:format(Dev, " ~-10s: ~p~n", - [OptName, proplists:get_value(OptName, Opts)]), - dump_opts2(Dev, Opts, R); -dump_opts2(_Dev, _Opts, []) -> ok. - -%%% logging %%% - -log(L, Fmt, Args, Opts) when is_list(Opts) -> - log(L, Fmt, Args, proplists:get_value(verbose, Opts, 0), Opts). - -log(debug, Fmt, Args, V, Opts) when V > 2 -> log2("DEBUG", Fmt, Args, Opts); -log(info, Fmt, Args, V, Opts) when V > 1 -> log2("INFO", Fmt, Args, Opts); -log(notice, Fmt, Args, V, Opts) when V > 0 -> log2("NOTICE", Fmt, Args, Opts); -log(warn, Fmt, Args, _V, Opts) -> log2("WARNING", Fmt, Args, Opts); -log(error, Fmt, Args, _V, Opts) -> log2("ERROR", Fmt, Args, Opts); - -log(Lvl, Fmt, Args, V, Opts) when V >= Lvl -> log2("", Fmt, Args, Opts); - -log(_, _, _, _i, _) -> ok. - -log2(Type, Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, "~s: " ++ Fmt, [Type | Args]); -log2("", Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, Fmt, Args); -log2(_Type, Fun, _Args, _Opts) when is_function(Fun, 1) -> - Fun(standard_error). - -%%% RTP packets %%% - -make_rtp_packet(P = #rtp_packet{version = 2}) -> - << (P#rtp_packet.version):2, - 0:1, % P - 0:1, % X - 0:4, % CC - (P#rtp_packet.marker):1, - (P#rtp_packet.payload_type):7, - (P#rtp_packet.seqno):16, - (P#rtp_packet.timestamp):32, - (P#rtp_packet.ssrc):32, - (P#rtp_packet.payload)/bytes - >>. - -parse_rtp_packet( - << 2:2, % Version 2 - 0:1, % P (not supported yet) - 0:1, % X (not supported yet) - 0:4, % CC (not supported yet) - M:1, - PT:7, - SeqNo: 16, - TS:32, - Ssrc:32, - Payload/bytes >>) -> - #rtp_packet{ - version = 0, - marker = M, - payload_type = PT, - seqno = SeqNo, - timestamp = TS, - ssrc = Ssrc, - payload = Payload}. - -%%% payload generation %%% - -next_payload(F) when is_function(F) -> - {F(), F}; -next_payload({F, D}) when is_function(F) -> - {P, D2} = F(D), - {P, {F, D2}}; -next_payload([P | R]) -> - {P, R}; -next_payload([]) -> - undef; -next_payload(Bin = <<_/bytes>>) -> - {Bin, Bin}. - -%%% real writing work %%% - -write_packets(_Dev, DS, _P, _F, 0, _O, _Opts) -> - DS; -write_packets(Dev, DataSource, P = #rtp_packet{}, F, L, O, Opts) -> - Format = proplists:get_value(format, Opts, state), - Ptime = proplists:get_value(duration, Opts, 160), - Delay = proplists:get_value(delay, Opts, 0), - Rate = proplists:get_value(rate, Opts, 8000), - case next_payload(DataSource) of - {Payload, DataSource2} -> - write_packet(Dev, Ptime * F / Rate + Delay, - P#rtp_packet{seqno = F, timestamp = F*Ptime+O, - payload = Payload}, - Format), - write_packets(Dev, DataSource2, P, F+1, L-1, O, Opts); - Other -> Other - end. - -write_packet(Dev, Time, P = #rtp_packet{}, Format) -> - Bin = make_rtp_packet(P), - - write_packet_line(Dev, Time, P, Bin, Format). - -write_packet_pre(Dev, carray) -> - io:format(Dev, - "struct {float t; int len; char *data;} packets[] = {~n", []); - -write_packet_pre(_Dev, _) -> ok. - -write_packet_post(Dev, carray) -> - io:format(Dev, "};~n", []); - -write_packet_post(_Dev, _) -> ok. - -write_packet_line(Dev, Time, _P, Bin, state) -> - io:format(Dev, "~f ~s~n", [Time, bin_to_hex(Bin)]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, c) -> - ByteList = [ [ $0, $x | integer_to_list(Byte, 16) ] || <> <= Bin ], - ByteStr = string:join(ByteList, ", "), - io:format(Dev, "/* time=~f, SeqNo=~B, TS=~B */ {~s}~n", [Time, N, TS, ByteStr]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, carray) -> - io:format(Dev, " /* RTP: SeqNo=~B, TS=~B */~n", [N, TS]), - io:format(Dev, " {~f, ~B, \"", [Time, size(Bin)]), - [ io:format(Dev, "\\x~2.16.0B", [Byte]) || <> <= Bin ], - io:format(Dev, "\"},~n", []). - -%%% real reading work %%% - -read_packets(Dev, Opts) -> - Format = proplists:get_value(in_format, Opts, state), - - read_packets(Dev, Opts, Format). - -read_packets(Dev, Opts, Format) -> - case read_packet(Dev, Opts, Format) of - eof -> []; - Tuple -> [Tuple | read_packets(Dev, Opts, Format)] - end. - -read_packet(Dev, Opts, bin) -> - Size = proplists:get_value(frame_size, Opts), - case file:read(Dev, Size) of - {ok, Data} -> {0, #rtp_packet{payload = iolist_to_binary(Data)}}; - eof -> eof - end; -read_packet(Dev, _Opts, Format) -> - case read_packet_line(Dev, Format) of - {Time, Bin} -> {Time, parse_rtp_packet(Bin)}; - eof -> eof - end. - -read_packet_line(Dev, state) -> - case io:fread(Dev, "", "~f ~s") of - {ok, [Time, Hex]} -> {Time, hex_to_bin(Hex)}; - eof -> eof - end. diff --git a/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st deleted file mode 100644 index e26d073..0000000 --- a/contrib/rtp/rtp_replay.st +++ /dev/null @@ -1,21 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. -FileStream fileIn: 'rtp_replay_shared.st'. - - -Eval [ - | replay file host dport | - - file := Smalltalk arguments at: 1 ifAbsent: [ 'rtpstream.state' ]. - host := Smalltalk arguments at: 2 ifAbsent: [ '127.0.0.1' ]. - dport := (Smalltalk arguments at: 3 ifAbsent: [ '4000' ]) asInteger. - sport := (Smalltalk arguments at: 4 ifAbsent: [ '0' ]) asInteger. - - replay := RTPReplay on: file fromPort: sport. - - Transcript nextPutAll: 'Going to stream now'; nl. - replay streamAudio: host port: dport. -] diff --git a/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st deleted file mode 100644 index 7b68c0f..0000000 --- a/contrib/rtp/rtp_replay_shared.st +++ /dev/null @@ -1,118 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. - -Object subclass: SDPUtils [ - "Look into using PetitParser." - SDPUtils class >> findPort: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'm=audio ') ifTrue: [ - | stream | - stream := line readStream - skip: 'm=audio ' size; - yourself. - ^ Number readFrom: stream. - ] - ]. - - ^ self error: 'Not found'. - ] - - SDPUtils class >> findHost: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'c=IN IP4 ') ifTrue: [ - | stream | - ^ stream := line readStream - skip: 'c=IN IP4 ' size; - upToEnd. - ] - ]. - - ^ self error: 'Not found'. - ] -] - -Object subclass: RTPReplay [ - | filename socket | - RTPReplay class >> on: aFile [ - ^ self new - initialize; - file: aFile; yourself - ] - - RTPReplay class >> on: aFile fromPort: aPort [ - ^ self new - initialize: aPort; - file: aFile; yourself - ] - - initialize [ - self initialize: 0. - ] - - initialize: aPort [ - socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort. - ] - - file: aFile [ - filename := aFile - ] - - localPort [ - ^ socket port - ] - - streamAudio: aHost port: aPort [ - | file last_time last_image udp_send dest | - - last_time := nil. - last_image := nil. - file := FileStream open: filename mode: #read. - - "Send the payload" - dest := Sockets.SocketAddress byName: aHost. - udp_send := [:payload | | datagram | - datagram := Sockets.Datagram data: payload contents address: dest port: aPort. - socket nextPut: datagram - ]. - - [file atEnd] whileFalse: [ - | lineStream time data now_image | - lineStream := file nextLine readStream. - - "Read the time, skip the blank, parse the data" - time := Number readFrom: lineStream. - lineStream skip: 1. - - data := WriteStream on: (ByteArray new: 30). - [lineStream atEnd] whileFalse: [ - | hex | - hex := lineStream next: 2. - data nextPut: (Number readFrom: hex readStream radix: 16). - ]. - - last_time isNil - ifTrue: [ - "First time, send it right now" - last_time := time. - last_image := Time millisecondClockValue. - udp_send value: data. - ] - ifFalse: [ - | wait_image new_image_time | - - "How long to wait?" - wait_image := last_image + ((time - last_time) * 1000). - [ wait_image > Time millisecondClockValue ] - whileTrue: [Processor yield]. - - udp_send value: data. - last_time := time. - last_image := wait_image. - ] - ] - ] -] - diff --git a/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st deleted file mode 100644 index 5f844df..0000000 --- a/contrib/rtp/rtp_replay_sip.st +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create a SIP connection and then stream... -""" - -PackageLoader - fileInPackage: #OsmoSIP. - -"Load for the replay code" -FileStream fileIn: 'rtp_replay_shared.st'. - - -Osmo.SIPCall subclass: StreamCall [ - | sem stream | - - createCall: aSDP [ - | sdp | - stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'. - sdp := aSDP % {stream localPort}. - ^ super createCall: sdp. - ] - - sem: aSemaphore [ - sem := aSemaphore - ] - - sessionNew [ - | host port | - Transcript nextPutAll: 'The call has started'; nl. - Transcript nextPutAll: sdp_result; nl. - - host := SDPUtils findHost: sdp_result. - port := SDPUtils findPort: sdp_result. - - [ - stream streamAudio: host port: port. - Transcript nextPutAll: 'Streaming has finished.'; nl. - ] fork. - ] - - sessionFailed [ - sem signal - ] - - sessionEnd [ - sem signal - ] -] - -Eval [ - | transport agent call sem sdp_fr sdp_amr | - - - sdp_fr := (WriteStream on: String new) - nextPutAll: 'v=0'; cr; nl; - nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 's=-'; cr; nl; - nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 't=0 0'; cr; nl; - nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl; - nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl; - nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl; - nextPutAll: 'a=fmtp:101 0-15'; cr; nl; - nextPutAll: 'a=ptime:20'; cr; nl; - contents. - - sem := Semaphore new. - transport := Osmo.SIPUdpTransport - startOn: '0.0.0.0' port: 5066. - agent := Osmo.SIPUserAgent createOn: transport. - transport start. - - call := (StreamCall - fromUser: 'sip:1000 at sip.zecke.osmocom.org' - host: '127.0.0.1' - port: 5060 - to: 'sip:123456 at 127.0.0.1' - on: agent) - sem: sem; yourself. - - call createCall: sdp_fr. - - - "Wait for the stream to have ended" - sem wait. - - (Delay forSeconds: 4) wait. -] diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua deleted file mode 100644 index c18a06b..0000000 --- a/contrib/rtp/timestamp_rtp.lua +++ /dev/null @@ -1,28 +0,0 @@ -print("Ni hao") - - -do - local tap = Listener.new("ip", "rtp") - local rtp_ssrc = Field.new("rtp.ssrc") - local frame_time = Field.new("frame.time_relative") - local rtp = Field.new("rtp") - - function tap.packet(pinfo, tvb, ip) - local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) - local rtp_data = rtp() - local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" - local f = io.open(filename, "a") - - f:write(tostring(frame_time()) .. " ") - f:write(tostring(rtp_data.value)) - f:write("\n") - f:close() - end - - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end -end diff --git a/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st deleted file mode 100644 index da0643e..0000000 --- a/contrib/sms/fill-hlr.st +++ /dev/null @@ -1,66 +0,0 @@ -"I create output for some simple SQL statements for the HLR db" - - -Eval [ - -"Create tables if they don't exist" -Transcript show: 'CREATE TABLE SMS ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - sent TIMESTAMP, - sender_id INTEGER NOT NULL, - receiver_id INTEGER NOT NULL, - deliver_attempts INTEGER NOT NULL DEFAULT 0, - valid_until TIMESTAMP, - reply_path_req INTEGER NOT NULL, - status_rep_req INTEGER NOT NULL, - protocol_id INTEGER NOT NULL, - data_coding_scheme INTEGER NOT NULL, - ud_hdr_ind INTEGER NOT NULL, - dest_addr TEXT, - user_data BLOB, - header BLOB, - text TEXT);'; nl; - show: 'CREATE TABLE Subscriber ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - updated TIMESTAMP NOT NULL, - imsi NUMERIC UNIQUE NOT NULL, - name TEXT, - extension TEXT UNIQUE, - authorized INTEGER NOT NULL DEFAULT 0, - tmsi TEXT UNIQUE, - lac INTEGER NOT NULL DEFAULT 0);'; nl. - -"Create some dummy subscribers" -num_sub := 1000. -num_sms := 30. -lac := 1. - -Transcript show: 'BEGIN;'; nl. - -1 to: num_sub do: [:each | - Transcript show: 'INSERT INTO Subscriber - (imsi, created, updated, authorized, lac, extension) - VALUES - (%1, datetime(''now''), datetime(''now''), 1, %2, %3);' % - {(274090000000000 + each). lac. each}; nl. -]. - -1 to: num_sms do: [:sms | - 1 to: num_sub do: [:sub | - Transcript show: 'INSERT INTO SMS - (created, sender_id, receiver_id, valid_until, - reply_path_req, status_rep_req, protocol_id, - data_coding_scheme, ud_hdr_ind, dest_addr, - text) VALUES - (datetime(''now''), 1, %1, ''2222-2-2'', - 0, 0, 0, - 0, 0, ''123456'', - ''abc'');' % {sub}; nl. - ] -]. - -Transcript show: 'COMMIT;'; nl. - -] diff --git a/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st deleted file mode 100644 index bd3f97a..0000000 --- a/contrib/sms/hlr-query.st +++ /dev/null @@ -1,10 +0,0 @@ -"Query for one SMS" - -Eval [ -1 to: 100 do: [:each | - Transcript show: 'SELECT SMS.* FROM SMS - JOIN Subscriber ON SMS.receiver_id = Subscriber.id - WHERE SMS.id >= 1 AND SMS.sent IS NULL AND Subscriber.lac > 0 - ORDER BY SMS.id LIMIT 1;'; nl. -]. -] diff --git a/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d deleted file mode 100644 index e75cdfc..0000000 --- a/contrib/sms/sqlite-probe.tap.d +++ /dev/null @@ -1,5 +0,0 @@ -probe process("/usr/lib/libsqlite3.so.0.8.6").function("sqlite3_get_table") -{ - a = user_string($zSql); - printf("sqlite3_get_table called '%s'\n", a); -} diff --git a/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service deleted file mode 100644 index c040e60..0000000 --- a/contrib/systemd/osmo-bsc-mgcp.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC MGCP - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service deleted file mode 100644 index 4047fef..0000000 --- a/contrib/systemd/osmo-bsc.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=OpenBSC BSC -Wants=osmo-bsc-mgcp.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service deleted file mode 100644 index a0b7829..0000000 --- a/contrib/systemd/osmo-gbproxy.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Osmocom Gb proxy - -[Service] -Type=simple -ExecStart=/usr/bin/osmo-gbproxy -c /etc/osmocom/osmo-gbproxy.cfg -Restart=always -RestartSec=2 -RestartPreventExitStatus=1 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service deleted file mode 100644 index 377497e..0000000 --- a/contrib/systemd/osmo-nitb.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC Network In the Box (NITB) - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3 -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service deleted file mode 100644 index bf6a8e0..0000000 --- a/contrib/systemd/osmo-sgsn.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=OpenBSC SGSN -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-sgsn -c /etc/osmocom/osmo-sgsn.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/testconv/Makefile b/contrib/testconv/Makefile deleted file mode 100644 index bb856f7..0000000 --- a/contrib/testconv/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -OBJS = testconv_main.o - -CC = gcc -CFLAGS = -O0 -ggdb -Wall -LDFLAGS = -CPPFLAGS = -I../.. -I../../include $(shell pkg-config --cflags libosmocore) $(shell pkg-config --cflags libbcg729) -LIBS = ../../src/libmgcp/libmgcp.a ../../src/libcommon/libcommon.a $(shell pkg-config --libs libosmocore) $(shell pkg-config --libs libbcg729) -lgsm -lrt - -testconv: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) - -testconv_main.o: testconv_main.c - -$(OBJS): - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c deleted file mode 100644 index 6c95c55..0000000 --- a/contrib/testconv/testconv_main.c +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "bscconfig.h" -#ifndef BUILD_MGCP_TRANSCODING -#error "Requires MGCP transcoding enabled (see --enable-mgcp-transcoding)" -#endif - -#include "openbsc/mgcp_transcode.h" - -static int audio_name_to_type(const char *name) -{ - if (!strcasecmp(name, "gsm")) - return 3; -#ifdef HAVE_BCG729 - else if (!strcasecmp(name, "g729")) - return 18; -#endif - else if (!strcasecmp(name, "pcma")) - return 8; - else if (!strcasecmp(name, "l16")) - return 11; - return -1; -} - -int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst); - -int main(int argc, char **argv) -{ - char buf[4096] = {0x80, 0}; - int cc, rc; - struct mgcp_rtp_end *dst_end; - struct mgcp_rtp_end *src_end; - struct mgcp_trunk_config tcfg = {{0}}; - struct mgcp_endpoint endp = {0}; - struct mgcp_process_rtp_state *state; - int in_size; - int in_samples = 160; - int out_samples = 0; - uint32_t ts = 0; - uint16_t seq = 0; - - osmo_init_logging(&log_info); - - tcfg.endpoints = &endp; - tcfg.number_endpoints = 1; - endp.tcfg = &tcfg; - mgcp_initialize_endp(&endp); - - dst_end = &endp.bts_end; - src_end = &endp.net_end; - - if (argc <= 2) - errx(1, "Usage: {gsm|g729|pcma|l16} {gsm|g729|pcma|l16} [SPP]"); - - if ((src_end->codec.payload_type = audio_name_to_type(argv[1])) == -1) - errx(1, "invalid input format '%s'", argv[1]); - if ((dst_end->codec.payload_type = audio_name_to_type(argv[2])) == -1) - errx(1, "invalid output format '%s'", argv[2]); - if (argc > 3) - out_samples = atoi(argv[3]); - - if (out_samples) { - dst_end->codec.frame_duration_den = dst_end->codec.rate; - dst_end->codec.frame_duration_num = out_samples; - dst_end->frames_per_packet = 1; - } - - rc = mgcp_transcoding_setup(&endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); - - state = dst_end->rtp_process_data; - OSMO_ASSERT(state != NULL); - - in_size = mgcp_transcoding_get_frame_size(state, in_samples, 0); - OSMO_ASSERT(sizeof(buf) >= in_size + 12); - - buf[1] = src_end->codec.payload_type; - *(uint16_t*)(buf+2) = htons(1); - *(uint32_t*)(buf+4) = htonl(0); - *(uint32_t*)(buf+8) = htonl(0xaabbccdd); - - while ((cc = read(0, buf + 12, in_size))) { - int cont; - int len; - - if (cc != in_size) - err(1, "read"); - - *(uint16_t*)(buf+2) = htonl(seq); - *(uint32_t*)(buf+4) = htonl(ts); - - seq += 1; - ts += in_samples; - - cc += 12; /* include RTP header */ - - len = cc; - - do { - cont = mgcp_transcoding_process_rtp(&endp, dst_end, - buf, &len, sizeof(buf)); - if (cont == -EAGAIN) { - fprintf(stderr, "Got EAGAIN\n"); - break; - } - - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); - - len -= 12; /* ignore RTP header */ - - if (write(1, buf + 12, len) != len) - err(1, "write"); - - len = cont; - } while (len > 0); - } - return 0; -} - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/e1-data-model.txt b/doc/e1-data-model.txt deleted file mode 100644 index 509004f..0000000 --- a/doc/e1-data-model.txt +++ /dev/null @@ -1,172 +0,0 @@ -E1 related data model - -This data model describes the physical relationship of the individual -parts in the network, it is not the logical/protocol side of the GSM -network. - -A BTS is connected to the BSC by some physical link. It could be an actual -E1 link, but it could also be abis-over-IP with a mixture of TCP and RTP/UDP. - -To further complicate the fact, multiple BTS can share one such pysical -link. On a single E1 line, we can easily accomodate up to three BTS with -two TRX each. - -Thus, it is best for OpenBSC to have some kind of abstraction layer. The BSC's -view of a BTS connected to it. We call this 'bts_link'. A bts_link can be -* all the TCP and UDP streams of a Abis-over-IP BTS -* a set of E1 timeslots for OML, RSL and TRAU connections on a E1 link -* a serial line exclusively used for OML messages (T-Link) - -A bts_link can be registered with the OpenBSC core at runtime. - -struct trx_link { - struct gsm_bts_trx *trx; -}; - -struct bts_link { - struct gsm_bts *bts; - struct trx_link trx_links[NUM_TRX]; -}; - -Interface from stack to input core: -====================================================================== -int abis_rsl_sendmsg(struct msgb *msg); - send a message through a RSL link to the TRX specified by the caller in - msg->trx. - -int abis_rsl_rcvmsg(struct msgb *msg); - receive a message from a RSL link from the TRX specified by the - caller in msg->trx. - -int abis_nm_sendmsg(struct msgb *msg); - send a message through a OML link to the BTS specified by the caller in - msg->trx->bts. The caller can just use bts->c0 to get the first TRX - in a BTS. (OML messages are not really sent to a TRX but to the BTS) - -int abis_nm_rcvmsg(struct msgb *msg); - receive a message from a OML link from the BTS specified by the caller - in msg->trx->bts. The caller can just use bts->c0 to get the first - TRX in a BTS. - -int abis_link_event(int event, void *data); - signal some event (such as layer 1 connect/disconnect) from the - input core to the stack. - -int subch_demux_in(mx, const uint8_t *data, int len); - receive 'len' bytes from a given E1 timeslot (TRAU frames) - -int subchan_mux_out(mx, uint8_t *data, int len); - obtain 'len' bytes of output data to be sent on E1 timeslot - -Intrface by Input Core for Input Plugins -====================================================================== - -int btslink_register_plugin(); - - -Configuration for the E1 input module -====================================================================== - -BTS - BTS number - number of TRX - OML link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TRX - RSL link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TS - E1 line number - timeslot number - subslot number - - -E1 input module data model -====================================================================== - - -enum e1inp_sign_type { - E1INP_SIGN_NONE, - E1INP_SIGN_OML, - E1INP_SIGN_RSL, -}; - -struct e1inp_sign_link { - /* list of signalling links */ - struct llist_head list; - - enum e1inp_sign_type type; - - /* trx for msg->trx of received msgs */ - struct gsm_bts_trx *trx; - - /* msgb queue of to-be-transmitted msgs */ - struct llist_head tx_list; - - /* SAPI and TEI on the E1 TS */ - uint8_t sapi; - uint8_t tei; -} - -enum e1inp_ts_type { - E1INP_TS_TYPE_NONE, - E1INP_TS_TYPE_SIGN, - E1INP_TS_TYPE_TRAU, -}; - -/* A timeslot in the E1 interface */ -struct e1inp_ts { - enum e1inp_ts_type type; - struct e1inp_line *line; - union { - struct { - struct llist_head sign_links; - } sign; - struct { - /* subchannel demuxer for frames from E1 */ - struct subch_demux demux; - /* subchannel muxer for frames to E1 */ - struct subch_mux mux; - } trau; - }; - union { - struct { - /* mISDN driver has one fd for each ts */ - struct osmo_fd; - } misdn; - } driver; -}; - -struct e1inp_line { - unsigned int num; - char *name; - - struct e1inp_ts ts[NR_E1_TS]; - - char *e1inp_driver; - void *driver_data; -}; - -/* Call from the Stack: configuration of this TS has changed */ -int e1inp_update_ts(struct e1inp_ts *ts); - -/* Receive a packet from the E1 driver */ -int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, - uint8_t tei, uint8_t sapi); - -/* Send a packet, callback function in the driver */ -int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg) - - -struct e1inp_driver { - const char *name; - int (*want_write)(struct e1inp_ts *ts); -}; diff --git a/doc/examples/osmo-bsc_nat/bscs.cfg b/doc/examples/osmo-bsc_nat/bscs.cfg deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.cfg +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg deleted file mode 100644 index 5e64342..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ /dev/null @@ -1,27 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy accept-all -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/handover.txt b/doc/handover.txt deleted file mode 100644 index ac19e87..0000000 --- a/doc/handover.txt +++ /dev/null @@ -1,89 +0,0 @@ -Ideas about a handover algorithm -====================================================================== - -This is mostly based on the results presented in Chapter 8 of "Performance -Enhancements in a Frequency Hopping GSM Network" by Thomas Toftegaard Nielsen -and Joeroen Wigard. - - -=== Reasons for performing handover === - -Section 2.1.1: Handover used in their CAPACITY simulation: - -1) Interference Handover - -Average RXLEV is satisfactory high, but average RXQUAL too low indicates -interference to the channel. Handover should be made. - -2) Bad Quality - -Averaged RXQUAL is lower than a threshold - -3) Low Level / Signal Strength - -Average RXLEV is lower than a threshold - -4) Distance Handover - -MS is too far away from a cell (measured by TA) - -5) Power budget / Better Cell - -RX Level of neighbor cell is at least "HO Margin dB" dB better than the -current serving cell. - -=== Ideal parameters for HO algorithm === - -Chapter 8, Section 2.2, Table 24: - -Window RXLEV averaging: 10 SACCH frames (no weighting) -Window RXQUAL averaging: 1 SACCH frame (no averaging) -Level Threashold: 1 of the last 1 AV-RXLEV values < -110dBm -Quality Threshold: 3 of the last 4 AV-RXQUAL values >= 5 -Interference Threshold: 1 of the last AV-RXLEV > -85 dBm & - 3 of the last 4 AV-RXQUAL values >= 5 -Power Budget: Level of neighbor cell > 3 dB better -Power Budget Interval: Every 6 SACCH frames (6 seconds ?!?) -Distance Handover: Disabled -Evaluation rule 1: RXLEV of the candidate cell a tleast -104 dBm -Evaluation rule 2: Level of candidate cell > 3dB better own cell -Timer Successful HO: 5 SACCH frames -Timer Unsuccessful HO: 1 SACCH frame - -In a non-frequency hopping case, RXQUAL threshold can be decreased to -RXLEV >= 4 - -When frequency hopping is enabled, the following additional parameters -should be introduced: - -* No intra-cell handover -* Use a HO Margin of 2dB - -=== Handover Channel Reservation === - -In loaded network, each cell should reserve some channels for handovers, -rather than using all of them for new call establishment. This reduces the -need to drop calls due to failing handovers, at the expense of failing new call -attempts. - -=== Dynamic HO Margin === - -The handover margin (hysteresis) should depend on the RXQUAL. Optimal results -were achieved with the following settings: -* RXQUAL <= 4: 9 dB -* RXQUAL == 5: 6 dB -* RXQUAL >= 6: 1 dB - - - -== Actual Handover on a protocol level == - -After the BSC has decided a handover shall be done, it has to - -# allocate a channel at the new BTS -# allocate a handover reference -# activate the channel on the BTS side using RSL CHANNEL ACTIVATION, - indicating the HO reference -# BTS responds with CHAN ACT ACK, including GSM frame number -# BSC sends 04.08 HO CMD to MS using old BTS - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/osmoappdesc.py b/osmoappdesc.py index b72c93e..be97a71 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -14,23 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see - -# Most systems won't be able to use these, so they're separated out -nitb_e1_configs = [ - "doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg", - "doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg", - "doc/examples/osmo-nitb/bs11/openbsc.cfg", - "doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg", - "doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg", - "doc/examples/osmo-nitb/rbs2308/openbsc.cfg" -] - - app_configs = { "msc": ["doc/examples/osmo-msc/osmo-msc.cfg"], } - apps = [(4254, "src/osmo-msc/osmo-msc", "OsmoMSC", "msc"), ] -- To view, visit https://gerrit.osmocom.org/3801 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49957769e09eed6d723bf7c3777024b62b3480fd Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:45:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:45:29 +0000 Subject: [MERGED] osmo-msc[master]: debian: fix web and VCS links, tweak osmo-msc.install In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: fix web and VCS links, tweak osmo-msc.install ...................................................................... debian: fix web and VCS links, tweak osmo-msc.install Change-Id: I3fffa73722c5437c969d25294e0ff86de5385087 --- M debian/control M debian/osmo-msc.install 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 907ec38..13d4806 100644 --- a/debian/control +++ b/debian/control @@ -23,9 +23,9 @@ libosmo-netif-dev, libosmo-ranap-dev Standards-Version: 3.9.8 -Vcs-Git: git://git.osmocom.org/osmo-bsc.git -Vcs-Browser: https://git.osmocom.org/osmo-bsc/ -Homepage: https://projects.osmocom.org/projects/osmo-bsc +Vcs-Git: git://git.osmocom.org/osmo-msc.git +Vcs-Browser: https://git.osmocom.org/osmo-msc/ +Homepage: https://osmocom.org/projects/osmomsc Package: osmo-msc Architecture: any diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 2c733e0..145d25d 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ -usr/bin +usr/bin/osmo-msc usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg -- To view, visit https://gerrit.osmocom.org/3799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3fffa73722c5437c969d25294e0ff86de5385087 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:45:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:45:30 +0000 Subject: [MERGED] osmo-msc[master]: rename openbsc.pc to osmo-msc.pc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rename openbsc.pc to osmo-msc.pc ...................................................................... rename openbsc.pc to osmo-msc.pc Change-Id: Ibe73012cb2a27d886b5faf931a62d5efbddd8120 --- M Makefile.am M configure.ac R osmo-msc.pc.in 3 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 536b3f4..9a92b08 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = openbsc.pc +pkgconfig_DATA = osmo-msc.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index cd2af00..8d646d3 100644 --- a/configure.ac +++ b/configure.ac @@ -203,7 +203,7 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - openbsc.pc + osmo-msc.pc include/openbsc/Makefile include/Makefile src/Makefile diff --git a/openbsc.pc.in b/osmo-msc.pc.in similarity index 69% rename from openbsc.pc.in rename to osmo-msc.pc.in index 17e265d..c406061 100644 --- a/openbsc.pc.in +++ b/osmo-msc.pc.in @@ -3,8 +3,8 @@ libdir=@libdir@ includedir=@includedir@/ -Name: OpenBSC -Description: OpenBSC base station controller +Name: OsmoMSC +Description: Osmocom Mobile Switching Center Requires: Version: @VERSION@ Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/3798 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe73012cb2a27d886b5faf931a62d5efbddd8120 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:45:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:45:54 +0000 Subject: [ABANDON] osmo-sgsn[master]: --enable-iu by default In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: --enable-iu by default ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3788 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I04b07ffead5d5394651d80711d2de06162eeed14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:48:52 +0000 Subject: [MERGED] osmo-sgsn[master]: move include/openbsc to include/osmocom/sgsn In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move include/openbsc to include/osmocom/sgsn ...................................................................... move include/openbsc to include/osmocom/sgsn Change-Id: I281ef585fffc2644682c8282224fb1c2da5ca795 --- M configure.ac M debian/copyright M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/sgsn/Makefile.am R include/osmocom/sgsn/common.h R include/osmocom/sgsn/crc24.h R include/osmocom/sgsn/debug.h R include/osmocom/sgsn/gb_proxy.h R include/osmocom/sgsn/gprs_gb_parse.h R include/osmocom/sgsn/gprs_gmm.h R include/osmocom/sgsn/gprs_llc.h R include/osmocom/sgsn/gprs_llc_xid.h R include/osmocom/sgsn/gprs_sgsn.h R include/osmocom/sgsn/gprs_sndcp.h R include/osmocom/sgsn/gprs_sndcp_comp.h R include/osmocom/sgsn/gprs_sndcp_dcomp.h R include/osmocom/sgsn/gprs_sndcp_pcomp.h R include/osmocom/sgsn/gprs_sndcp_xid.h R include/osmocom/sgsn/gprs_subscriber.h R include/osmocom/sgsn/gprs_utils.h R include/osmocom/sgsn/gsup_client.h R include/osmocom/sgsn/gtphub.h R include/osmocom/sgsn/oap_client.h R include/osmocom/sgsn/rest_octets.h R include/osmocom/sgsn/sgsn.h R include/osmocom/sgsn/signal.h R include/osmocom/sgsn/slhc.h R include/osmocom/sgsn/v42bis.h R include/osmocom/sgsn/v42bis_private.h R include/osmocom/sgsn/vty.h M src/gprs/crc24.c M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_tlli.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gb_parse.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_llc_xid.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_comp.c M src/gprs/gprs_sndcp_dcomp.c M src/gprs/gprs_sndcp_pcomp.c M src/gprs/gprs_sndcp_vty.c M src/gprs/gprs_sndcp_xid.c M src/gprs/gprs_subscriber.c M src/gprs/gprs_utils.c M src/gprs/gsup_client.c M src/gprs/gtphub.c M src/gprs/gtphub_ares.c M src/gprs/gtphub_main.c M src/gprs/gtphub_sock.c M src/gprs/gtphub_vty.c M src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_auth.c M src/gprs/sgsn_cdr.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/gprs/slhc.c M src/gprs/v42bis.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libcommon/oap_client.c M src/libcommon/socket.c M tests/gbproxy/gbproxy_test.c M tests/gprs/gprs_test.c M tests/gtphub/gtphub_test.c M tests/oap/oap_client_test.c M tests/sgsn/sgsn_test.c M tests/slhc/slhc_test.c M tests/sndcp_xid/sndcp_xid_test.c M tests/v42bis/v42bis_test.c M tests/xid/xid_test.c 87 files changed, 268 insertions(+), 264 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 55aa7d5..d5d80cc 100644 --- a/configure.ac +++ b/configure.ac @@ -179,8 +179,9 @@ AC_OUTPUT( osmo-sgsn.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/sgsn/Makefile src/Makefile src/gprs/Makefile tests/Makefile diff --git a/debian/copyright b/debian/copyright index b58117e..1f7f6fd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -78,22 +78,22 @@ doc/osmo-nitb-data_structures.dot doc/paging.txt include/Makefile.am - include/openbsc/Makefile.am - include/openbsc/common.h - include/openbsc/crc24.h - include/openbsc/debug.h - include/openbsc/gb_proxy.h - include/openbsc/gprs_gb_parse.h - include/openbsc/gprs_gmm.h - include/openbsc/gprs_llc.h - include/openbsc/gprs_sgsn.h - include/openbsc/gprs_sndcp.h - include/openbsc/gprs_subscriber.h - include/openbsc/rest_octets.h - include/openbsc/sgsn.h - include/openbsc/vty.h + include/osmocom/sgsn/Makefile.am + include/osmocom/sgsn/common.h + include/osmocom/sgsn/crc24.h + include/osmocom/sgsn/debug.h + include/osmocom/sgsn/gb_proxy.h + include/osmocom/sgsn/gprs_gb_parse.h + include/osmocom/sgsn/gprs_gmm.h + include/osmocom/sgsn/gprs_llc.h + include/osmocom/sgsn/gprs_sgsn.h + include/osmocom/sgsn/gprs_sndcp.h + include/osmocom/sgsn/gprs_subscriber.h + include/osmocom/sgsn/rest_octets.h + include/osmocom/sgsn/sgsn.h + include/osmocom/sgsn/vty.h m4/README - openbsc.pc.in + osmo-sgsn.pc.in src/Makefile.am src/gprs/.gitignore src/gprs/Makefile.am @@ -130,17 +130,17 @@ Copyright: __NO_COPYRIGHT_NOR_LICENSE__ License: __NO_COPYRIGHT_NOR_LICENSE__ -Files: include/openbsc/a_reset.h - include/openbsc/gprs_llc_xid.h - include/openbsc/gprs_sndcp_comp.h - include/openbsc/gprs_sndcp_dcomp.h - include/openbsc/gprs_sndcp_pcomp.h - include/openbsc/gprs_sndcp_xid.h - include/openbsc/gprs_utils.h - include/openbsc/gsup_client.h - include/openbsc/gtphub.h - include/openbsc/oap_client.h - include/openbsc/signal.h +Files: include/osmocom/sgsn/a_reset.h + include/osmocom/sgsn/gprs_llc_xid.h + include/osmocom/sgsn/gprs_sndcp_comp.h + include/osmocom/sgsn/gprs_sndcp_dcomp.h + include/osmocom/sgsn/gprs_sndcp_pcomp.h + include/osmocom/sgsn/gprs_sndcp_xid.h + include/osmocom/sgsn/gprs_utils.h + include/osmocom/sgsn/gsup_client.h + include/osmocom/sgsn/gtphub.h + include/osmocom/sgsn/oap_client.h + include/osmocom/sgsn/signal.h src/gprs/crc24.c src/gprs/gb_proxy.c src/gprs/gb_proxy_main.c @@ -223,8 +223,8 @@ 2015 sysmocom s.f.m.c. GmbH License: __NO_LICENSE__ -Files: include/openbsc/v42bis.h - include/openbsc/v42bis_private.h +Files: include/osmocom/sgsn/v42bis.h + include/osmocom/sgsn/v42bis_private.h Copyright: 2005-2011 Steve Underwood License: LGPL-2.1 This program is free software; you can redistribute it and/or modify @@ -367,7 +367,7 @@ On Debian systems, the complete text of the GNU Lesser General Public License Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. -Files: include/openbsc/slhc.h +Files: include/osmocom/sgsn/slhc.h Copyright: 1989 Regents of the University of California. License: __UNKNOWN__ Redistribution and use in source and binary forms are permitted diff --git a/include/Makefile.am b/include/Makefile.am index 677eec3..9d963a0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,3 +1,3 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..09db97a --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + sgsn \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/sgsn/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/sgsn/Makefile.am diff --git a/include/openbsc/common.h b/include/osmocom/sgsn/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/sgsn/common.h diff --git a/include/openbsc/crc24.h b/include/osmocom/sgsn/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/sgsn/crc24.h diff --git a/include/openbsc/debug.h b/include/osmocom/sgsn/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/sgsn/debug.h diff --git a/include/openbsc/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h similarity index 100% rename from include/openbsc/gb_proxy.h rename to include/osmocom/sgsn/gb_proxy.h diff --git a/include/openbsc/gprs_gb_parse.h b/include/osmocom/sgsn/gprs_gb_parse.h similarity index 97% rename from include/openbsc/gprs_gb_parse.h rename to include/osmocom/sgsn/gprs_gb_parse.h index 2468392..9f43fae 100644 --- a/include/openbsc/gprs_gb_parse.h +++ b/include/osmocom/sgsn/gprs_gb_parse.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include diff --git a/include/openbsc/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h similarity index 96% rename from include/openbsc/gprs_gmm.h rename to include/osmocom/sgsn/gprs_gmm.h index c38e49f..6324c5d 100644 --- a/include/openbsc/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -2,7 +2,7 @@ #define _GPRS_GMM_H #include -#include +#include #include diff --git a/include/openbsc/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h similarity index 98% rename from include/openbsc/gprs_llc.h rename to include/osmocom/sgsn/gprs_llc.h index 8bc2267..376ae9a 100644 --- a/include/openbsc/gprs_llc.h +++ b/include/osmocom/sgsn/gprs_llc.h @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include /* Section 4.7 LLC Layer Structure */ enum gprs_llc_sapi { diff --git a/include/openbsc/gprs_llc_xid.h b/include/osmocom/sgsn/gprs_llc_xid.h similarity index 100% rename from include/openbsc/gprs_llc_xid.h rename to include/osmocom/sgsn/gprs_llc_xid.h diff --git a/include/openbsc/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h similarity index 100% rename from include/openbsc/gprs_sgsn.h rename to include/osmocom/sgsn/gprs_sgsn.h diff --git a/include/openbsc/gprs_sndcp.h b/include/osmocom/sgsn/gprs_sndcp.h similarity index 100% rename from include/openbsc/gprs_sndcp.h rename to include/osmocom/sgsn/gprs_sndcp.h diff --git a/include/openbsc/gprs_sndcp_comp.h b/include/osmocom/sgsn/gprs_sndcp_comp.h similarity index 98% rename from include/openbsc/gprs_sndcp_comp.h rename to include/osmocom/sgsn/gprs_sndcp_comp.h index 87ab638..c04f7d4 100644 --- a/include/openbsc/gprs_sndcp_comp.h +++ b/include/osmocom/sgsn/gprs_sndcp_comp.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* Header / Data compression entity */ struct gprs_sndcp_comp { diff --git a/include/openbsc/gprs_sndcp_dcomp.h b/include/osmocom/sgsn/gprs_sndcp_dcomp.h similarity index 97% rename from include/openbsc/gprs_sndcp_dcomp.h rename to include/osmocom/sgsn/gprs_sndcp_dcomp.h index a76b4a4..3e85142 100644 --- a/include/openbsc/gprs_sndcp_dcomp.h +++ b/include/osmocom/sgsn/gprs_sndcp_dcomp.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* Note: The decompressed packet may have a maximum size of: * Return value * MAX_DATADECOMPR_FAC */ diff --git a/include/openbsc/gprs_sndcp_pcomp.h b/include/osmocom/sgsn/gprs_sndcp_pcomp.h similarity index 97% rename from include/openbsc/gprs_sndcp_pcomp.h rename to include/osmocom/sgsn/gprs_sndcp_pcomp.h index 4e15b9b..3e3131b 100644 --- a/include/openbsc/gprs_sndcp_pcomp.h +++ b/include/osmocom/sgsn/gprs_sndcp_pcomp.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* Note: The decompressed packet may have a maximum size of: * Return value + MAX_DECOMPR_INCR */ diff --git a/include/openbsc/gprs_sndcp_xid.h b/include/osmocom/sgsn/gprs_sndcp_xid.h similarity index 100% rename from include/openbsc/gprs_sndcp_xid.h rename to include/osmocom/sgsn/gprs_sndcp_xid.h diff --git a/include/openbsc/gprs_subscriber.h b/include/osmocom/sgsn/gprs_subscriber.h similarity index 100% rename from include/openbsc/gprs_subscriber.h rename to include/osmocom/sgsn/gprs_subscriber.h diff --git a/include/openbsc/gprs_utils.h b/include/osmocom/sgsn/gprs_utils.h similarity index 100% rename from include/openbsc/gprs_utils.h rename to include/osmocom/sgsn/gprs_utils.h diff --git a/include/openbsc/gsup_client.h b/include/osmocom/sgsn/gsup_client.h similarity index 97% rename from include/openbsc/gsup_client.h rename to include/osmocom/sgsn/gsup_client.h index 4a25490..29092ad 100644 --- a/include/openbsc/gsup_client.h +++ b/include/osmocom/sgsn/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 diff --git a/include/openbsc/gtphub.h b/include/osmocom/sgsn/gtphub.h similarity index 99% rename from include/openbsc/gtphub.h rename to include/osmocom/sgsn/gtphub.h index 9cb7605..8fd9f38 100644 --- a/include/openbsc/gtphub.h +++ b/include/osmocom/sgsn/gtphub.h @@ -28,7 +28,7 @@ #include #include -#include +#include /* support */ diff --git a/include/openbsc/oap_client.h b/include/osmocom/sgsn/oap_client.h similarity index 100% rename from include/openbsc/oap_client.h rename to include/osmocom/sgsn/oap_client.h diff --git a/include/openbsc/rest_octets.h b/include/osmocom/sgsn/rest_octets.h similarity index 98% rename from include/openbsc/rest_octets.h rename to include/osmocom/sgsn/rest_octets.h index 49a2312..0dbe7ae 100644 --- a/include/openbsc/rest_octets.h +++ b/include/osmocom/sgsn/rest_octets.h @@ -2,7 +2,7 @@ #define _REST_OCTETS_H #include -#include +#include #include /* generate SI1 rest octets */ diff --git a/include/openbsc/sgsn.h b/include/osmocom/sgsn/sgsn.h similarity index 97% rename from include/openbsc/sgsn.h rename to include/osmocom/sgsn/sgsn.h index f371dc6..e4eda17 100644 --- a/include/openbsc/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -5,9 +5,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/signal.h b/include/osmocom/sgsn/signal.h similarity index 100% rename from include/openbsc/signal.h rename to include/osmocom/sgsn/signal.h diff --git a/include/openbsc/slhc.h b/include/osmocom/sgsn/slhc.h similarity index 100% rename from include/openbsc/slhc.h rename to include/osmocom/sgsn/slhc.h diff --git a/include/openbsc/v42bis.h b/include/osmocom/sgsn/v42bis.h similarity index 100% rename from include/openbsc/v42bis.h rename to include/osmocom/sgsn/v42bis.h diff --git a/include/openbsc/v42bis_private.h b/include/osmocom/sgsn/v42bis_private.h similarity index 100% rename from include/openbsc/v42bis_private.h rename to include/osmocom/sgsn/v42bis_private.h diff --git a/include/openbsc/vty.h b/include/osmocom/sgsn/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/sgsn/vty.h diff --git a/src/gprs/crc24.c b/src/gprs/crc24.c index 1a420ed..da269b3 100644 --- a/src/gprs/crc24.c +++ b/src/gprs/crc24.c @@ -19,7 +19,7 @@ * */ -#include +#include /* CRC24 table - FCS */ static const uint32_t tbl_crc24[256] = { diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index d288cb3..eb2bbcc 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -41,14 +41,14 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include -#include +#include #include diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c index 853a763..9f9c605 100644 --- a/src/gprs/gb_proxy_main.c +++ b/src/gprs/gb_proxy_main.c @@ -41,10 +41,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index bee3150..4862755 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -18,12 +18,12 @@ * */ -#include +#include -#include -#include +#include +#include -#include +#include #include #include diff --git a/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c index a83630b..69cce3a 100644 --- a/src/gprs/gb_proxy_peer.c +++ b/src/gprs/gb_proxy_peer.c @@ -20,9 +20,9 @@ * */ -#include +#include -#include +#include #include #include diff --git a/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c index 3b3b976..1832122 100644 --- a/src/gprs/gb_proxy_tlli.c +++ b/src/gprs/gb_proxy_tlli.c @@ -20,12 +20,12 @@ #include -#include +#include -#include -#include +#include +#include -#include +#include #include diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c index bd5bb1b..156f337 100644 --- a/src/gprs/gb_proxy_vty.c +++ b/src/gprs/gb_proxy_vty.c @@ -31,10 +31,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c index d5a122b..ba78e89 100644 --- a/src/gprs/gprs_gb_parse.c +++ b/src/gprs/gprs_gb_parse.c @@ -21,11 +21,11 @@ #include #include -#include +#include -#include +#include -#include +#include #include diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 7301bf1..7e109b4 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -54,15 +54,15 @@ #include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 904ec7e..22743fe 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -33,15 +33,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static struct gprs_llc_llme *llme_alloc(uint32_t tlli); static int gprs_llc_tx_xid(struct gprs_llc_lle *lle, struct msgb *msg, diff --git a/src/gprs/gprs_llc_parse.c b/src/gprs/gprs_llc_parse.c index be63497..1d97004 100644 --- a/src/gprs/gprs_llc_parse.c +++ b/src/gprs/gprs_llc_parse.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static const struct value_string llc_cmd_strs[] = { { GPRS_LLC_NULL, "NULL" }, diff --git a/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c index 626d6ef..1433efe 100644 --- a/src/gprs/gprs_llc_vty.c +++ b/src/gprs/gprs_llc_vty.c @@ -32,9 +32,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c index fe63171..de60e49 100644 --- a/src/gprs/gprs_llc_xid.c +++ b/src/gprs/gprs_llc_xid.c @@ -30,10 +30,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include const struct value_string gprs_llc_xid_type_names[] = { { GPRS_LLC_XID_T_VERSION, "VERSION"}, diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 560485d..4cd3df1 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -33,14 +33,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include "openbsc/gprs_llc.h" +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c index 05dad66..77f8ca6 100644 --- a/src/gprs/gprs_sndcp.c +++ b/src/gprs/gprs_sndcp.c @@ -30,15 +30,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define DEBUG_IP_PACKETS 0 /* 0=Disabled, 1=Enabled */ diff --git a/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c index a12c39a..60b15b9 100644 --- a/src/gprs/gprs_sndcp_comp.c +++ b/src/gprs/gprs_sndcp_comp.c @@ -30,11 +30,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Create a new compression entity from a XID-Field */ static struct gprs_sndcp_comp *gprs_sndcp_comp_create(const void *ctx, diff --git a/src/gprs/gprs_sndcp_dcomp.c b/src/gprs/gprs_sndcp_dcomp.c index b0f95b4..04ff491 100644 --- a/src/gprs/gprs_sndcp_dcomp.c +++ b/src/gprs/gprs_sndcp_dcomp.c @@ -33,14 +33,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /* A struct to capture the output data of compressor and decompressor */ struct v42bis_output_buffer { diff --git a/src/gprs/gprs_sndcp_pcomp.c b/src/gprs/gprs_sndcp_pcomp.c index a2236c3..2911b5e 100644 --- a/src/gprs/gprs_sndcp_pcomp.c +++ b/src/gprs/gprs_sndcp_pcomp.c @@ -33,13 +33,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* Initalize header compression */ int gprs_sndcp_pcomp_init(const void *ctx, struct gprs_sndcp_comp *comp_entity, diff --git a/src/gprs/gprs_sndcp_vty.c b/src/gprs/gprs_sndcp_vty.c index 4bad8b0..0994a4c 100644 --- a/src/gprs/gprs_sndcp_vty.c +++ b/src/gprs/gprs_sndcp_vty.c @@ -31,10 +31,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/gprs_sndcp_xid.c b/src/gprs/gprs_sndcp_xid.c index dfea5fe..8f844b5 100644 --- a/src/gprs/gprs_sndcp_xid.c +++ b/src/gprs/gprs_sndcp_xid.c @@ -31,10 +31,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include /* When the propose bit in an SNDCP-XID compression field is set to zero, * the algorithm identifier is stripped. The algoritm parameters are specific diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 94297d0..bebdb1e 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -25,15 +25,15 @@ #include #include #include -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include #include diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c index 91a09d2..307699b 100644 --- a/src/gprs/gprs_utils.c +++ b/src/gprs/gprs_utils.c @@ -19,7 +19,7 @@ * along with this program. If not, see . * */ -#include +#include #include #include diff --git a/src/gprs/gsup_client.c b/src/gprs/gsup_client.c index 258f230..48357b4 100644 --- a/src/gprs/gsup_client.c +++ b/src/gprs/gsup_client.c @@ -21,14 +21,14 @@ * */ -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 0a8e375..7e3e663 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -32,9 +32,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/gprs/gtphub_ares.c b/src/gprs/gtphub_ares.c index afeeda6..87dc860 100644 --- a/src/gprs/gtphub_ares.c +++ b/src/gprs/gtphub_ares.c @@ -28,15 +28,15 @@ #include #include -#include -#include +#include +#include #include #include /* TODO split GRX ares from sgsn into a separate struct and allow use without * globals. */ -#include +#include extern struct sgsn_instance *sgsn; struct sgsn_instance sgsn_inst = { 0 }; diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index d7b3ba7..782afb3 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -41,9 +41,9 @@ #include -#include -#include -#include +#include +#include +#include #include "../../bscconfig.h" diff --git a/src/gprs/gtphub_sock.c b/src/gprs/gtphub_sock.c index 60bebaa..1acd5a6 100644 --- a/src/gprs/gtphub_sock.c +++ b/src/gprs/gtphub_sock.c @@ -25,8 +25,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include /* Convenience makro, note: only within this C file. */ #define LOG(level, fmt, args...) \ diff --git a/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c index d611b1f..3a46e81 100644 --- a/src/gprs/gtphub_vty.c +++ b/src/gprs/gtphub_vty.c @@ -30,12 +30,12 @@ #include #include -#include -#include +#include +#include /* TODO split GRX ares from sgsn into a separate struct and allow use without * globals. */ -#include +#include extern struct sgsn_instance *sgsn; extern void *tall_bsc_ctx; diff --git a/src/gprs/oap_client.c b/src/gprs/oap_client.c index 5128ac1..9ff84a6 100644 --- a/src/gprs/oap_client.c +++ b/src/gprs/oap_client.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include int oap_client_init(struct oap_client_config *config, struct oap_client_state *state) diff --git a/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c index 6238099..17567c4 100644 --- a/src/gprs/sgsn_ares.c +++ b/src/gprs/sgsn_ares.c @@ -19,8 +19,8 @@ * */ -#include -#include +#include +#include #include diff --git a/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c index a64339c..92712ef 100644 --- a/src/gprs/sgsn_auth.c +++ b/src/gprs/sgsn_auth.c @@ -21,11 +21,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include const struct value_string auth_state_names[] = { { SGSN_AUTH_ACCEPTED, "accepted"}, diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c index 16ea9d4..474d41a 100644 --- a/src/gprs/sgsn_cdr.c +++ b/src/gprs/sgsn_cdr.c @@ -18,13 +18,13 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include diff --git a/src/gprs/sgsn_ctrl.c b/src/gprs/sgsn_ctrl.c index f7b1180..dc5ae79 100644 --- a/src/gprs/sgsn_ctrl.c +++ b/src/gprs/sgsn_ctrl.c @@ -21,9 +21,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 90b4d16..9a00266 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -42,14 +42,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef BUILD_IU #include diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 8ffc6c8..d79beb3 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -52,12 +52,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index fce2518..1882852 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -30,12 +30,12 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include @@ -657,7 +657,7 @@ } /* Subscriber */ -#include +#include static void subscr_dump_full_vty(struct vty *vty, struct gprs_subscr *gsub, int pending) { diff --git a/src/gprs/slhc.c b/src/gprs/slhc.c index cbdf8db..20e571d 100644 --- a/src/gprs/slhc.c +++ b/src/gprs/slhc.c @@ -57,8 +57,8 @@ #include #include #include -#include -#include +#include +#include #define ERR_PTR(x) x diff --git a/src/gprs/v42bis.c b/src/gprs/v42bis.c index a04b0af..3bb9afc 100644 --- a/src/gprs/v42bis.c +++ b/src/gprs/v42bis.c @@ -38,9 +38,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 856583e..ac3c7fc 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,11 +23,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..6076409 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7be2240..a2837f3 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..8d5f990 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index 018ed21..2a8a59f 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index fd65e7b..89a9f70 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -21,14 +21,14 @@ * */ -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index b6a8d6b..cc0f58b 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include static struct gsup_client *g_gc; diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c index 5128ac1..9ff84a6 100644 --- a/src/libcommon/oap_client.c +++ b/src/libcommon/oap_client.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include int oap_client_init(struct oap_client_config *config, struct oap_client_state *state) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..dfcb393 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index 9672dcb..e8a4ef9 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -31,11 +31,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index aac9bb8..2dcbafa 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -2,10 +2,10 @@ #include #include -#include -#include +#include +#include -#include +#include #include #include diff --git a/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c index e7c27d2..ac0223b 100644 --- a/tests/gtphub/gtphub_test.c +++ b/tests/gtphub/gtphub_test.c @@ -28,9 +28,9 @@ #include #include -#include +#include -#include +#include #include #include diff --git a/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c index e6501cb..7adae83 100644 --- a/tests/oap/oap_client_test.c +++ b/tests/oap/oap_client_test.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index d66c5dd..a486794 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -19,15 +19,15 @@ * */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include diff --git a/tests/slhc/slhc_test.c b/tests/slhc/slhc_test.c index d2e1cd9..bb0e26c 100644 --- a/tests/slhc/slhc_test.c +++ b/tests/slhc/slhc_test.c @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include #include diff --git a/tests/sndcp_xid/sndcp_xid_test.c b/tests/sndcp_xid/sndcp_xid_test.c index 151dd2b..dc6da82 100644 --- a/tests/sndcp_xid/sndcp_xid_test.c +++ b/tests/sndcp_xid/sndcp_xid_test.c @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include #include diff --git a/tests/v42bis/v42bis_test.c b/tests/v42bis/v42bis_test.c index 7e90785..41d23b0 100644 --- a/tests/v42bis/v42bis_test.c +++ b/tests/v42bis/v42bis_test.c @@ -19,9 +19,9 @@ * along with this program. If not, see . */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/xid/xid_test.c b/tests/xid/xid_test.c index b77a4ae..e30a14f 100644 --- a/tests/xid/xid_test.c +++ b/tests/xid/xid_test.c @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -#include -#include +#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/3810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I281ef585fffc2644682c8282224fb1c2da5ca795 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:48:52 +0000 Subject: [MERGED] osmo-sgsn[master]: move openbsc.pc to osmo-sgsn.pc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move openbsc.pc to osmo-sgsn.pc ...................................................................... move openbsc.pc to osmo-sgsn.pc Change-Id: Iad28d85b2a6d175cbe5d506aa82e7e4d94111eff --- M Makefile.am M configure.ac D openbsc.pc.in A osmo-sgsn.pc.in 4 files changed, 12 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/Makefile.am b/Makefile.am index 536b3f4..d57b66d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = openbsc.pc +pkgconfig_DATA = osmo-sgsn.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index aa1c0a1..55aa7d5 100644 --- a/configure.ac +++ b/configure.ac @@ -178,7 +178,7 @@ AM_CONFIG_HEADER(bscconfig.h) AC_OUTPUT( - openbsc.pc + osmo-sgsn.pc include/openbsc/Makefile include/Makefile src/Makefile diff --git a/openbsc.pc.in b/openbsc.pc.in deleted file mode 100644 index 17e265d..0000000 --- a/openbsc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ - -Name: OpenBSC -Description: OpenBSC base station controller -Requires: -Version: @VERSION@ -Cflags: -I${includedir} diff --git a/osmo-sgsn.pc.in b/osmo-sgsn.pc.in new file mode 100644 index 0000000..45aef57 --- /dev/null +++ b/osmo-sgsn.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/ + +Name: OsmoSGSN +Description: Osmocom's Serving GPRS Support Node for 2G and 3G packet-switched mobile networks +Requires: +Version: @VERSION@ +Cflags: -I${includedir} -- To view, visit https://gerrit.osmocom.org/3809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iad28d85b2a6d175cbe5d506aa82e7e4d94111eff Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:48:52 +0000 Subject: [MERGED] osmo-sgsn[master]: configure.ac: set name to osmo-sgsn, fix ML addr In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: set name to osmo-sgsn, fix ML addr ...................................................................... configure.ac: set name to osmo-sgsn, fix ML addr Change-Id: I47e9f2307b42d171f2ceeda1e129e2311f611883 --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index a90a6ca..aa1c0a1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT([openbsc], +AC_INIT([osmo-sgsn], m4_esyscmd([./git-version-gen .tarball-version]), - [openbsc at lists.osmocom.org]) + [osmocom-net-gprs at lists.osmocom.org]) dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ AC_CONFIG_AUX_DIR([.]) -- To view, visit https://gerrit.osmocom.org/3808 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I47e9f2307b42d171f2ceeda1e129e2311f611883 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:48:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:48:52 +0000 Subject: [MERGED] osmo-sgsn[master]: rewrite README In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rewrite README ...................................................................... rewrite README Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 --- M README 1 file changed, 14 insertions(+), 36 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/README b/README index d01b2cf..a14ba38 100644 --- a/README +++ b/README @@ -1,39 +1,17 @@ -About OpenBSC -============= +About OsmoSGSN +============== -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoSGSN originated from the OpenBSC project, as a separate program within +openbsc.git. In 2017, OpenBSC was split in separate repositories, and hence +OsmoSGSN was given its own separate git repository. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoSGSN exposes +- GSUP towards OsmoHLR (or a MAP proxy); +- GTP towards a GGSN (e.g. OsmoGGSN); +- Gb towards a BSS (e.g. OsmoPCU); +- IuPS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G data; +- The Osmocom typical telnet VTY and CTRL interfaces. -Various interfaces towards the BTS are supported, among which are: - - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. - - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. - - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoSGSN issue tracker and wiki online at +https://osmocom.org/projects/osmosgsn +https://osmocom.org/projects/osmosgsn/wiki -- To view, visit https://gerrit.osmocom.org/3804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If78b74494a00ad230aec94e03b2fe4e905473897 Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:48:53 +0000 Subject: [MERGED] osmo-sgsn[master]: drop files unrelated to osmo-sgsn In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: drop files unrelated to osmo-sgsn ...................................................................... drop files unrelated to osmo-sgsn These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-sgsn. Change-Id: Ie9dc7514c3850010d0e9b3ab716b4f4e8d83594f --- D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/mgcp_server.py D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/systemd/osmo-bsc-mgcp.service D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c M debian/copyright D doc/BS11-OML.txt D doc/call-routing.txt D doc/channel_release.txt D doc/e1-data-model.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/bscs.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-msc/osmo-msc.cfg D doc/gsm-hopping.txt D doc/handover.txt D doc/ipa-sccp.txt D doc/oml-interface.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/a_reset.h D include/openbsc/gsm_04_14.h D include/openbsc/iu_dummy.h M src/Makefile.am D src/libmsc/gsm_04_14.c D src/libmsc/iu_dummy.c D tools/hlrstat.pl 59 files changed, 0 insertions(+), 3,583 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/contrib/a-link/sccp-split-by-con.lua b/contrib/a-link/sccp-split-by-con.lua deleted file mode 100644 index f5d5502..0000000 --- a/contrib/a-link/sccp-split-by-con.lua +++ /dev/null @@ -1,170 +0,0 @@ --- Split trace based on SCCP Source --- There are still bugs to find... bugs bugs bugs... hmm -do - local function init_listener() - print("CREATED LISTENER") - local tap = Listener.new("ip", "sccp && (ip.src == 172.16.1.81 || ip.dst == 172.16.1.81)") - local sccp_type_field = Field.new("sccp.message_type") - local sccp_src_field = Field.new("sccp.slr") - local sccp_dst_field = Field.new("sccp.dlr") - local msg_type_field = Field.new("gsm_a.dtap_msg_mm_type") - local lu_rej_field = Field.new("gsm_a.dtap.rej_cause") - local ip_src_field = Field.new("ip.src") - local ip_dst_field = Field.new("ip.dst") - - -- - local bssmap_msgtype_field = Field.new("gsm_a.bssmap_msgtype") - -- assignment failure 0x03 - -- - - -- - local dtap_cause_field = Field.new("gsm_a_dtap.cause") - local dtap_cc_field = Field.new("gsm_a.dtap_msg_cc_type") - - local connections = {} - - function check_failure(con) - check_lu_reject(con) - check_disconnect(con) - check_failures(con) - end - - -- cipher mode reject - function check_failures(con) - local msgtype = bssmap_msgtype_field() - if not msgtype then - return - end - - msgtype = tonumber(msgtype) - if msgtype == 89 then - print("Cipher mode reject") - con[4] = true - elseif msgtype == 0x03 then - print("Assignment failure") - con[4] = true - elseif msgtype == 0x22 then - print("Clear Request... RF failure?") - con[4] = true - end - end - - -- check if a DISCONNECT is normal - function check_disconnect(con) - local msg_type = dtap_cc_field() - if not msg_type then - return - end - - if tonumber(msg_type) ~= 0x25 then - return - end - - local cause = dtap_cause_field() - if not cause then - return - end - - cause = tonumber(cause) - if cause ~= 0x10 then - print("DISCONNECT != Normal") - con[4] = true - end - end - - -- check if we have a LU Reject - function check_lu_reject(con) - local msg_type = msg_type_field() - if not msg_type then - return - end - - msg_type = tonumber(tostring(msg_type)) - if msg_type == 0x04 then - print("LU REJECT with " .. tostring(lu_rej_field())) - con[4] = true - end - end - - function tap.packet(pinfo,tvb,ip) - local ip_src = tostring(ip_src_field()) - local ip_dst = tostring(ip_dst_field()) - local sccp_type = tonumber(tostring(sccp_type_field())) - local sccp_src = sccp_src_field() - local sccp_dst = sccp_dst_field() - - local con - - if sccp_type == 0x01 then - elseif sccp_type == 0x2 then - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local datestring = os.date("%Y%m%d%H%M%S") - local pcap_name = string.format("alink_trace_%s-%s_%s.pcap", src, dst, datestring) - local dumper = Dumper.new_for_current(pcap_name) - - local con = { ip_src, tostring(sccp_src), tostring(sccp_dst), false, dumper, pcap_name } - - dumper:dump_current() - connections[src] = con - connections[dst] = con - elseif sccp_type == 0x4 then - -- close a connection... remove it from the list - local src = string.format("%s-%s", ip_src, tostring(sccp_src)) - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - - local con = connections[src] - if not con then - return - end - - con[5]:dump_current() - con[5]:flush() - - -- this causes a crash on unpacted wireshark - con[5]:close() - - -- the connection had a failure - if con[4] == true then - local datestring = os.date("%Y%m%d%H%M%S") - local new_name = string.format("alink_failure_%s_%s-%s.pcap", datestring, con[2], con[3]) - os.rename(con[6], new_name) - else - os.remove(con[6]) - end - - - -- clear the old connection - connections[src] = nil - connections[dst] = nil - - elseif sccp_type == 0x5 then - -- not handled yet... we should verify stuff here... - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - return - end - con[5]:dump_current() - elseif sccp_type == 0x6 then - local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst)) - local con = connections[dst] - if not con then - print("DON'T KNOW THIS CONNECTION for " .. ip_dst) - return - end - con[5]:dump_current() - check_failure(con) - end - - end - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end - end - - init_listener() -end diff --git a/contrib/bsc-test/README b/contrib/bsc-test/README deleted file mode 100644 index adb222e..0000000 --- a/contrib/bsc-test/README +++ /dev/null @@ -1 +0,0 @@ -Some crazy scripts call testing... and MSC link failure simulation diff --git a/contrib/bsc-test/all_dial b/contrib/bsc-test/all_dial deleted file mode 100644 index 96e5f00..0000000 --- a/contrib/bsc-test/all_dial +++ /dev/null @@ -1,8 +0,0 @@ -ABORT BUSY -ABORT 'NO CARRIER' -ABORT 'OK' - -'' AT -SAY "Dialing a number\n" -'OK' ATD05660066; - diff --git a/contrib/bsc-test/dial.sh b/contrib/bsc-test/dial.sh deleted file mode 100755 index e5e19f6..0000000 --- a/contrib/bsc-test/dial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Evil dial script.. - -while true; -do - chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0 - sleep 5s - chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0 - sleep 2s -done - diff --git a/contrib/bsc-test/drop-oml.sh b/contrib/bsc-test/drop-oml.sh deleted file mode 100755 index 84eead7..0000000 --- a/contrib/bsc-test/drop-oml.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -sleep 3 -echo "enable" -sleep 1 -echo "drop bts connection 0 oml" -sleep 1 diff --git a/contrib/bsc-test/drop.sh b/contrib/bsc-test/drop.sh deleted file mode 100755 index c7b66ba..0000000 --- a/contrib/bsc-test/drop.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Going to drop the OML connection" - ./drop-oml.sh | telnet 127.0.0.1 4242 - sleep 58m -done diff --git a/contrib/bsc-test/hangup b/contrib/bsc-test/hangup deleted file mode 100644 index cad6870..0000000 --- a/contrib/bsc-test/hangup +++ /dev/null @@ -1,4 +0,0 @@ -TIMEOUT 10 -'' ^Z -SAY "Waiting for hangup confirm\n" -'' ATH; diff --git a/contrib/bsc-test/msc.sh b/contrib/bsc-test/msc.sh deleted file mode 100755 index bec011d..0000000 --- a/contrib/bsc-test/msc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -while true; -do - echo "Kill the osmo-bsc" - /usr/bin/kill -s SIGUSR2 `pidof osmo-bsc` - sleep 58s -done diff --git a/contrib/bsc_control.py b/contrib/bsc_control.py deleted file mode 100755 index c1b09ce..0000000 --- a/contrib/bsc_control.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/python -# -*- mode: python-mode; py-indent-tabs-mode: nil -*- -""" -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -""" - -from optparse import OptionParser -from ipa import Ctrl -import socket - -verbose = False - -def connect(host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - return sck - -def do_set_get(sck, var, value = None): - (r, c) = Ctrl().cmd(var, value) - sck.send(c) - answer = Ctrl().rem_header(sck.recv(4096)) - return (answer,) + Ctrl().verify(answer, r, var, value) - -def set_var(sck, var, val): - (a, _, _) = do_set_get(sck, var, val) - return a - -def get_var(sck, var): - (_, _, v) = do_set_get(sck, var) - return v - -def _leftovers(sck, fl): - """ - Read outstanding data if any according to flags - """ - try: - data = sck.recv(1024, fl) - except socket.error as (s_errno, strerror): - return False - if len(data) != 0: - tail = data - while True: - (head, tail) = Ctrl().split_combined(tail) - print "Got message:", Ctrl().rem_header(head) - if len(tail) == 0: - break - return True - return False - -if __name__ == '__main__': - parser = OptionParser("Usage: %prog [options] var [value]") - parser.add_option("-d", "--host", dest="host", - help="connect to HOST", metavar="HOST") - parser.add_option("-p", "--port", dest="port", type="int", - help="use PORT", metavar="PORT", default=4249) - parser.add_option("-g", "--get", action="store_true", - dest="cmd_get", help="perform GET operation") - parser.add_option("-s", "--set", action="store_true", - dest="cmd_set", help="perform SET operation") - parser.add_option("-v", "--verbose", action="store_true", - dest="verbose", help="be verbose", default=False) - parser.add_option("-m", "--monitor", action="store_true", - dest="monitor", help="monitor the connection for traps", default=False) - - (options, args) = parser.parse_args() - - verbose = options.verbose - - if options.cmd_set and options.cmd_get: - parser.error("Get and set options are mutually exclusive!") - - if not (options.cmd_get or options.cmd_set or options.monitor): - parser.error("One of -m, -g, or -s must be set") - - if not (options.host): - parser.error("Destination host and port required!") - - sock = connect(options.host, options.port) - - if options.cmd_set: - if len(args) < 2: - parser.error("Set requires var and value arguments") - _leftovers(sock, socket.MSG_DONTWAIT) - print "Got message:", set_var(sock, args[0], ' '.join(args[1:])) - - if options.cmd_get: - if len(args) != 1: - parser.error("Get requires the var argument") - _leftovers(sock, socket.MSG_DONTWAIT) - (a, _, _) = do_set_get(sock, args[0]) - print "Got message:", a - - if options.monitor: - while True: - if not _leftovers(sock, 0): - print "Connection is gone." - break - sock.close() diff --git a/contrib/bt.py b/contrib/bt.py deleted file mode 100755 index 1b111ef..0000000 --- a/contrib/bt.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import os - -f = open("unbalanced") -lines = [] -for line in f: - lines.append(line) - -filenames = {} - -output = [] -for line in lines: - if "[0x" in line: - start = line.find("[") - end = line.find("]") - addr = line[start+1:end] - try: - file = filenames[addr] - except KeyError: - r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr) - all = r.read().replace("\n", ",") - file = all - filenames[addr] = file - - line = line.replace(addr, file) - output.append(line) - -g = open("unbalanced.2", "w") -g.write("".join(output)) - - - diff --git a/contrib/convert_to_enum.py b/contrib/convert_to_enum.py deleted file mode 100755 index bcd6f2c..0000000 --- a/contrib/convert_to_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# -# Convert ETSI documents to an enum -# - -import re, sys - -def convert(string): - string = string.strip().replace(" ", "").rjust(8, "0") - var = 0 - offset = 7 - for char in string: - assert offset >= 0 - var = var | (int(char) << offset) - offset = offset - 1 - - return var - -def string(name): - name = name.replace(" ", "_") - name = name.replace('"', "") - name = name.replace('/', '_') - name = name.replace('(', '_') - name = name.replace(')', '_') - return "%s_%s" % (sys.argv[2], name.upper()) - -file = open(sys.argv[1]) - - -for line in file: - m = re.match(r"[ \t]*(?P[01 ]+)[ ]+(?P[a-zA-Z /0-9()]+)", line[:-1]) - - if m: - print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"])) - else: - print line[:-1] diff --git a/contrib/ctrl2sse.py b/contrib/ctrl2sse.py deleted file mode 100755 index 8b630ec..0000000 --- a/contrib/ctrl2sse.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python2 - -mod_license = ''' -/* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -''' - -import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control -from eventsource import listener, request - -''' -N. B: this is not an example of building proper REST API or building secure web application. -It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API. -Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem -from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that. -''' - -token = None -stream = None -url = None - -''' -Returns json according to following schema - see http://json-schema.org/documentation.html for details: -{ - "title": "Ctrl Schema", - "type": "object", - "properties": { - "variable": { - "type": "string" - }, - "varlue": { - "type": "string" - } - }, - "required": ["interface", "variable", "value"] -} -Example validation from command-line: -json validate --schema-file=schema.json --document-file=data.json -The interface is represented as string because it might look different for IPv4 vs v6. -''' - -def read_header(data): - t_length = bsc_control.ipa_ctrl_header(data) - if (t_length): - stream.read_bytes(t_length - 1, callback = read_trap) - else: - print >> sys.stderr, "protocol error: length missing in %s!" % data - - at tornado.gen.coroutine -def read_trap(data): - (t, z, v, p) = data.split() - if (t != 'TRAP' or int(z) != 0): - print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z)) - else: - yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token), - method = 'POST', - headers = {'Content-Type': 'application/json'}, - body = tornado.escape.json_encode({ 'variable' : v, 'value' : p }))) - stream.read_bytes(4, callback = read_header) - - at tornado.gen.coroutine -def trap_setup(host, port, target_host, target_port, tk): - global stream - global url - global token - token = tk - url = "http://%s:%s/sse" % (host, port) - stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port) - stream.read_bytes(4, callback = read_header) - -def get_v(s, v): - return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) } - -class CtrlHandler(tornado.web.RequestHandler): - def initialize(self): - self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port']) - - def get(self, v): - self.write(get_v(self.skt, v)) - - def post(self): - self.write(get_v(self.skt, self.get_argument("variable"))) - -class SetCtrl(CtrlHandler): - def get(self, var, val): - bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val)) - super(SetCtrl, self).get(tornado.escape.native_str(var)) - - def post(self): - bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value"))) - super(SetCtrl, self).post() - -class Slash(tornado.web.RequestHandler): - def get(self): - self.write('%sUsing Tornado framework v%s' - '
' - '' - '' - '
' - '
' - '' - '' - '' - '
' - '' % ("Osmocom Control Interface Proxy", tornado.version)) - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.') - p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port") - p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress") - p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface") - p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface") - p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)") - p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value") - p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000") - args = p.parse_args() - random.seed() - tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver - logging.basicConfig() - application = tornado.web.Application([ - (r"/", Slash), - (r"/get", CtrlHandler), - (r"/get/(.*)", CtrlHandler), - (r"/set", SetCtrl), - (r"/set/(.*)/(.*)", SetCtrl), - (r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)), - ], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port) - application.listen(address = args.host, port = args.port) - trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token) - tornado.ioloop.IOLoop.instance().start() diff --git a/contrib/hlr-remove-old.sql b/contrib/hlr-remove-old.sql deleted file mode 100644 index 626a331..0000000 --- a/contrib/hlr-remove-old.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Remove old data from the database -DELETE FROM Subscriber - WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1; -DELETE FROM Equipment - WHERE datetime('now', '-10 days') > updated; -DELETE FROM EquipmentWatch - WHERE datetime('now', '-10 days') > updated; -DELETE FROM SMS - WHERE datetime('now', '-10 days') > created; -DELETE FROM VLR - WHERE datetime('now', '-10 days') > updated; -DELETE FROM ApduBlobs - WHERE datetime('now', '-10 days') > created; -DELETE FROM Counters - WHERE datetime('now', '-10 days') > timestamp; -DELETE FROM RateCounters - WHERE datetime('now', '-10 days') > timestamp; -VACUUM; diff --git a/contrib/hlrsync/hlrsync.py b/contrib/hlrsync/hlrsync.py deleted file mode 100755 index e4a4955..0000000 --- a/contrib/hlrsync/hlrsync.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python2.5 - -from __future__ import with_statement - -from pysqlite2 import dbapi2 as sqlite3 -import sys - -hlr = sqlite3.connect(sys.argv[1]) -web = sqlite3.connect(sys.argv[2]) - -# switch to autocommit -hlr.isolation_level = None -web.isolation_level = None - -hlr.row_factory = sqlite3.Row -web.row_factory = sqlite3.Row - -with hlr: - hlr_subscrs = hlr.execute(""" - SELECT * FROM Subscriber - """).fetchall() - hlr_tokens = hlr.execute(""" - SELECT * FROM AuthToken - """).fetchall() - -with web: - web_tokens = web.execute(""" - SELECT * FROM reg_tokens - """).fetchall() - web_sms = web.execute(""" - SELECT * FROM sms_queue - """).fetchall() - -# index by subscr id -hlr_subscrs_by_id = {} -hlr_subscrs_by_ext = {} -hlr_tokens_by_subscr_id = {} -for x in hlr_subscrs: - hlr_subscrs_by_id[x['id']] = x - hlr_subscrs_by_ext[x['extension']] = x -del hlr_subscrs -for x in hlr_tokens: - hlr_tokens_by_subscr_id[x['subscriber_id']] = x -del hlr_tokens - -web_tokens_by_subscr_id = {} -for x in web_tokens: - web_tokens_by_subscr_id[x['subscriber_id']] = x -del web_tokens - -# remove leftover web_tokens and correct inconsistent fields -with web: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - web.execute(""" - DELETE FROM reg_tokens WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del web_tokens_by_subscr_id[x['subscriber_id']] - continue - if str(x['imsi']) != str(subscr['imsi']) or \ - x['extension'] != subscr['extension'] or \ - x['tmsi'] != subscr['tmsi'] or \ - x['lac'] != subscr['lac']: - web.execute(""" - UPDATE reg_tokens - SET imsi = ?, extension = ?, tmsi = ?, lac = ? - WHERE subscriber_id = ? - """, (str(subscr['imsi']), subscr['extension'], - subscr['tmsi'], subscr['lac'], x['subscriber_id'])) - -# add missing web_tokens -with web: - for x in hlr_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if subscr is None: - hlr.execute(""" - DELETE FROM AuthToken WHERE subscriber_id = ? - """, (x['subscriber_id'],)) - del hlr_tokens_by_subscr_id[x['subscriber_id']] - continue - webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None) - if webtoken is None: - web.execute(""" - INSERT INTO reg_tokens - (subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi) - VALUES - (?, ?, 0, ?, '', ?, ?, ?, ?) - """, (x['subscriber_id'], subscr['extension'], subscr['name'], - subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi'])) - -# authorize subscribers -with hlr: - for x in web_tokens_by_subscr_id.values(): - subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None) - if x['reg_completed'] and not subscr['authorized']: - hlr.execute(""" - UPDATE Subscriber - SET authorized = 1 - WHERE id = ? - """, (x['subscriber_id'],)) - -# Sync SMS from web to hlr -with hlr: - for sms in web_sms: - subscr = hlr_subscrs_by_ext.get(sms['receiver_ext']) - if subscr is None: - print '%s not found' % sms['receiver_ext'] - continue - hlr.execute(""" - INSERT INTO SMS - (created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text) - VALUES - (?, 1, ?, 0, 0, 0, 0, 0, ?) - """, (sms['created'], subscr['id'], sms['text'])) -with web: - for sms in web_sms: - web.execute(""" - DELETE FROM sms_queue WHERE id = ? - """, (sms['id'],)) - - -hlr.close() -web.close() - diff --git a/contrib/mgcp_server.py b/contrib/mgcp_server.py deleted file mode 100755 index 05c489d..0000000 --- a/contrib/mgcp_server.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Simple server for mgcp... send audit, receive response.. - -import socket, time - -MGCP_GATEWAY_PORT = 2427 -MGCP_CALLAGENT_PORT = 2727 - -rsip_resp = """200 321321332\r\n""" -audit_packet = """AUEP %d 13 at mgw MGCP 1.0\r\n""" -crcx_packet = """CRCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n""" -dlcx_packet = """DLCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\n""" -mdcx_packet = """MDCX %d 14 at mgw MGCP 1.0\r\nC: 4a84ad5d25f\r\nI: %d\r\nL: p:20, a:GSM-EFR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 258696477 0 IN IP4 172.16.1.107\r\ns=-\r\nc=IN IP4 172.16.1.107\r\nt=0 0\r\nm=audio 6666 RTP/AVP 127\r\na=rtpmap:127 GSM-EFR/8000/1\r\na=ptime:20\r\na=recvonly\r\nm=image 4402 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n""" - -def hexdump(src, length=8): - """Recipe is from http://code.activestate.com/recipes/142812/""" - result = [] - digits = 4 if isinstance(src, unicode) else 2 - for i in xrange(0, len(src), length): - s = src[i:i+length] - hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s]) - text = b''.join([x if 0x20 <= ord(x) < 0x7F else b'.' for x in s]) - result.append( b"%04X %-*s %s" % (i, length*(digits + 1), hexa, text) ) - return b'\n'.join(result) - -server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -server_socket.bind(("127.0.0.1", MGCP_CALLAGENT_PORT)) -server_socket.setblocking(1) - -last_ci = 1 -def send_and_receive(packet): - global last_ci - server_socket.sendto(packet, ("127.0.0.1", MGCP_GATEWAY_PORT)) - try: - data, addr = server_socket.recvfrom(4096) - - # attempt to store the CI of the response - list = data.split("\n") - for item in list: - if item.startswith("I: "): - last_ci = int(item[3:]) - - print hexdump(data), addr - except socket.error, e: - print e - pass - -def generate_tid(): - import random - return random.randint(0, 65123) - - - -while True: - send_and_receive(audit_packet % generate_tid()) - send_and_receive(crcx_packet % generate_tid() ) - send_and_receive(mdcx_packet % (generate_tid(), last_ci)) - send_and_receive(dlcx_packet % (generate_tid(), last_ci)) - - time.sleep(3) diff --git a/contrib/nat/test_regexp.c b/contrib/nat/test_regexp.c deleted file mode 100644 index 808a703..0000000 --- a/contrib/nat/test_regexp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* make test_regexp */ -#include -#include -#include - - -int main(int argc, char **argv) -{ - regex_t reg; - regmatch_t matches[2]; - - if (argc != 4) { - printf("Invoke with: test_regexp REGEXP REPLACE NR\n"); - return -1; - } - - if (regcomp(®, argv[1], REG_EXTENDED) != 0) { - fprintf(stderr, "Regexp '%s' is not valid.\n", argv[1]); - return -1; - } - - if (regexec(®, argv[3], 2, matches, 0) == 0 && matches[1].rm_eo != -1) - printf("New Number: %s%s\n", argv[2], &argv[3][matches[1].rm_so]); - else - printf("No match.\n"); - - regfree(®); - - return 0; -} diff --git a/contrib/nat/ussd_example.py b/contrib/nat/ussd_example.py deleted file mode 100644 index 8f7a58d..0000000 --- a/contrib/nat/ussd_example.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python2.7 - -""" -AGPLv3+ 2016 Copyright Holger Hans Peter Freyther - -Example of how to connect to the USSD side-channel and how to respond -with a fixed message. -""" - -import socket -import struct - -ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -ussdSocket.connect(('127.0.0.1', 5001)) - -def send_dt1(dstref, data): - dlen = struct.pack('B', len(data)).encode('hex') - hex = '06' + dstref.encode('hex') + '00' + '01' + dlen + data.encode('hex') - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def send_rel(srcref, dstref): - hex = '04' + dstref.encode('hex') + srcref.encode('hex') + '000100' - pdata = hex.decode('hex') - out = struct.pack('>HB', len(pdata), 0xfd) + pdata - ussdSocket.send(out) - -def recv_one(): - plen = ussdSocket.recv(3) - (plen,ptype) = struct.unpack(">HB", plen) - data = ussdSocket.recv(plen) - - return ptype, data - -# Assume this is the ID request -data = ussdSocket.recv(4) -ussdSocket.send("\x00\x08\xfe\x05\x00" + "\x05\x01" + "ussd") -# ^len ^len of tag ... and ignore - -# Expect a fake message. see struct ipac_msgt_sccp_state -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) -(srcref, dstref, transid, invokeid) = struct.unpack("<3s3sBB", data[1:9]) -print("New transID %d invoke %d" % (transid, invokeid)) - -# Expect a the invocation.. todo.. extract invoke id -ptype, data = recv_one() -print("%d %s" % (ptype, data.encode('hex'))) - -# Reply with BSSAP + GSM 04.08 + MAP portion -# 00 == invoke id 0f == DCS -res = "01002a9b2a0802e1901c22a220020100301b02013b301604010f041155e7d2f9bc3a41412894991c06a9c9a713" -send_dt1(dstref, res.decode('hex')) - -clear = "000420040109" -send_dt1(dstref, clear.decode('hex')) - -# should be the clear complete -send_rel(srcref, dstref) - -# Give it some time to handle connection shutdown properly -print("Gracefully sleeping") -import time -time.sleep(3) diff --git a/contrib/rtp/gen_rtp_header.erl b/contrib/rtp/gen_rtp_header.erl deleted file mode 100755 index 47839c1..0000000 --- a/contrib/rtp/gen_rtp_header.erl +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- -%%! -smp disable --module(gen_rtp_header). - -% -mode(compile). - --define(VERSION, "0.1"). - --export([main/1]). - --record(rtp_packet, - { - version = 2, - padding = 0, - marker = 0, - payload_type = 0, - seqno = 0, - timestamp = 0, - ssrc = 0, - csrcs = [], - extension = <<>>, - payload = <<>>, - realtime - }). - - -main(Args) -> - DefaultOpts = [{format, state}, - {ssrc, 16#11223344}, - {rate, 8000}, - {pt, 98}], - {PosArgs, Opts} = getopts_checked(Args, DefaultOpts), - log(debug, fun (Dev) -> - io:format(Dev, "Initial options:~n", []), - dump_opts(Dev, Opts), - io:format(Dev, "~s: ~p~n", ["Args", PosArgs]) - end, [], Opts), - main(PosArgs, Opts). - -main([First | RemArgs], Opts) -> - try - F = list_to_integer(First), - Format = proplists:get_value(format, Opts, state), - PayloadData = proplists:get_value(payload, Opts, undef), - InFile = proplists:get_value(file, Opts, undef), - - Payload = case {PayloadData, InFile} of - {undef, undef} -> - % use default value - #rtp_packet{}#rtp_packet.payload; - {P, undef} -> P; - {_, File} -> - log(info, "Loading file '~s'~n", [File], Opts), - {ok, InDev} = file:open(File, [read]), - DS = [ Pl#rtp_packet.payload || {_T, Pl} <- read_packets(InDev, Opts)], - file:close(InDev), - log(debug, "File '~s' closed, ~w packets read.~n", [File, length(DS)], Opts), - DS - end, - Dev = standard_io, - write_packet_pre(Dev, Format), - do_groups(Dev, Payload, F, RemArgs, Opts), - write_packet_post(Dev, Format), - 0 - catch - _:_ -> - log(debug, "~p~n", [hd(erlang:get_stacktrace())], Opts), - usage(), - halt(1) - end - ; - -main(_, _Opts) -> - usage(), - halt(1). - -%%% group (count + offset) handling %%% - -do_groups(_Dev, _Pl, _F, [], _Opts) -> - ok; - -do_groups(Dev, Pl, F, [L], Opts) -> - do_groups(Dev, Pl, F, [L, 0], Opts); - -do_groups(Dev, Pl, First, [L, O | Args], Opts) -> - Ssrc = proplists:get_value(ssrc, Opts, #rtp_packet.ssrc), - PT = proplists:get_value(pt, Opts, #rtp_packet.payload_type), - Len = list_to_num(L), - Offs = list_to_num(O), - log(info, "Starting group: Ssrc=~.16B, PT=~B, First=~B, Len=~B, Offs=~B~n", - [Ssrc, PT, First, Len, Offs], Opts), - Pkg = #rtp_packet{ssrc = Ssrc, payload_type = PT}, - Pl2 = write_packets(Dev, Pl, Pkg, First, Len, Offs, Opts), - {Args2, Opts2} = getopts_checked(Args, Opts), - log(debug, fun (Io) -> - io:format(Io, "Changed options:~n", []), - dump_opts(Io, Opts2 -- Opts) - end, [], Opts), - do_groups(Dev, Pl2, First+Len, Args2, Opts2). - -%%% error handling helpers %%% - -getopts_checked(Args, Opts) -> - try - getopts(Args, Opts) - catch - C:R -> - log(error, "~s~n", - [explain_error(C, R, erlang:get_stacktrace(), Opts)], Opts), - usage(), - halt(1) - end. - -explain_error(error, badarg, [{erlang,list_to_integer,[S,B]} | _ ], _Opts) -> - io_lib:format("Invalid number '~s' (base ~B)", [S, B]); -explain_error(error, badarg, [{erlang,list_to_integer,[S]} | _ ], _Opts) -> - io_lib:format("Invalid decimal number '~s'", [S]); -explain_error(C, R, [Hd | _ ], _Opts) -> - io_lib:format("~p, ~p:~p", [Hd, C, R]); -explain_error(_, _, [], _Opts) -> - "". - -%%% usage and options %%% - -myname() -> - filename:basename(escript:script_name()). - -usage(Text) -> - io:format(standard_error, "~s: ~s~n", [myname(), Text]), - usage(). - -usage() -> - io:format(standard_error, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n", - [myname()]). - -show_version() -> - io:format(standard_io, - "~s ~s~n", [myname(), ?VERSION]). - -show_help() -> - io:format(standard_io, - "Usage: ~s [Options] Start Count1 Offs1 [[Options] Count2 Offs2 ...]~n~n" ++ - "Options:~n" ++ - " -h, --help this text~n" ++ - " --version show version info~n" ++ - " -i, --file=FILE reads payload from file (state format by default)~n" ++ - " -f, --frame-size=N read payload as binary frames of size N instead~n" ++ - " -p, --payload=HEX set constant payload~n" ++ - " --verbose=N set verbosity~n" ++ - " -v increase verbosity~n" ++ - " --format=state use state format for output (default)~n" ++ - " -C, --format=c use simple C lines for output~n" ++ - " --format=carray use a C array for output~n" ++ - " -s, --ssrc=SSRC set the SSRC~n" ++ - " -t, --type=N set the payload type~n" ++ - " -r, --rate=N set the RTP rate [8000]~n" ++ - " -D, --duration=N set the packet duration in RTP time units [160]~n" ++ - " -d, --delay=FLOAT add offset to playout timestamp~n" ++ - "~n" ++ - "Arguments:~n" ++ - " Start initial packet (sequence) number~n" ++ - " Count number of packets~n" ++ - " Offs timestamp offset (in RTP units)~n" ++ - "", [myname()]). - -getopts([ "--file=" ++ File | R], Opts) -> - getopts(R, [{file, File} | Opts]); -getopts([ "-i" ++ T | R], Opts) -> - getopts_alias_arg("--file", T, R, Opts); -getopts([ "--frame-size=" ++ N | R], Opts) -> - Size = list_to_integer(N), - getopts(R, [{frame_size, Size}, {in_format, bin} | Opts]); -getopts([ "-f" ++ T | R], Opts) -> - getopts_alias_arg("--frame-size", T, R, Opts); -getopts([ "--duration=" ++ N | R], Opts) -> - Duration = list_to_integer(N), - getopts(R, [{duration, Duration} | Opts]); -getopts([ "-D" ++ T | R], Opts) -> - getopts_alias_arg("--duration", T, R, Opts); -getopts([ "--rate=" ++ N | R], Opts) -> - Rate = list_to_integer(N), - getopts(R, [{rate, Rate} | Opts]); -getopts([ "-r" ++ T | R], Opts) -> - getopts_alias_arg("--rate", T, R, Opts); -getopts([ "--version" | _], _Opts) -> - show_version(), - halt(0); -getopts([ "--help" | _], _Opts) -> - show_help(), - halt(0); -getopts([ "-h" ++ T | R], Opts) -> - getopts_alias_no_arg("--help", T, R, Opts); -getopts([ "--verbose=" ++ V | R], Opts) -> - Verbose = list_to_integer(V), - getopts(R, [{verbose, Verbose} | Opts]); -getopts([ "-v" ++ T | R], Opts) -> - Verbose = proplists:get_value(verbose, Opts, 0), - getopts_short_no_arg(T, R, [ {verbose, Verbose+1} | Opts]); -getopts([ "--format=state" | R], Opts) -> - getopts(R, [{format, state} | Opts]); -getopts([ "--format=c" | R], Opts) -> - getopts(R, [{format, c} | Opts]); -getopts([ "-C" ++ T | R], Opts) -> - getopts_alias_no_arg("--format=c", T, R, Opts); -getopts([ "--format=carray" | R], Opts) -> - getopts(R, [{format, carray} | Opts]); -getopts([ "--payload=" ++ Hex | R], Opts) -> - getopts(R, [{payload, hex_to_bin(Hex)} | Opts]); -getopts([ "--ssrc=" ++ Num | R], Opts) -> - getopts(R, [{ssrc, list_to_num(Num)} | Opts]); -getopts([ "-s" ++ T | R], Opts) -> - getopts_alias_arg("--ssrc", T, R, Opts); -getopts([ "--type=" ++ Num | R], Opts) -> - getopts(R, [{pt, list_to_num(Num)} | Opts]); -getopts([ "-t" ++ T | R], Opts) -> - getopts_alias_arg("--type", T, R, Opts); -getopts([ "--delay=" ++ Num | R], Opts) -> - getopts(R, [{delay, list_to_float(Num)} | Opts]); -getopts([ "-d" ++ T | R], Opts) -> - getopts_alias_arg("--delay", T, R, Opts); - -% parsing helpers -getopts([ "--" | R], Opts) -> - {R, normalize_opts(Opts)}; -getopts([ O = "--" ++ _ | _], _Opts) -> - usage("Invalid option: " ++ O), - halt(1); -getopts([ [ $-, C | _] | _], _Opts) when C < $0; C > $9 -> - usage("Invalid option: -" ++ [C]), - halt(1); - -getopts(R, Opts) -> - {R, normalize_opts(Opts)}. - -getopts_short_no_arg([], R, Opts) -> getopts(R, Opts); -getopts_short_no_arg(T, R, Opts) -> getopts([ "-" ++ T | R], Opts). - -getopts_alias_no_arg(A, [], R, Opts) -> getopts([A | R], Opts); -getopts_alias_no_arg(A, T, R, Opts) -> getopts([A, "-" ++ T | R], Opts). - -getopts_alias_arg(A, [], [T | R], Opts) -> getopts([A ++ "=" ++ T | R], Opts); -getopts_alias_arg(A, T, R, Opts) -> getopts([A ++ "=" ++ T | R], Opts). - -normalize_opts(Opts) -> - [ proplists:lookup(E, Opts) || E <- proplists:get_keys(Opts) ]. - -%%% conversions %%% - -bin_to_hex(Bin) -> [hd(integer_to_list(N,16)) || <> <= Bin]. -hex_to_bin(Hex) -> << <<(list_to_integer([Nib],16)):4>> || Nib <- Hex>>. - -list_to_num("-" ++ Str) -> -list_to_num(Str); -list_to_num("0x" ++ Str) -> list_to_integer(Str, 16); -list_to_num("0b" ++ Str) -> list_to_integer(Str, 2); -list_to_num(Str = [ $0 | _ ]) -> list_to_integer(Str, 8); -list_to_num(Str) -> list_to_integer(Str, 10). - -%%% dumping data %%% - -dump_opts(Dev, Opts) -> - dump_opts2(Dev, Opts, proplists:get_keys(Opts)). - -dump_opts2(Dev, Opts, [OptName | R]) -> - io:format(Dev, " ~-10s: ~p~n", - [OptName, proplists:get_value(OptName, Opts)]), - dump_opts2(Dev, Opts, R); -dump_opts2(_Dev, _Opts, []) -> ok. - -%%% logging %%% - -log(L, Fmt, Args, Opts) when is_list(Opts) -> - log(L, Fmt, Args, proplists:get_value(verbose, Opts, 0), Opts). - -log(debug, Fmt, Args, V, Opts) when V > 2 -> log2("DEBUG", Fmt, Args, Opts); -log(info, Fmt, Args, V, Opts) when V > 1 -> log2("INFO", Fmt, Args, Opts); -log(notice, Fmt, Args, V, Opts) when V > 0 -> log2("NOTICE", Fmt, Args, Opts); -log(warn, Fmt, Args, _V, Opts) -> log2("WARNING", Fmt, Args, Opts); -log(error, Fmt, Args, _V, Opts) -> log2("ERROR", Fmt, Args, Opts); - -log(Lvl, Fmt, Args, V, Opts) when V >= Lvl -> log2("", Fmt, Args, Opts); - -log(_, _, _, _i, _) -> ok. - -log2(Type, Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, "~s: " ++ Fmt, [Type | Args]); -log2("", Fmt, Args, _Opts) when is_list(Fmt) -> - io:format(standard_error, Fmt, Args); -log2(_Type, Fun, _Args, _Opts) when is_function(Fun, 1) -> - Fun(standard_error). - -%%% RTP packets %%% - -make_rtp_packet(P = #rtp_packet{version = 2}) -> - << (P#rtp_packet.version):2, - 0:1, % P - 0:1, % X - 0:4, % CC - (P#rtp_packet.marker):1, - (P#rtp_packet.payload_type):7, - (P#rtp_packet.seqno):16, - (P#rtp_packet.timestamp):32, - (P#rtp_packet.ssrc):32, - (P#rtp_packet.payload)/bytes - >>. - -parse_rtp_packet( - << 2:2, % Version 2 - 0:1, % P (not supported yet) - 0:1, % X (not supported yet) - 0:4, % CC (not supported yet) - M:1, - PT:7, - SeqNo: 16, - TS:32, - Ssrc:32, - Payload/bytes >>) -> - #rtp_packet{ - version = 0, - marker = M, - payload_type = PT, - seqno = SeqNo, - timestamp = TS, - ssrc = Ssrc, - payload = Payload}. - -%%% payload generation %%% - -next_payload(F) when is_function(F) -> - {F(), F}; -next_payload({F, D}) when is_function(F) -> - {P, D2} = F(D), - {P, {F, D2}}; -next_payload([P | R]) -> - {P, R}; -next_payload([]) -> - undef; -next_payload(Bin = <<_/bytes>>) -> - {Bin, Bin}. - -%%% real writing work %%% - -write_packets(_Dev, DS, _P, _F, 0, _O, _Opts) -> - DS; -write_packets(Dev, DataSource, P = #rtp_packet{}, F, L, O, Opts) -> - Format = proplists:get_value(format, Opts, state), - Ptime = proplists:get_value(duration, Opts, 160), - Delay = proplists:get_value(delay, Opts, 0), - Rate = proplists:get_value(rate, Opts, 8000), - case next_payload(DataSource) of - {Payload, DataSource2} -> - write_packet(Dev, Ptime * F / Rate + Delay, - P#rtp_packet{seqno = F, timestamp = F*Ptime+O, - payload = Payload}, - Format), - write_packets(Dev, DataSource2, P, F+1, L-1, O, Opts); - Other -> Other - end. - -write_packet(Dev, Time, P = #rtp_packet{}, Format) -> - Bin = make_rtp_packet(P), - - write_packet_line(Dev, Time, P, Bin, Format). - -write_packet_pre(Dev, carray) -> - io:format(Dev, - "struct {float t; int len; char *data;} packets[] = {~n", []); - -write_packet_pre(_Dev, _) -> ok. - -write_packet_post(Dev, carray) -> - io:format(Dev, "};~n", []); - -write_packet_post(_Dev, _) -> ok. - -write_packet_line(Dev, Time, _P, Bin, state) -> - io:format(Dev, "~f ~s~n", [Time, bin_to_hex(Bin)]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, c) -> - ByteList = [ [ $0, $x | integer_to_list(Byte, 16) ] || <> <= Bin ], - ByteStr = string:join(ByteList, ", "), - io:format(Dev, "/* time=~f, SeqNo=~B, TS=~B */ {~s}~n", [Time, N, TS, ByteStr]); - -write_packet_line(Dev, Time, #rtp_packet{seqno = N, timestamp = TS}, Bin, carray) -> - io:format(Dev, " /* RTP: SeqNo=~B, TS=~B */~n", [N, TS]), - io:format(Dev, " {~f, ~B, \"", [Time, size(Bin)]), - [ io:format(Dev, "\\x~2.16.0B", [Byte]) || <> <= Bin ], - io:format(Dev, "\"},~n", []). - -%%% real reading work %%% - -read_packets(Dev, Opts) -> - Format = proplists:get_value(in_format, Opts, state), - - read_packets(Dev, Opts, Format). - -read_packets(Dev, Opts, Format) -> - case read_packet(Dev, Opts, Format) of - eof -> []; - Tuple -> [Tuple | read_packets(Dev, Opts, Format)] - end. - -read_packet(Dev, Opts, bin) -> - Size = proplists:get_value(frame_size, Opts), - case file:read(Dev, Size) of - {ok, Data} -> {0, #rtp_packet{payload = iolist_to_binary(Data)}}; - eof -> eof - end; -read_packet(Dev, _Opts, Format) -> - case read_packet_line(Dev, Format) of - {Time, Bin} -> {Time, parse_rtp_packet(Bin)}; - eof -> eof - end. - -read_packet_line(Dev, state) -> - case io:fread(Dev, "", "~f ~s") of - {ok, [Time, Hex]} -> {Time, hex_to_bin(Hex)}; - eof -> eof - end. diff --git a/contrib/rtp/rtp_replay.st b/contrib/rtp/rtp_replay.st deleted file mode 100644 index e26d073..0000000 --- a/contrib/rtp/rtp_replay.st +++ /dev/null @@ -1,21 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. -FileStream fileIn: 'rtp_replay_shared.st'. - - -Eval [ - | replay file host dport | - - file := Smalltalk arguments at: 1 ifAbsent: [ 'rtpstream.state' ]. - host := Smalltalk arguments at: 2 ifAbsent: [ '127.0.0.1' ]. - dport := (Smalltalk arguments at: 3 ifAbsent: [ '4000' ]) asInteger. - sport := (Smalltalk arguments at: 4 ifAbsent: [ '0' ]) asInteger. - - replay := RTPReplay on: file fromPort: sport. - - Transcript nextPutAll: 'Going to stream now'; nl. - replay streamAudio: host port: dport. -] diff --git a/contrib/rtp/rtp_replay_shared.st b/contrib/rtp/rtp_replay_shared.st deleted file mode 100644 index 7b68c0f..0000000 --- a/contrib/rtp/rtp_replay_shared.st +++ /dev/null @@ -1,118 +0,0 @@ -" -Simple UDP replay from the state files -" - -PackageLoader fileInPackage: #Sockets. - -Object subclass: SDPUtils [ - "Look into using PetitParser." - SDPUtils class >> findPort: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'm=audio ') ifTrue: [ - | stream | - stream := line readStream - skip: 'm=audio ' size; - yourself. - ^ Number readFrom: stream. - ] - ]. - - ^ self error: 'Not found'. - ] - - SDPUtils class >> findHost: aSDP [ - aSDP linesDo: [:line | - (line startsWith: 'c=IN IP4 ') ifTrue: [ - | stream | - ^ stream := line readStream - skip: 'c=IN IP4 ' size; - upToEnd. - ] - ]. - - ^ self error: 'Not found'. - ] -] - -Object subclass: RTPReplay [ - | filename socket | - RTPReplay class >> on: aFile [ - ^ self new - initialize; - file: aFile; yourself - ] - - RTPReplay class >> on: aFile fromPort: aPort [ - ^ self new - initialize: aPort; - file: aFile; yourself - ] - - initialize [ - self initialize: 0. - ] - - initialize: aPort [ - socket := Sockets.DatagramSocket local: '0.0.0.0' port: aPort. - ] - - file: aFile [ - filename := aFile - ] - - localPort [ - ^ socket port - ] - - streamAudio: aHost port: aPort [ - | file last_time last_image udp_send dest | - - last_time := nil. - last_image := nil. - file := FileStream open: filename mode: #read. - - "Send the payload" - dest := Sockets.SocketAddress byName: aHost. - udp_send := [:payload | | datagram | - datagram := Sockets.Datagram data: payload contents address: dest port: aPort. - socket nextPut: datagram - ]. - - [file atEnd] whileFalse: [ - | lineStream time data now_image | - lineStream := file nextLine readStream. - - "Read the time, skip the blank, parse the data" - time := Number readFrom: lineStream. - lineStream skip: 1. - - data := WriteStream on: (ByteArray new: 30). - [lineStream atEnd] whileFalse: [ - | hex | - hex := lineStream next: 2. - data nextPut: (Number readFrom: hex readStream radix: 16). - ]. - - last_time isNil - ifTrue: [ - "First time, send it right now" - last_time := time. - last_image := Time millisecondClockValue. - udp_send value: data. - ] - ifFalse: [ - | wait_image new_image_time | - - "How long to wait?" - wait_image := last_image + ((time - last_time) * 1000). - [ wait_image > Time millisecondClockValue ] - whileTrue: [Processor yield]. - - udp_send value: data. - last_time := time. - last_image := wait_image. - ] - ] - ] -] - diff --git a/contrib/rtp/rtp_replay_sip.st b/contrib/rtp/rtp_replay_sip.st deleted file mode 100644 index 5f844df..0000000 --- a/contrib/rtp/rtp_replay_sip.st +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create a SIP connection and then stream... -""" - -PackageLoader - fileInPackage: #OsmoSIP. - -"Load for the replay code" -FileStream fileIn: 'rtp_replay_shared.st'. - - -Osmo.SIPCall subclass: StreamCall [ - | sem stream | - - createCall: aSDP [ - | sdp | - stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'. - sdp := aSDP % {stream localPort}. - ^ super createCall: sdp. - ] - - sem: aSemaphore [ - sem := aSemaphore - ] - - sessionNew [ - | host port | - Transcript nextPutAll: 'The call has started'; nl. - Transcript nextPutAll: sdp_result; nl. - - host := SDPUtils findHost: sdp_result. - port := SDPUtils findPort: sdp_result. - - [ - stream streamAudio: host port: port. - Transcript nextPutAll: 'Streaming has finished.'; nl. - ] fork. - ] - - sessionFailed [ - sem signal - ] - - sessionEnd [ - sem signal - ] -] - -Eval [ - | transport agent call sem sdp_fr sdp_amr | - - - sdp_fr := (WriteStream on: String new) - nextPutAll: 'v=0'; cr; nl; - nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 's=-'; cr; nl; - nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl; - nextPutAll: 't=0 0'; cr; nl; - nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl; - nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl; - nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl; - nextPutAll: 'a=fmtp:101 0-15'; cr; nl; - nextPutAll: 'a=ptime:20'; cr; nl; - contents. - - sem := Semaphore new. - transport := Osmo.SIPUdpTransport - startOn: '0.0.0.0' port: 5066. - agent := Osmo.SIPUserAgent createOn: transport. - transport start. - - call := (StreamCall - fromUser: 'sip:1000 at sip.zecke.osmocom.org' - host: '127.0.0.1' - port: 5060 - to: 'sip:123456 at 127.0.0.1' - on: agent) - sem: sem; yourself. - - call createCall: sdp_fr. - - - "Wait for the stream to have ended" - sem wait. - - (Delay forSeconds: 4) wait. -] diff --git a/contrib/rtp/timestamp_rtp.lua b/contrib/rtp/timestamp_rtp.lua deleted file mode 100644 index c18a06b..0000000 --- a/contrib/rtp/timestamp_rtp.lua +++ /dev/null @@ -1,28 +0,0 @@ -print("Ni hao") - - -do - local tap = Listener.new("ip", "rtp") - local rtp_ssrc = Field.new("rtp.ssrc") - local frame_time = Field.new("frame.time_relative") - local rtp = Field.new("rtp") - - function tap.packet(pinfo, tvb, ip) - local ip_src, ip_dst = tostring(ip.ip_src), tostring(ip.ip_dst) - local rtp_data = rtp() - local filename = "rtp_ssrc" .. rtp_ssrc() "_src_" .. ip_src .. "_to_" .. ip_dst .. ".state" - local f = io.open(filename, "a") - - f:write(tostring(frame_time()) .. " ") - f:write(tostring(rtp_data.value)) - f:write("\n") - f:close() - end - - function tap.draw() - print("DRAW") - end - function tap.reset() - print("RESET") - end -end diff --git a/contrib/sms/fill-hlr.st b/contrib/sms/fill-hlr.st deleted file mode 100644 index da0643e..0000000 --- a/contrib/sms/fill-hlr.st +++ /dev/null @@ -1,66 +0,0 @@ -"I create output for some simple SQL statements for the HLR db" - - -Eval [ - -"Create tables if they don't exist" -Transcript show: 'CREATE TABLE SMS ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - sent TIMESTAMP, - sender_id INTEGER NOT NULL, - receiver_id INTEGER NOT NULL, - deliver_attempts INTEGER NOT NULL DEFAULT 0, - valid_until TIMESTAMP, - reply_path_req INTEGER NOT NULL, - status_rep_req INTEGER NOT NULL, - protocol_id INTEGER NOT NULL, - data_coding_scheme INTEGER NOT NULL, - ud_hdr_ind INTEGER NOT NULL, - dest_addr TEXT, - user_data BLOB, - header BLOB, - text TEXT);'; nl; - show: 'CREATE TABLE Subscriber ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - created TIMESTAMP NOT NULL, - updated TIMESTAMP NOT NULL, - imsi NUMERIC UNIQUE NOT NULL, - name TEXT, - extension TEXT UNIQUE, - authorized INTEGER NOT NULL DEFAULT 0, - tmsi TEXT UNIQUE, - lac INTEGER NOT NULL DEFAULT 0);'; nl. - -"Create some dummy subscribers" -num_sub := 1000. -num_sms := 30. -lac := 1. - -Transcript show: 'BEGIN;'; nl. - -1 to: num_sub do: [:each | - Transcript show: 'INSERT INTO Subscriber - (imsi, created, updated, authorized, lac, extension) - VALUES - (%1, datetime(''now''), datetime(''now''), 1, %2, %3);' % - {(274090000000000 + each). lac. each}; nl. -]. - -1 to: num_sms do: [:sms | - 1 to: num_sub do: [:sub | - Transcript show: 'INSERT INTO SMS - (created, sender_id, receiver_id, valid_until, - reply_path_req, status_rep_req, protocol_id, - data_coding_scheme, ud_hdr_ind, dest_addr, - text) VALUES - (datetime(''now''), 1, %1, ''2222-2-2'', - 0, 0, 0, - 0, 0, ''123456'', - ''abc'');' % {sub}; nl. - ] -]. - -Transcript show: 'COMMIT;'; nl. - -] diff --git a/contrib/sms/hlr-query.st b/contrib/sms/hlr-query.st deleted file mode 100644 index bd3f97a..0000000 --- a/contrib/sms/hlr-query.st +++ /dev/null @@ -1,10 +0,0 @@ -"Query for one SMS" - -Eval [ -1 to: 100 do: [:each | - Transcript show: 'SELECT SMS.* FROM SMS - JOIN Subscriber ON SMS.receiver_id = Subscriber.id - WHERE SMS.id >= 1 AND SMS.sent IS NULL AND Subscriber.lac > 0 - ORDER BY SMS.id LIMIT 1;'; nl. -]. -] diff --git a/contrib/sms/sqlite-probe.tap.d b/contrib/sms/sqlite-probe.tap.d deleted file mode 100644 index e75cdfc..0000000 --- a/contrib/sms/sqlite-probe.tap.d +++ /dev/null @@ -1,5 +0,0 @@ -probe process("/usr/lib/libsqlite3.so.0.8.6").function("sqlite3_get_table") -{ - a = user_string($zSql); - printf("sqlite3_get_table called '%s'\n", a); -} diff --git a/contrib/systemd/osmo-bsc-mgcp.service b/contrib/systemd/osmo-bsc-mgcp.service deleted file mode 100644 index c040e60..0000000 --- a/contrib/systemd/osmo-bsc-mgcp.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC MGCP - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service deleted file mode 100644 index 4047fef..0000000 --- a/contrib/systemd/osmo-bsc.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=OpenBSC BSC -Wants=osmo-bsc-mgcp.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service deleted file mode 100644 index 7cebb14..0000000 --- a/contrib/systemd/osmo-msc.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Osmocom Mobile Switching Center (MSC) -Wants=osmo-hlr.service -After=osmo-hlr.service -After=osmo-hnbgw.service - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/osmo-nitb.service b/contrib/systemd/osmo-nitb.service deleted file mode 100644 index 377497e..0000000 --- a/contrib/systemd/osmo-nitb.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=OpenBSC Network In the Box (NITB) - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3 -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/contrib/testconv/Makefile b/contrib/testconv/Makefile deleted file mode 100644 index bb856f7..0000000 --- a/contrib/testconv/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -OBJS = testconv_main.o - -CC = gcc -CFLAGS = -O0 -ggdb -Wall -LDFLAGS = -CPPFLAGS = -I../.. -I../../include $(shell pkg-config --cflags libosmocore) $(shell pkg-config --cflags libbcg729) -LIBS = ../../src/libmgcp/libmgcp.a ../../src/libcommon/libcommon.a $(shell pkg-config --libs libosmocore) $(shell pkg-config --libs libbcg729) -lgsm -lrt - -testconv: $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) - -testconv_main.o: testconv_main.c - -$(OBJS): - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< diff --git a/contrib/testconv/testconv_main.c b/contrib/testconv/testconv_main.c deleted file mode 100644 index 6c95c55..0000000 --- a/contrib/testconv/testconv_main.c +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "bscconfig.h" -#ifndef BUILD_MGCP_TRANSCODING -#error "Requires MGCP transcoding enabled (see --enable-mgcp-transcoding)" -#endif - -#include "openbsc/mgcp_transcode.h" - -static int audio_name_to_type(const char *name) -{ - if (!strcasecmp(name, "gsm")) - return 3; -#ifdef HAVE_BCG729 - else if (!strcasecmp(name, "g729")) - return 18; -#endif - else if (!strcasecmp(name, "pcma")) - return 8; - else if (!strcasecmp(name, "l16")) - return 11; - return -1; -} - -int mgcp_get_trans_frame_size(void *state_, int nsamples, int dst); - -int main(int argc, char **argv) -{ - char buf[4096] = {0x80, 0}; - int cc, rc; - struct mgcp_rtp_end *dst_end; - struct mgcp_rtp_end *src_end; - struct mgcp_trunk_config tcfg = {{0}}; - struct mgcp_endpoint endp = {0}; - struct mgcp_process_rtp_state *state; - int in_size; - int in_samples = 160; - int out_samples = 0; - uint32_t ts = 0; - uint16_t seq = 0; - - osmo_init_logging(&log_info); - - tcfg.endpoints = &endp; - tcfg.number_endpoints = 1; - endp.tcfg = &tcfg; - mgcp_initialize_endp(&endp); - - dst_end = &endp.bts_end; - src_end = &endp.net_end; - - if (argc <= 2) - errx(1, "Usage: {gsm|g729|pcma|l16} {gsm|g729|pcma|l16} [SPP]"); - - if ((src_end->codec.payload_type = audio_name_to_type(argv[1])) == -1) - errx(1, "invalid input format '%s'", argv[1]); - if ((dst_end->codec.payload_type = audio_name_to_type(argv[2])) == -1) - errx(1, "invalid output format '%s'", argv[2]); - if (argc > 3) - out_samples = atoi(argv[3]); - - if (out_samples) { - dst_end->codec.frame_duration_den = dst_end->codec.rate; - dst_end->codec.frame_duration_num = out_samples; - dst_end->frames_per_packet = 1; - } - - rc = mgcp_transcoding_setup(&endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); - - state = dst_end->rtp_process_data; - OSMO_ASSERT(state != NULL); - - in_size = mgcp_transcoding_get_frame_size(state, in_samples, 0); - OSMO_ASSERT(sizeof(buf) >= in_size + 12); - - buf[1] = src_end->codec.payload_type; - *(uint16_t*)(buf+2) = htons(1); - *(uint32_t*)(buf+4) = htonl(0); - *(uint32_t*)(buf+8) = htonl(0xaabbccdd); - - while ((cc = read(0, buf + 12, in_size))) { - int cont; - int len; - - if (cc != in_size) - err(1, "read"); - - *(uint16_t*)(buf+2) = htonl(seq); - *(uint32_t*)(buf+4) = htonl(ts); - - seq += 1; - ts += in_samples; - - cc += 12; /* include RTP header */ - - len = cc; - - do { - cont = mgcp_transcoding_process_rtp(&endp, dst_end, - buf, &len, sizeof(buf)); - if (cont == -EAGAIN) { - fprintf(stderr, "Got EAGAIN\n"); - break; - } - - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); - - len -= 12; /* ignore RTP header */ - - if (write(1, buf + 12, len) != len) - err(1, "write"); - - len = cont; - } while (len > 0); - } - return 0; -} - diff --git a/debian/copyright b/debian/copyright index 8d731ee..b58117e 100644 --- a/debian/copyright +++ b/debian/copyright @@ -78,7 +78,6 @@ doc/osmo-nitb-data_structures.dot doc/paging.txt include/Makefile.am - include/compat_af_isdn.h include/openbsc/Makefile.am include/openbsc/common.h include/openbsc/crc24.h @@ -340,21 +339,6 @@ . On Debian systems, the complete text of the GNU General Public License Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -Files: include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - This code is free software; you can redistribute it and/or modify - it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE - version 2.1 as published by the Free Software Foundation. - . - This code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU LESSER GENERAL PUBLIC LICENSE for more details. - . - On Debian systems, the complete text of the GNU Lesser General Public License - Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. Files: src/gprs/v42bis.c Copyright: 2005-2011 Steve Underwood diff --git a/doc/BS11-OML.txt b/doc/BS11-OML.txt deleted file mode 100644 index e5c3299..0000000 --- a/doc/BS11-OML.txt +++ /dev/null @@ -1,31 +0,0 @@ -The Siemens BS-11 supports the following additional GSM 12.21 OML operations: - - -CREATE OBJECT - -abis_om_fom_hdr.obj_class can be -A3: -A5: ALCO, BBSIG, CCLK, GPSU, LI, PA -A8: EnvaBTSE -A9: BPORT - -the abis_om_obj_inst.trx_nr field indicates the index of object, whereas the -abis_om_fom_hdr.bts_nr indicates the type of the object. - -enum abis_bs11_objtype { - BS11_OBJ_ALCO = 0x01, - BS11_OBJ_BBSIG = 0x02, /* obj_class: 0,1 */ - BS11_OBJ_TRX1 = 0x03, /* only DEACTIVATE TRX1 */ - BS11_OBJ_CCLK = 0x04, - BS11_OBJ_GPSU = 0x06, - BS11_OBJ_LI = 0x07, - BS11_OBJ_PA = 0x09, /* obj_class: 0, 1*/ -}; - -In case of CREATE ENVABTSE, the abis_om_obj_inst.trx_nr indicates the EnvaBTSEx -number. - -In case of A9 (CREAETE BPORT), the abis_om_obj_inst.bts_nr indicates which BPORT -shall be used. - - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/channel_release.txt b/doc/channel_release.txt deleted file mode 100644 index c9cdfeb..0000000 --- a/doc/channel_release.txt +++ /dev/null @@ -1,95 +0,0 @@ - -GSM 04.08 7.1.7 / 9.1.7 RR CHANNEL RELESE - -RSL 08.58 3.4 / ? RLL Link Release Request - -RSL 08.58 4.6 / 8.4.5 DEACTivate SACCH - * Deactivate SACCH according to Channel Release Proc 04.08 - * to be sent after RR CHANNEL RELEASE is sent to MS - -RSL 08.58 4.7 / 8.4.14 RF CHANnel RELease - * tells the BTS to release a radio channel - * "when an activated radio channel is no longer needed" - * BTS responds with RF CHANnel RELease ACKnowledge - - -GSM 04.08 3.4.13: RR connection release procedure - -* network sends RR CHANNEL RELEASE to MS on the DCCH - * start T3109 - * deactivate SACCH -* MS disconnects main signalling link (by sending DISC) - * all other data links are disconnected by local end link release -* network receives DISC (BTS sends RLL REL IND to BSC) - * stop T3109 - * start T3111 -* when T3111 times out, the network can reuse the channls -* if T3109 times out, the network deactivates the channels - and can reuse them - * this probably means simply RF CHANnel RELease - - -== Implementation in OpenBSC == - -There are two possible reasons a gsm_subscriber_connection -will be released. One is a network failure, the other is -the completion of an operation/transaction. - -=== Failure === -The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback -and the MSC part will release all transactions, operations and such -and the channels will be released as error case. - -=== Success === -Every time an 'operation' or 'transaction' is finished msc_release_connection -will be called and it will determine if the gsm_subscriber_connection can -be released. - -In case it can be released bsc_api.c:gsm0808_clear will be called -which will release all lchan's associated with the connection. For the -primary channel a SACH Deactivate will be send with the release -reason NORMAL RELEASE. - - -bsc_api.c:gsm0808_clear - * Release a channel used for handover - * Release the primary lchan with normal release, SACH deactivate - -chan_alloc.c:lchan_release(chan, sacch_deactivate, reason) - * Start the release procedure. It is working in steps with callbacks - coming from the abis_rsl.c code. - * Release all SAPI's > 0 as local end (The BTS should send a - REL_CONF a message) - * Send SACH Deactivate on SAPI=0 if required. - * Start T3109 (stop it when the main signalling link is disconnected) - or when the channel released. On timeout start the error handling. - * abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are - released and after T3111 has timed out or there is an error. - -RX of RELease INDication: - * Calls internal rsl_handle_release which might release the RF. - -RX of RELease CONFirmation: - * Calls internal rsl_handle_release which might release the RF. - -* RX of RF_CHAN_REL_ACK - * call lchan_free() - - -=== Integration with SMS === - -* RX of CP_ERROR or unimplemented MT - * trigger trans_free() which will msc_release_connection() - -* CP TC1* expired while waiting for CP-ACK - * trigger trans_free() which will msc_release_connection() - -* RX of RP_ERROR - * trigger trans_free() which will msc_release_connection() - -* TX of CP-ACK in MT DELIVER - * trigger trans_free() which will msc_release_connection() - -* RX of CP-ACK in MO SUBMIT - * trigger trans_free() which will msc_release_connection() - diff --git a/doc/e1-data-model.txt b/doc/e1-data-model.txt deleted file mode 100644 index 509004f..0000000 --- a/doc/e1-data-model.txt +++ /dev/null @@ -1,172 +0,0 @@ -E1 related data model - -This data model describes the physical relationship of the individual -parts in the network, it is not the logical/protocol side of the GSM -network. - -A BTS is connected to the BSC by some physical link. It could be an actual -E1 link, but it could also be abis-over-IP with a mixture of TCP and RTP/UDP. - -To further complicate the fact, multiple BTS can share one such pysical -link. On a single E1 line, we can easily accomodate up to three BTS with -two TRX each. - -Thus, it is best for OpenBSC to have some kind of abstraction layer. The BSC's -view of a BTS connected to it. We call this 'bts_link'. A bts_link can be -* all the TCP and UDP streams of a Abis-over-IP BTS -* a set of E1 timeslots for OML, RSL and TRAU connections on a E1 link -* a serial line exclusively used for OML messages (T-Link) - -A bts_link can be registered with the OpenBSC core at runtime. - -struct trx_link { - struct gsm_bts_trx *trx; -}; - -struct bts_link { - struct gsm_bts *bts; - struct trx_link trx_links[NUM_TRX]; -}; - -Interface from stack to input core: -====================================================================== -int abis_rsl_sendmsg(struct msgb *msg); - send a message through a RSL link to the TRX specified by the caller in - msg->trx. - -int abis_rsl_rcvmsg(struct msgb *msg); - receive a message from a RSL link from the TRX specified by the - caller in msg->trx. - -int abis_nm_sendmsg(struct msgb *msg); - send a message through a OML link to the BTS specified by the caller in - msg->trx->bts. The caller can just use bts->c0 to get the first TRX - in a BTS. (OML messages are not really sent to a TRX but to the BTS) - -int abis_nm_rcvmsg(struct msgb *msg); - receive a message from a OML link from the BTS specified by the caller - in msg->trx->bts. The caller can just use bts->c0 to get the first - TRX in a BTS. - -int abis_link_event(int event, void *data); - signal some event (such as layer 1 connect/disconnect) from the - input core to the stack. - -int subch_demux_in(mx, const uint8_t *data, int len); - receive 'len' bytes from a given E1 timeslot (TRAU frames) - -int subchan_mux_out(mx, uint8_t *data, int len); - obtain 'len' bytes of output data to be sent on E1 timeslot - -Intrface by Input Core for Input Plugins -====================================================================== - -int btslink_register_plugin(); - - -Configuration for the E1 input module -====================================================================== - -BTS - BTS number - number of TRX - OML link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TRX - RSL link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TS - E1 line number - timeslot number - subslot number - - -E1 input module data model -====================================================================== - - -enum e1inp_sign_type { - E1INP_SIGN_NONE, - E1INP_SIGN_OML, - E1INP_SIGN_RSL, -}; - -struct e1inp_sign_link { - /* list of signalling links */ - struct llist_head list; - - enum e1inp_sign_type type; - - /* trx for msg->trx of received msgs */ - struct gsm_bts_trx *trx; - - /* msgb queue of to-be-transmitted msgs */ - struct llist_head tx_list; - - /* SAPI and TEI on the E1 TS */ - uint8_t sapi; - uint8_t tei; -} - -enum e1inp_ts_type { - E1INP_TS_TYPE_NONE, - E1INP_TS_TYPE_SIGN, - E1INP_TS_TYPE_TRAU, -}; - -/* A timeslot in the E1 interface */ -struct e1inp_ts { - enum e1inp_ts_type type; - struct e1inp_line *line; - union { - struct { - struct llist_head sign_links; - } sign; - struct { - /* subchannel demuxer for frames from E1 */ - struct subch_demux demux; - /* subchannel muxer for frames to E1 */ - struct subch_mux mux; - } trau; - }; - union { - struct { - /* mISDN driver has one fd for each ts */ - struct osmo_fd; - } misdn; - } driver; -}; - -struct e1inp_line { - unsigned int num; - char *name; - - struct e1inp_ts ts[NR_E1_TS]; - - char *e1inp_driver; - void *driver_data; -}; - -/* Call from the Stack: configuration of this TS has changed */ -int e1inp_update_ts(struct e1inp_ts *ts); - -/* Receive a packet from the E1 driver */ -int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, - uint8_t tei, uint8_t sapi); - -/* Send a packet, callback function in the driver */ -int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg) - - -struct e1inp_driver { - const char *name; - int (*want_write)(struct e1inp_ts *ts); -}; diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg deleted file mode 100644 index 7c10e9d..0000000 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ /dev/null @@ -1,101 +0,0 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login -! -e1_input - e1_line 0 driver ipa -network - network country code 1 - mobile network code 1 - short name OsmoBSC - long name OsmoBSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - neci 1 - paging any use tch 0 - rrlp mode none - mm info 1 - handover 0 - handover window rxlev averaging 10 - handover window rxqual averaging 1 - handover window rxlev neighbor averaging 10 - handover power budget interval 6 - handover power budget hysteresis 3 - handover maximum distance 9999 - bts 0 - type nanobts - band DCS1800 - cell_identity 0 - location_area_code 1 - training_sequence_code 7 - base_station_id_code 63 - ms max power 15 - cell reselection hysteresis 4 - rxlev access min 0 - channel allocator ascending - rach tx integer 9 - rach max transmission 7 - dtx uplink force - dtx downlink - ip.access unit_id 0 0 - oml ip.access stream_id 255 line 0 - neighbor-list mode manual-si5 - neighbor-list add arfcn 100 - neighbor-list add arfcn 200 - si5 neighbor-list add arfcn 10 - si5 neighbor-list add arfcn 20 - gprs mode none - trx 0 - rf_locked 0 - arfcn 871 - nominal power 23 - max_power_red 20 - rsl e1 tei 0 - timeslot 0 - phys_chan_config CCCH+SDCCH4 - hopping enabled 0 - timeslot 1 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 2 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 3 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 4 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 5 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 6 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 7 - phys_chan_config TCH/F - hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote - ip.access rtp-base 4000 - timeout-ping 20 - timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name -bsc - no access-list-name - access-list-name bsc-list diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg deleted file mode 100644 index 3c43f1f..0000000 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! MGCP configuration hand edited -! ! -password foo -! -line vty - no login -! -mgcp - !local ip 10.23.24.2 - !bts ip 10.24.24.1 - !bind ip 10.23.24.1 - bind port 2427 - rtp base 4000 - rtp force-ptime 20 - sdp audio payload number 98 - sdp audio payload name AMR/8000 - number endpoints 31 - no rtcp-omit diff --git a/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg deleted file mode 100644 index d36179d..0000000 --- a/doc/examples/osmo-bsc_nat/black-list.cfg +++ /dev/null @@ -1 +0,0 @@ -678012512671923:6:6: diff --git a/doc/examples/osmo-bsc_nat/bscs.cfg b/doc/examples/osmo-bsc_nat/bscs.cfg deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.cfg +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg deleted file mode 100644 index e835e06..0000000 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ /dev/null @@ -1,66 +0,0 @@ -! -! OsmoBSCNAT (0.12.0.266-2daa9) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level rll notice - logging level cc notice - logging level mm notice - logging level rr notice - logging level rsl notice - logging level nm info - logging level mncc notice - logging level pag notice - logging level meas notice - logging level sccp notice - logging level msc notice - logging level mgcp notice - logging level ho notice - logging level db notice - logging level ref notice - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level llc debug - logging level sndcp debug - logging level nat notice - logging level ctrl notice - logging level smpp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -mgcp - bind ip 0.0.0.0 - bind port 2427 - rtp bts-base 4000 - rtp net-base 16000 - rtp ip-dscp 0 - no rtcp-omit - sdp audio-payload number 126 - sdp audio-payload name AMR/8000 - loop 0 - number endpoints 1 - call-agent ip 127.0.0.1 - rtp transcoder-base 0 - transcoder-remote-base 4000 -nat - msc ip 127.0.0.1 - msc port 5000 - timeout auth 2 - timeout ping 20 - timeout pong 5 - ip-dscp 0 - bscs-config-file bscs.cfg - access-list bla imsi-allow ^11$ diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg deleted file mode 100644 index 1b1d192..0000000 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! OsmoMSC configuration saved from vty -! -line vty - no login -! -network - network country code 1 - mobile network code 1 - short name OsmoMSC - long name OsmoMSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - rrlp mode none - mm info 1 -msc - mgcpgw remote-ip 10.23.24.1 - assign-tmsi diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/handover.txt b/doc/handover.txt deleted file mode 100644 index ac19e87..0000000 --- a/doc/handover.txt +++ /dev/null @@ -1,89 +0,0 @@ -Ideas about a handover algorithm -====================================================================== - -This is mostly based on the results presented in Chapter 8 of "Performance -Enhancements in a Frequency Hopping GSM Network" by Thomas Toftegaard Nielsen -and Joeroen Wigard. - - -=== Reasons for performing handover === - -Section 2.1.1: Handover used in their CAPACITY simulation: - -1) Interference Handover - -Average RXLEV is satisfactory high, but average RXQUAL too low indicates -interference to the channel. Handover should be made. - -2) Bad Quality - -Averaged RXQUAL is lower than a threshold - -3) Low Level / Signal Strength - -Average RXLEV is lower than a threshold - -4) Distance Handover - -MS is too far away from a cell (measured by TA) - -5) Power budget / Better Cell - -RX Level of neighbor cell is at least "HO Margin dB" dB better than the -current serving cell. - -=== Ideal parameters for HO algorithm === - -Chapter 8, Section 2.2, Table 24: - -Window RXLEV averaging: 10 SACCH frames (no weighting) -Window RXQUAL averaging: 1 SACCH frame (no averaging) -Level Threashold: 1 of the last 1 AV-RXLEV values < -110dBm -Quality Threshold: 3 of the last 4 AV-RXQUAL values >= 5 -Interference Threshold: 1 of the last AV-RXLEV > -85 dBm & - 3 of the last 4 AV-RXQUAL values >= 5 -Power Budget: Level of neighbor cell > 3 dB better -Power Budget Interval: Every 6 SACCH frames (6 seconds ?!?) -Distance Handover: Disabled -Evaluation rule 1: RXLEV of the candidate cell a tleast -104 dBm -Evaluation rule 2: Level of candidate cell > 3dB better own cell -Timer Successful HO: 5 SACCH frames -Timer Unsuccessful HO: 1 SACCH frame - -In a non-frequency hopping case, RXQUAL threshold can be decreased to -RXLEV >= 4 - -When frequency hopping is enabled, the following additional parameters -should be introduced: - -* No intra-cell handover -* Use a HO Margin of 2dB - -=== Handover Channel Reservation === - -In loaded network, each cell should reserve some channels for handovers, -rather than using all of them for new call establishment. This reduces the -need to drop calls due to failing handovers, at the expense of failing new call -attempts. - -=== Dynamic HO Margin === - -The handover margin (hysteresis) should depend on the RXQUAL. Optimal results -were achieved with the following settings: -* RXQUAL <= 4: 9 dB -* RXQUAL == 5: 6 dB -* RXQUAL >= 6: 1 dB - - - -== Actual Handover on a protocol level == - -After the BSC has decided a handover shall be done, it has to - -# allocate a channel at the new BTS -# allocate a handover reference -# activate the channel on the BTS side using RSL CHANNEL ACTIVATION, - indicating the HO reference -# BTS responds with CHAN ACT ACK, including GSM frame number -# BSC sends 04.08 HO CMD to MS using old BTS - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/oml-interface.txt b/doc/oml-interface.txt deleted file mode 100644 index 02bead7..0000000 --- a/doc/oml-interface.txt +++ /dev/null @@ -1,22 +0,0 @@ -oml interface design notes - -problems: - -* there is no way how to tag a command sent to the BTS, with the response - having the same tag to identify the originator of the command -* therefore, we can have e.g. both the BSC and the OML interface send a - SET ATTRIBUTE message, where the responses would end up at the wrong - query. -* The BTS has 10s to ACK/NACK a command. We do not run any timers. - -the only possible solutions i can imagine: -* have some kind of exclusive locking, where the OML interface gets blocked - from the BSC and is exclusively assigned to the OML console until all commands - of the OML console have terminated. This can either be done explicitly - dynamically or on demand - -* use the OML interface synchronously, i.e. always wait for the response from - the BTS before - -* unilateral / unsolicited messages need to be broadcasted to both the BSC and - the OML console diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/include/Makefile.am b/include/Makefile.am index 3234e62..677eec3 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,8 +1,3 @@ SUBDIRS = \ openbsc \ $(NULL) - -noinst_HEADERS = \ - mISDNif.h \ - compat_af_isdn.h \ - $(NULL) diff --git a/include/compat_af_isdn.h b/include/compat_af_isdn.h deleted file mode 100644 index 56cbfb3..0000000 --- a/include/compat_af_isdn.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifdef MISDN_OLD_AF_COMPATIBILITY -#undef AF_ISDN -#undef PF_ISDN - -extern int AF_ISDN; -#define PF_ISDN AF_ISDN - -int AF_ISDN; - -#endif - -extern void init_af_isdn(void); - -#ifdef AF_COMPATIBILITY_FUNC -#ifdef MISDN_OLD_AF_COMPATIBILITY -void init_af_isdn(void) -{ - int s; - - /* test for new value */ - AF_ISDN = 34; - s = socket(AF_ISDN, SOCK_RAW, ISDN_P_BASE); - if (s >= 0) { - close(s); - return; - } - AF_ISDN = 27; - s = socket(AF_ISDN, SOCK_RAW, ISDN_P_BASE); - if (s >= 0) { - close(s); - return; - } -} -#else -void init_af_isdn(void) -{ -} -#endif -#endif diff --git a/include/mISDNif.h b/include/mISDNif.h deleted file mode 100644 index 8e065d2..0000000 --- a/include/mISDNif.h +++ /dev/null @@ -1,387 +0,0 @@ -/* - * - * Author Karsten Keil - * - * Copyright 2008 by Karsten Keil - * - * This code is free software; you can redistribute it and/or modify - * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE - * version 2.1 as published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU LESSER GENERAL PUBLIC LICENSE for more details. - * - */ - -#ifndef mISDNIF_H -#define mISDNIF_H - -#include -#ifdef linux -#include -#include -#include -#else -#include -#include -#include -#endif - -/* - * ABI Version 32 bit - * - * <8 bit> Major version - * - changed if any interface become backwards incompatible - * - * <8 bit> Minor version - * - changed if any interface is extended but backwards compatible - * - * <16 bit> Release number - * - should be incremented on every checkin - */ -#define MISDN_MAJOR_VERSION 1 -#define MISDN_MINOR_VERSION 1 -#define MISDN_RELEASE 20 - -/* primitives for information exchange - * generell format - * <16 bit 0 > - * <8 bit command> - * BIT 8 = 1 LAYER private - * BIT 7 = 1 answer - * BIT 6 = 1 DATA - * <8 bit target layer mask> - * - * Layer = 00 is reserved for general commands - Layer = 01 L2 -> HW - Layer = 02 HW -> L2 - Layer = 04 L3 -> L2 - Layer = 08 L2 -> L3 - * Layer = FF is reserved for broadcast commands - */ - -#define MISDN_CMDMASK 0xff00 -#define MISDN_LAYERMASK 0x00ff - -/* generell commands */ -#define OPEN_CHANNEL 0x0100 -#define CLOSE_CHANNEL 0x0200 -#define CONTROL_CHANNEL 0x0300 -#define CHECK_DATA 0x0400 - -/* layer 2 -> layer 1 */ -#define PH_ACTIVATE_REQ 0x0101 -#define PH_DEACTIVATE_REQ 0x0201 -#define PH_DATA_REQ 0x2001 -#define MPH_ACTIVATE_REQ 0x0501 -#define MPH_DEACTIVATE_REQ 0x0601 -#define MPH_INFORMATION_REQ 0x0701 -#define PH_CONTROL_REQ 0x0801 - -/* layer 1 -> layer 2 */ -#define PH_ACTIVATE_IND 0x0102 -#define PH_ACTIVATE_CNF 0x4102 -#define PH_DEACTIVATE_IND 0x0202 -#define PH_DEACTIVATE_CNF 0x4202 -#define PH_DATA_IND 0x2002 -#define PH_DATA_E_IND 0x3002 -#define MPH_ACTIVATE_IND 0x0502 -#define MPH_DEACTIVATE_IND 0x0602 -#define MPH_INFORMATION_IND 0x0702 -#define PH_DATA_CNF 0x6002 -#define PH_CONTROL_IND 0x0802 -#define PH_CONTROL_CNF 0x4802 - -/* layer 3 -> layer 2 */ -#define DL_ESTABLISH_REQ 0x1004 -#define DL_RELEASE_REQ 0x1104 -#define DL_DATA_REQ 0x3004 -#define DL_UNITDATA_REQ 0x3104 -#define DL_INFORMATION_REQ 0x0004 - -/* layer 2 -> layer 3 */ -#define DL_ESTABLISH_IND 0x1008 -#define DL_ESTABLISH_CNF 0x5008 -#define DL_RELEASE_IND 0x1108 -#define DL_RELEASE_CNF 0x5108 -#define DL_DATA_IND 0x3008 -#define DL_UNITDATA_IND 0x3108 -#define DL_INFORMATION_IND 0x0008 - -/* intern layer 2 managment */ -#define MDL_ASSIGN_REQ 0x1804 -#define MDL_ASSIGN_IND 0x1904 -#define MDL_REMOVE_REQ 0x1A04 -#define MDL_REMOVE_IND 0x1B04 -#define MDL_STATUS_UP_IND 0x1C04 -#define MDL_STATUS_DOWN_IND 0x1D04 -#define MDL_STATUS_UI_IND 0x1E04 -#define MDL_ERROR_IND 0x1F04 -#define MDL_ERROR_RSP 0x5F04 - -/* DL_INFORMATION_IND types */ -#define DL_INFO_L2_CONNECT 0x0001 -#define DL_INFO_L2_REMOVED 0x0002 - -/* PH_CONTROL types */ -/* TOUCH TONE IS 0x20XX XX "0"..."9", "A","B","C","D","*","#" */ -#define DTMF_TONE_VAL 0x2000 -#define DTMF_TONE_MASK 0x007F -#define DTMF_TONE_START 0x2100 -#define DTMF_TONE_STOP 0x2200 -#define DTMF_HFC_COEF 0x4000 -#define DSP_CONF_JOIN 0x2403 -#define DSP_CONF_SPLIT 0x2404 -#define DSP_RECEIVE_OFF 0x2405 -#define DSP_RECEIVE_ON 0x2406 -#define DSP_ECHO_ON 0x2407 -#define DSP_ECHO_OFF 0x2408 -#define DSP_MIX_ON 0x2409 -#define DSP_MIX_OFF 0x240a -#define DSP_DELAY 0x240b -#define DSP_JITTER 0x240c -#define DSP_TXDATA_ON 0x240d -#define DSP_TXDATA_OFF 0x240e -#define DSP_TX_DEJITTER 0x240f -#define DSP_TX_DEJ_OFF 0x2410 -#define DSP_TONE_PATT_ON 0x2411 -#define DSP_TONE_PATT_OFF 0x2412 -#define DSP_VOL_CHANGE_TX 0x2413 -#define DSP_VOL_CHANGE_RX 0x2414 -#define DSP_BF_ENABLE_KEY 0x2415 -#define DSP_BF_DISABLE 0x2416 -#define DSP_BF_ACCEPT 0x2416 -#define DSP_BF_REJECT 0x2417 -#define DSP_PIPELINE_CFG 0x2418 -#define HFC_VOL_CHANGE_TX 0x2601 -#define HFC_VOL_CHANGE_RX 0x2602 -#define HFC_SPL_LOOP_ON 0x2603 -#define HFC_SPL_LOOP_OFF 0x2604 - -/* DSP_TONE_PATT_ON parameter */ -#define TONE_OFF 0x0000 -#define TONE_GERMAN_DIALTONE 0x0001 -#define TONE_GERMAN_OLDDIALTONE 0x0002 -#define TONE_AMERICAN_DIALTONE 0x0003 -#define TONE_GERMAN_DIALPBX 0x0004 -#define TONE_GERMAN_OLDDIALPBX 0x0005 -#define TONE_AMERICAN_DIALPBX 0x0006 -#define TONE_GERMAN_RINGING 0x0007 -#define TONE_GERMAN_OLDRINGING 0x0008 -#define TONE_AMERICAN_RINGPBX 0x000b -#define TONE_GERMAN_RINGPBX 0x000c -#define TONE_GERMAN_OLDRINGPBX 0x000d -#define TONE_AMERICAN_RINGING 0x000e -#define TONE_GERMAN_BUSY 0x000f -#define TONE_GERMAN_OLDBUSY 0x0010 -#define TONE_AMERICAN_BUSY 0x0011 -#define TONE_GERMAN_HANGUP 0x0012 -#define TONE_GERMAN_OLDHANGUP 0x0013 -#define TONE_AMERICAN_HANGUP 0x0014 -#define TONE_SPECIAL_INFO 0x0015 -#define TONE_GERMAN_GASSENBESETZT 0x0016 -#define TONE_GERMAN_AUFSCHALTTON 0x0016 - -/* MPH_INFORMATION_IND */ -#define L1_SIGNAL_LOS_OFF 0x0010 -#define L1_SIGNAL_LOS_ON 0x0011 -#define L1_SIGNAL_AIS_OFF 0x0012 -#define L1_SIGNAL_AIS_ON 0x0013 -#define L1_SIGNAL_RDI_OFF 0x0014 -#define L1_SIGNAL_RDI_ON 0x0015 -#define L1_SIGNAL_SLIP_RX 0x0020 -#define L1_SIGNAL_SLIP_TX 0x0021 - -/* - * protocol ids - * D channel 1-31 - * B channel 33 - 63 - */ - -#define ISDN_P_NONE 0 -#define ISDN_P_BASE 0 -#define ISDN_P_TE_S0 0x01 -#define ISDN_P_NT_S0 0x02 -#define ISDN_P_TE_E1 0x03 -#define ISDN_P_NT_E1 0x04 -#define ISDN_P_TE_UP0 0x05 -#define ISDN_P_NT_UP0 0x06 - -#define IS_ISDN_P_TE(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_TE_E1) || \ - (p == ISDN_P_TE_UP0) || (p == ISDN_P_LAPD_TE)) -#define IS_ISDN_P_NT(p) ((p == ISDN_P_NT_S0) || (p == ISDN_P_NT_E1) || \ - (p == ISDN_P_NT_UP0) || (p == ISDN_P_LAPD_NT)) -#define IS_ISDN_P_S0(p) ((p == ISDN_P_TE_S0) || (p == ISDN_P_NT_S0)) -#define IS_ISDN_P_E1(p) ((p == ISDN_P_TE_E1) || (p == ISDN_P_NT_E1)) -#define IS_ISDN_P_UP0(p) ((p == ISDN_P_TE_UP0) || (p == ISDN_P_NT_UP0)) - - -#define ISDN_P_LAPD_TE 0x10 -#define ISDN_P_LAPD_NT 0x11 - -#define ISDN_P_B_MASK 0x1f -#define ISDN_P_B_START 0x20 - -#define ISDN_P_B_RAW 0x21 -#define ISDN_P_B_HDLC 0x22 -#define ISDN_P_B_X75SLP 0x23 -#define ISDN_P_B_L2DTMF 0x24 -#define ISDN_P_B_L2DSP 0x25 -#define ISDN_P_B_L2DSPHDLC 0x26 - -#define OPTION_L2_PMX 1 -#define OPTION_L2_PTP 2 -#define OPTION_L2_FIXEDTEI 3 -#define OPTION_L2_CLEANUP 4 - -/* should be in sync with linux/kobject.h:KOBJ_NAME_LEN */ -#define MISDN_MAX_IDLEN 20 - -struct mISDNhead { - unsigned int prim; - unsigned int id; -} __attribute__((packed)); - -#define MISDN_HEADER_LEN sizeof(struct mISDNhead) -#define MAX_DATA_SIZE 2048 -#define MAX_DATA_MEM (MAX_DATA_SIZE + MISDN_HEADER_LEN) -#define MAX_DFRAME_LEN 260 - -#define MISDN_ID_ADDR_MASK 0xFFFF -#define MISDN_ID_TEI_MASK 0xFF00 -#define MISDN_ID_SAPI_MASK 0x00FF -#define MISDN_ID_TEI_ANY 0x7F00 - -#define MISDN_ID_ANY 0xFFFF -#define MISDN_ID_NONE 0xFFFE - -#define GROUP_TEI 127 -#define TEI_SAPI 63 -#define CTRL_SAPI 0 - -#define MISDN_MAX_CHANNEL 127 -#define MISDN_CHMAP_SIZE ((MISDN_MAX_CHANNEL + 1) >> 3) - -#define SOL_MISDN 0 - -struct sockaddr_mISDN { - sa_family_t family; - unsigned char dev; - unsigned char channel; - unsigned char sapi; - unsigned char tei; -}; - -struct mISDNversion { - unsigned char major; - unsigned char minor; - unsigned short release; -}; - -#define MAX_DEVICE_ID 63 - -struct mISDN_devinfo { - u_int id; - u_int Dprotocols; - u_int Bprotocols; - u_int protocol; - u_char channelmap[MISDN_CHMAP_SIZE]; - u_int nrbchan; - char name[MISDN_MAX_IDLEN]; -}; - -struct mISDN_devrename { - u_int id; - char name[MISDN_MAX_IDLEN]; -}; - -struct ph_info_ch { - int32_t protocol; - int64_t Flags; -}; - -struct ph_info_dch { - struct ph_info_ch ch; - int16_t state; - int16_t num_bch; -}; - -struct ph_info { - struct ph_info_dch dch; - struct ph_info_ch bch[]; -}; - -/* timer device ioctl */ -#define IMADDTIMER _IOR('I', 64, int) -#define IMDELTIMER _IOR('I', 65, int) -/* socket ioctls */ -#define IMGETVERSION _IOR('I', 66, int) -#define IMGETCOUNT _IOR('I', 67, int) -#define IMGETDEVINFO _IOR('I', 68, int) -#define IMCTRLREQ _IOR('I', 69, int) -#define IMCLEAR_L2 _IOR('I', 70, int) -#define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename) - -static inline int -test_channelmap(u_int nr, u_char *map) -{ - if (nr <= MISDN_MAX_CHANNEL) - return map[nr >> 3] & (1 << (nr & 7)); - else - return 0; -} - -static inline void -set_channelmap(u_int nr, u_char *map) -{ - map[nr >> 3] |= (1 << (nr & 7)); -} - -static inline void -clear_channelmap(u_int nr, u_char *map) -{ - map[nr >> 3] &= ~(1 << (nr & 7)); -} - -/* CONTROL_CHANNEL parameters */ -#define MISDN_CTRL_GETOP 0x0000 -#define MISDN_CTRL_LOOP 0x0001 -#define MISDN_CTRL_CONNECT 0x0002 -#define MISDN_CTRL_DISCONNECT 0x0004 -#define MISDN_CTRL_PCMCONNECT 0x0010 -#define MISDN_CTRL_PCMDISCONNECT 0x0020 -#define MISDN_CTRL_SETPEER 0x0040 -#define MISDN_CTRL_UNSETPEER 0x0080 -#define MISDN_CTRL_RX_OFF 0x0100 -#define MISDN_CTRL_FILL_EMPTY 0x0200 -#define MISDN_CTRL_GETPEER 0x0400 -#define MISDN_CTRL_HW_FEATURES_OP 0x2000 -#define MISDN_CTRL_HW_FEATURES 0x2001 -#define MISDN_CTRL_HFC_OP 0x4000 -#define MISDN_CTRL_HFC_PCM_CONN 0x4001 -#define MISDN_CTRL_HFC_PCM_DISC 0x4002 -#define MISDN_CTRL_HFC_CONF_JOIN 0x4003 -#define MISDN_CTRL_HFC_CONF_SPLIT 0x4004 -#define MISDN_CTRL_HFC_RECEIVE_OFF 0x4005 -#define MISDN_CTRL_HFC_RECEIVE_ON 0x4006 -#define MISDN_CTRL_HFC_ECHOCAN_ON 0x4007 -#define MISDN_CTRL_HFC_ECHOCAN_OFF 0x4008 - - -/* socket options */ -#define MISDN_TIME_STAMP 0x0001 - -struct mISDN_ctrl_req { - int op; - int channel; - int p1; - int p2; -}; - -/* muxer options */ -#define MISDN_OPT_ALL 1 -#define MISDN_OPT_TEIMGR 2 - -#endif /* mISDNIF_H */ diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 031ef79..1502129 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -1,5 +1,4 @@ noinst_HEADERS = \ - a_reset.h \ common.h \ crc24.h \ debug.h \ diff --git a/include/openbsc/a_reset.h b/include/openbsc/a_reset.h deleted file mode 100644 index 7aaab06..0000000 --- a/include/openbsc/a_reset.h +++ /dev/null @@ -1,63 +0,0 @@ -/* (C) 2017 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - - - -/* Reset context data (callbacks, state machine etc...) */ -struct a_reset_ctx { - - /* FSM instance, which handles the reset procedure */ - struct osmo_fsm_inst *fsm; - - /* Connection failure counter. When this counter - * reaches a certain threshold, the reset procedure - * will be triggered */ - int conn_loss_counter; - - /* A human readable name to display in the logs */ - char name[256]; - - /* Callback function to be called when a connection - * failure is detected and a rest must occur */ - void (*cb)(void *priv); - - /* Privated data for the callback function */ - void *priv; -}; - -/* Create and start state machine which handles the reset/reset-ack procedure */ -struct a_reset_ctx *a_reset_alloc(const void *ctx, const char *name, void *cb, void *priv); - -/* Tear down state machine */ -void a_reset_free(struct a_reset_ctx *reset); - -/* Confirm that we sucessfully received a reset acknowlege message */ -void a_reset_ack_confirm(struct a_reset_ctx *reset); - -/* Report a failed connection */ -void a_reset_conn_fail(struct a_reset_ctx *reset); - -/* Report a successful connection */ -void a_reset_conn_success(struct a_reset_ctx *reset); - -/* Check if we have a connection to a specified msc */ -bool a_reset_conn_ready(struct a_reset_ctx *reset); diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h deleted file mode 100644 index 3cdbe04..0000000 --- a/include/openbsc/gsm_04_14.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode); -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs); -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology); - -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h deleted file mode 100644 index d5e1428..0000000 --- a/include/openbsc/iu_dummy.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include - -struct msgb; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -struct ranap_ue_conn_ctx { - struct llist_head list; - uint32_t conn_id; -}; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi); -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck); -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/src/Makefile.am b/src/Makefile.am index 4d1bba4..d2dcb9f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,25 +1,3 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) - -# Programs SUBDIRS = \ gprs \ $(NULL) diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c deleted file mode 100644 index b529f4c..0000000 --- a/src/libmsc/gsm_04_14.c +++ /dev/null @@ -1,133 +0,0 @@ -/* GSM MS Testing Layer 3 messages - * 3GPP TS 44.014 / GSM TS 04.14 */ - -/* (C) 2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include "bscconfig.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static struct msgb *create_gsm0414_msg(uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_TEST; - gh->msg_type = msg_type; - return msg; -} - -static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - return msc_tx_dtap(conn, msg); -} - -static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) -{ - struct msgb *msg = create_gsm0414_msg(msg_type); - - return gsm0414_conn_sendmsg(conn, msg); -} - - -/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); - uint8_t subch; - - subch = (loop_mode << 1); - msgb_put_u8(msg, subch); - - msg->lchan = conn->lchan; - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a OPEN_LOOP_CMD according to Section 8.3 */ -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); -} - -/* Send a ACT_EMMI_CMD according to Section 8.8 */ -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); -} - -/* Send a DEACT_EMMI_CMD according to Section 8.10 */ -int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); -} - -/* Send a TEST_INTERFACE according to Section 8.11 */ -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); - msgb_put_u8(msg, tested_devs); - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); - msgb_put_u8(msg, technology); - return gsm0414_conn_sendmsg(conn, msg); -} - - - -/* Entry point for incoming GSM48_PDISC_TEST received from MS */ -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - - if (msgb_l3len(msg) < sizeof(*gh)) - return -1; - - LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", - get_value_string(gsm414_msgt_names, gh->msg_type)); - - return 0; -} diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c deleted file mode 100644 index e9d335e..0000000 --- a/src/libmsc/iu_dummy.c +++ /dev/null @@ -1,93 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include "../../bscconfig.h" -#ifndef BUILD_IU - -#include - -#include -#include -#include - -struct msgb; -struct ranap_ue_conn_ctx; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", - msg->len, osmo_hexdump(msg->data, msg->len)); - return 0; -} - -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); - return 0; -} - -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); - return 23; -} - -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); - return 0; -} - -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap) -{ - LOGP(DLGLOBAL, LOGL_INFO, "ranap_new_msg_rab_assign_voice() dummy called, NOT composing RAB Assignment\n"); - return NULL; -} - -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); - return 0; -} - -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); - return 0; -} - -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); - return 0; -} - -#endif diff --git a/tools/hlrstat.pl b/tools/hlrstat.pl deleted file mode 100755 index 668fc9a..0000000 --- a/tools/hlrstat.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -use strict; -use DBI; -my $dbh = DBI->connect("dbi:SQLite:dbname=hlr.sqlite3","",""); - - -my %mcc_names; -my %mcc_mnc_names; - -sub get_mcc_mnc_name($) -{ - my $mcc_mnc = shift; - my $ret = $mcc_mnc; - - if ($mcc_mnc_names{$mcc_mnc} ne '') { - $ret = $mcc_mnc_names{$mcc_mnc}; - } - - return $ret; -} - -sub read_networks($) -{ - my $filename = shift; - my $cur_name; - - open(INFILE, $filename); - while (my $l = ) { - chomp($l); - if ($l =~ /^#/) { - next; - } - if ($l =~ /^\t/) { - my ($mcc, $mnc, $brand, $r) = split(' ', $l, 4); - #printf("%s|%s|%s\n", $mcc, $mnc, $brand); - $mcc_mnc_names{"$mcc-$mnc"} = $brand; - $mcc_names{$mcc} = $cur_name; - } elsif ($l =~ /^(\w\w)\t(.*)/) { - #printf("%s|%s\n", $1, $2); - $cur_name = $2; - } - } - close(INFILE); -} - -read_networks("networks.tab"); - -my %oper_count; -my %country_count; - -#my $sth = $dbh->prepare("SELECT imsi FROM subscriber where authorized=1"); -my $sth = $dbh->prepare("SELECT imsi FROM subscriber"); - -$sth->execute(); - -while (my $href = $sth->fetchrow_hashref) { - my ($mcc, $mnc) = $$href{imsi} =~ /(\d{3})(\d{2}).*/; - #printf("%s %s-%s \n", $$href{imsi}, $mcc, $mnc); - $oper_count{"$mcc-$mnc"}++; - $country_count{$mcc}++; -} - - -foreach my $c (sort{$country_count{$b} <=> $country_count{$a}} keys %country_count) { - printf("%s: %d\n", $mcc_names{$c}, $country_count{$c}); - - foreach my $k (sort{$oper_count{$b} <=> $oper_count{$a}} keys %oper_count) { - if ($k =~ /^$c-/) { - printf("\t%s: %d\n", get_mcc_mnc_name($k), $oper_count{$k}); - } - } -} -- To view, visit https://gerrit.osmocom.org/3797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie9dc7514c3850010d0e9b3ab716b4f4e8d83594f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:48:53 +0000 Subject: [MERGED] osmo-sgsn[master]: debian: fix osmo-sgsn.install, tweak VCS link and descriptions In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: fix osmo-sgsn.install, tweak VCS link and descriptions ...................................................................... debian: fix osmo-sgsn.install, tweak VCS link and descriptions Change-Id: I6493a7ca7d996fab00d99652a74a709c860a3de7 --- M debian/control M debian/osmo-sgsn.install 2 files changed, 5 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/debian/control b/debian/control index 16fd244..4a3a07f 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ libosmo-netif-dev Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-sgsn.git -Vcs-Browser: http://git.osmocom.org/gitweb?p=osmo-sgsn.git;a=summary +Vcs-Browser: https://git.osmocom.org/osmo-sgsn Homepage: https://projects.osmocom.org/projects/osmo-sgsn @@ -42,8 +42,7 @@ Package: osmo-gtphub Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. +Description: Osmocom GTP Hub: Proxy for GTP traffic between multiple SGSNs and GGSNs Package: osmo-gtphub-dbg Architecture: any @@ -51,24 +50,19 @@ Priority: extra Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for Osmocom GTP Hub - Make debugging possible Package: osmo-gbproxy Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: osmocom-sgsn +Recommends: osmo-sgsn Description: Osmocom GPRS Gb Interface Proxy The purpose of the Gb proxy is to aggregate the Gb links of multiple BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. Package: osmo-gbproxy-dbg Architecture: any Section: debug Priority: extra Depends: osmo-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible - +Description: Debug symbols for Osmocom GPRS Gb Interface Proxy diff --git a/debian/osmo-sgsn.install b/debian/osmo-sgsn.install index 55086cc..a92ae18 100644 --- a/debian/osmo-sgsn.install +++ b/debian/osmo-sgsn.install @@ -1,4 +1,2 @@ -usr/bin -usr/share/doc/openbsc/examples/osmo-gtphub -usr/share/doc/openbsc/examples/osmo-gbproxy +usr/bin/osmo-sgsn usr/share/doc/openbsc/examples/osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6493a7ca7d996fab00d99652a74a709c860a3de7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:49:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:49:27 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: per build, drop programs built "unintentionally" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: per build, drop programs built "unintentionally" ...................................................................... jenkins: per build, drop programs built "unintentionally" Each of the jenkins-build-* scripts intends to build a specific set of programs. While compiling dependencies, other programs may end up in $prefix/bin. Drop those other binaries to reduce potential confusion. Add arguments to the create_bin_tgz function: callers need to list exactly the $prefix/bin/* binaries that should be tar'd. All others are first removed from the prefix. Adjust existing scripts to provide such binary names. Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 --- M contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh M contrib/jenkins-build-osmo-pcu-sysmo.sh M contrib/jenkins-build-osmo-pcu.sh M contrib/jenkins-build-osmo-trx.sh 9 files changed, 24 insertions(+), 8 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 3e30873..3d9932d 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -140,6 +140,22 @@ create_bin_tgz() { # build the archive that is going to be copied to the tester + + wanted_binaries="$@" + + if [ -z "$wanted_binaries" ]; then + set +x; echo "ERROR: create_bin_tgz needs a list of permitted binaries"; set -x + exit 1 + fi + + # remove binaries not intended to originate from this build + cd "$prefix_real"/bin + for f in * ; do + if [ -z "$(echo "_ $wanted_binaries _" | grep " $f ")" ]; then + rm "$f" + fi + done + cd "$prefix_real" this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" tar="${this}.tgz" diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index f286368..e636893 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -20,4 +20,4 @@ build_repo libosmo-abis build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include -create_bin_tgz +create_bin_tgz osmo-bts-sysmo diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 8664a08..6188be1 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -11,4 +11,4 @@ build_repo libosmo-abis build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -create_bin_tgz +create_bin_tgz osmo-bts-trx diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 67e135f..460e9d6 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -8,4 +8,4 @@ build_repo libosmo-abis build_repo osmo-hlr -create_bin_tgz +create_bin_tgz osmo-hlr diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index dddacc7..8025ca2 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -14,4 +14,4 @@ build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -create_bin_tgz +create_bin_tgz osmo-msc diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 2f26a20..ef55259 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -12,4 +12,4 @@ build_repo libosmo-sccp build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -create_bin_tgz +create_bin_tgz osmo-nitb diff --git a/contrib/jenkins-build-osmo-pcu-sysmo.sh b/contrib/jenkins-build-osmo-pcu-sysmo.sh index b912252..c38bc33 100755 --- a/contrib/jenkins-build-osmo-pcu-sysmo.sh +++ b/contrib/jenkins-build-osmo-pcu-sysmo.sh @@ -16,4 +16,4 @@ build_repo libosmocore --disable-pcsc --disable-doxygen build_repo osmo-pcu --enable-sysmocom-dsp -create_bin_tgz +create_bin_tgz osmo-pcu diff --git a/contrib/jenkins-build-osmo-pcu.sh b/contrib/jenkins-build-osmo-pcu.sh index 7953875..4d4277f 100755 --- a/contrib/jenkins-build-osmo-pcu.sh +++ b/contrib/jenkins-build-osmo-pcu.sh @@ -7,4 +7,4 @@ build_repo libosmocore --disable-pcsc --disable-doxygen build_repo osmo-pcu -create_bin_tgz +create_bin_tgz osmo-pcu diff --git a/contrib/jenkins-build-osmo-trx.sh b/contrib/jenkins-build-osmo-trx.sh index 7d2a5b6..b996cfe 100755 --- a/contrib/jenkins-build-osmo-trx.sh +++ b/contrib/jenkins-build-osmo-trx.sh @@ -6,4 +6,4 @@ build_repo osmo-trx --without-sse -create_bin_tgz +create_bin_tgz osmo-trx -- To view, visit https://gerrit.osmocom.org/3818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 6 14:51:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 14:51:41 +0000 Subject: osmo-gsm-tester[master]: modem: Include serial attribute in info() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd490942ecc8ecfd0f799ed241a53d45f5870b30 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:00:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 15:00:09 +0000 Subject: osmo-gsm-tester[master]: modem: log property changes from Modem interface In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) (I'd give +2 and let you decide, but want to make sure you notice there are comments.) https://gerrit.osmocom.org/#/c/3834/1/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 228: self.dbg('%r.PropertyChanged() -> %s=%s' % (I_MODEM, name, value)) I'd prefer to drop all that is anyway constant. i.e. only log '%s=%s', and maybe rather '%s=%r'. Or use the dict style self.dbg(name=value) If you do want to indicate that a prop was received, rather less long? self.dbg('rx', name=value) -- To view, visit https://gerrit.osmocom.org/3834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:04:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 15:04:46 +0000 Subject: osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 meh, do you really have to introduce mixed array styles... :/ well then. About the empty features, test them now or omit the list? -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:07:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 15:07:11 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:12:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 15:12:43 +0000 Subject: osmo-gsm-tester[master]: modem: log property changes from Modem interface In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3834/1/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 228: self.dbg('%r.PropertyChanged() -> %s=%s' % (I_MODEM, name, value)) > I'd prefer to drop all that is anyway constant. i.e. only log '%s=%s', and It's not constant because we also use that for the I_NETREG interface. I used this format on purpose to use the same one as we use for I_NETREG, and I like it because it feels pretty like when using mdbus -l or dbus-monitor and provides quick understanding on where the messages/info comes from. -- To view, visit https://gerrit.osmocom.org/3834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:22:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 15:22:30 +0000 Subject: osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:34:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 15:34:35 +0000 Subject: osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 > osmo_select_main() doesn't check the return value at all You mean osmo_fd_disp_fds()? I don't see any cb() call in osmo_select_main(). -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:41:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 15:41:06 +0000 Subject: [PATCH] osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Hello daniel, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3878 to look at the new patch set (#3). Check return value to prevent crash Previously result of readv() was used unconditionally so when it failed and returned negative value it was treated like very large positive which lead to memory corruption. Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Related: SYS#3865 --- M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-sysmo/l1_transp_hw.c 2 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/3878/3 diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 6381864..38b9ffe 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -204,8 +204,10 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); + if (rc < 0) + count = 0; + count = rc / prim_size; for (i = 0; i < count; ++i) { diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index da8ac3f..c9f6861 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -215,8 +215,10 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); + if (rc < 0) + count = 0; + count = rc / prim_size; for (i = 0; i < count; ++i) { -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:42:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 15:42:34 +0000 Subject: osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3815/1/src/osmo_gsm_tester/osmo_bsc.py File src/osmo_gsm_tester/osmo_bsc.py: Line 89: encryption_vty = util.encryption2osmovty(values['bsc']['net']['encryption']) hmm, I didn't think of this, now we need to translate the value kept in the config. This is moving part of rendering the model into the realm of composing the object, so, strictly speaking, this is breaking the DOM separation. It would be cleaner to still just overlay the config here, and do the conversion in the template rendering itself. I still have to make up my mind whether we should bother, and try out how it would look in the template. Will this sort of thing re-appear for other values and we need a whole layer for conversion? So far we only have 1:1 vty compatibility for all values and names, right? We have constants for the band ('GSM-1800'), but these are translated to an ARFCN and never end up in the VTY as such. Sorry for the diversion here. We can also merge this and I can come back to it later... Thoughts? https://gerrit.osmocom.org/#/c/3815/1/src/osmo_gsm_tester/util.py File src/osmo_gsm_tester/util.py: Line 319: return 'a5 ' + val[3:] well, what if I feed 'a5_potato' :) -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:42:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 15:42:51 +0000 Subject: osmo-gsm-tester[master]: resource_test: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I654484b21ca2e950ff3019ee20133e9cb50296bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:44:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 15:44:03 +0000 Subject: osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:47:03 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 6 Sep 2017 15:47:03 +0000 Subject: osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (2 comments) Your assignment of count has no effect Maybe use if/else? https://gerrit.osmocom.org/#/c/3878/3/src/osmo-bts-litecell15/l1_transp_hw.c File src/osmo-bts-litecell15/l1_transp_hw.c: Line 211: count = rc / prim_size; same https://gerrit.osmocom.org/#/c/3878/3/src/osmo-bts-sysmo/l1_transp_hw.c File src/osmo-bts-sysmo/l1_transp_hw.c: Line 222: count = rc / prim_size; count will be overwritten here... -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:48:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 15:48:06 +0000 Subject: osmo-msc[master]: remove contrib/soap.py, seems to apply to osmo-bsc only In-Reply-To: References: Message-ID: Patch Set 1: This part - is: it handles particular type of TRAP message from osmo-bsc. In general, any message not handled explicitly in Trap class will be handled by CTRL class. -- To view, visit https://gerrit.osmocom.org/3812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I647be0a646bbc3cfee226c55061e0e57fa1211fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 15:51:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 15:51:38 +0000 Subject: [PATCH] osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Hello daniel, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3878 to look at the new patch set (#4). Check return value to prevent crash Previously result of readv() was used unconditionally so when it failed and returned negative value it was treated like very large positive which lead to memory corruption. Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Related: SYS#3865 --- M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-sysmo/l1_transp_hw.c 2 files changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/3878/4 diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 6381864..f70291f 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -204,9 +204,8 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); - count = rc / prim_size; + count = (rc <= 0) ? 0 : (rc / prim_size); for (i = 0; i < count; ++i) { msgb_put(msg[i], prim_size); diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index da8ac3f..04adc80 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -215,9 +215,8 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); - count = rc / prim_size; + count = (rc <= 0) ? 0 : (rc / prim_size); for (i = 0; i < count; ++i) { msgb_put(msg[i], prim_size); -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Sep 6 16:16:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 16:16:23 +0000 Subject: osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/3815/1/src/osmo_gsm_tester/osmo_bsc.py File src/osmo_gsm_tester/osmo_bsc.py: Line 89: encryption_vty = util.encryption2osmovty(values['bsc']['net']['encryption']) > hmm, I didn't think of this, now we need to translate the value kept in the I must admit I hated you a bit while reworking this to use "_" instead of " " :-P I had to add an extra commit + add lines like this one, it took me a while. I didn't think about the extra work initially, same as you. This sort of thing can indeed re-appear with other values, or if other implementations / hw are included which use a different configuration format / fields. For some cases it can be easily done during rendering of mode, for other probably we need to keep some logic here. But I don't think this is an issue, as anyway the python object is bound to the config template anyway... What we need for sure is to maintain a unified format to specify in resources.conf/defaults.conf, as well as the one used through public APIs accessible from tests, as well as properties which are shared between objects through public interfaces. Once inside an object, like inside configure(), it's not an issue to convert stuff or do some tricks there. I think we should merge this and if we see it's an issue later, fix it. Let's not lose time reworking commits with this things if we can avoid it. https://gerrit.osmocom.org/#/c/3815/1/src/osmo_gsm_tester/util.py File src/osmo_gsm_tester/util.py: Line 319: return 'a5 ' + val[3:] > well, what if I feed 'a5_potato' :) In that case you really well deserve getting an error somewhere else. I can introduce a PotatoException and test that one specifically if you want :-) It's not that important, values coming from config files are checked before during schema validation. The assert in there is a small check to understand what do you need to pass to the function if you use that inside the code of osmo-gsm-tester, or if using it quickly in a wrong way (passing some other object or strange value), to get a quick report. -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 16:23:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 16:23:19 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 (3 comments) https://gerrit.osmocom.org/#/c/3722/2//COMMIT_MSG Commit Message: Line 31: - 'a5 1' (writing this last) Now I understand, and I think this is a no-go. A scenario is by nature imperative, and adding a scenario shall only add more restriction, never enlarge the scope of permitted options. If we want a scenario with both a5 0 and 1, we need an actual separate scenario file saying ciphers: - a5_0 - a5_1 If we allow adding a scenario to enhance options, we will break the semantics and pretty surely end up in chaos. To change this, we'd need some 'a OR b' operator, but so far adding a scenario is strictly 'AND' implicitly. We also potentially hit problems there with the logic that we need to think about: if a scenario says [a5_0, a5_1], it implies that a BTS must support *both* a5_0 and a5_1 at the same time, not that it may support either of the two. More fitting I guess is the argument of frequency bands as in another patch: if a scenario requests multiple bands, it would imply that a BTS supports all of them at the same time. We can't let the resolver pick one of them without breaking the rest of the logic. The same argument applies to the reverse case: a BTS supports multiple bands, but a scenario picks only one of them -- this is also potentially breaking the current resolver. The places where we need this have to be set apart from the rest somehow to work safely. Compare to the modem features where all have to be present, this cannot be implicit. We need to go back to the drawing board and discuss in person I believe. Something like 'AND', 'OR' keywords maybe, if we can't find a way to avoid this. Apologies for not spotting this earlier. I'm leaving the remaining comments for illustration... https://gerrit.osmocom.org/#/c/3722/2/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 249: assert type(dest[i]) == type(src[i]) this is fragile: tuple and list are both iterable and can be combined, yet their type() differs. I guess this needs to be assert is_list(a) == is_list(b) and is_dict(a) == is_dict(b) ? Line 253: dest.append(src[i]) I need to think hard here ... maybe a comment would be good. ...so... dest and src are both lists. now we see whether each item in src matches the item in dest at the same index. but if dest[i] is only a single value and src[i] ... is nowhere else in dest ... we append to dest? I can't wrap my head around it, looks like a violation of matching up indexes in the lists. Also while we're iterating, appending to the list being iterated opens up all sorts of hell. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 16:23:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 6 Sep 2017 16:23:45 +0000 Subject: [PATCH] osmo-bsc[master]: Wrap channel state assignment in macro In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3828 to look at the new patch set (#4). Wrap channel state assignment in macro Previously we've used function so debug print always pointed to the same place which is not very useful. Wrap it with macro so proper file:line is printed. Also, make sure that we always change state only through this wrapper and log only when the state has changed. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 --- M include/osmocom/bsc/abis_rsl.h M src/libbsc/abis_rsl.c M src/libbsc/chan_alloc.c 3 files changed, 10 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/28/3828/4 diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h index f983fce..7bea79b 100644 --- a/include/osmocom/bsc/abis_rsl.h +++ b/include/osmocom/bsc/abis_rsl.h @@ -34,6 +34,9 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) +#define rsl_lchan_set_state(lch_, st_) \ + rsl_lchan_set_state_with_log(lch_, st_, __BASE_FILE__, __LINE__) + int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); @@ -74,7 +77,7 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, enum rsl_rel_mode release_mode); -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); +int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, uint8_t state, const char *file, unsigned line); int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); /* to be provided by external code */ diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 09fb14b..51e4826 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1225,11 +1225,12 @@ return 0; } -int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) +int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, uint8_t state, const char *file, unsigned line) { - DEBUGP(DRSL, "%s state %s -> %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), - gsm_lchans_name(state)); + if (lchan->state != state) + LOGPSRC(DRSL, LOGL_DEBUG, file, line, "%s state %s -> %s\n", + gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), gsm_lchans_name(state)); + lchan->state = state; return 0; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 679ad42..f0275bc 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -448,7 +448,7 @@ osmo_timer_del(&lchan->error_timer); lchan->type = GSM_LCHAN_NONE; - lchan->state = LCHAN_S_NONE; + rsl_lchan_set_state(lchan, LCHAN_S_NONE); if (lchan->abis_ip.rtp_socket) { rtp_socket_free(lchan->abis_ip.rtp_socket); -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 16:25:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 16:25:02 +0000 Subject: osmo-gsm-tester[master]: Add minimal USSD support to test extension number In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib19331f9c6476ac01bf729790dfd63c56de86a89 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 16:32:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 16:32:07 +0000 Subject: osmo-gsm-tester[master]: Verify that BTS successfully connects to NITB In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2692/2/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 136: config.overlay(values, { 'cell_identity': self.cell_identity }) this is putting the cell_identity() function in the dict https://gerrit.osmocom.org/#/c/2692/2/src/osmo_gsm_tester/osmo_nitb.py File src/osmo_gsm_tester/osmo_nitb.py: Line 195: def bts_is_connected(self, bts): I still think we should add a CTRL command to osmo-bsc that allows querying whether a given cell identity is attached and drop this logic for the benefit of a single CTRL call. -- To view, visit https://gerrit.osmocom.org/2692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bbf9ac2b05d95a113ed4ad5e93093431496d44e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 17:00:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 17:00:33 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: what holds me back now is that we need to install stow on the build slaves, right? If I merge this, all our builds will fall on their faces otherwise. -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 17:01:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 17:01:29 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/3722/2//COMMIT_MSG Commit Message: Line 31: - 'a5 1' > (writing this last) All this is quite tricky and we should talk in person about it, indeed. > if a scenario says [a5_0, a5_1], it implies that a BTS must support *both* > a5_0 and a5_1 at the same time, not that it may support either of the two. I know, and that's the intention here. Because in the same suite I'm doing tests which require a50 and a51 on others. This means I need a BTS which can handle both. It's expected . Of course we can also split the suite into several suites and ask for one at each time, but I didn't require it for now because we have BTS supporting both. > A scenario is by nature imperative, and adding a scenario shall only add more > restriction, never enlarge the scope of permitted options. Yes, that's what it does. Adding a scenario enlarges the list of required option. As a result, adds more restriction. If you have a set A (resources), and a set B (resources/requirements), by adding an element to the array in B, you are enlarging set B. Thus, when intersecting A with B, the result C (valid resources) is same or smaller than it should have been if you didn't enlarge B with the field. As far as I understand, the final "resources" set B, is an aggregation (union) of sub sets, each sub set being one leave in the tree of resources (eg union(set(modem.label=foo), set(modem.has_cipher_a50_in_list), set(modem.has_cipher_a51_in_list)) = set(modem.label=foo, modem.has_cipher_a50_in_list, modem.has_cipher_a51_in_list). So, using a list is just a handy way of group naming specific attributes which can be used to form sets. Hopefully I made myself clearer and it makes sense. I had to think about this while doing this patch. > To change this, we'd need some 'a OR b' operator, but so far adding a scenario is > strictly 'AND' implicitly. I agree, I also thought about this option, and we may require it at some point (having some way to OR scenarios instead of joining them). Something like: "osmo-gsm-tester -s sms:cipher-a50~cipher-a51" Note the "~" character instead of +. This would basically mean something like "try matching resources against cipher-a50, and if it fails, try with ciper-a51". This of course cold be nested: "osmo-gsm-tester -s sms:(cipher-a50+cipher-a51)~(cipher-a52+cipher-a53)" Which would mean something like "I want a modem/bts which supports a50 ANR a51, OR otherwise give me one which supports a52 AND a53." Of course from GSM point of view this example may not make sense, but hopefully I explain the idea. Do we need this for now? No. Can we work around need for this for now/ever? Yes, probably. https://gerrit.osmocom.org/#/c/3722/2/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 249: assert type(dest[i]) == type(src[i]) > this is fragile: tuple and list are both iterable and can be combined, yet I think I never saw any checks for tuples in this code, so if I understand correctly we don't support using tuples here? Line 253: dest.append(src[i]) > I need to think hard here ... maybe a comment would be good. It's the case in which src and dst are lists containing "basic" values (ie. not lists or dictionaries), and then we need to merge (combine) elements from both lists. As the function combine() merges src into dst, we append src elements not present in dst into dst. This way, at the end dst is a superset of src, exactly what we are looking at here in general. When combine() finishes, dst is a superset of src. As a superset, then when intersecting with the available resources, it will provide a subset of available combinations, and it's what we are looking at. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 17:02:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 17:02:12 +0000 Subject: osmo-ci[master]: jenkins: Follow the convention and create a jenkins.sh as well In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3676/1/contrib/jenkins.sh File contrib/jenkins.sh: Line 7: git pull origin > I've had massive pains with "git, please just use latest master", and it lo I think laforge uses 'git fetch; git checkout -f master' ... haven't verified yet that it solves all situations. -- To view, visit https://gerrit.osmocom.org/3676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 17:06:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 6 Sep 2017 17:06:36 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3722/2//COMMIT_MSG Commit Message: Line 31: - 'a5 1' > All this is quite tricky and we should talk in person about it, indeed. > If you have a set A (resources), and a set B (resources/requirements), by Here I meant: "set B (scenarios/requirements)", sorry for that. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 6 22:32:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 22:32:32 +0000 Subject: osmo-msc[master]: rename include/openbsc to include/osmocom/msc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 reinstate +2 after rebase with minor merge conflict resolution -- To view, visit https://gerrit.osmocom.org/3811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 6 22:32:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 6 Sep 2017 22:32:36 +0000 Subject: [MERGED] osmo-msc[master]: rename include/openbsc to include/osmocom/msc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rename include/openbsc to include/osmocom/msc ...................................................................... rename include/openbsc to include/osmocom/msc Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 --- M configure.ac M include/Makefile.am A include/osmocom/Makefile.am R include/osmocom/msc/Makefile.am R include/osmocom/msc/a_iface.h R include/osmocom/msc/a_iface_bssap.h R include/osmocom/msc/a_reset.h R include/osmocom/msc/abis_nm.h R include/osmocom/msc/abis_om2000.h R include/osmocom/msc/abis_rsl.h R include/osmocom/msc/arfcn_range_encode.h R include/osmocom/msc/auth.h R include/osmocom/msc/bsc_api.h R include/osmocom/msc/bsc_msc.h R include/osmocom/msc/bsc_msc_data.h R include/osmocom/msc/bsc_msg_filter.h R include/osmocom/msc/bsc_rll.h R include/osmocom/msc/bss.h R include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h R include/osmocom/msc/chan_alloc.h R include/osmocom/msc/common.h R include/osmocom/msc/common_bsc.h R include/osmocom/msc/common_cs.h R include/osmocom/msc/crc24.h R include/osmocom/msc/ctrl.h R include/osmocom/msc/db.h R include/osmocom/msc/debug.h R include/osmocom/msc/e1_config.h R include/osmocom/msc/gsm_04_08.h R include/osmocom/msc/gsm_04_11.h R include/osmocom/msc/gsm_04_14.h R include/osmocom/msc/gsm_04_80.h R include/osmocom/msc/gsm_data.h R include/osmocom/msc/gsm_data_shared.h R include/osmocom/msc/gsm_subscriber.h R include/osmocom/msc/gsup_client.h R include/osmocom/msc/gtphub.h R include/osmocom/msc/handover.h R include/osmocom/msc/handover_decision.h R include/osmocom/msc/ipaccess.h R include/osmocom/msc/iu_dummy.h R include/osmocom/msc/iucs.h R include/osmocom/msc/iucs_ranap.h R include/osmocom/msc/meas_feed.h R include/osmocom/msc/meas_rep.h R include/osmocom/msc/misdn.h R include/osmocom/msc/mncc.h R include/osmocom/msc/mncc_int.h R include/osmocom/msc/msc_ifaces.h R include/osmocom/msc/network_listen.h R include/osmocom/msc/oap_client.h R include/osmocom/msc/openbscdefines.h R include/osmocom/msc/osmo_bsc.h R include/osmocom/msc/osmo_bsc_grace.h R include/osmocom/msc/osmo_bsc_reset.h R include/osmocom/msc/osmo_bsc_rf.h R include/osmocom/msc/osmo_bsc_sigtran.h R include/osmocom/msc/osmo_msc.h R include/osmocom/msc/osmux.h R include/osmocom/msc/paging.h R include/osmocom/msc/rest_octets.h R include/osmocom/msc/rrlp.h R include/osmocom/msc/rs232.h R include/osmocom/msc/rtp_proxy.h R include/osmocom/msc/signal.h R include/osmocom/msc/silent_call.h R include/osmocom/msc/slhc.h R include/osmocom/msc/smpp.h R include/osmocom/msc/sms_queue.h R include/osmocom/msc/socket.h R include/osmocom/msc/system_information.h R include/osmocom/msc/transaction.h R include/osmocom/msc/trau_mux.h R include/osmocom/msc/trau_upqueue.h R include/osmocom/msc/ussd.h R include/osmocom/msc/vlr.h R include/osmocom/msc/vty.h M src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libcommon/gsm_subscriber_base.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/libcommon/oap_client.c M src/libcommon/socket.c M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/auth.c M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/meas_feed.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c M src/libmsc/mncc_sock.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.c M src/libmsc/smpp_utils.c M src/libmsc/smpp_vty.c M src/libmsc/sms_queue.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/ussd.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_auth_fsm.c M src/libvlr/vlr_core.h M src/libvlr/vlr_lu_fsm.c M src/osmo-msc/msc_main.c M src/utils/meas_db.c M src/utils/meas_json.c M src/utils/meas_pcap2db.c M src/utils/meas_udp2db.c M src/utils/meas_vis.c M src/utils/smpp_mirror.c M tests/db/db_test.c M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp/smpp_test.c M tests/sms_queue/sms_queue_test.c 137 files changed, 349 insertions(+), 345 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 8d646d3..dd61e52 100644 --- a/configure.ac +++ b/configure.ac @@ -204,8 +204,9 @@ AC_OUTPUT( osmo-msc.pc - include/openbsc/Makefile include/Makefile + include/osmocom/Makefile + include/osmocom/msc/Makefile src/Makefile src/libmsc/Makefile src/libvlr/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 677eec3..9d963a0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,3 +1,3 @@ SUBDIRS = \ - openbsc \ + osmocom \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..4d80637 --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + msc \ + $(NULL) diff --git a/include/openbsc/Makefile.am b/include/osmocom/msc/Makefile.am similarity index 100% rename from include/openbsc/Makefile.am rename to include/osmocom/msc/Makefile.am diff --git a/include/openbsc/a_iface.h b/include/osmocom/msc/a_iface.h similarity index 98% rename from include/openbsc/a_iface.h rename to include/osmocom/msc/a_iface.h index 149f1c7..a49ede2 100644 --- a/include/openbsc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -20,7 +20,7 @@ #pragma once -#include +#include /* A struct to keep a context information about the BSCs we are associated with */ struct bsc_context { diff --git a/include/openbsc/a_iface_bssap.h b/include/osmocom/msc/a_iface_bssap.h similarity index 100% rename from include/openbsc/a_iface_bssap.h rename to include/osmocom/msc/a_iface_bssap.h diff --git a/include/openbsc/a_reset.h b/include/osmocom/msc/a_reset.h similarity index 100% rename from include/openbsc/a_reset.h rename to include/osmocom/msc/a_reset.h diff --git a/include/openbsc/abis_nm.h b/include/osmocom/msc/abis_nm.h similarity index 99% rename from include/openbsc/abis_nm.h rename to include/osmocom/msc/abis_nm.h index db2a659..2581962 100644 --- a/include/openbsc/abis_nm.h +++ b/include/osmocom/msc/abis_nm.h @@ -26,7 +26,7 @@ #include #include -#include +#include /* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ #define MAX_BTS_ATTR 5 diff --git a/include/openbsc/abis_om2000.h b/include/osmocom/msc/abis_om2000.h similarity index 100% rename from include/openbsc/abis_om2000.h rename to include/osmocom/msc/abis_om2000.h diff --git a/include/openbsc/abis_rsl.h b/include/osmocom/msc/abis_rsl.h similarity index 100% rename from include/openbsc/abis_rsl.h rename to include/osmocom/msc/abis_rsl.h diff --git a/include/openbsc/arfcn_range_encode.h b/include/osmocom/msc/arfcn_range_encode.h similarity index 100% rename from include/openbsc/arfcn_range_encode.h rename to include/osmocom/msc/arfcn_range_encode.h diff --git a/include/openbsc/auth.h b/include/osmocom/msc/auth.h similarity index 100% rename from include/openbsc/auth.h rename to include/osmocom/msc/auth.h diff --git a/include/openbsc/bsc_api.h b/include/osmocom/msc/bsc_api.h similarity index 100% rename from include/openbsc/bsc_api.h rename to include/osmocom/msc/bsc_api.h diff --git a/include/openbsc/bsc_msc.h b/include/osmocom/msc/bsc_msc.h similarity index 98% rename from include/openbsc/bsc_msc.h rename to include/osmocom/msc/bsc_msc.h index 380eb17..d649f76 100644 --- a/include/openbsc/bsc_msc.h +++ b/include/osmocom/msc/bsc_msc.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/include/openbsc/bsc_msc_data.h b/include/osmocom/msc/bsc_msc_data.h similarity index 100% rename from include/openbsc/bsc_msc_data.h rename to include/osmocom/msc/bsc_msc_data.h diff --git a/include/openbsc/bsc_msg_filter.h b/include/osmocom/msc/bsc_msg_filter.h similarity index 100% rename from include/openbsc/bsc_msg_filter.h rename to include/osmocom/msc/bsc_msg_filter.h diff --git a/include/openbsc/bsc_rll.h b/include/osmocom/msc/bsc_rll.h similarity index 92% rename from include/openbsc/bsc_rll.h rename to include/osmocom/msc/bsc_rll.h index 729ba60..93c80e7 100644 --- a/include/openbsc/bsc_rll.h +++ b/include/osmocom/msc/bsc_rll.h @@ -1,7 +1,7 @@ #ifndef _BSC_RLL_H #define _BSC_RLL_H -#include +#include enum bsc_rllr_ind { BSC_RLLR_IND_EST_CONF, diff --git a/include/openbsc/bss.h b/include/osmocom/msc/bss.h similarity index 93% rename from include/openbsc/bss.h rename to include/osmocom/msc/bss.h index 9f16bf7..0904334 100644 --- a/include/openbsc/bss.h +++ b/include/osmocom/msc/bss.h @@ -1,7 +1,7 @@ #ifndef _BSS_H_ #define _BSS_H_ -#include +#include struct msgb; diff --git a/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h similarity index 100% rename from include/openbsc/bts_ipaccess_nanobts_omlattr.h rename to include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h diff --git a/include/openbsc/chan_alloc.h b/include/osmocom/msc/chan_alloc.h similarity index 100% rename from include/openbsc/chan_alloc.h rename to include/osmocom/msc/chan_alloc.h diff --git a/include/openbsc/common.h b/include/osmocom/msc/common.h similarity index 100% rename from include/openbsc/common.h rename to include/osmocom/msc/common.h diff --git a/include/openbsc/common_bsc.h b/include/osmocom/msc/common_bsc.h similarity index 83% rename from include/openbsc/common_bsc.h rename to include/osmocom/msc/common_bsc.h index 7960383..821298c 100644 --- a/include/openbsc/common_bsc.h +++ b/include/osmocom/msc/common_bsc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, diff --git a/include/openbsc/common_cs.h b/include/osmocom/msc/common_cs.h similarity index 100% rename from include/openbsc/common_cs.h rename to include/osmocom/msc/common_cs.h diff --git a/include/openbsc/crc24.h b/include/osmocom/msc/crc24.h similarity index 100% rename from include/openbsc/crc24.h rename to include/osmocom/msc/crc24.h diff --git a/include/openbsc/ctrl.h b/include/osmocom/msc/ctrl.h similarity index 100% rename from include/openbsc/ctrl.h rename to include/osmocom/msc/ctrl.h diff --git a/include/openbsc/db.h b/include/osmocom/msc/db.h similarity index 100% rename from include/openbsc/db.h rename to include/osmocom/msc/db.h diff --git a/include/openbsc/debug.h b/include/osmocom/msc/debug.h similarity index 100% rename from include/openbsc/debug.h rename to include/osmocom/msc/debug.h diff --git a/include/openbsc/e1_config.h b/include/osmocom/msc/e1_config.h similarity index 83% rename from include/openbsc/e1_config.h rename to include/osmocom/msc/e1_config.h index 538c0b0..ac5fbb1 100644 --- a/include/openbsc/e1_config.h +++ b/include/osmocom/msc/e1_config.h @@ -1,7 +1,7 @@ #ifndef _E1_CONFIG_H #define _E1_CONFIG_H -#include +#include int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); int e1_reconfig_trx(struct gsm_bts_trx *trx); diff --git a/include/openbsc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h similarity index 98% rename from include/openbsc/gsm_04_08.h rename to include/osmocom/msc/gsm_04_08.h index ca251b0..c99fc86 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -5,7 +5,7 @@ #include #include -#include +#include struct msgb; struct gsm_bts; diff --git a/include/openbsc/gsm_04_11.h b/include/osmocom/msc/gsm_04_11.h similarity index 100% rename from include/openbsc/gsm_04_11.h rename to include/osmocom/msc/gsm_04_11.h diff --git a/include/openbsc/gsm_04_14.h b/include/osmocom/msc/gsm_04_14.h similarity index 100% rename from include/openbsc/gsm_04_14.h rename to include/osmocom/msc/gsm_04_14.h diff --git a/include/openbsc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h similarity index 100% rename from include/openbsc/gsm_04_80.h rename to include/osmocom/msc/gsm_04_80.h diff --git a/include/openbsc/gsm_data.h b/include/osmocom/msc/gsm_data.h similarity index 99% rename from include/openbsc/gsm_data.h rename to include/osmocom/msc/gsm_data.h index 88a4f10..9343c31 100644 --- a/include/openbsc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -14,9 +14,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/include/openbsc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h similarity index 99% rename from include/openbsc/gsm_data_shared.h rename to include/osmocom/msc/gsm_data_shared.h index bed46d2..5028a26 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -24,7 +24,7 @@ #include #endif -#include +#include /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ diff --git a/include/openbsc/gsm_subscriber.h b/include/osmocom/msc/gsm_subscriber.h similarity index 97% rename from include/openbsc/gsm_subscriber.h rename to include/osmocom/msc/gsm_subscriber.h index d88e32a..6b0e3da 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/osmocom/msc/gsm_subscriber.h @@ -6,7 +6,7 @@ #include #include -#include +#include #define GSM_NAME_LENGTH 160 diff --git a/include/openbsc/gsup_client.h b/include/osmocom/msc/gsup_client.h similarity index 97% rename from include/openbsc/gsup_client.h rename to include/osmocom/msc/gsup_client.h index 4a25490..3d1dce0 100644 --- a/include/openbsc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 diff --git a/include/openbsc/gtphub.h b/include/osmocom/msc/gtphub.h similarity index 99% rename from include/openbsc/gtphub.h rename to include/osmocom/msc/gtphub.h index 9cb7605..d7b6f1b 100644 --- a/include/openbsc/gtphub.h +++ b/include/osmocom/msc/gtphub.h @@ -28,7 +28,7 @@ #include #include -#include +#include /* support */ diff --git a/include/openbsc/handover.h b/include/osmocom/msc/handover.h similarity index 100% rename from include/openbsc/handover.h rename to include/osmocom/msc/handover.h diff --git a/include/openbsc/handover_decision.h b/include/osmocom/msc/handover_decision.h similarity index 100% rename from include/openbsc/handover_decision.h rename to include/osmocom/msc/handover_decision.h diff --git a/include/openbsc/ipaccess.h b/include/osmocom/msc/ipaccess.h similarity index 100% rename from include/openbsc/ipaccess.h rename to include/osmocom/msc/ipaccess.h diff --git a/include/openbsc/iu_dummy.h b/include/osmocom/msc/iu_dummy.h similarity index 100% rename from include/openbsc/iu_dummy.h rename to include/osmocom/msc/iu_dummy.h diff --git a/include/openbsc/iucs.h b/include/osmocom/msc/iucs.h similarity index 100% rename from include/openbsc/iucs.h rename to include/osmocom/msc/iucs.h diff --git a/include/openbsc/iucs_ranap.h b/include/osmocom/msc/iucs_ranap.h similarity index 100% rename from include/openbsc/iucs_ranap.h rename to include/osmocom/msc/iucs_ranap.h diff --git a/include/openbsc/meas_feed.h b/include/osmocom/msc/meas_feed.h similarity index 95% rename from include/openbsc/meas_feed.h rename to include/osmocom/msc/meas_feed.h index f77ee07..02b7d95 100644 --- a/include/openbsc/meas_feed.h +++ b/include/osmocom/msc/meas_feed.h @@ -3,7 +3,7 @@ #include -#include +#include struct meas_feed_hdr { uint8_t msg_type; diff --git a/include/openbsc/meas_rep.h b/include/osmocom/msc/meas_rep.h similarity index 100% rename from include/openbsc/meas_rep.h rename to include/osmocom/msc/meas_rep.h diff --git a/include/openbsc/misdn.h b/include/osmocom/msc/misdn.h similarity index 100% rename from include/openbsc/misdn.h rename to include/osmocom/msc/misdn.h diff --git a/include/openbsc/mncc.h b/include/osmocom/msc/mncc.h similarity index 100% rename from include/openbsc/mncc.h rename to include/osmocom/msc/mncc.h diff --git a/include/openbsc/mncc_int.h b/include/osmocom/msc/mncc_int.h similarity index 100% rename from include/openbsc/mncc_int.h rename to include/osmocom/msc/mncc_int.h diff --git a/include/openbsc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h similarity index 97% rename from include/openbsc/msc_ifaces.h rename to include/osmocom/msc/msc_ifaces.h index a1071ae..d46dfe9 100644 --- a/include/openbsc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/openbsc/network_listen.h b/include/osmocom/msc/network_listen.h similarity index 92% rename from include/openbsc/network_listen.h rename to include/osmocom/msc/network_listen.h index 67d1f4e..05fbb2f 100644 --- a/include/openbsc/network_listen.h +++ b/include/osmocom/msc/network_listen.h @@ -2,7 +2,7 @@ #define _OPENBSC_NWL_H #include -#include +#include void ipac_nwl_init(void); diff --git a/include/openbsc/oap_client.h b/include/osmocom/msc/oap_client.h similarity index 100% rename from include/openbsc/oap_client.h rename to include/osmocom/msc/oap_client.h diff --git a/include/openbsc/openbscdefines.h b/include/osmocom/msc/openbscdefines.h similarity index 100% rename from include/openbsc/openbscdefines.h rename to include/osmocom/msc/openbscdefines.h diff --git a/include/openbsc/osmo_bsc.h b/include/osmocom/msc/osmo_bsc.h similarity index 100% rename from include/openbsc/osmo_bsc.h rename to include/osmocom/msc/osmo_bsc.h diff --git a/include/openbsc/osmo_bsc_grace.h b/include/osmocom/msc/osmo_bsc_grace.h similarity index 94% rename from include/openbsc/osmo_bsc_grace.h rename to include/osmocom/msc/osmo_bsc_grace.h index 5a81cd1..6232ffd 100644 --- a/include/openbsc/osmo_bsc_grace.h +++ b/include/osmocom/msc/osmo_bsc_grace.h @@ -21,8 +21,8 @@ #ifndef OSMO_BSC_GRACE_H #define OSMO_BSC_GRACE_H -#include -#include +#include +#include struct bsc_msc_data; diff --git a/include/openbsc/osmo_bsc_reset.h b/include/osmocom/msc/osmo_bsc_reset.h similarity index 100% rename from include/openbsc/osmo_bsc_reset.h rename to include/osmocom/msc/osmo_bsc_reset.h diff --git a/include/openbsc/osmo_bsc_rf.h b/include/osmocom/msc/osmo_bsc_rf.h similarity index 97% rename from include/openbsc/osmo_bsc_rf.h rename to include/osmocom/msc/osmo_bsc_rf.h index 19ccd08..a81ebd7 100644 --- a/include/openbsc/osmo_bsc_rf.h +++ b/include/osmocom/msc/osmo_bsc_rf.h @@ -1,7 +1,7 @@ #ifndef OSMO_BSC_RF #define OSMO_BSC_RF -#include +#include #include #include diff --git a/include/openbsc/osmo_bsc_sigtran.h b/include/osmocom/msc/osmo_bsc_sigtran.h similarity index 95% rename from include/openbsc/osmo_bsc_sigtran.h rename to include/osmocom/msc/osmo_bsc_sigtran.h index fbcfcb3..7015edb 100644 --- a/include/openbsc/osmo_bsc_sigtran.h +++ b/include/osmocom/msc/osmo_bsc_sigtran.h @@ -20,8 +20,8 @@ #pragma once -#include -#include +#include +#include /* Allocate resources to make a new connection oriented sigtran connection * (not the connection ittself!) */ diff --git a/include/openbsc/osmo_msc.h b/include/osmocom/msc/osmo_msc.h similarity index 98% rename from include/openbsc/osmo_msc.h rename to include/osmocom/msc/osmo_msc.h index cdfd27f..5f4713e 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/osmocom/msc/osmo_msc.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "bsc_api.h" diff --git a/include/openbsc/osmux.h b/include/osmocom/msc/osmux.h similarity index 100% rename from include/openbsc/osmux.h rename to include/osmocom/msc/osmux.h diff --git a/include/openbsc/paging.h b/include/osmocom/msc/paging.h similarity index 98% rename from include/openbsc/paging.h rename to include/osmocom/msc/paging.h index 049da14..b856dcd 100644 --- a/include/openbsc/paging.h +++ b/include/osmocom/msc/paging.h @@ -26,7 +26,7 @@ #include #include -#include +#include /** * A pending paging request diff --git a/include/openbsc/rest_octets.h b/include/osmocom/msc/rest_octets.h similarity index 98% rename from include/openbsc/rest_octets.h rename to include/osmocom/msc/rest_octets.h index 49a2312..49857b7 100644 --- a/include/openbsc/rest_octets.h +++ b/include/osmocom/msc/rest_octets.h @@ -2,7 +2,7 @@ #define _REST_OCTETS_H #include -#include +#include #include /* generate SI1 rest octets */ diff --git a/include/openbsc/rrlp.h b/include/osmocom/msc/rrlp.h similarity index 100% rename from include/openbsc/rrlp.h rename to include/osmocom/msc/rrlp.h diff --git a/include/openbsc/rs232.h b/include/osmocom/msc/rs232.h similarity index 100% rename from include/openbsc/rs232.h rename to include/osmocom/msc/rs232.h diff --git a/include/openbsc/rtp_proxy.h b/include/osmocom/msc/rtp_proxy.h similarity index 98% rename from include/openbsc/rtp_proxy.h rename to include/osmocom/msc/rtp_proxy.h index 52ffefd..3cd8cac 100644 --- a/include/openbsc/rtp_proxy.h +++ b/include/osmocom/msc/rtp_proxy.h @@ -27,7 +27,7 @@ #include #include -#include +#include #define RTP_PT_GSM_FULL 3 #define RTP_PT_GSM_HALF 96 diff --git a/include/openbsc/signal.h b/include/osmocom/msc/signal.h similarity index 99% rename from include/openbsc/signal.h rename to include/osmocom/msc/signal.h index 49f86d6..14c76f8 100644 --- a/include/openbsc/signal.h +++ b/include/osmocom/msc/signal.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include diff --git a/include/openbsc/silent_call.h b/include/osmocom/msc/silent_call.h similarity index 100% rename from include/openbsc/silent_call.h rename to include/osmocom/msc/silent_call.h diff --git a/include/openbsc/slhc.h b/include/osmocom/msc/slhc.h similarity index 100% rename from include/openbsc/slhc.h rename to include/osmocom/msc/slhc.h diff --git a/include/openbsc/smpp.h b/include/osmocom/msc/smpp.h similarity index 100% rename from include/openbsc/smpp.h rename to include/osmocom/msc/smpp.h diff --git a/include/openbsc/sms_queue.h b/include/osmocom/msc/sms_queue.h similarity index 100% rename from include/openbsc/sms_queue.h rename to include/osmocom/msc/sms_queue.h diff --git a/include/openbsc/socket.h b/include/osmocom/msc/socket.h similarity index 100% rename from include/openbsc/socket.h rename to include/osmocom/msc/socket.h diff --git a/include/openbsc/system_information.h b/include/osmocom/msc/system_information.h similarity index 94% rename from include/openbsc/system_information.h rename to include/osmocom/msc/system_information.h index 71bea26..854b7e3 100644 --- a/include/openbsc/system_information.h +++ b/include/osmocom/msc/system_information.h @@ -3,7 +3,7 @@ #include -#include +#include struct gsm_bts; diff --git a/include/openbsc/transaction.h b/include/osmocom/msc/transaction.h similarity index 94% rename from include/openbsc/transaction.h rename to include/osmocom/msc/transaction.h index 4930fbd..272fb3b 100644 --- a/include/openbsc/transaction.h +++ b/include/osmocom/msc/transaction.h @@ -1,11 +1,11 @@ #ifndef _TRANSACT_H #define _TRANSACT_H -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include diff --git a/include/openbsc/trau_mux.h b/include/osmocom/msc/trau_mux.h similarity index 97% rename from include/openbsc/trau_mux.h rename to include/osmocom/msc/trau_mux.h index 75c359b..08863bf 100644 --- a/include/openbsc/trau_mux.h +++ b/include/osmocom/msc/trau_mux.h @@ -29,8 +29,8 @@ */ #include -#include -#include +#include +#include struct decoded_trau_frame; diff --git a/include/openbsc/trau_upqueue.h b/include/osmocom/msc/trau_upqueue.h similarity index 100% rename from include/openbsc/trau_upqueue.h rename to include/osmocom/msc/trau_upqueue.h diff --git a/include/openbsc/ussd.h b/include/osmocom/msc/ussd.h similarity index 100% rename from include/openbsc/ussd.h rename to include/osmocom/msc/ussd.h diff --git a/include/openbsc/vlr.h b/include/osmocom/msc/vlr.h similarity index 99% rename from include/openbsc/vlr.h rename to include/osmocom/msc/vlr.h index 619971a..e9afde3 100644 --- a/include/openbsc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -7,9 +7,9 @@ #include #include #include -#include +#include // for GSM_NAME_LENGTH -#include +#include struct log_target; diff --git a/include/openbsc/vty.h b/include/osmocom/msc/vty.h similarity index 100% rename from include/openbsc/vty.h rename to include/osmocom/msc/vty.h diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index c0294c7..9a226ac 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -25,9 +25,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index d6dff95..8a28b72 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -24,11 +24,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 1791687..cdefa09 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -25,10 +25,10 @@ #include #include -#include +#include -#include -#include +#include +#include struct cmd_node net_node = { GSMNET_NODE, diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 7157e00..6037dda 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -23,10 +23,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 7236413..612e215 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include /* default categories */ static const struct log_info_cat default_categories[] = { diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7be2240..f4f6e5d 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 2696273..9382889 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -32,7 +32,7 @@ #include #include -#include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index 018ed21..58a6ff0 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include LLIST_HEAD(active_subscribers); void *tall_subscr_ctx; diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index fd65e7b..b5f2e68 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -21,14 +21,14 @@ * */ -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index b6a8d6b..5576292 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include static struct gsup_client *g_gc; diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c index 5128ac1..39055ab 100644 --- a/src/libcommon/oap_client.c +++ b/src/libcommon/oap_client.c @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include int oap_client_init(struct oap_client_config *config, struct oap_client_state *state) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c index 2a64767..2793bcf 100644 --- a/src/libcommon/socket.c +++ b/src/libcommon/socket.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include int make_sock(struct osmo_fd *bfd, int proto, diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index e473b75..7a6000a 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -29,16 +29,16 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include /* A pointer to the GSM network we work with. By the current paradigm, * there can only be one gsm_network per MSC. The pointer is set once diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index e8a2293..1cd6723 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -25,13 +25,13 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #define IP_V4_ADDR_LEN 4 diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c index 9064ce6..7b5367b 100644 --- a/src/libmsc/auth.c +++ b/src/libmsc/auth.c @@ -20,10 +20,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index 9d1f0d4..7e445aa 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -21,11 +21,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/src/libmsc/db.c b/src/libmsc/db.c index ae7e287..4e4477b 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -29,12 +29,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 90a0431..2ef0b30 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -35,33 +35,33 @@ #include "bscconfig.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #include #include @@ -76,8 +76,8 @@ #include #endif -#include -#include +#include +#include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 574fe28..99adbf7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -43,21 +43,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef BUILD_SMPP #include "smpp_smsc.h" diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c index b529f4c..5f49574 100644 --- a/src/libmsc/gsm_04_14.c +++ b/src/libmsc/gsm_04_14.c @@ -26,12 +26,12 @@ #include "bscconfig.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index bec1d26..37e058c 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 09540c1..8bc060f 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -37,20 +37,20 @@ #ifdef BUILD_IU #include #else -#include +#include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param) diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index e9d335e..4191c5a 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,7 +26,7 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include +#include #include #include diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index 04b9ece..c89e412 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -26,12 +26,12 @@ #include #include -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index 45de1ca..abf1812 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -29,13 +29,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include /* To continue authorization after a Security Mode Complete */ int gsm0408_authorize(struct gsm_subscriber_connection *conn); diff --git a/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c index 1e7b4cd..3daebee 100644 --- a/src/libmsc/meas_feed.c +++ b/src/libmsc/meas_feed.c @@ -13,12 +13,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "meas_feed.h" diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 8110ead..4e88bc6 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -29,12 +29,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static const struct value_string mncc_names[] = { diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index ac6e734..84623df 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -27,14 +27,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include void *tall_call_ctx; diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 0c696f2..05c9439 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -35,9 +35,9 @@ #include #include -#include -#include -#include +#include +#include +#include struct mncc_sock_state { struct gsm_network *net; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 161a100..b191e0d 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -20,15 +20,15 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #include "../../bscconfig.h" @@ -39,7 +39,7 @@ uint16_t rtp_port, bool use_x213_nsap); #else -#include +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 50679aa..2f0f056 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -32,10 +32,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include static struct cmd_node msc_node = { MSC_NODE, diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 4d24f22..db24757 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -21,22 +21,22 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include #include "../../bscconfig.h" #ifdef BUILD_IU #include #else -#include +#include #endif /* Receive a SAPI-N-REJECT from BSC */ diff --git a/src/libmsc/rrlp.c b/src/libmsc/rrlp.c index cd3da06..7428893 100644 --- a/src/libmsc/rrlp.c +++ b/src/libmsc/rrlp.c @@ -21,10 +21,10 @@ -#include -#include -#include -#include +#include +#include +#include +#include /* RRLP msPositionReq, nsBased, * Accuracy=60, Method=gps, ResponseTime=2, oneSet */ diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index 7af7a80..5b19700 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -25,14 +25,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /* paging of the requested subscriber has completed */ static int paging_cb_silent(unsigned int hooknum, unsigned int event, diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 431cb4d..3ea5ddd 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -36,16 +36,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "smpp_smsc.h" diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 04afc49..88cecfc 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -41,8 +41,8 @@ #include "smpp_smsc.h" -#include -#include +#include +#include /*! \brief Ugly wrapper. libsmpp34 should do this itself! */ #define SMPP34_UNPACK(rc, type, str, data, len) \ diff --git a/src/libmsc/smpp_utils.c b/src/libmsc/smpp_utils.c index d0850d8..7208e25 100644 --- a/src/libmsc/smpp_utils.c +++ b/src/libmsc/smpp_utils.c @@ -19,7 +19,7 @@ #include "smpp_smsc.h" -#include +#include int smpp_determine_scheme(uint8_t dcs, uint8_t *data_coding, int *mode) diff --git a/src/libmsc/smpp_vty.c b/src/libmsc/smpp_vty.c index 13467f1..c0309d6 100644 --- a/src/libmsc/smpp_vty.c +++ b/src/libmsc/smpp_vty.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include "smpp_smsc.h" diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index fe7a608..609a0db 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -30,15 +30,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index bcab8e4..336637c 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -25,12 +25,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 28e0914..bac31a1 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -18,16 +18,16 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include void *tall_trans_ctx; diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index 81a3566..e3263d2 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -29,11 +29,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index b4c9450..484e9d5 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -31,30 +31,30 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include "meas_feed.h" diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a5ea0f6..a9aacbd 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -25,10 +25,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index f9ed0b5..9d9e4c1 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c index 0eb86e7..1c9e191 100644 --- a/src/libvlr/vlr_auth_fsm.c +++ b/src/libvlr/vlr_auth_fsm.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h index 0e63c7e..6ca54e8 100644 --- a/src/libvlr/vlr_core.h +++ b/src/libvlr/vlr_core.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #define LOGGSUPP(level, gsup, fmt, args...) \ LOGP(DVLR, level, "GSUP(%s) " fmt, \ diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index 94bea56..c9223f8 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 30b11d9..41dfedb 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -37,32 +37,32 @@ /* build switches from the configure script */ #include "../../bscconfig.h" -#include +#include #include #include #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -70,10 +70,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include static const char * const osmomsc_copyright = "OsmoMSC - Osmocom Circuit-Switched Core Network implementation\r\n" diff --git a/src/utils/meas_db.c b/src/utils/meas_db.c index d81efca..8cf27df 100644 --- a/src/utils/meas_db.c +++ b/src/utils/meas_db.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_json.c b/src/utils/meas_json.c index 51eb6c7..8db7791 100644 --- a/src/utils/meas_json.c +++ b/src/utils/meas_json.c @@ -37,9 +37,9 @@ #include -#include -#include -#include +#include +#include +#include static void print_meas_rep_uni_json(struct gsm_meas_rep_unidir *mru) { diff --git a/src/utils/meas_pcap2db.c b/src/utils/meas_pcap2db.c index b874ac4..0644521 100644 --- a/src/utils/meas_pcap2db.c +++ b/src/utils/meas_pcap2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include diff --git a/src/utils/meas_udp2db.c b/src/utils/meas_udp2db.c index 5032d0c..c2b5ace 100644 --- a/src/utils/meas_udp2db.c +++ b/src/utils/meas_udp2db.c @@ -36,7 +36,7 @@ #include -#include +#include #include "meas_db.h" diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 77194de..5efb300 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -16,7 +16,7 @@ #include -#include +#include struct ms_state_uni { CDKSLIDER *cdk; diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index c570505..248396a 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -18,7 +18,7 @@ #include #include -#include +#include /* FIXME: merge with smpp_smsc.c */ #define SMPP_SYS_ID_LEN 16 diff --git a/tests/db/db_test.c b/tests/db/db_test.c index a0c1e79..63099f6 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -18,11 +18,11 @@ * */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 4b10e49..d05aa29 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -30,15 +30,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include #if BUILD_IU -#include +#include #include #else -#include +#include #endif #include "msc_vlr_tests.h" diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h index c2c5a58..1cd3914 100644 --- a/tests/msc_vlr/msc_vlr_tests.h +++ b/tests/msc_vlr/msc_vlr_tests.h @@ -26,9 +26,9 @@ #include #include -#include -#include -#include +#include +#include +#include extern bool _log_lines; #define _log(fmt, args...) do { \ diff --git a/tests/smpp/smpp_test.c b/tests/smpp/smpp_test.c index 62fa9d2..5f5f2d6 100644 --- a/tests/smpp/smpp_test.c +++ b/tests/smpp/smpp_test.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c index af25b06..0d073db 100644 --- a/tests/sms_queue/sms_queue_test.c +++ b/tests/sms_queue/sms_queue_test.c @@ -23,8 +23,8 @@ #include -#include -#include +#include +#include static void *talloc_ctx = NULL; -- To view, visit https://gerrit.osmocom.org/3811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 6 23:02:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 6 Sep 2017 23:02:19 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGGSN: Add VTY reference manual Message-ID: Review at https://gerrit.osmocom.org/3879 OsmoGGSN: Add VTY reference manual Change-Id: Iddf6fe26689172d7db001198943c816eaaed7931 --- M OsmoGGSN/Makefile A OsmoGGSN/osmoggsn-vty-reference.xml A OsmoGGSN/vty/ggsn_vty_additions.xml 3 files changed, 95 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/79/3879/1 diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index daf3597..2dfedb2 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,6 +1,18 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals +EXTRA_DEPS = gen-ggsn-vty-docbook + +topdir = . +ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml +manuals = $(ggsn_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + TOPDIR := .. ASCIIDOCS := osmoggsn-usermanual @@ -10,4 +22,18 @@ osmoggsn-usermanual.pdf: chapters/*.adoc clean: - rm -rf $(cleanfiles) + -rm -rf $(cleanfiles) + -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png + -rm osmoggsn-usermanual.check + +gen-ggsn-vty-docbook: FORCE + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging GGSN VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting GGSN VTY to DocBook) diff --git a/OsmoGGSN/osmoggsn-vty-reference.xml b/OsmoGGSN/osmoggsn-vty-reference.xml new file mode 100644 index 0000000..44e7bfc --- /dev/null +++ b/OsmoGGSN/osmoggsn-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 06th September 2017 + hw + Initial version as of OsmoGGSN v1.0.0 + + + + OsmoGGSN VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoGGSN/vty/ggsn_vty_additions.xml b/OsmoGGSN/vty/ggsn_vty_additions.xml new file mode 100644 index 0000000..1bbeb81 --- /dev/null +++ b/OsmoGGSN/vty/ggsn_vty_additions.xml @@ -0,0 +1,30 @@ + + + + Telnet/VTY Configuration Node + + Configure parameters of the Telnet/VTY Interface, such as to which IP address it should bind/listen to. + + + + + CTRL Configuration Node + + Configure parameters of the CTRL Interface, such as to which IP address it should bind/listen to. + + + + + GGSN Instance Configuration Node + + Configure an Instance of a (virtual) GGSN + + + + + APN Configuration Node + + Configure an Access Point Name (APN) inside a GGSN Instance + + + -- To view, visit https://gerrit.osmocom.org/3879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddf6fe26689172d7db001198943c816eaaed7931 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Sep 7 01:10:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 01:10:54 +0000 Subject: [PATCH] osmo-msc[master]: doc/examples: add detailed cs7 config examples In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3827 to look at the new patch set (#2). doc/examples: add detailed cs7 config examples Change-Id: I4da6724cd4348e92dfd06516f82af06c97277ef9 --- A doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg A doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg M osmoappdesc.py 3 files changed, 60 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/27/3827/2 diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg new file mode 100644 index 0000000..3de478a --- /dev/null +++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg @@ -0,0 +1,27 @@ +! +! OsmoMSC configuration saved from vty +! +line vty + no login +! +network + network country code 1 + mobile network code 1 + short name OsmoMSC + long name OsmoMSC + auth policy closed + location updating reject cause 13 + encryption a5 0 + rrlp mode none + mm info 1 +cs7 instance 0 + point-code 0.23.1 + asp asp-clnt-OsmoMSC-A-Iu 2905 0 m3ua + ! where to reach the STP: + remote-ip 10.23.24.1 +! local-ip 10.23.24.1 +msc + cs7-instance-a 0 + cs7-instance-iu 0 + mgcpgw remote-ip 10.23.24.1 + assign-tmsi diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg new file mode 100644 index 0000000..3c38445 --- /dev/null +++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg @@ -0,0 +1,29 @@ +! +! OsmoMSC configuration saved from vty +! +line vty + no login +! +network + network country code 1 + mobile network code 1 + short name OsmoMSC + long name OsmoMSC + auth policy closed + location updating reject cause 13 + encryption a5 0 + rrlp mode none + mm info 1 +cs7 instance 0 + point-code 0.23.1 + asp asp-clnt-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.24.1 +cs7 instance 1 + point-code 0.23.2 + asp asp-clnt-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.24.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 + mgcpgw remote-ip 10.23.24.1 + assign-tmsi diff --git a/osmoappdesc.py b/osmoappdesc.py index be97a71..886c682 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -15,7 +15,10 @@ # along with this program. If not, see app_configs = { - "msc": ["doc/examples/osmo-msc/osmo-msc.cfg"], + "msc": ["doc/examples/osmo-msc/osmo-msc.cfg", + "doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg", + "doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg", + ], } apps = [(4254, "src/osmo-msc/osmo-msc", "OsmoMSC", "msc"), -- To view, visit https://gerrit.osmocom.org/3827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4da6724cd4348e92dfd06516f82af06c97277ef9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 7 04:09:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 04:09:50 +0000 Subject: [PATCH] libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup Message-ID: Review at https://gerrit.osmocom.org/3880 VTY: implicit node exit by de-indenting, not parent lookup Note: This will break users' config files if they do not use exactly one space of indenting per vty child node level. When reading VTY commands from a file, use indenting as means to implicitly exit child nodes. Do not look for commands in the parent node implicitly. The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the current node, but succeeds on the parent node. That is the mechanism by which our VTY config files do not need 'exit' at the end of each child node. We've hit problems with this in the following scenarios, which will show improved user experience after this patch: *) When both a parent and its child node have commands with identical names: cs7 instace 0 point-code 1.2.3 sccp-address osmo-msc point-code 0.0.1 If I put the parent's command below the child, it is still interpreted in the context of the child node: cs7 instace 0 sccp-address osmo-msc point-code 0.0.1 point-code 1.2.3 Though the indenting lets me assume I am setting the cs7 instance's global PC to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the 0.0.1. *) When a software change moves a VTY command from a child to a parent. Say 'timezone' moved from 'bts' to 'network' level: network timezone 1 2 Say a user still has an old config file with 'timezone' on the child level: network bts 0 timezone 1 2 trx 0 The user would expect an error message that 'timezone' is invalid on the 'bts' level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts' to the 'network' level, and instead says that the 'trx' command does not exist. Implementation: Track node depth: whenever a command enters a child node, we increase the depth counter. If the amount of spaces that indent a following VTY command are less than this expected depth, call vty_go_parent() until it matches up. Transitions to child node are spread across VTY implementations and are hard to change. But transitions to the parent node are all handled by vty_go_parent(). By decreasing a depth counter in vty_go_parent(), we can also detect that a command has changed the node without decreasing the depth, hence it must have stepped into a child node, and we can increase the depth. The behavior on the interactive telnet VTY remains unchanged. Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 --- M include/osmocom/vty/command.h M include/osmocom/vty/vty.h M src/vty/command.c M src/vty/vty.c M tests/Makefile.am M tests/testsuite.at A tests/vty/fail_not_de-indented.cfg A tests/vty/fail_too_much_indent.cfg A tests/vty/ok.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 11 files changed, 125 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/3880/1 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0fa5175..9817d73 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -161,6 +161,8 @@ #define CMD_COMPLETE_MATCH 8 #define CMD_COMPLETE_LIST_MATCH 9 #define CMD_SUCCESS_DAEMON 10 +#define CMD_ERR_INVALID_INDENT 11 +#define CMD_ERR_TOO_MUCH_INDENT 12 /* Argc max counts. */ #define CMD_ARGC_MAX 256 @@ -368,6 +370,7 @@ char *argv_concat(const char **argv, int argc, int shift); vector cmd_make_strvec(const char *); +int cmd_make_strvec2(const char *string, int *indent, vector *strvec_p); void cmd_free_strvec(vector); vector cmd_describe_command(); char **cmd_complete_command(); diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index 544e1fa..448b343 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -134,6 +134,9 @@ /*! In configure mode. */ int config; + + /*! track how deep we descended into child nodes for reading config files */ + int node_depth; }; /* Small macro to determine newline is newline only or linefeed needed. */ diff --git a/src/vty/command.c b/src/vty/command.c index 33862c0..aa5d0d8 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -190,31 +190,52 @@ } } -/*! Breaking up string into each command piece. I assume given - character is separated by a space character. Return value is a - vector which includes char ** data element. */ -vector cmd_make_strvec(const char *string) +/*! Break up string in command tokens. Count leading indents. + * \param[in] string String to split. + * \param[out] indent If not NULL, returns leading indents. + * \param[out] strvec_p Returns vector of split tokens, must not be NULL. + * \returns CMD_SUCCESS or CMD_ERR_INVALID_INDENT + * + * If \a indent is passed non-NULL, only simple space ' ' indents are allowed, + * so that \a indent can simply return the count of leading spaces. + * Otherwise any isspace() characters are allowed for indenting (backwards compat). + */ +int cmd_make_strvec2(const char *string, int *indent, vector *strvec_p) { const char *cp, *start; char *token; int strlen; vector strvec; + *strvec_p = NULL; + if (indent) + *indent = 0; + if (string == NULL) - return NULL; + return CMD_SUCCESS; cp = string; /* Skip white spaces. */ - while (isspace((int)*cp) && *cp != '\0') + while (isspace((int)*cp) && *cp != '\0') { + /* if we're counting indents, we need to be strict about them */ + if (indent && (*cp != ' ')) { + /* indicate position of error */ + *indent = cp - string; + return CMD_ERR_INVALID_INDENT; + } cp++; + } + + if (indent) + *indent = cp - string; /* Return if there is only white spaces */ if (*cp == '\0') - return NULL; + return CMD_SUCCESS; if (*cp == '!' || *cp == '#') - return NULL; + return CMD_SUCCESS; /* Prepare return vector. */ strvec = vector_init(VECTOR_MIN_SIZE); @@ -236,8 +257,21 @@ cp++; if (*cp == '\0') - return strvec; + break; } + + *strvec_p = strvec; + return CMD_SUCCESS; +} + +/*! Breaking up string into each command piece. I assume given + character is separated by a space character. Return value is a + vector which includes char ** data element. */ +vector cmd_make_strvec(const char *string) +{ + vector strvec; + cmd_make_strvec2(string, NULL, &strvec); + return strvec; } /*! Free allocated string vector. */ @@ -1969,24 +2003,34 @@ case VIEW_NODE: case ENABLE_NODE: case CONFIG_NODE: + vty->node_depth = 0; break; case AUTH_ENABLE_NODE: vty->node = VIEW_NODE; + vty->node_depth = 0; break; case CFG_LOG_NODE: case VTY_NODE: vty->node = CONFIG_NODE; + vty->node_depth = 0; break; default: - if (host.app_info->go_parent_cb) + if (host.app_info->go_parent_cb) { host.app_info->go_parent_cb(vty); - else if (is_config_child(vty)) + if (vty->node_depth > 0) + vty->node_depth--; + } + else if (is_config_child(vty)) { vty->node = CONFIG_NODE; - else + vty->node_depth = 0; + } + else { vty->node = VIEW_NODE; + vty->node_depth = 0; + } break; } @@ -2281,29 +2325,43 @@ { int ret; vector vline; + int indent; + int prev_node; + int prev_node_depth; + vty->node_depth = 0; while (fgets(vty->buf, VTY_BUFSIZ, fp)) { - vline = cmd_make_strvec(vty->buf); + ret = cmd_make_strvec2(vty->buf, &indent, &vline); - /* In case of comment line */ + if (ret != CMD_SUCCESS) + return CMD_ERR_INVALID_INDENT; + + /* In case of comment or empty line */ if (vline == NULL) continue; - /* Execute configuration command : this is strict match */ - ret = cmd_execute_command_strict(vline, vty, NULL); - /* Try again with setting node to CONFIG_NODE */ - while (ret != CMD_SUCCESS && ret != CMD_WARNING - && ret != CMD_ERR_NOTHING_TODO - && is_config_child(vty)) { + if (indent > vty->node_depth) + return CMD_ERR_TOO_MUCH_INDENT; + + while (indent < vty->node_depth) vty_go_parent(vty); - ret = cmd_execute_command_strict(vline, vty, NULL); - } + prev_node = vty->node; + prev_node_depth = vty->node_depth; + ret = cmd_execute_command_strict(vline, vty, NULL); cmd_free_strvec(vline); if (ret != CMD_SUCCESS && ret != CMD_WARNING && ret != CMD_ERR_NOTHING_TODO) return ret; + + /* If we have stepped down into a child node, count the indent. + * The causality is such: we don't expect every single node entry implementation to + * increment vty->node_depth. Instead we expect vty_go_parent() do *decrement* the + * node_depth. Hence if the node changed without node_depth decreasing, we must have + * stepped into a child node and now expect a deeper indent. */ + if (vty->node != prev_node && !(vty->node_depth < prev_node_depth)) + vty->node_depth++; } return CMD_SUCCESS; } diff --git a/src/vty/vty.c b/src/vty/vty.c index 113a781..94ce428 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1480,6 +1480,13 @@ case CMD_ERR_NO_MATCH: fprintf(stderr, "There is no such command.\n"); break; + case CMD_ERR_INVALID_INDENT: + fprintf(stderr, "Invalid indentation, only space characters allowed.\n"); + break; + case CMD_ERR_TOO_MUCH_INDENT: + fprintf(stderr, "Too much indentation, number of leading spaces" + " must match the child node depth exactly.\n"); + break; } fprintf(stderr, "Error occurred during reading the below " "line:\n%s\n", vty->buf); diff --git a/tests/Makefile.am b/tests/Makefile.am index 37378fb..8526847 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -217,7 +217,9 @@ logging/logging_test.ok logging/logging_test.err \ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ - vty/vty_test.ok comp128/comp128_test.ok \ + vty/vty_test.ok vty/fail_not_de-indented.cfg \ + vty/fail_too_much_indent.cfg vty/ok.cfg \ + comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/testsuite.at b/tests/testsuite.at index f148cf5..1954e66 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -174,6 +174,7 @@ AT_SETUP([vty]) AT_KEYWORDS([vty]) cat $abs_srcdir/vty/vty_test.ok > expout +cp $abs_srcdir/vty/*.cfg . AT_CHECK([$abs_top_builddir/tests/vty/vty_test], [0], [expout], [ignore]) AT_CLEANUP diff --git a/tests/vty/fail_not_de-indented.cfg b/tests/vty/fail_not_de-indented.cfg new file mode 100644 index 0000000..5af833d --- /dev/null +++ b/tests/vty/fail_not_de-indented.cfg @@ -0,0 +1,3 @@ +line vty + no login + log stderr diff --git a/tests/vty/fail_too_much_indent.cfg b/tests/vty/fail_too_much_indent.cfg new file mode 100644 index 0000000..032af00 --- /dev/null +++ b/tests/vty/fail_too_much_indent.cfg @@ -0,0 +1,3 @@ +line vty + no login +log stderr diff --git a/tests/vty/ok.cfg b/tests/vty/ok.cfg new file mode 100644 index 0000000..d5ef23e --- /dev/null +++ b/tests/vty/ok.cfg @@ -0,0 +1,3 @@ +line vty + no login +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index 1e1b495..e24045c 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -290,6 +291,15 @@ destroy_test_vty(&test, vty); } +void test_exit_by_indent(const char *fname, int expect_rc) +{ + int rc; + printf("reading file %s, expecting rc=%d\n", fname, expect_rc); + rc = vty_read_config_file(fname, NULL); + printf("got rc=%d\n", rc); + OSMO_ASSERT(rc == expect_rc); +} + int main(int argc, char **argv) { struct vty_app_info vty_info = { @@ -324,6 +334,9 @@ test_cmd_string_from_valstr(); test_node_tree_structure(); test_stats_vty(); + test_exit_by_indent("ok.cfg", 0); + test_exit_by_indent("fail_not_de-indented.cfg", -EINVAL); + test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index a9e283d..00b0853 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -110,4 +110,10 @@ Returned: 0, Current node: 4 '%s(config)# ' Going to execute 'no stats reporter statsd' Returned: 0, Current node: 4 '%s(config)# ' +reading file ok.cfg, expecting rc=0 +got rc=0 +reading file fail_not_de-indented.cfg, expecting rc=-22 +got rc=-22 +reading file fail_too_much_indent.cfg, expecting rc=-22 +got rc=-22 All tests passed -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 04:09:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 04:09:50 +0000 Subject: [PATCH] libosmocore[master]: VTY: never look for matching commands on parent node Message-ID: Review at https://gerrit.osmocom.org/3881 VTY: never look for matching commands on parent node For interactive telnet VTY, remove the implicit move up to the parent node when a command did not succeed on the current node level. When reading config files, this behavior was useful to allow skipping explicit 'exit' commands. (A different patch deals with that.) In the telnet VTY, this behavior was never necessary. Explicit 'exit' commands can move to the parent node, and typically uninformed users expect to require that. On a telnet VTY, counting indents like for reading config files is not an option: a user will always type from the first column or may paste some leading spaces without intended meaning. After this patch, it is thus no longer possible to paste a complete config across several node levels directly to a telnet session, unless it contains 'exit' commands. Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 --- M src/vty/command.c M tests/vty/vty_test.c M tests/vty/vty_test.ok 3 files changed, 5 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/3881/1 diff --git a/src/vty/command.c b/src/vty/command.c index aa5d0d8..9161bf5 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2155,12 +2155,10 @@ cmd_execute_command(vector vline, struct vty *vty, struct cmd_element **cmd, int vtysh) { - int ret, saved_ret, tried = 0; + int ret; enum node_type onode; - void *oindex; onode = vty->node; - oindex = vty->index; if (cmd_try_do_shortcut(vty->node, vector_slot(vline, 0))) { vector shifted_vline; @@ -2183,29 +2181,7 @@ return ret; } - saved_ret = ret = cmd_execute_command_real(vline, vty, cmd); - - if (vtysh) - return saved_ret; - - /* Go to parent for config nodes to attempt to find the right command */ - while (ret != CMD_SUCCESS && ret != CMD_WARNING - && is_config_child(vty)) { - vty_go_parent(vty); - ret = cmd_execute_command_real(vline, vty, cmd); - tried = 1; - if (ret == CMD_SUCCESS || ret == CMD_WARNING) { - /* succesfull command, leave the node as is */ - return ret; - } - } - /* no command succeeded, reset the vty to the original node and - return the error for this node */ - if (tried) { - vty->node = onode; - vty->index = oindex; - } - return saved_ret; + return cmd_execute_command_real(vline, vty, cmd); } /* Execute command by argument readline. */ diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index e24045c..63b0b03 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -156,14 +156,12 @@ OSMO_ASSERT(vty->node == ENABLE_NODE); - /* Check searching the parents nodes for matching commands. */ + /* Check for not searching the parent node for matching commands. */ OSMO_ASSERT(do_vty_command(vty, "configure terminal") == CMD_SUCCESS); OSMO_ASSERT(vty->node == CONFIG_NODE); OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS); OSMO_ASSERT(vty->node == CFG_LOG_NODE); - OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_SUCCESS); - OSMO_ASSERT(vty->node == VTY_NODE); - OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_ERR_NO_MATCH); OSMO_ASSERT(vty->node == CFG_LOG_NODE); OSMO_ASSERT(do_vty_command(vty, "end") == CMD_SUCCESS); OSMO_ASSERT(vty->node == ENABLE_NODE); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index 00b0853..0da0c2f 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -36,9 +36,7 @@ Going to execute 'log stderr' Returned: 0, Current node: 7 '%s(config-log)# ' Going to execute 'line vty' -Returned: 0, Current node: 9 '%s(config-line)# ' -Going to execute 'log stderr' -Returned: 0, Current node: 7 '%s(config-log)# ' +Returned: 2, Current node: 7 '%s(config-log)# ' Going to execute 'end' Returned: 0, Current node: 3 '%s# ' Going to execute 'exit' -- To view, visit https://gerrit.osmocom.org/3881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 04:09:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 04:09:51 +0000 Subject: [PATCH] libosmocore[master]: VTY: allow comments in the same line as vty commands Message-ID: Review at https://gerrit.osmocom.org/3882 VTY: allow comments in the same line as vty commands Note: this breaks users' VTY config when a command's argument starts with a '!' or '#'. Allow comments following VTY commands, on the same line. Start a comment with '!' or '#' following a space, which allows using the comment characters in command arguments -- just not at the start of an argument. This patch allows to do: remote-ip 10.23.24.1 # where to reach the STP When they are not preceded by a space, the comment characters still count as VTY command tokens, i.e. still allowing: short-name instance#23 This would parse "instance#23" as name. (We usually use '!' as the VTY comment delimiter, but the code also allowed and still allows using '#', hence add both '#' and '!' as same-line comment delimiter.) Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_comments.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/3882/1 diff --git a/src/vty/command.c b/src/vty/command.c index 9161bf5..f981692 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -242,6 +242,9 @@ /* Copy each command piece and set into vector. */ while (1) { + if (*cp == '!' || *cp == '#') + break; + start = cp; while (!(isspace((int)*cp) || *cp == '\r' || *cp == '\n') && *cp != '\0') diff --git a/tests/Makefile.am b/tests/Makefile.am index 8526847..5a124c1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -218,7 +218,8 @@ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ vty/vty_test.ok vty/fail_not_de-indented.cfg \ - vty/fail_too_much_indent.cfg vty/ok.cfg \ + vty/fail_too_much_indent.cfg vty/ok.cfg \ + vty/ok_comments.cfg \ comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ diff --git a/tests/vty/ok_comments.cfg b/tests/vty/ok_comments.cfg new file mode 100644 index 0000000..c040892 --- /dev/null +++ b/tests/vty/ok_comments.cfg @@ -0,0 +1,3 @@ +line vty ! comments + no login # after +log stderr #commands diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index 63b0b03..a269764 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -335,6 +335,7 @@ test_exit_by_indent("ok.cfg", 0); test_exit_by_indent("fail_not_de-indented.cfg", -EINVAL); test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); + test_exit_by_indent("ok_comments.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index 0da0c2f..85ee337 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -114,4 +114,6 @@ got rc=-22 reading file fail_too_much_indent.cfg, expecting rc=-22 got rc=-22 +reading file ok_comments.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 08:23:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 7 Sep 2017 08:23:37 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 1: I think it deserves wider discussion in ML because it have a chance to break pretty much every Osmocom config file out there. -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 10:23:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 7 Sep 2017 10:23:46 +0000 Subject: [PATCH] osmocom-bb[master]: Add 'git review' config file Message-ID: Review at https://gerrit.osmocom.org/3883 Add 'git review' config file Change-Id: Ibc891a88811817a4f5a56fe22b1967a464e6d242 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/83/3883/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..65d8bd8 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmocom-bb -- To view, visit https://gerrit.osmocom.org/3883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc891a88811817a4f5a56fe22b1967a464e6d242 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 7 10:23:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 7 Sep 2017 10:23:47 +0000 Subject: [PATCH] osmocom-bb[master]: Add arbitrary config file location support Message-ID: Review at https://gerrit.osmocom.org/3884 Add arbitrary config file location support All other Osmocom projects use '-c' command line option to specify the location of config file. Let's do the same and remove existing implicit logic. Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 --- M src/host/layer23/src/mobile/main.c 1 file changed, 7 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/84/3884/1 diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 630bc53..0fc74c1 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -51,6 +51,7 @@ void *l23_ctx = NULL; struct llist_head ms_list; static char *gsmtap_ip = 0; +static const char *config_file = "mobile.cfg"; struct gsmtap_inst *gsmtap_inst = NULL; static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; @@ -96,6 +97,7 @@ printf(" -d --debug Change debug flags. default: %s\n", debug_default); printf(" -D --daemonize Run as daemon\n"); + printf(" -c --config-file filename The config file to use.\n"); printf(" -m --mncc-sock Disable built-in MNCC handler and " "offer socket\n"); } @@ -111,11 +113,12 @@ {"vty-port", 1, 0, 'v'}, {"debug", 1, 0, 'd'}, {"daemonize", 0, 0, 'D'}, + {"config-file", 1, 0, 'c'}, {"mncc-sock", 0, 0, 'm'}, {0, 0, 0, 0}, }; - c = getopt_long(argc, argv, "hi:u:v:d:Dm", + c = getopt_long(argc, argv, "hi:u:c:v:d:Dm", long_options, &option_index); if (c == -1) break; @@ -131,6 +134,9 @@ break; case 'u': vty_ip = optarg; + break; + case 'c': + config_file = optarg; break; case 'v': vty_port = atoi(optarg); @@ -201,10 +207,6 @@ { int quit = 0; int rc; - char const * home; - size_t len; - const char osmocomcfg[] = ".osmocom/bb/mobile.cfg"; - char *config_file = NULL; printf("%s\n", openbsc_copyright); @@ -234,13 +236,6 @@ gsmtap_source_add_sink(gsmtap_inst); } - home = getenv("HOME"); - if (home != NULL) { - len = strlen(home) + 1 + sizeof(osmocomcfg); - config_file = talloc_size(l23_ctx, len); - if (config_file != NULL) - snprintf(config_file, len, "%s/%s", home, osmocomcfg); - } /* save the config file directory name */ config_dir = talloc_strdup(l23_ctx, config_file); config_dir = dirname(config_dir); @@ -277,7 +272,6 @@ l23_app_exit(); - talloc_free(config_file); talloc_free(config_dir); talloc_report_full(l23_ctx, stderr); -- To view, visit https://gerrit.osmocom.org/3884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:42:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:42:27 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:44:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:44:12 +0000 Subject: osmocom-bb[master]: Add arbitrary config file location support In-Reply-To: References: Message-ID: Patch Set 1: I agree the config file location should be configurable. However, you are breaking existing setups of users for no good reason. I suggest you fall back to the .osmocom/bb file if no explicit files has been specified and no ./osmocom-bb.cfg was found. -- To view, visit https://gerrit.osmocom.org/3884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:44:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:44:35 +0000 Subject: osmocom-bb[master]: Add 'git review' config file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc891a88811817a4f5a56fe22b1967a464e6d242 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:44:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:44:37 +0000 Subject: [MERGED] osmocom-bb[master]: Add 'git review' config file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add 'git review' config file ...................................................................... Add 'git review' config file Change-Id: Ibc891a88811817a4f5a56fe22b1967a464e6d242 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..65d8bd8 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmocom-bb -- To view, visit https://gerrit.osmocom.org/3883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibc891a88811817a4f5a56fe22b1967a464e6d242 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:48:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:48:40 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 1: Thanks for looking into this. I think it might be difficult to insist on one space idnent per level. It would be much mor user friendly if there was a notion of 'parent node depth', i.e. you can use any number of additional spaces to indent a new depth level, and as soon as you go back beyond that depthy level we go to the parent. Not sure how comple that would be to implement? Also, if we now have a notion of the "depth", could this somehow be used to automatically generate the required spaces in front of a string when saving the file (config_write_...())? So far we manually have to print those spaces which is a bit ugly (and doesn't permit a node to appear at different parent nodes / depths). -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:49:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:49:25 +0000 Subject: libosmocore[master]: VTY: never look for matching commands on parent node In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:50:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:50:33 +0000 Subject: libosmocore[master]: VTY: allow comments in the same line as vty commands In-Reply-To: References: Message-ID: Patch Set 1: does this also work with the .LINE syntax of the parser, which is a token that means "rest of the line" ? We use this in situations where spaces are part of the "token" -- To view, visit https://gerrit.osmocom.org/3882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:50:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:50:55 +0000 Subject: osmo-mgw[master]: drop files unrelated to osmo-mgw In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3780 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I623ba8c053bef91a327e58de214e05f0d6768605 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:51:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:51:11 +0000 Subject: osmo-mgw[master]: debian: fix VCS links, tweak descriptions and copyright In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3781 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a444cf40839c20a0d3d5237f9d4d01d71e01d60 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:51:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:51:22 +0000 Subject: osmo-msc[master]: doc/examples: add detailed cs7 config examples In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4da6724cd4348e92dfd06516f82af06c97277ef9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:52:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:52:09 +0000 Subject: osmo-msc[master]: use separated libosmo-mgcp-client, apply rename to mgcp_clie... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:52:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:52:33 +0000 Subject: osmo-bsc[master]: drop MGCP client from osmo-bsc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:53:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:53:07 +0000 Subject: osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:55:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:55:13 +0000 Subject: osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3783/2//COMMIT_MSG Commit Message: Line 18: code dup or yet another libosmo-mgcp-common library.) I don't like this, but I think having client and server (mgw) in one program is rather unlikely, so we can get away with it. -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:55:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:55:46 +0000 Subject: osmo-mgw[master]: rename mgcpgw_client_* to mgcp_client_* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99f7faab637cfcc22ece64a1dbcbe590f2042187 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:56:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:56:10 +0000 Subject: osmo-mgw[master]: rewrite README In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3782 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I84cba73b4366c6b403f7da587f46cf621e58c33f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 11:57:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 11:57:21 +0000 Subject: osmo-ci[master]: jenkins: Follow the convention and create a jenkins.sh as well In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3676/1/contrib/jenkins.sh File contrib/jenkins.sh: Line 7: git pull origin > I think laforge uses 'git fetch; git checkout -f master' ... haven't verifi to be more precise I use 'git fetch && git checkout -f -B master origin/master'. The uppercase B will overwrite any pre-existing local branch of the same name. -- To view, visit https://gerrit.osmocom.org/3676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 7 14:18:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 14:18:15 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGGSN: Add VTY reference manual In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3879 to look at the new patch set (#2). OsmoGGSN: Add VTY reference manual Change-Id: Iddf6fe26689172d7db001198943c816eaaed7931 --- M OsmoGGSN/Makefile A OsmoGGSN/osmoggsn-vty-reference.xml A OsmoGGSN/vty/ggsn_vty_additions.xml A OsmoGGSN/vty/ggsn_vty_reference.xml 4 files changed, 1,575 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/79/3879/2 diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index daf3597..2dfedb2 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,6 +1,18 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals +EXTRA_DEPS = gen-ggsn-vty-docbook + +topdir = . +ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml +manuals = $(ggsn_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + TOPDIR := .. ASCIIDOCS := osmoggsn-usermanual @@ -10,4 +22,18 @@ osmoggsn-usermanual.pdf: chapters/*.adoc clean: - rm -rf $(cleanfiles) + -rm -rf $(cleanfiles) + -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png + -rm osmoggsn-usermanual.check + +gen-ggsn-vty-docbook: FORCE + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging GGSN VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting GGSN VTY to DocBook) diff --git a/OsmoGGSN/osmoggsn-vty-reference.xml b/OsmoGGSN/osmoggsn-vty-reference.xml new file mode 100644 index 0000000..44e7bfc --- /dev/null +++ b/OsmoGGSN/osmoggsn-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 06th September 2017 + hw + Initial version as of OsmoGGSN v1.0.0 + + + + OsmoGGSN VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoGGSN/vty/ggsn_vty_additions.xml b/OsmoGGSN/vty/ggsn_vty_additions.xml new file mode 100644 index 0000000..1bbeb81 --- /dev/null +++ b/OsmoGGSN/vty/ggsn_vty_additions.xml @@ -0,0 +1,30 @@ + + + + Telnet/VTY Configuration Node + + Configure parameters of the Telnet/VTY Interface, such as to which IP address it should bind/listen to. + + + + + CTRL Configuration Node + + Configure parameters of the CTRL Interface, such as to which IP address it should bind/listen to. + + + + + GGSN Instance Configuration Node + + Configure an Instance of a (virtual) GGSN + + + + + APN Configuration Node + + Configure an Access Point Name (APN) inside a GGSN Instance + + + diff --git a/OsmoGGSN/vty/ggsn_vty_reference.xml b/OsmoGGSN/vty/ggsn_vty_reference.xml new file mode 100644 index 0000000..6809ead --- /dev/null +++ b/OsmoGGSN/vty/ggsn_vty_reference.xml @@ -0,0 +1,1480 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iddf6fe26689172d7db001198943c816eaaed7931 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 7 14:40:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 14:40:44 +0000 Subject: osmo-gsm-manuals[master]: OsmoGGSN: Add VTY reference manual In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iddf6fe26689172d7db001198943c816eaaed7931 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 14:40:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 14:40:48 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGGSN: Add VTY reference manual In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OsmoGGSN: Add VTY reference manual ...................................................................... OsmoGGSN: Add VTY reference manual Change-Id: Iddf6fe26689172d7db001198943c816eaaed7931 --- M OsmoGGSN/Makefile A OsmoGGSN/osmoggsn-vty-reference.xml A OsmoGGSN/vty/ggsn_vty_additions.xml A OsmoGGSN/vty/ggsn_vty_reference.xml 4 files changed, 1,575 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index daf3597..2dfedb2 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,6 +1,18 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals +EXTRA_DEPS = gen-ggsn-vty-docbook + +topdir = . +ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml +manuals = $(ggsn_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + TOPDIR := .. ASCIIDOCS := osmoggsn-usermanual @@ -10,4 +22,18 @@ osmoggsn-usermanual.pdf: chapters/*.adoc clean: - rm -rf $(cleanfiles) + -rm -rf $(cleanfiles) + -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png + -rm osmoggsn-usermanual.check + +gen-ggsn-vty-docbook: FORCE + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/vty/ggsn_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging GGSN VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined2.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting GGSN VTY to DocBook) diff --git a/OsmoGGSN/osmoggsn-vty-reference.xml b/OsmoGGSN/osmoggsn-vty-reference.xml new file mode 100644 index 0000000..44e7bfc --- /dev/null +++ b/OsmoGGSN/osmoggsn-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 06th September 2017 + hw + Initial version as of OsmoGGSN v1.0.0 + + + + OsmoGGSN VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoGGSN/vty/ggsn_vty_additions.xml b/OsmoGGSN/vty/ggsn_vty_additions.xml new file mode 100644 index 0000000..1bbeb81 --- /dev/null +++ b/OsmoGGSN/vty/ggsn_vty_additions.xml @@ -0,0 +1,30 @@ + + + + Telnet/VTY Configuration Node + + Configure parameters of the Telnet/VTY Interface, such as to which IP address it should bind/listen to. + + + + + CTRL Configuration Node + + Configure parameters of the CTRL Interface, such as to which IP address it should bind/listen to. + + + + + GGSN Instance Configuration Node + + Configure an Instance of a (virtual) GGSN + + + + + APN Configuration Node + + Configure an Access Point Name (APN) inside a GGSN Instance + + + diff --git a/OsmoGGSN/vty/ggsn_vty_reference.xml b/OsmoGGSN/vty/ggsn_vty_reference.xml new file mode 100644 index 0000000..6809ead --- /dev/null +++ b/OsmoGGSN/vty/ggsn_vty_reference.xml @@ -0,0 +1,1480 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iddf6fe26689172d7db001198943c816eaaed7931 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 7 14:54:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 14:54:25 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) we discussed today and found a solution. The intention is indeed to become more strict by combining the lists. But the algorithm needs a fix, because if we request more than one of the same resource, we have lists of dicts that need to be matched up by index: bts: - type: sysmo times: 2 becomes bts: [ {type: sysmo}, {type: sysmo} ] (mark -1 to wait for new patch set) https://gerrit.osmocom.org/#/c/3722/2/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 249: assert type(dest[i]) == type(src[i]) > I think I never saw any checks for tuples in this code, so if I understand Notes from discussion: There are two kinds of lists: a list of dicts representing more of one resource kind; a list of resource features like string tokens. The list of resources needs to be treated by matching up indexes, the list of string tokens needs to be combined like taking the union of two sets (making the requirements stricter by adding more tokens, think a list of features becoming stricter). Pseudocode of what this needs to do: # sanity: the lists aren't mixed and match each other foreach src + dst: assert all types match # treat resource lists differently from sets of features if any([is_list(i) or is_dict(i) for i in src+dst]): combine(src, dst) # recurse, as in list of resources else: dst = union(src, dst) # enlarge list of features -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:19:41 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 7 Sep 2017 15:19:41 +0000 Subject: [PATCH] openbsc[master]: libmsc: Either route report to ESME or send it, not both Message-ID: Review at https://gerrit.osmocom.org/3885 libmsc: Either route report to ESME or send it, not both Logic in sms_status_report(): We cannot check gsms->receiver as an indication that sms_route_mt_sms failed to find a route. gsms is the original message for which we are sending a report, so it already has a receiver. Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/3885/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ddef444..86cdb8e 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -690,6 +690,13 @@ "Failed to send status report! err=%d\n", rc); } + if (rc == 0) { + LOGP(DLSMS, LOGL_INFO, + "Status report for %s was routed to ESME\n", gsms->receiver->extension); + sms_free(sms_report); + return; + } + /* No route via SMPP, send the GSM 03.40 status-report now. */ if (gsms->receiver) gsm340_rx_sms_submit(sms_report); -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:20:35 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 7 Sep 2017 15:20:35 +0000 Subject: openbsc[master]: libmsc: Either route report to ESME or send it, not both In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3885/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 693: if (rc == 0) { Pablo, I'm not sure how you would like to make this test here. -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:45:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:45:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins-common: ensure requested binaries indeed have been b... Message-ID: Review at https://gerrit.osmocom.org/3886 jenkins-common: ensure requested binaries indeed have been built Recent change Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 drops binaries from a build artifact by leaving only explicitly requested ones. This adds a check that the requested ones indeed exist. Change-Id: Iceddeee6aebb1cdb54d7304495c3e332390261db --- M contrib/jenkins-build-common.sh 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/3886/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 3d9932d..e15c616 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -156,6 +156,15 @@ fi done + # ensure requested binaries indeed exist + for b in $wanted_binaries ; do + if [ ! -f "$b" ]; then + set +x; echo "ERROR: no such binary: $b in $prefix_real/bin/"; set -x + ls -1 "$prefix_real/bin" + exit 1 + fi + done + cd "$prefix_real" this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" tar="${this}.tgz" -- To view, visit https://gerrit.osmocom.org/3886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iceddeee6aebb1cdb54d7304495c3e332390261db Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:45:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:45:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: build from new osmo-{msc, bsc, mgw, sgsn} repositories Message-ID: Review at https://gerrit.osmocom.org/3887 jenkins: build from new osmo-{msc,bsc,mgw,sgsn} repositories The idea is to build each binary separately: even though osmo-msc requires libosmo-sccp, which already includes the osmo-stp binary, we still want osmo-stp to be built from a separate script. The reason: to track down regressions, we can change the versions each binary is built from separately. The additional build effort and jenkins script multitude is acceptable. Change-Id: I194ad5169dbe013c8e1cf9d631033cb2576744dd --- A contrib/jenkins-build-osmo-bsc.sh A contrib/jenkins-build-osmo-ggsn.sh A contrib/jenkins-build-osmo-mgw.sh M contrib/jenkins-build-osmo-msc.sh A contrib/jenkins-build-osmo-sgsn.sh A contrib/jenkins-build-osmo-stp.sh M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_stp.py 9 files changed, 67 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/87/3887/1 diff --git a/contrib/jenkins-build-osmo-bsc.sh b/contrib/jenkins-build-osmo-bsc.sh new file mode 100755 index 0000000..ee58c9d --- /dev/null +++ b/contrib/jenkins-build-osmo-bsc.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-bsc" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo libosmo-sccp +build_repo osmo-mgw +build_repo osmo-bsc + +create_bin_tgz osmo-bsc diff --git a/contrib/jenkins-build-osmo-ggsn.sh b/contrib/jenkins-build-osmo-ggsn.sh new file mode 100755 index 0000000..a46c3aa --- /dev/null +++ b/contrib/jenkins-build-osmo-ggsn.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-ggsn" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo osmo-ggsn + +create_bin_tgz osmo-ggsn diff --git a/contrib/jenkins-build-osmo-mgw.sh b/contrib/jenkins-build-osmo-mgw.sh new file mode 100755 index 0000000..4ca1e45 --- /dev/null +++ b/contrib/jenkins-build-osmo-mgw.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-mgw" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo osmo-mgw + +create_bin_tgz osmo-bsc_mgcp diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 8025ca2..c0faf78 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -7,11 +7,9 @@ build_repo libosmocore --disable-doxygen build_repo libosmo-abis build_repo libosmo-netif --disable-doxygen -build_repo openggsn build_repo libsmpp34 build_repo libosmo-sccp -build_repo libasn1c -build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH -build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu +build_repo osmo-mgw +build_repo osmo-msc --enable-smpp --disable-iu create_bin_tgz osmo-msc diff --git a/contrib/jenkins-build-osmo-sgsn.sh b/contrib/jenkins-build-osmo-sgsn.sh new file mode 100755 index 0000000..1979e8c --- /dev/null +++ b/contrib/jenkins-build-osmo-sgsn.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-sgsn" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo libosmo-sccp +build_repo openggsn +build_repo osmo-sgsn --disable-iu + +create_bin_tgz osmo-sgsn diff --git a/contrib/jenkins-build-osmo-stp.sh b/contrib/jenkins-build-osmo-stp.sh new file mode 100755 index 0000000..86cbe3d --- /dev/null +++ b/contrib/jenkins-build-osmo-stp.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-stp" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo libosmo-sccp + +create_bin_tgz osmo-stp diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 2eb23fb..f9eb858 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -43,10 +43,7 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - # NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the - # osmo-msc build will also provide the OsmoBSC binary. As soon as the - # repositories are separate, there shall be a separate artifact. - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-bsc'))) binary = inst.child('bin', 'osmo-bsc') if not os.path.isfile(binary): diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index db41dff..93c3a7c 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -40,7 +40,7 @@ self.log('Starting osmo-mgcpgw') self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-mgw'))) binary = inst.child('bin', 'osmo-bsc_mgcp') if not os.path.isfile(binary): raise RuntimeError('Binary missing: %r' % binary) diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py index 1aeb879..cc3906f 100644 --- a/src/osmo_gsm_tester/osmo_stp.py +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -39,9 +39,7 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of - # OsmoMSC. - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-stp'))) binary = inst.child('bin', 'osmo-stp') if not os.path.isfile(binary): -- To view, visit https://gerrit.osmocom.org/3887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I194ad5169dbe013c8e1cf9d631033cb2576744dd Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:48:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:48:51 +0000 Subject: osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3783/2//COMMIT_MSG Commit Message: Line 18: code dup or yet another libosmo-mgcp-common library.) > I don't like this, but I think having client and server (mgw) in one progra I still want to fix it some day (tm) and dexter agrees we should separate it, but for now it's the fastest way forward, what with all the other things that need to be done for the split... -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:48:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:48:59 +0000 Subject: [MERGED] osmo-mgw[master]: rewrite README In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rewrite README ...................................................................... rewrite README Change-Id: I84cba73b4366c6b403f7da587f46cf621e58c33f --- M README 1 file changed, 21 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README b/README index d01b2cf..7f55fe6 100644 --- a/README +++ b/README @@ -1,39 +1,28 @@ -About OpenBSC +About OsmoMGW ============= -OpenBSC started as a minimalistic all-in-one implementation of the GSM Network, -with particular emphasis on the functionality typically provided by the BSC, -MSC, HLR, VLR and SMSC. Today it is a growing suite of libraries and programs, -implementing protocol stacks and functional elements, including +OsmoMGW originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. - * OsmoBSC - a pure GSM BSC, speaking Abis/IP to the BTS and A/IP to the MSC - * OsmoBSC-MGCP - MGCP helper to the OsmoBSC software - * OsmoNITB - a BSC+MSC+VLR+HLR+SMSC "Network in the box". - * OsmoMSC - a voice CN with A/IP and IuCS/IP towards the BSC and/or HNB-GW - * OsmoSGSN - a GPRS SGSN with Gb/IP and IuPS/IP towards the PCU and/or HNB-GW - * Osmo-GbProxy - a Proxy to aggregate many Gb links as one Gb link to the SGSN - * OsmoBSCNAT - a gateway aggregating many A links as one A link to the MSC - * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) - * ipaccess-utils - some tools to discover + configure ip.access nanoBTS - * bs11_config - a tool to configure the Siemens BS-11 microBTS +OsmoMGW was one of the parts split off from the old openbsc.git. It originated +as a solution to merely navigate RTP streams through a NAT, but has since +matured to a Media Gateway implementation that is capable of streaming RTP for +2G (AoIP) and 3G (IuCS) GSM networks as well as (still not implemented at time +of writing) transcoding between TRAU, various RTP payloads and IuUP. -Various interfaces towards the BTS are supported, among which are: +The OsmoMGW program exposes an MGCP interface towards clients like OsmoMSC and +OsmoBSC, and receives and sends RTP streams as configured via MGCP. - * Classic A-bis over E1 using a mISDN based E1 interface. In other - words, you can connect existing GSM Base Transceiver Station (BTS) - through E1 to OpenBSC. So far, we have made it work with the Siemens BS-11, - various Ericsson RBS2xxx BTS models and the Nokia MetroSite. +The libosmo-mgcp-client library exposes utilities used by e.g. OsmoMSC (found +in osmo-msc.git) to instruct OsmoMGW via its MGCP service. - * A-bis over IP as used by the ip.access nanoBTS product family as well as - the Open Source OsmoBTS software (by the same authors as OpenBSC). OsmoBTS - in turn supports various transceiver hardware, including the sysmoBTS - product family, as well as SDR transceivers supported by OsmoTRX, such as - the UmTRX or USRP boardss. +The libosmo-mgcp library exposes MGCP server utilities used by e.g. OsmoBSC-NAT +(found in osmo-bsc.git) to navigate RTP streams through a NAT. +(At time of writing, this is still called libosmo-legacy-mgcp.) - * IuCS and IuPS over IP towards an HNB-GW (see osmo-iuh) for UMTS (3G) - voice and data links. - -Find OpenBSC online at -http://openbsc.osmocom.org/ - - Harald Welte +Find OsmoMGW issue tracker and wiki online at +https://osmocom.org/projects/osmo-mgw +https://osmocom.org/projects/osmo-mgw/wiki -- To view, visit https://gerrit.osmocom.org/3782 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84cba73b4366c6b403f7da587f46cf621e58c33f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:48:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:48:59 +0000 Subject: [MERGED] osmo-mgw[master]: debian: fix VCS links, tweak descriptions and copyright In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: fix VCS links, tweak descriptions and copyright ...................................................................... debian: fix VCS links, tweak descriptions and copyright Change-Id: I4a444cf40839c20a0d3d5237f9d4d01d71e01d60 --- M debian/control M debian/copyright 2 files changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index a1e4704..af49dc7 100644 --- a/debian/control +++ b/debian/control @@ -9,9 +9,9 @@ libosmocore-dev, libosmo-netif-dev Standards-Version: 3.9.8 -Vcs-Git: git://git.osmocom.org/osmo-iuh.git -Vcs-Browser: https://git.osmocom.org/osmo-iuh/ -Homepage: https://projects.osmocom.org/projects/osmohnbgw +Vcs-Git: git://git.osmocom.org/osmo-mgw.git +Vcs-Browser: https://git.osmocom.org/osmo-mgw/ +Homepage: https://osmocom.org/projects/osmo-mgw Package: osmo-mgw Architecture: any @@ -32,18 +32,18 @@ Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks +Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library Package: libosmo-legacy-mgcp-dbg Section: debug Architecture: any Multi-Arch: same Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks +Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library Package: libosmo-legacy-mgcp-dev Section: libdevel Architecture: any Multi-Arch: same Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks +Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library diff --git a/debian/copyright b/debian/copyright index f1dada2..83e29df 100644 --- a/debian/copyright +++ b/debian/copyright @@ -6,7 +6,7 @@ Copyright: 2009-2014 On-Waves 2009-2015 Holger Hans Peter Freyther 2013 Jacob Erlbeck - 2016 sysmocom s.m.f.c. GmbH + 2016-2017 sysmocom s.m.f.c. GmbH License: AGPL-3.0+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by -- To view, visit https://gerrit.osmocom.org/3781 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a444cf40839c20a0d3d5237f9d4d01d71e01d60 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:49:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:49:00 +0000 Subject: [MERGED] osmo-mgw[master]: drop files unrelated to osmo-mgw In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: drop files unrelated to osmo-mgw ...................................................................... drop files unrelated to osmo-mgw These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-mgw. The ctrl_test_runner.py from openbsc.git still sticks around, but osmo-bsc_mgcp has no CTRL interface (yet). If it gets one, we can re-add the ctrl_test_runner. Change-Id: I623ba8c053bef91a327e58de214e05f0d6768605 --- D doc/BS11-OML.txt D doc/call-routing.txt D doc/channel_release.txt D doc/e1-data-model.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/bscs.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/gsm-hopping.txt D doc/handover.txt D doc/ipa-sccp.txt D doc/oml-interface.txt D doc/osmo-nitb-data_structures.dot D doc/paging.txt D include/openbsc/gsm_04_14.h D include/openbsc/iu_dummy.h D src/libmsc/gsm_04_14.c M tests/Makefile.am D tests/ctrl_test_runner.py D tools/hlrstat.pl 28 files changed, 0 insertions(+), 1,977 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/BS11-OML.txt b/doc/BS11-OML.txt deleted file mode 100644 index e5c3299..0000000 --- a/doc/BS11-OML.txt +++ /dev/null @@ -1,31 +0,0 @@ -The Siemens BS-11 supports the following additional GSM 12.21 OML operations: - - -CREATE OBJECT - -abis_om_fom_hdr.obj_class can be -A3: -A5: ALCO, BBSIG, CCLK, GPSU, LI, PA -A8: EnvaBTSE -A9: BPORT - -the abis_om_obj_inst.trx_nr field indicates the index of object, whereas the -abis_om_fom_hdr.bts_nr indicates the type of the object. - -enum abis_bs11_objtype { - BS11_OBJ_ALCO = 0x01, - BS11_OBJ_BBSIG = 0x02, /* obj_class: 0,1 */ - BS11_OBJ_TRX1 = 0x03, /* only DEACTIVATE TRX1 */ - BS11_OBJ_CCLK = 0x04, - BS11_OBJ_GPSU = 0x06, - BS11_OBJ_LI = 0x07, - BS11_OBJ_PA = 0x09, /* obj_class: 0, 1*/ -}; - -In case of CREATE ENVABTSE, the abis_om_obj_inst.trx_nr indicates the EnvaBTSEx -number. - -In case of A9 (CREAETE BPORT), the abis_om_obj_inst.bts_nr indicates which BPORT -shall be used. - - diff --git a/doc/call-routing.txt b/doc/call-routing.txt deleted file mode 100644 index 3402f9e..0000000 --- a/doc/call-routing.txt +++ /dev/null @@ -1,25 +0,0 @@ -Call routing in OpenBSC - -Flow of events: - - # MO call initiated by MS, CHANNEL RQD, IMMEDIATE ASSIGN - # MS sends CC SETUP message, we assume already on TCH/H FACCH - # OpenBSC does a subscriber lookup based on the target extension - * If a subscriber is found: - # send CALL PROCEEDING message to MO - # page the MT subscriber and ask itI to ask for TCH/H - # once paging completes, we have the TCH/H for the MT end - # send SETUP to MT - # receive CALL CONFIRMED from MT - # set-up the TRAU mux mapping between the E1 subslots for both TCH/H - # receive ALERTING from MT, route ALERTING to MO - # receive CONNECT from MT, confirm to MT with CONNECT_ACK - # send a CONNECT message to MO, receive CONNECT_ACK from MO - * If subscriber is not found: - # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - - - -Thoughts about RR/MM: - -* we allocate RR/MM entities on demand, when we need them diff --git a/doc/channel_release.txt b/doc/channel_release.txt deleted file mode 100644 index c9cdfeb..0000000 --- a/doc/channel_release.txt +++ /dev/null @@ -1,95 +0,0 @@ - -GSM 04.08 7.1.7 / 9.1.7 RR CHANNEL RELESE - -RSL 08.58 3.4 / ? RLL Link Release Request - -RSL 08.58 4.6 / 8.4.5 DEACTivate SACCH - * Deactivate SACCH according to Channel Release Proc 04.08 - * to be sent after RR CHANNEL RELEASE is sent to MS - -RSL 08.58 4.7 / 8.4.14 RF CHANnel RELease - * tells the BTS to release a radio channel - * "when an activated radio channel is no longer needed" - * BTS responds with RF CHANnel RELease ACKnowledge - - -GSM 04.08 3.4.13: RR connection release procedure - -* network sends RR CHANNEL RELEASE to MS on the DCCH - * start T3109 - * deactivate SACCH -* MS disconnects main signalling link (by sending DISC) - * all other data links are disconnected by local end link release -* network receives DISC (BTS sends RLL REL IND to BSC) - * stop T3109 - * start T3111 -* when T3111 times out, the network can reuse the channls -* if T3109 times out, the network deactivates the channels - and can reuse them - * this probably means simply RF CHANnel RELease - - -== Implementation in OpenBSC == - -There are two possible reasons a gsm_subscriber_connection -will be released. One is a network failure, the other is -the completion of an operation/transaction. - -=== Failure === -The BSC API will call the gsm_04_08.c:gsm0408_clear_request callback -and the MSC part will release all transactions, operations and such -and the channels will be released as error case. - -=== Success === -Every time an 'operation' or 'transaction' is finished msc_release_connection -will be called and it will determine if the gsm_subscriber_connection can -be released. - -In case it can be released bsc_api.c:gsm0808_clear will be called -which will release all lchan's associated with the connection. For the -primary channel a SACH Deactivate will be send with the release -reason NORMAL RELEASE. - - -bsc_api.c:gsm0808_clear - * Release a channel used for handover - * Release the primary lchan with normal release, SACH deactivate - -chan_alloc.c:lchan_release(chan, sacch_deactivate, reason) - * Start the release procedure. It is working in steps with callbacks - coming from the abis_rsl.c code. - * Release all SAPI's > 0 as local end (The BTS should send a - REL_CONF a message) - * Send SACH Deactivate on SAPI=0 if required. - * Start T3109 (stop it when the main signalling link is disconnected) - or when the channel released. On timeout start the error handling. - * abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are - released and after T3111 has timed out or there is an error. - -RX of RELease INDication: - * Calls internal rsl_handle_release which might release the RF. - -RX of RELease CONFirmation: - * Calls internal rsl_handle_release which might release the RF. - -* RX of RF_CHAN_REL_ACK - * call lchan_free() - - -=== Integration with SMS === - -* RX of CP_ERROR or unimplemented MT - * trigger trans_free() which will msc_release_connection() - -* CP TC1* expired while waiting for CP-ACK - * trigger trans_free() which will msc_release_connection() - -* RX of RP_ERROR - * trigger trans_free() which will msc_release_connection() - -* TX of CP-ACK in MT DELIVER - * trigger trans_free() which will msc_release_connection() - -* RX of CP-ACK in MO SUBMIT - * trigger trans_free() which will msc_release_connection() - diff --git a/doc/e1-data-model.txt b/doc/e1-data-model.txt deleted file mode 100644 index 509004f..0000000 --- a/doc/e1-data-model.txt +++ /dev/null @@ -1,172 +0,0 @@ -E1 related data model - -This data model describes the physical relationship of the individual -parts in the network, it is not the logical/protocol side of the GSM -network. - -A BTS is connected to the BSC by some physical link. It could be an actual -E1 link, but it could also be abis-over-IP with a mixture of TCP and RTP/UDP. - -To further complicate the fact, multiple BTS can share one such pysical -link. On a single E1 line, we can easily accomodate up to three BTS with -two TRX each. - -Thus, it is best for OpenBSC to have some kind of abstraction layer. The BSC's -view of a BTS connected to it. We call this 'bts_link'. A bts_link can be -* all the TCP and UDP streams of a Abis-over-IP BTS -* a set of E1 timeslots for OML, RSL and TRAU connections on a E1 link -* a serial line exclusively used for OML messages (T-Link) - -A bts_link can be registered with the OpenBSC core at runtime. - -struct trx_link { - struct gsm_bts_trx *trx; -}; - -struct bts_link { - struct gsm_bts *bts; - struct trx_link trx_links[NUM_TRX]; -}; - -Interface from stack to input core: -====================================================================== -int abis_rsl_sendmsg(struct msgb *msg); - send a message through a RSL link to the TRX specified by the caller in - msg->trx. - -int abis_rsl_rcvmsg(struct msgb *msg); - receive a message from a RSL link from the TRX specified by the - caller in msg->trx. - -int abis_nm_sendmsg(struct msgb *msg); - send a message through a OML link to the BTS specified by the caller in - msg->trx->bts. The caller can just use bts->c0 to get the first TRX - in a BTS. (OML messages are not really sent to a TRX but to the BTS) - -int abis_nm_rcvmsg(struct msgb *msg); - receive a message from a OML link from the BTS specified by the caller - in msg->trx->bts. The caller can just use bts->c0 to get the first - TRX in a BTS. - -int abis_link_event(int event, void *data); - signal some event (such as layer 1 connect/disconnect) from the - input core to the stack. - -int subch_demux_in(mx, const uint8_t *data, int len); - receive 'len' bytes from a given E1 timeslot (TRAU frames) - -int subchan_mux_out(mx, uint8_t *data, int len); - obtain 'len' bytes of output data to be sent on E1 timeslot - -Intrface by Input Core for Input Plugins -====================================================================== - -int btslink_register_plugin(); - - -Configuration for the E1 input module -====================================================================== - -BTS - BTS number - number of TRX - OML link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TRX - RSL link - E1 line number - timeslot number - [subslot number] - SAPI - TEI - for each TS - E1 line number - timeslot number - subslot number - - -E1 input module data model -====================================================================== - - -enum e1inp_sign_type { - E1INP_SIGN_NONE, - E1INP_SIGN_OML, - E1INP_SIGN_RSL, -}; - -struct e1inp_sign_link { - /* list of signalling links */ - struct llist_head list; - - enum e1inp_sign_type type; - - /* trx for msg->trx of received msgs */ - struct gsm_bts_trx *trx; - - /* msgb queue of to-be-transmitted msgs */ - struct llist_head tx_list; - - /* SAPI and TEI on the E1 TS */ - uint8_t sapi; - uint8_t tei; -} - -enum e1inp_ts_type { - E1INP_TS_TYPE_NONE, - E1INP_TS_TYPE_SIGN, - E1INP_TS_TYPE_TRAU, -}; - -/* A timeslot in the E1 interface */ -struct e1inp_ts { - enum e1inp_ts_type type; - struct e1inp_line *line; - union { - struct { - struct llist_head sign_links; - } sign; - struct { - /* subchannel demuxer for frames from E1 */ - struct subch_demux demux; - /* subchannel muxer for frames to E1 */ - struct subch_mux mux; - } trau; - }; - union { - struct { - /* mISDN driver has one fd for each ts */ - struct osmo_fd; - } misdn; - } driver; -}; - -struct e1inp_line { - unsigned int num; - char *name; - - struct e1inp_ts ts[NR_E1_TS]; - - char *e1inp_driver; - void *driver_data; -}; - -/* Call from the Stack: configuration of this TS has changed */ -int e1inp_update_ts(struct e1inp_ts *ts); - -/* Receive a packet from the E1 driver */ -int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, - uint8_t tei, uint8_t sapi); - -/* Send a packet, callback function in the driver */ -int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg) - - -struct e1inp_driver { - const char *name; - int (*want_write)(struct e1inp_ts *ts); -}; diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg deleted file mode 100644 index 7c10e9d..0000000 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ /dev/null @@ -1,101 +0,0 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login -! -e1_input - e1_line 0 driver ipa -network - network country code 1 - mobile network code 1 - short name OsmoBSC - long name OsmoBSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - neci 1 - paging any use tch 0 - rrlp mode none - mm info 1 - handover 0 - handover window rxlev averaging 10 - handover window rxqual averaging 1 - handover window rxlev neighbor averaging 10 - handover power budget interval 6 - handover power budget hysteresis 3 - handover maximum distance 9999 - bts 0 - type nanobts - band DCS1800 - cell_identity 0 - location_area_code 1 - training_sequence_code 7 - base_station_id_code 63 - ms max power 15 - cell reselection hysteresis 4 - rxlev access min 0 - channel allocator ascending - rach tx integer 9 - rach max transmission 7 - dtx uplink force - dtx downlink - ip.access unit_id 0 0 - oml ip.access stream_id 255 line 0 - neighbor-list mode manual-si5 - neighbor-list add arfcn 100 - neighbor-list add arfcn 200 - si5 neighbor-list add arfcn 10 - si5 neighbor-list add arfcn 20 - gprs mode none - trx 0 - rf_locked 0 - arfcn 871 - nominal power 23 - max_power_red 20 - rsl e1 tei 0 - timeslot 0 - phys_chan_config CCCH+SDCCH4 - hopping enabled 0 - timeslot 1 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 2 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 3 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 4 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 5 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 6 - phys_chan_config TCH/F - hopping enabled 0 - timeslot 7 - phys_chan_config TCH/F - hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote - ip.access rtp-base 4000 - timeout-ping 20 - timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name -bsc - no access-list-name - access-list-name bsc-list diff --git a/doc/examples/osmo-bsc_nat/black-list.cfg b/doc/examples/osmo-bsc_nat/black-list.cfg deleted file mode 100644 index d36179d..0000000 --- a/doc/examples/osmo-bsc_nat/black-list.cfg +++ /dev/null @@ -1 +0,0 @@ -678012512671923:6:6: diff --git a/doc/examples/osmo-bsc_nat/bscs.cfg b/doc/examples/osmo-bsc_nat/bscs.cfg deleted file mode 100644 index 176debe..0000000 --- a/doc/examples/osmo-bsc_nat/bscs.cfg +++ /dev/null @@ -1,13 +0,0 @@ -nat - bsc 0 - token lol - location_area_code 1234 - description bsc - max-endpoints 32 - paging forbidden 0 - bsc 1 - token wat - location_area_code 5678 - description bsc - max-endpoints 32 - paging forbidden 0 diff --git a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg deleted file mode 100644 index e835e06..0000000 --- a/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg +++ /dev/null @@ -1,66 +0,0 @@ -! -! OsmoBSCNAT (0.12.0.266-2daa9) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level rll notice - logging level cc notice - logging level mm notice - logging level rr notice - logging level rsl notice - logging level nm info - logging level mncc notice - logging level pag notice - logging level meas notice - logging level sccp notice - logging level msc notice - logging level mgcp notice - logging level ho notice - logging level db notice - logging level ref notice - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level llc debug - logging level sndcp debug - logging level nat notice - logging level ctrl notice - logging level smpp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -mgcp - bind ip 0.0.0.0 - bind port 2427 - rtp bts-base 4000 - rtp net-base 16000 - rtp ip-dscp 0 - no rtcp-omit - sdp audio-payload number 126 - sdp audio-payload name AMR/8000 - loop 0 - number endpoints 1 - call-agent ip 127.0.0.1 - rtp transcoder-base 0 - transcoder-remote-base 4000 -nat - msc ip 127.0.0.1 - msc port 5000 - timeout auth 2 - timeout ping 20 - timeout pong 5 - ip-dscp 0 - bscs-config-file bscs.cfg - access-list bla imsi-allow ^11$ diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg deleted file mode 100644 index 15fd74a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg +++ /dev/null @@ -1,44 +0,0 @@ -! -! OsmoGbProxy (UNKNOWN) configuration saved from vty -!! -! -log stderr - logging filter all 1 - logging color 1 - logging timestamp 0 - logging level all debug - logging level gprs debug - logging level ns info - logging level bssgp debug - logging level lglobal notice - logging level llapd notice - logging level linp notice - logging level lmux notice - logging level lmi notice - logging level lmib notice - logging level lsms notice -! -line vty - no login -! -ns - nse 666 nsvci 666 - nse 666 remote-role sgsn -! nse 666 encapsulation framerelay-gre -! nse 666 remote-ip 172.16.1.70 -! nse 666 fr-dlci 666 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-port 23000 -! encapsulation framerelay-gre enabled 1 -gbproxy - sgsn nsei 666 - core-mobile-country-code 666 - core-mobile-network-code 6 - core-access-point-name none match-imsi ^666066|^66607 - tlli-list max-length 200 diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg deleted file mode 100644 index 0c3917a..0000000 --- a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty -!! -! -line vty - no login -! -gbproxy - sgsn nsei 101 -ns - nse 101 nsvci 101 - nse 101 remote-role sgsn - nse 101 encapsulation udp - nse 101 remote-ip 192.168.100.239 - nse 101 remote-port 7777 - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation framerelay-gre enabled 0 - encapsulation framerelay-gre local-ip 0.0.0.0 - encapsulation udp local-port 23000 diff --git a/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt deleted file mode 100644 index 9c65f92..0000000 --- a/doc/examples/osmo-gtphub/gtphub-example.txt +++ /dev/null @@ -1,90 +0,0 @@ -Here is a simple setup to test GTPHub operations. The IP addresses picked will -work well only on a system that creates local addresses (127.0.0.123) on the -fly (like linux) -- you may pick of course different IP addresses. - -Overview of the example setup: - - sgsnemu gtphub ggsn - 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 - -Prerequisites: openggsn. - -Have a local directory where you store config files and from which you launch -the GSNs and the hub (they will store restart counter files in that dir). -In it, have these config files: - -ggsn.conf: - - # GGSN local address - listen 127.0.0.2 - - # End User Addresses are picked from this range - net 10.23.42.0/24 - - pcodns1 8.8.8.8 - - logfile /tmp/foo - -gtphub.conf: - - gtphub - bind-to-sgsns 127.0.0.3 - bind-to-ggsns 127.0.0.4 - ggsn-proxy 127.0.0.2 - end - - -( -You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX -address and GGSN IP address to /etc/hosts something like: - - 127.0.0.2 internet.mnc070.mcc901.gprs - -) - - -Once the config files are in place, start the programs, in separate terminals. -GGSN and SGSN need to be started with root priviliges to be able to create tun -interfaces. GTPHub may run as unprivileged user. - -The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. - - -1. GGSN: - - sudo -s - cd - LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf - -2. GTPHub: - - cd - path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level - -3. SGSN tests: - - sudo -s - cd - /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --imsi 420001214365100 --contexts=3 - -Add more SGSNs using different IMSIs and local ports (if the same IMSI is used, -the GGSN will reuse TEIs and tunnels will be discarded automatically): - - /usr/local/bin/sgsnemu --createif -l 127.0.0.11 -r 127.0.0.3 --imsi 420001214365300 --contexts=3 - -This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu -still needs some effort to announce a mobile subscriber or the like (I have -used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). - -The core capability of GTPHub is to manage more than two GSNs, e.g. an SGSN -contacting various GGSNs over the single GTPHub link. You would configure the -SGSN to use one fixed GGSN (sending to gtphub) and gtphub will resolve the -GGSNs once it has received the messages. So the SGSN may be behind NAT (add -"sgsn-use-sender" to gtphub.conf) and communicate to various GGSNs over a -single link to gtphub. - -I hope this helps to get you going. -Any suggestions/patches are welcome! - -~Neels - diff --git a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg deleted file mode 100644 index 3913d2c..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! -! This file is used for VTY tests, referenced by openbsc/osmoappdesc.py -! For the test, try to use most config commands. -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, both on one interface. - ! The side towards SGSN uses nonstandard ports. - bind-to-sgsns ctrl 127.0.0.1 12123 user 127.0.0.1 12153 - ! The GGSN side with standard ports. - bind-to-ggsns 127.0.0.1 - - ! Proxy: unconditionally direct all traffic to... - sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg deleted file mode 100644 index 0dc4150..0000000 --- a/doc/examples/osmo-gtphub/osmo-gtphub.cfg +++ /dev/null @@ -1,25 +0,0 @@ -! -! Osmocom gtphub configuration -! - -line vty - no login - -gtphub - ! Local addresses to listen on and send from, each on standard ports - ! 2123 and 2152. Setting these addresses is mandatory. - bind-to-sgsns 127.0.0.1 - bind-to-ggsns 127.0.0.2 - - ! Local nonstandard ports or separate IPs: - !bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223 - - ! Proxy: unconditionally direct all traffic to... - !ggsn-proxy 127.0.0.3 - !sgsn-proxy 127.0.0.4 - - ! Proxy with nonstandard ports or separate IPs: - !ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 - - ! Add a name server for GGSN resolution - !grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg deleted file mode 100644 index 1b1d192..0000000 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ /dev/null @@ -1,19 +0,0 @@ -! -! OsmoMSC configuration saved from vty -! -line vty - no login -! -network - network country code 1 - mobile network code 1 - short name OsmoMSC - long name OsmoMSC - auth policy closed - location updating reject cause 13 - encryption a5 0 - rrlp mode none - mm info 1 -msc - mgcpgw remote-ip 10.23.24.1 - assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg deleted file mode 100644 index 5e64342..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ /dev/null @@ -1,27 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy accept-all -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg deleted file mode 100644 index 06f035f..0000000 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ /dev/null @@ -1,29 +0,0 @@ -! -! Osmocom SGSN configuration -! -! -line vty - no login -! -sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.2 - ggsn 0 gtp-version 1 - auth-policy remote - gsup remote-ip 127.0.0.1 - gsup remote-port 4222 -! -ns - timer tns-block 3 - timer tns-block-retries 3 - timer tns-reset 3 - timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 - encapsulation udp local-port 23000 - encapsulation framerelay-gre enabled 0 -! -bssgp -! diff --git a/doc/gsm-hopping.txt b/doc/gsm-hopping.txt deleted file mode 100644 index c964963..0000000 --- a/doc/gsm-hopping.txt +++ /dev/null @@ -1,54 +0,0 @@ -according to GSM 05.02: - -general parameters from CCCH: -* CA cell allocation of ARFCN's (System Information / BCCH) -* FN: TDMA frame number (t1,t2,t3') in SCH - -specific parameters from channel assignment: -* MA: mobile allocation, defines set of ARFCN's, up to 64 -* MAIO: index -* HSN: hopping sequence generator number (0..64) - - -hopping sequence generation (6.2.3): - -uint8_t rntable[114] = { - 48, 98, 63, 1, 36, 95, 78, 102, 94, 73, - 0, 64, 25, 81, 76, 59, 124, 23, 104, 100, - 101, 47, 118, 85, 18, 56, 96, 86, 54, 2, - 80, 34, 127, 13, 6, 89, 57, 103, 12, 74, - 55, 111, 75, 38, 109, 71, 112, 29, 11, 88, - 87, 19, 3, 68, 110, 26, 33, 31, 8, 45, - 82, 58, 40, 107, 32, 5, 106, 92, 62, 67, - 77, 108, 122, 37, 60, 66, 121, 42, 51, 126, - 117, 114, 4, 90, 43, 52, 53, 113, 120, 72, - 16, 49, 7, 79, 119, 61, 22, 84, 9, 97, - 125, 99, 17, 123 -}; - -/* mai=0 represents lowest ARFCN in the MA */ - - -uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio, - uint8_t t1, uint8_t t2, uint8_t t3_) -{ - uint8_t mai; - - if (hsn == 0) /* cyclic hopping */ - mai = (fn + maio) % n; - else { - uint32_t m, m_, t_, s; - - m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; - m_ = m % (2^NBIN); - t_ = t3 % (2^NBIN); - if (m_ < n then) - s = m_; - else - s = (m_ + t_) % n; - mai = (s + maio) % n; - } - - return mai; -} - diff --git a/doc/handover.txt b/doc/handover.txt deleted file mode 100644 index ac19e87..0000000 --- a/doc/handover.txt +++ /dev/null @@ -1,89 +0,0 @@ -Ideas about a handover algorithm -====================================================================== - -This is mostly based on the results presented in Chapter 8 of "Performance -Enhancements in a Frequency Hopping GSM Network" by Thomas Toftegaard Nielsen -and Joeroen Wigard. - - -=== Reasons for performing handover === - -Section 2.1.1: Handover used in their CAPACITY simulation: - -1) Interference Handover - -Average RXLEV is satisfactory high, but average RXQUAL too low indicates -interference to the channel. Handover should be made. - -2) Bad Quality - -Averaged RXQUAL is lower than a threshold - -3) Low Level / Signal Strength - -Average RXLEV is lower than a threshold - -4) Distance Handover - -MS is too far away from a cell (measured by TA) - -5) Power budget / Better Cell - -RX Level of neighbor cell is at least "HO Margin dB" dB better than the -current serving cell. - -=== Ideal parameters for HO algorithm === - -Chapter 8, Section 2.2, Table 24: - -Window RXLEV averaging: 10 SACCH frames (no weighting) -Window RXQUAL averaging: 1 SACCH frame (no averaging) -Level Threashold: 1 of the last 1 AV-RXLEV values < -110dBm -Quality Threshold: 3 of the last 4 AV-RXQUAL values >= 5 -Interference Threshold: 1 of the last AV-RXLEV > -85 dBm & - 3 of the last 4 AV-RXQUAL values >= 5 -Power Budget: Level of neighbor cell > 3 dB better -Power Budget Interval: Every 6 SACCH frames (6 seconds ?!?) -Distance Handover: Disabled -Evaluation rule 1: RXLEV of the candidate cell a tleast -104 dBm -Evaluation rule 2: Level of candidate cell > 3dB better own cell -Timer Successful HO: 5 SACCH frames -Timer Unsuccessful HO: 1 SACCH frame - -In a non-frequency hopping case, RXQUAL threshold can be decreased to -RXLEV >= 4 - -When frequency hopping is enabled, the following additional parameters -should be introduced: - -* No intra-cell handover -* Use a HO Margin of 2dB - -=== Handover Channel Reservation === - -In loaded network, each cell should reserve some channels for handovers, -rather than using all of them for new call establishment. This reduces the -need to drop calls due to failing handovers, at the expense of failing new call -attempts. - -=== Dynamic HO Margin === - -The handover margin (hysteresis) should depend on the RXQUAL. Optimal results -were achieved with the following settings: -* RXQUAL <= 4: 9 dB -* RXQUAL == 5: 6 dB -* RXQUAL >= 6: 1 dB - - - -== Actual Handover on a protocol level == - -After the BSC has decided a handover shall be done, it has to - -# allocate a channel at the new BTS -# allocate a handover reference -# activate the channel on the BTS side using RSL CHANNEL ACTIVATION, - indicating the HO reference -# BTS responds with CHAN ACT ACK, including GSM frame number -# BSC sends 04.08 HO CMD to MS using old BTS - diff --git a/doc/ipa-sccp.txt b/doc/ipa-sccp.txt deleted file mode 100644 index 5d6719e..0000000 --- a/doc/ipa-sccp.txt +++ /dev/null @@ -1,94 +0,0 @@ - -IPA SCCP message flow in the BSC - -February, 2013 Holger Hans Peter Freyther - -CONTENTS - -1. SCCP inside the IPA header -2. Supported SCCP message types -3. Receiving SCCP messages -4. Sending SCCP messages - - -1. SCCP inside the IPA header - -Many Soft-MSCs implement something that is called SCCP/lite. This means -that SCCP messages are transported inside a small multiplexing protocol -over TCP/IP. This is an alternative to a full SIGTRAN implementation. - -The multiplexing protocol is the same as used with the sysmoBTS and the -ip.access nanoBTS. It is a three byte header with two bytes for the length -in network byte order and one byte for the type. The type to be used for -SCCP is 0xFD. - - struct ipa_header { - uint16_t length_in_network_order; - uint8_t type; - } __attribute__((packed)); - - - -2. Supported SCCP message types - -To implement GSM 08.08 only a subset of SCCP messages need to be implemented. -For transporting paging and reset messages SCCP UDT messages are used. For -the connections with a Mobile Station (MS) a SCCP connection is opened. This -means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1 -and SCCP IT messages are supported. - - -3. Receiving SCCP UDT messages - -This is an illustration of the flow of messages. The IPA multiplexing protocol -is used for various protocols. This means there is a central place where the -multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c -file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching -sccp_system_incoming method is called. This function is implemented in the -libosmo-sccp library. - -To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the -sccp_set_read function to register a callback for UDT messages. The callback -is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the -osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages. -Currently only the reset acknowledge and the paging messages are handled. - -The BSC currently does not accept incoming SCCP messages and is only opening -SCCP connections to the MSC. When opening a connection the callbacks for state -changes (connection confirmed, released, release complete) are set and a routine -for handling incoming data. This registration is done in the osmo_bsc_sccp.c -file and the bsc_create_new_connection method. The name of the callback is -msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented -in the osmo_bsc_bssap.c file. This will forward the messages to the right -Mobile Station (MS). - - -4. Sending SCCP messages - -There are three parts to sending that will be explained below. The first part -is to send an entire SCCP frame (which includes the GSM 08.08 data) to the -MSC. This is done by first registering the low level sending. sccp_system_init -is called with the function that is responsible for sending a message. The -msc_sccp_write_ipa will call the msc_queue_write function with the data and -the right MSC connection. Below the msc_queue_write the IPA header will be -prepended to the msg and then send to the MSC. - -The BSC supports multiple different A-link connections, the decision to pick -the right MSC is done in this method. It is either done via the SCCP connection -or the ctx pointer. - -When the BSC is starting a BSS RESET message will be sent to the MSC. The reset -is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with -the GSM 08.08 data and the connection to use. The libosmo-sccp library will -embed it into a SCCP UDT message and call the msc_sccp_write_ipa method. - -When a new SCCP connection is to be created the bsc_create_new_connection -in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create -the context for a SCCP connection. The state and data callback will be used -to be notified about data and changes. Once the connection is configured the -bsc_open_connection will be called that will ask the libosmo-sccp library to -create a SCCP CR message using the sccp_connection_connect method. For active -connections the sccp_connection_write method will be called. - - - diff --git a/doc/oml-interface.txt b/doc/oml-interface.txt deleted file mode 100644 index 02bead7..0000000 --- a/doc/oml-interface.txt +++ /dev/null @@ -1,22 +0,0 @@ -oml interface design notes - -problems: - -* there is no way how to tag a command sent to the BTS, with the response - having the same tag to identify the originator of the command -* therefore, we can have e.g. both the BSC and the OML interface send a - SET ATTRIBUTE message, where the responses would end up at the wrong - query. -* The BTS has 10s to ACK/NACK a command. We do not run any timers. - -the only possible solutions i can imagine: -* have some kind of exclusive locking, where the OML interface gets blocked - from the BSC and is exclusively assigned to the OML console until all commands - of the OML console have terminated. This can either be done explicitly - dynamically or on demand - -* use the OML interface synchronously, i.e. always wait for the response from - the BTS before - -* unilateral / unsolicited messages need to be broadcasted to both the BSC and - the OML console diff --git a/doc/osmo-nitb-data_structures.dot b/doc/osmo-nitb-data_structures.dot deleted file mode 100644 index 81955e8..0000000 --- a/doc/osmo-nitb-data_structures.dot +++ /dev/null @@ -1,33 +0,0 @@ -digraph G { - net [label="gsm_network"] - bts [label="gsm_bts"] - trx [label="gsm_bts_trx"] - ts [label="gsm_bts_trx_ts"] - lchan [label="gsm_lchan"] - sub [label="gsm_subscriber"] - subcon [label="gsm_subscriber_conn"] - sccpcon [label="osmo_bsc_sccp_con"] - subgrp [label="gsm_subscriber_group"] - - net -> bts - bts -> trx - trx -> ts - ts -> lchan - - lchan -> ts - ts -> trx - trx -> bts - bts -> net - - lchan -> subcon - - subcon -> sub - subcon -> sccpcon - subcon -> lchan - subcon -> lchan [label="ho_lchan"] - subcon -> bts - subcon -> lchan [label="secondary_lchan"] - - sub -> subgrp - subgrp -> net -} diff --git a/doc/paging.txt b/doc/paging.txt deleted file mode 100644 index c597c22..0000000 --- a/doc/paging.txt +++ /dev/null @@ -1,48 +0,0 @@ - -GSM Paging implementation in OpenBSC - -== Code structure == - -The code is implemented in the libbsc/paging.c file. The external -interface is documented/specified in the include/openbsc/paging.h -header file. The code is used by the NITB and BSC application. - - -== Implementation == - -Paging can be initiated in two ways. The standard way is to page by -LAC. Each BTS has its own list/queue of outstanding paging operation. -When a subscriber is paged one "struct paging_request" per BTS will -be allocated and added to the tail of the list. The BTS is supposed -to be configured to not repeat the paging. - -A paging_request will remain in the queue until a paging response or at -the expiry of the T3113. Every 500 milliseconds a RSL paging command is -send to the BTS. The 500 milliseconds is a throttling to not crash the -ip.access nanoBTS. Once one paging_request has been handled it will be -put at the end of the queue/list and the available slots for the BTS -will be decreased. - -The available slots will be updated based on the paging load information -element of the CCCH Load indication. If no paging slots are considered -to be available and no load indication is sent a timer is started. The -current timeout is 500 milliseconds and at the expiry of the timer the -available slots will be set to 20. - -OpenBSC has the " paging free <-1-1024>" configuration option. In case -there are less free channels than required no paging request will be -sent to the BTS. Instead it will be attempted to send the paging request -at the next timeout (500 milliseconds). - -== Limitation == - -The paging throughput could be higher but this has lead to crashes on the -ip.access nanoBTS in the past. - -== Configuration == - -=== ip.access nanoBTS === - -The current CCCH Load indication threshold is 10% and the period is 1 second. -The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the -nanobts_attr_bts array. diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h deleted file mode 100644 index 3cdbe04..0000000 --- a/include/openbsc/gsm_04_14.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode); -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs); -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology); - -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h deleted file mode 100644 index d5e1428..0000000 --- a/include/openbsc/iu_dummy.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Trivial switch-off of external Iu dependencies, - * allowing to run full unit tests even when built without Iu support. */ - -/* - * (C) 2016,2017 by sysmocom s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include - -struct msgb; -struct gsm_auth_tuple; -struct RANAP_Cause; -struct osmo_auth_vector; - -struct ranap_ue_conn_ctx { - struct llist_head list; - uint32_t conn_id; -}; - -int ranap_iu_tx(struct msgb *msg, uint8_t sapi); -int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, - int send_ck); -int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); -struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); -int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); -int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); -int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c deleted file mode 100644 index b529f4c..0000000 --- a/src/libmsc/gsm_04_14.c +++ /dev/null @@ -1,133 +0,0 @@ -/* GSM MS Testing Layer 3 messages - * 3GPP TS 44.014 / GSM TS 04.14 */ - -/* (C) 2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include "bscconfig.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static struct msgb *create_gsm0414_msg(uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_TEST; - gh->msg_type = msg_type; - return msg; -} - -static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - return msc_tx_dtap(conn, msg); -} - -static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) -{ - struct msgb *msg = create_gsm0414_msg(msg_type); - - return gsm0414_conn_sendmsg(conn, msg); -} - - -/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ -int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, - enum gsm414_tch_loop_mode loop_mode) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); - uint8_t subch; - - subch = (loop_mode << 1); - msgb_put_u8(msg, subch); - - msg->lchan = conn->lchan; - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a OPEN_LOOP_CMD according to Section 8.3 */ -int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); -} - -/* Send a ACT_EMMI_CMD according to Section 8.8 */ -int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); -} - -/* Send a DEACT_EMMI_CMD according to Section 8.10 */ -int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) -{ - return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); -} - -/* Send a TEST_INTERFACE according to Section 8.11 */ -int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, - uint8_t tested_devs) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); - msgb_put_u8(msg, tested_devs); - return gsm0414_conn_sendmsg(conn, msg); -} - -/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ -int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, - uint8_t technology) -{ - struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); - msgb_put_u8(msg, technology); - return gsm0414_conn_sendmsg(conn, msg); -} - - - -/* Entry point for incoming GSM48_PDISC_TEST received from MS */ -int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - - if (msgb_l3len(msg) < sizeof(*gh)) - return -1; - - LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", - get_value_string(gsm414_msgt_names, gh->msg_type)); - - return 0; -} diff --git a/tests/Makefile.am b/tests/Makefile.am index 4a1f27a..f6cb938 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,7 +25,6 @@ $(srcdir)/package.m4 \ $(TESTSUITE) \ vty_test_runner.py \ - ctrl_test_runner.py \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -39,7 +38,6 @@ osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v $(PYTHON) $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v - $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py deleted file mode 100644 index 2e59e13..0000000 --- a/tests/ctrl_test_runner.py +++ /dev/null @@ -1,575 +0,0 @@ -#!/usr/bin/env python - -# (C) 2013 by Jacob Erlbeck -# (C) 2014 by Holger Hans Peter Freyther -# based on vty_test_runner.py: -# (C) 2013 by Katerina Barone-Adesi -# (C) 2013 by Holger Hans Peter Freyther -# based on bsc_control.py. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import os -import time -import unittest -import socket -import sys -import struct - -import osmopy.obscvty as obscvty -import osmopy.osmoutil as osmoutil - -# add $top_srcdir/contrib to find ipa.py -sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) - -from ipa import Ctrl, IPA - -# to be able to find $top_srcdir/doc/... -confpath = os.path.join(sys.path[0], '..') -verbose = False - -class TestCtrlBase(unittest.TestCase): - - def ctrl_command(self): - raise Exception("Needs to be implemented by a subclass") - - def ctrl_app(self): - raise Exception("Needs to be implemented by a subclass") - - def setUp(self): - osmo_ctrl_cmd = self.ctrl_command()[:] - config_index = osmo_ctrl_cmd.index('-c') - if config_index: - cfi = config_index + 1 - osmo_ctrl_cmd[cfi] = os.path.join(confpath, osmo_ctrl_cmd[cfi]) - - try: - self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) - except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" - time.sleep(2) - - appstring = self.ctrl_app()[2] - appport = self.ctrl_app()[0] - self.connect("127.0.0.1", appport) - self.next_id = 1000 - - def tearDown(self): - self.disconnect() - osmoutil.end_proc(self.proc) - - def disconnect(self): - if not (self.sock is None): - self.sock.close() - - def connect(self, host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) - - retries = 30 - while True: - try: - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - except IOError: - retries -= 1 - if retries <= 0: - raise - time.sleep(.1) - continue - break - self.sock = sck - return sck - - def send(self, data): - if verbose: - print "Sending \"%s\"" %(data) - data = Ctrl().add_header(data) - return self.sock.send(data) == len(data) - - def send_set(self, var, value, id): - setmsg = "SET %s %s %s" %(id, var, value) - return self.send(setmsg) - - def send_get(self, var, id): - getmsg = "GET %s %s" %(id, var) - return self.send(getmsg) - - def do_set(self, var, value): - id = self.next_id - self.next_id += 1 - self.send_set(var, value, id) - return self.recv_msgs()[id] - - def do_get(self, var): - id = self.next_id - self.next_id += 1 - self.send_get(var, id) - return self.recv_msgs()[id] - - def recv_msgs(self): - responses = {} - data = self.sock.recv(4096) - while (len(data)>0): - (head, data) = IPA().split_combined(data) - answer = Ctrl().rem_header(head) - if verbose: - print "Got message:", answer - (mtype, id, msg) = answer.split(None, 2) - id = int(id) - rsp = {'mtype': mtype, 'id': id} - if mtype == "ERROR": - rsp['error'] = msg - else: - split = msg.split(None, 1) - rsp['var'] = split[0] - if len(split) > 1: - rsp['value'] = split[1] - else: - rsp['value'] = None - responses[id] = rsp - - if verbose: - print "Decoded replies: ", responses - - return responses - - -class TestCtrlBSC(TestCtrlBase): - - def tearDown(self): - TestCtrlBase.tearDown(self) - os.unlink("tmp_dummy_sock") - - def ctrl_command(self): - return ["./src/osmo-bsc/osmo-bsc", "-r", "tmp_dummy_sock", "-c", - "doc/examples/osmo-bsc/osmo-bsc.cfg"] - - def ctrl_app(self): - return (4249, "./src/osmo-bsc/osmo-bsc", "OsmoBSC", "bsc") - - def testCtrlErrs(self): - r = self.do_get('invalid') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Command not found') - - r = self.do_set('rf_locked', '999') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Value failed verification.') - - r = self.do_get('bts') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Error while parsing the index.') - - r = self.do_get('bts.999') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Error while resolving object') - - def testBtsLac(self): - r = self.do_get('bts.0.location-area-code') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.location-area-code') - self.assertEquals(r['value'], '1') - - r = self.do_set('bts.0.location-area-code', '23') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.location-area-code') - self.assertEquals(r['value'], '23') - - r = self.do_get('bts.0.location-area-code') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.location-area-code') - self.assertEquals(r['value'], '23') - - r = self.do_set('bts.0.location-area-code', '-1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Input not within the range') - - def testBtsCi(self): - r = self.do_get('bts.0.cell-identity') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.cell-identity') - self.assertEquals(r['value'], '0') - - r = self.do_set('bts.0.cell-identity', '23') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.cell-identity') - self.assertEquals(r['value'], '23') - - r = self.do_get('bts.0.cell-identity') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.cell-identity') - self.assertEquals(r['value'], '23') - - r = self.do_set('bts.0.cell-identity', '-1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Input not within the range') - - def testBtsGenerateSystemInformation(self): - r = self.do_get('bts.0.send-new-system-informations') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Write Only attribute') - - # No RSL links so it will fail - r = self.do_set('bts.0.send-new-system-informations', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Failed to generate SI') - - def testBtsChannelLoad(self): - r = self.do_set('bts.0.channel-load', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Read Only attribute') - - # No RSL link so everything is 0 - r = self.do_get('bts.0.channel-load') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['value'], - 'CCCH+SDCCH4,0,0 TCH/F,0,0 TCH/H,0,0 SDCCH8,0,0' - + ' TCH/F_PDCH,0,0 CCCH+SDCCH4+CBCH,0,0' - + ' SDCCH8+CBCH,0,0 TCH/F_TCH/H_PDCH,0,0') - - def testBtsOmlConnectionState(self): - """Check OML state. It will not be connected""" - r = self.do_set('bts.0.oml-connection-state', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Read Only attribute') - - # No RSL link so everything is 0 - r = self.do_get('bts.0.oml-connection-state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['value'], 'disconnected') - - def testTrxPowerRed(self): - r = self.do_get('bts.0.trx.0.max-power-reduction') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction') - self.assertEquals(r['value'], '20') - - r = self.do_set('bts.0.trx.0.max-power-reduction', '22') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction') - self.assertEquals(r['value'], '22') - - r = self.do_get('bts.0.trx.0.max-power-reduction') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.max-power-reduction') - self.assertEquals(r['value'], '22') - - r = self.do_set('bts.0.trx.0.max-power-reduction', '1') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Value must be even') - - def testTrxArfcn(self): - r = self.do_get('bts.0.trx.0.arfcn') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.arfcn') - self.assertEquals(r['value'], '871') - - r = self.do_set('bts.0.trx.0.arfcn', '873') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.arfcn') - self.assertEquals(r['value'], '873') - - r = self.do_get('bts.0.trx.0.arfcn') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.trx.0.arfcn') - self.assertEquals(r['value'], '873') - - r = self.do_set('bts.0.trx.0.arfcn', '2000') - self.assertEquals(r['mtype'], 'ERROR') - self.assertEquals(r['error'], 'Input not within the range') - - def testRfLock(self): - r = self.do_get('bts.0.rf_state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.rf_state') - self.assertEquals(r['value'], 'inoperational,unlocked,on') - - r = self.do_set('rf_locked', '1') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], '1') - - time.sleep(1.5) - - r = self.do_get('bts.0.rf_state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.rf_state') - self.assertEquals(r['value'], 'inoperational,locked,off') - - r = self.do_get('rf_locked') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], 'state=off,policy=off') - - r = self.do_set('rf_locked', '0') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], '0') - - time.sleep(1.5) - - r = self.do_get('bts.0.rf_state') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.rf_state') - self.assertEquals(r['value'], 'inoperational,unlocked,on') - - r = self.do_get('rf_locked') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'rf_locked') - self.assertEquals(r['value'], 'state=off,policy=on') - - def testTimezone(self): - r = self.do_get('timezone') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], 'off') - - r = self.do_set('timezone', '-2,15,2') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], '-2,15,2') - - r = self.do_get('timezone') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], '-2,15,2') - - # Test invalid input - r = self.do_set('timezone', '-2,15,2,5,6,7') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], '-2,15,2') - - r = self.do_set('timezone', '-2,15') - self.assertEquals(r['mtype'], 'ERROR') - r = self.do_set('timezone', '-2') - self.assertEquals(r['mtype'], 'ERROR') - r = self.do_set('timezone', '1') - - r = self.do_set('timezone', 'off') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], 'off') - - r = self.do_get('timezone') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'timezone') - self.assertEquals(r['value'], 'off') - - def testMcc(self): - r = self.do_set('mcc', '23') - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '23') - - r = self.do_set('mcc', '023') - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '23') - - def testMnc(self): - r = self.do_set('mnc', '9') - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '9') - - r = self.do_set('mnc', '09') - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '9') - - - def testMccMncApply(self): - # Test some invalid input - r = self.do_set('mcc-mnc-apply', 'WRONG') - self.assertEquals(r['mtype'], 'ERROR') - - r = self.do_set('mcc-mnc-apply', '1,') - self.assertEquals(r['mtype'], 'ERROR') - - r = self.do_set('mcc-mnc-apply', '200,3') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - # Set it again - r = self.do_set('mcc-mnc-apply', '200,3') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Nothing changed') - - # Change it - r = self.do_set('mcc-mnc-apply', '200,4') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - # Change it - r = self.do_set('mcc-mnc-apply', '201,4') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - # Verify - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '4') - - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '201') - - # Change it - r = self.do_set('mcc-mnc-apply', '202,03') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'mcc-mnc-apply') - self.assertEquals(r['value'], 'Tried to drop the BTS') - - r = self.do_get('mnc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mnc') - self.assertEquals(r['value'], '3') - - r = self.do_get('mcc') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'mcc') - self.assertEquals(r['value'], '202') - -class TestCtrlNAT(TestCtrlBase): - - def ctrl_command(self): - return ["./src/osmo-bsc_nat/osmo-bsc_nat", "-c", - "doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"] - - def ctrl_app(self): - return (4250, "./src/osmo-bsc_nat/osmo-bsc_nat", "OsmoNAT", "nat") - - def testAccessList(self): - r = self.do_get('net.0.bsc_cfg.0.access-list-name') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], None) - - r = self.do_set('net.0.bsc_cfg.0.access-list-name', 'bla') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], 'bla') - - r = self.do_get('net.0.bsc_cfg.0.access-list-name') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], 'bla') - - r = self.do_set('net.0.bsc_cfg.0.no-access-list-name', '1') - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], None) - - r = self.do_get('net.0.bsc_cfg.0.access-list-name') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'net') - self.assertEquals(r['value'], None) - - def testAccessListManagement(self): - r = self.do_set("net.0.add.allow.access-list.404", "abc") - self.assertEquals(r['mtype'], 'ERROR') - - r = self.do_set("net.0.add.allow.access-list.bla", "^234$") - self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'net.0.add.allow.access-list.bla') - self.assertEquals(r['value'], 'IMSI allow added to access list') - - # TODO.. find a way to actually see if this rule has been - # added. e.g. by implementing a get for the list. - -class TestCtrlSGSN(TestCtrlBase): - def ctrl_command(self): - return ["./src/gprs/osmo-sgsn", "-c", - "doc/examples/osmo-sgsn/osmo-sgsn.cfg"] - - def ctrl_app(self): - return (4251, "./src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn") - - def testListSubscribers(self): - # TODO. Add command to mark a subscriber as active - r = self.do_get('subscriber-list-active-v1') - self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'subscriber-list-active-v1') - self.assertEquals(r['value'], None) - -def add_bsc_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): - print("Skipping the BSC test") - return - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlBSC) - suite.addTest(test) - -def add_nat_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc_nat/osmo-bsc_nat")): - print("Skipping the NAT test") - return - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlNAT) - suite.addTest(test) - -def add_sgsn_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/gprs/osmo-sgsn")): - print("Skipping the SGSN test") - return - test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlSGSN) - suite.addTest(test) - -if __name__ == '__main__': - import argparse - import sys - - workdir = '.' - - parser = argparse.ArgumentParser() - parser.add_argument("-v", "--verbose", dest="verbose", - action="store_true", help="verbose mode") - parser.add_argument("-p", "--pythonconfpath", dest="p", - help="searchpath for config") - parser.add_argument("-w", "--workdir", dest="w", - help="Working directory") - args = parser.parse_args() - - verbose_level = 1 - if args.verbose: - verbose_level = 2 - verbose = True - - if args.w: - workdir = args.w - - if args.p: - confpath = args.p - - print "confpath %s, workdir %s" % (confpath, workdir) - os.chdir(workdir) - print "Running tests for specific control commands" - suite = unittest.TestSuite() - add_bsc_test(suite, workdir) - add_nat_test(suite, workdir) - add_sgsn_test(suite, workdir) - res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) - sys.exit(len(res.errors) + len(res.failures)) diff --git a/tools/hlrstat.pl b/tools/hlrstat.pl deleted file mode 100755 index 668fc9a..0000000 --- a/tools/hlrstat.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl - -use strict; -use DBI; -my $dbh = DBI->connect("dbi:SQLite:dbname=hlr.sqlite3","",""); - - -my %mcc_names; -my %mcc_mnc_names; - -sub get_mcc_mnc_name($) -{ - my $mcc_mnc = shift; - my $ret = $mcc_mnc; - - if ($mcc_mnc_names{$mcc_mnc} ne '') { - $ret = $mcc_mnc_names{$mcc_mnc}; - } - - return $ret; -} - -sub read_networks($) -{ - my $filename = shift; - my $cur_name; - - open(INFILE, $filename); - while (my $l = ) { - chomp($l); - if ($l =~ /^#/) { - next; - } - if ($l =~ /^\t/) { - my ($mcc, $mnc, $brand, $r) = split(' ', $l, 4); - #printf("%s|%s|%s\n", $mcc, $mnc, $brand); - $mcc_mnc_names{"$mcc-$mnc"} = $brand; - $mcc_names{$mcc} = $cur_name; - } elsif ($l =~ /^(\w\w)\t(.*)/) { - #printf("%s|%s\n", $1, $2); - $cur_name = $2; - } - } - close(INFILE); -} - -read_networks("networks.tab"); - -my %oper_count; -my %country_count; - -#my $sth = $dbh->prepare("SELECT imsi FROM subscriber where authorized=1"); -my $sth = $dbh->prepare("SELECT imsi FROM subscriber"); - -$sth->execute(); - -while (my $href = $sth->fetchrow_hashref) { - my ($mcc, $mnc) = $$href{imsi} =~ /(\d{3})(\d{2}).*/; - #printf("%s %s-%s \n", $$href{imsi}, $mcc, $mnc); - $oper_count{"$mcc-$mnc"}++; - $country_count{$mcc}++; -} - - -foreach my $c (sort{$country_count{$b} <=> $country_count{$a}} keys %country_count) { - printf("%s: %d\n", $mcc_names{$c}, $country_count{$c}); - - foreach my $k (sort{$oper_count{$b} <=> $oper_count{$a}} keys %oper_count) { - if ($k =~ /^$c-/) { - printf("\t%s: %d\n", get_mcc_mnc_name($k), $oper_count{$k}); - } - } -} -- To view, visit https://gerrit.osmocom.org/3780 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I623ba8c053bef91a327e58de214e05f0d6768605 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:54:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 7 Sep 2017 15:54:43 +0000 Subject: osmo-gsm-tester[master]: jenkins-common: ensure requested binaries indeed have been b... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iceddeee6aebb1cdb54d7304495c3e332390261db Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:56:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 7 Sep 2017 15:56:48 +0000 Subject: osmo-gsm-tester[master]: jenkins: build from new osmo-{msc, bsc, mgw, sgsn} repositories In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I194ad5169dbe013c8e1cf9d631033cb2576744dd Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:58:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:58:06 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: build from new osmo-{msc, bsc, mgw, sgsn} repositories In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: build from new osmo-{msc,bsc,mgw,sgsn} repositories ...................................................................... jenkins: build from new osmo-{msc,bsc,mgw,sgsn} repositories The idea is to build each binary separately: even though osmo-msc requires libosmo-sccp, which already includes the osmo-stp binary, we still want osmo-stp to be built from a separate script. The reason: to track down regressions, we can change the versions each binary is built from separately. The additional build effort and jenkins script multitude is acceptable. Change-Id: I194ad5169dbe013c8e1cf9d631033cb2576744dd --- A contrib/jenkins-build-osmo-bsc.sh A contrib/jenkins-build-osmo-ggsn.sh A contrib/jenkins-build-osmo-mgw.sh M contrib/jenkins-build-osmo-msc.sh A contrib/jenkins-build-osmo-sgsn.sh A contrib/jenkins-build-osmo-stp.sh M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_stp.py 9 files changed, 67 insertions(+), 12 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-bsc.sh b/contrib/jenkins-build-osmo-bsc.sh new file mode 100755 index 0000000..ee58c9d --- /dev/null +++ b/contrib/jenkins-build-osmo-bsc.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-bsc" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo libosmo-sccp +build_repo osmo-mgw +build_repo osmo-bsc + +create_bin_tgz osmo-bsc diff --git a/contrib/jenkins-build-osmo-ggsn.sh b/contrib/jenkins-build-osmo-ggsn.sh new file mode 100755 index 0000000..a46c3aa --- /dev/null +++ b/contrib/jenkins-build-osmo-ggsn.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-ggsn" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo osmo-ggsn + +create_bin_tgz osmo-ggsn diff --git a/contrib/jenkins-build-osmo-mgw.sh b/contrib/jenkins-build-osmo-mgw.sh new file mode 100755 index 0000000..4ca1e45 --- /dev/null +++ b/contrib/jenkins-build-osmo-mgw.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-mgw" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo osmo-mgw + +create_bin_tgz osmo-bsc_mgcp diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 8025ca2..c0faf78 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -7,11 +7,9 @@ build_repo libosmocore --disable-doxygen build_repo libosmo-abis build_repo libosmo-netif --disable-doxygen -build_repo openggsn build_repo libsmpp34 build_repo libosmo-sccp -build_repo libasn1c -build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH -build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu +build_repo osmo-mgw +build_repo osmo-msc --enable-smpp --disable-iu create_bin_tgz osmo-msc diff --git a/contrib/jenkins-build-osmo-sgsn.sh b/contrib/jenkins-build-osmo-sgsn.sh new file mode 100755 index 0000000..1979e8c --- /dev/null +++ b/contrib/jenkins-build-osmo-sgsn.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-sgsn" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo libosmo-sccp +build_repo openggsn +build_repo osmo-sgsn --disable-iu + +create_bin_tgz osmo-sgsn diff --git a/contrib/jenkins-build-osmo-stp.sh b/contrib/jenkins-build-osmo-stp.sh new file mode 100755 index 0000000..86cbe3d --- /dev/null +++ b/contrib/jenkins-build-osmo-stp.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-stp" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-doxygen +build_repo libosmo-abis +build_repo libosmo-netif --disable-doxygen +build_repo libosmo-sccp + +create_bin_tgz osmo-stp diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 2eb23fb..f9eb858 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -43,10 +43,7 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - # NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the - # osmo-msc build will also provide the OsmoBSC binary. As soon as the - # repositories are separate, there shall be a separate artifact. - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-bsc'))) binary = inst.child('bin', 'osmo-bsc') if not os.path.isfile(binary): diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index db41dff..93c3a7c 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -40,7 +40,7 @@ self.log('Starting osmo-mgcpgw') self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-mgw'))) binary = inst.child('bin', 'osmo-bsc_mgcp') if not os.path.isfile(binary): raise RuntimeError('Binary missing: %r' % binary) diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py index 1aeb879..cc3906f 100644 --- a/src/osmo_gsm_tester/osmo_stp.py +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -39,9 +39,7 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of - # OsmoMSC. - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-stp'))) binary = inst.child('bin', 'osmo-stp') if not os.path.isfile(binary): -- To view, visit https://gerrit.osmocom.org/3887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I194ad5169dbe013c8e1cf9d631033cb2576744dd Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 7 15:58:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 15:58:06 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins-common: ensure requested binaries indeed have been b... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins-common: ensure requested binaries indeed have been built ...................................................................... jenkins-common: ensure requested binaries indeed have been built Recent change Ib1a00b2149453fedf9ece0460dd4d6e83f774d45 drops binaries from a build artifact by leaving only explicitly requested ones. This adds a check that the requested ones indeed exist. Change-Id: Iceddeee6aebb1cdb54d7304495c3e332390261db --- M contrib/jenkins-build-common.sh 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 3d9932d..e15c616 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -156,6 +156,15 @@ fi done + # ensure requested binaries indeed exist + for b in $wanted_binaries ; do + if [ ! -f "$b" ]; then + set +x; echo "ERROR: no such binary: $b in $prefix_real/bin/"; set -x + ls -1 "$prefix_real/bin" + exit 1 + fi + done + cd "$prefix_real" this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" tar="${this}.tgz" -- To view, visit https://gerrit.osmocom.org/3886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iceddeee6aebb1cdb54d7304495c3e332390261db Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 7 16:08:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 7 Sep 2017 16:08:13 +0000 Subject: [PATCH] osmocom-bb[master]: Add arbitrary config file location support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3884 to look at the new patch set (#2). Add arbitrary config file location support All other Osmocom projects use '-c' command line option to specify the location of config file. Let's do the same with fallback to existing implicit config file name logic. Also print config file path and vty host on startup. Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 --- M src/host/layer23/src/mobile/app_mobile.c M src/host/layer23/src/mobile/main.c 2 files changed, 16 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/84/3884/2 diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index 7dc7208..fd2c94f 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -409,12 +409,13 @@ " using: 'touch %s'\n", config_file); return rc; } + printf("Using configuration from %s\n", config_file); } vty_reading = 0; rc = telnet_init_dynif(l23_ctx, NULL, vty_ip, vty_port); if (rc < 0) return rc; - printf("VTY available on port %u.\n", vty_port); + printf("VTY available on %s %u\n", vty_ip, vty_port); osmo_signal_register_handler(SS_GLOBAL, &global_signal_cb, NULL); osmo_signal_register_handler(SS_L1CTL, &mobile_signal_cb, NULL); diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 630bc53..4a2e4ec 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ void *l23_ctx = NULL; struct llist_head ms_list; static char *gsmtap_ip = 0; +static const char *config_file = ".osmocom/bb/mobile.cfg"; +bool use_default_cfg = true; struct gsmtap_inst *gsmtap_inst = NULL; static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; @@ -96,6 +99,7 @@ printf(" -d --debug Change debug flags. default: %s\n", debug_default); printf(" -D --daemonize Run as daemon\n"); + printf(" -c --config-file filename The config file to use.\n"); printf(" -m --mncc-sock Disable built-in MNCC handler and " "offer socket\n"); } @@ -111,11 +115,12 @@ {"vty-port", 1, 0, 'v'}, {"debug", 1, 0, 'd'}, {"daemonize", 0, 0, 'D'}, + {"config-file", 1, 0, 'c'}, {"mncc-sock", 0, 0, 'm'}, {0, 0, 0, 0}, }; - c = getopt_long(argc, argv, "hi:u:v:d:Dm", + c = getopt_long(argc, argv, "hi:u:c:v:d:Dm", long_options, &option_index); if (c == -1) break; @@ -131,6 +136,10 @@ break; case 'u': vty_ip = optarg; + break; + case 'c': + config_file = optarg; + use_default_cfg = false; break; case 'v': vty_port = atoi(optarg); @@ -202,9 +211,6 @@ int quit = 0; int rc; char const * home; - size_t len; - const char osmocomcfg[] = ".osmocom/bb/mobile.cfg"; - char *config_file = NULL; printf("%s\n", openbsc_copyright); @@ -234,13 +240,11 @@ gsmtap_source_add_sink(gsmtap_inst); } - home = getenv("HOME"); - if (home != NULL) { - len = strlen(home) + 1 + sizeof(osmocomcfg); - config_file = talloc_size(l23_ctx, len); - if (config_file != NULL) - snprintf(config_file, len, "%s/%s", home, osmocomcfg); + if (use_default_cfg) { + home = talloc_strdup(l23_ctx, getenv("HOME")); + config_file = talloc_asprintf_append(home, "/%s", config_file); } + /* save the config file directory name */ config_dir = talloc_strdup(l23_ctx, config_file); config_dir = dirname(config_dir); -- To view, visit https://gerrit.osmocom.org/3884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 7 16:34:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 16:34:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: properly clean previous artifacts Message-ID: Review at https://gerrit.osmocom.org/3888 jenkins: properly clean previous artifacts Drop the second 'rm -f' from the rm shell command (typo). Remove all artifacts matching *.build-*.{tgz,md5} because if a job changes the name of its artifact, the previous artifacts would remain. (I hit this with the new scripts being originally wrong and all producing 'osmo-msc.*' artifacts, and those stuck around in the workspace even after the name was fixed.) Change-Id: I00d246226f4c723696bb737ed707cfd0e4c33714 --- M contrib/jenkins-build-common.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/88/3888/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index e15c616..a5b34af 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -56,7 +56,7 @@ env | grep -v "^LESS" | sort # clean the workspace -rm -f "$base/${name}"*.tgz rm -f "$base/${name}"*.md5 +rm -f "$base"/*.build-*.{tgz,md5} rm -rf "$prefix_real" mkdir -p "$prefix_real" -- To view, visit https://gerrit.osmocom.org/3888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00d246226f4c723696bb737ed707cfd0e4c33714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 16:52:15 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 7 Sep 2017 16:52:15 +0000 Subject: [PATCH] osmo-msc[master]: a_iface: fix memory leaks Message-ID: Review at https://gerrit.osmocom.org/3889 a_iface: fix memory leaks Fix multiple memory leaske in A/BSSMAP code Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d --- M include/osmocom/msc/a_iface.h M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/msc_ifaces.c 4 files changed, 22 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3889/1 diff --git a/include/osmocom/msc/a_iface.h b/include/osmocom/msc/a_iface.h index a49ede2..32003eb 100644 --- a/include/osmocom/msc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -51,7 +51,7 @@ /* Initalize A interface connection between to MSC and BSC */ int a_init(struct osmo_sccp_instance *sccp, struct gsm_network *network); -/* Send DTAP message via A-interface */ +/* Send DTAP message via A-interface, take ownership of msg */ int a_iface_tx_dtap(struct msgb *msg); /* Send Cipher mode command via A-interface */ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 7a6000a..528b959 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -127,7 +127,7 @@ return NULL; } -/* Send DTAP message via A-interface */ +/* Send DTAP message via A-interface, take ownership of msg */ int a_iface_tx_dtap(struct msgb *msg) { struct gsm_subscriber_connection *conn; @@ -144,13 +144,20 @@ msg->l3h = msg->data; msg_resp = gsm0808_create_dtap(msg, link_id); + if (!msg_resp) { LOGP(DMSC, LOGL_ERROR, "Unable to generate BSSMAP DTAP message!\n"); + msgb_free(msg); return -EINVAL; } else LOGP(DMSC, LOGL_DEBUG, "Massage will be sent as BSSMAP DTAP message!\n"); + /* gsm0808_create_dtap() has copied the data to msg_resp, + * so msg has served its purpose now */ + msgb_free(msg); + LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg_resp->data, msg_resp->len)); + /* osmo_sccp_tx_data_msg() takes ownership of msg_resp */ return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg_resp); } diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 1cd6723..16962e7 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -150,6 +150,7 @@ if (msgb_l3len(msg) < 1) { LOGP(DMSC, LOGL_NOTICE, "Error: No data received -- discarding message!\n"); + msgb_free(msg); return; } @@ -327,17 +328,17 @@ conn = subscr_conn_allocate_a(a_conn_info, network, lac, scu, a_conn_info->conn_id); /* Handover location update to the MSC code */ - /* msc_compl_l3() takes ownership of dtap_msg - * message buffer */ rc = msc_compl_l3(conn, msg, 0); if (rc == MSC_CONN_ACCEPT) { LOGP(DMSC, LOGL_NOTICE, "User has been accepted by MSC.\n"); + msgb_free(msg); return 0; } else if (rc == MSC_CONN_REJECT) LOGP(DMSC, LOGL_NOTICE, "User has been rejected by MSC.\n"); else LOGP(DMSC, LOGL_NOTICE, "User has been rejected by MSC (unknown error)\n"); + msgb_free(msg); return -EINVAL; fail: @@ -423,9 +424,9 @@ msg = NULL; } - /* Hand over cipher mode complete message to the MSC, - * msc_cipher_mode_compl() takes ownership for msg */ + /* Hand over cipher mode complete message to the MSC */ msc_cipher_mode_compl(conn, msg, alg_id); + msgb_free(msg); return 0; fail: @@ -677,9 +678,9 @@ /* msc_dtap expects the dtap payload in l3h */ msg->l3h = msg->l2h + 3; - /* Forward dtap payload into the msc, - * msc_dtap() takes ownership for msg */ + /* Forward dtap payload into the msc */ msc_dtap(conn, conn->a.conn_id, msg); + msgb_free(msg); return 0; } @@ -696,6 +697,7 @@ if (msgb_l2len(msg) < sizeof(struct bssmap_header)) { LOGP(DMSC, LOGL_NOTICE, "The header is too short -- discarding message!\n"); msgb_free(msg); + return -EINVAL; } switch (msg->l2h[0]) { diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index b191e0d..83a6dee 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -44,10 +44,12 @@ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) { - if (!conn) - return -EINVAL; if (!msg) return -EINVAL; + if (!conn) { + msgb_free(msg); + return -EINVAL; + } DEBUGP(DMSC, "msc_tx %u bytes to %s via %s\n", msg->len, vlr_subscr_name(conn->vsub), @@ -65,6 +67,7 @@ LOGP(DMSC, LOGL_ERROR, "msc_tx(): conn->via_ran invalid (%d)\n", conn->via_ran); + msgb_free(msg); return -1; } } -- To view, visit https://gerrit.osmocom.org/3889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Sep 7 17:10:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 7 Sep 2017 17:10:36 +0000 Subject: [PATCH] osmo-bsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3876 to look at the new patch set (#2). Make TRX rf locking more visible * log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/abis_nm.c M src/libbsc/bsc_rf_ctrl.c M src/libbsc/bsc_vty.c 4 files changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/3876/2 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ef041d6..91b0e6b 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -662,7 +662,7 @@ void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason); bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 3a48dee..9567cfa 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -2791,9 +2791,13 @@ *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); } -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason) { - int new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + + LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, + get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), + get_value_string(abis_nm_adm_state_names, new_state), reason); trx->mo.nm_state.administrative = new_state; if (!trx->bts || !trx->bts->oml_link) diff --git a/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c index 20115e1..f4a21b5 100644 --- a/src/libbsc/bsc_rf_ctrl.c +++ b/src/libbsc/bsc_rf_ctrl.c @@ -123,7 +123,7 @@ } } -static int lock_each_trx(struct gsm_network *net, int lock) +static int lock_each_trx(struct gsm_network *net, bool lock) { struct gsm_bts *bts; @@ -138,7 +138,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_trx_lock_rf(trx, lock); + gsm_trx_lock_rf(trx, lock, "ctrl"); } } @@ -245,7 +245,7 @@ static int switch_rf_off(struct osmo_bsc_rf *rf) { - lock_each_trx(rf->gsm_network, 1); + lock_each_trx(rf->gsm_network, true); send_signal(rf, S_RF_OFF); return 0; @@ -289,7 +289,7 @@ case RF_CMD_ON: rf->last_state_command = "RF Direct On"; osmo_timer_del(&rf->grace_timeout); - lock_each_trx(rf->gsm_network, 0); + lock_each_trx(rf->gsm_network, false); send_signal(rf, S_RF_ON); osmo_timer_schedule(&rf->rf_check, 3, 0); break; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 42c16e8..3a80f06 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3575,7 +3575,7 @@ int locked = atoi(argv[0]); struct gsm_bts_trx *trx = vty->index; - gsm_trx_lock_rf(trx, locked); + gsm_trx_lock_rf(trx, locked, "vty"); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 7 18:43:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 18:43:29 +0000 Subject: [PATCH] libosmocore[master]: ipa: place comment "IPA Multiplex" on ipa allocated msgbs Message-ID: Review at https://gerrit.osmocom.org/3890 ipa: place comment "IPA Multiplex" on ipa allocated msgbs libosmocore offers the ipa API as general IPA Multiplex, which is e.g. used for GSUP in osmo-msc. Looking at talloc reports, it is confusing to see "Abis/IP" as msgb comment, because osmo-msc does not have an Abis interface. Rename to "IPA Multiplex" as a more general description. Change-Id: I3714dd21707bec0c4bcd0871e6ee8ff32d56b125 --- M src/gsm/ipa.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/3890/1 diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index bc84850..fef73c3 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -582,7 +582,7 @@ headroom += sizeof(struct ipaccess_head); - nmsg = msgb_alloc_headroom(1200 + headroom, headroom, "Abis/IP"); + nmsg = msgb_alloc_headroom(1200 + headroom, headroom, "IPA Multiplex"); if (!nmsg) return NULL; return nmsg; -- To view, visit https://gerrit.osmocom.org/3890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3714dd21707bec0c4bcd0871e6ee8ff32d56b125 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 7 19:53:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 19:53:02 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 1: > Thanks for looking into this. I think it might be difficult to > insist on one space idnent per level. It would be much mor user > friendly if there was a notion of 'parent node depth', i.e. you can > use any number of additional spaces to indent a new depth level, > and as soon as you go back beyond that depthy level we go to the > parent. Not sure how comple that would be to implement? Currently the VTY only remembers a single node. It relies on the node commands to pick a child node, and on go_parent_cb() to pick the right parent for each child. i.e. there is no state about parent nodes at all. To remember which depths each parent node was on, we would need to create such state per parent node. So the effort is non-trivial. But nevertheless I like it, because we will hardly ever step in deeper than say five child node levels and keeping the state is far from performance / memory critical. Also it would obsolete the need for the go_parent callbacks, and we could actually define the child->parent relations merely from entering a child. (One step further could even define the parent->child relations statically when defining VTY commands, instead of writing code to enter another node, opening up the possibility to validate that the parent/child structure is sound). My main question is, how much of this code do we want to change? Is there a consideration like with llist, that we don't want to deviate from upstream too much? > Also, if we now have a notion of the "depth", could this somehow be > used to automatically generate the required spaces in front of a > string when saving the file (config_write_...())? That's a bit harder, because for writing the config we simply vty_out(). There would need to be some wrapper function prepending indent, plus some function indicating that we stepped in and out of a child node to modify the prepended indent. We still have to take care that we indicate that properly: network bts 0 arfcn 123 bts 1 >From 'arfcn' up to bts 1, we still have to manually indicate that we intended to step out of the bts 0 child node. Also structures like this are valid: network bts 0 bts 1 i.e. bts 0 would intend to enter a child node, but bts 1 follows right away on the same level, i.e. steps out of it again. There isn't any way that saves us from indicating those levels manually; we can only save ourselves from varying spaces while in a specific node by accident. Not sure if it's worth the trouble / easier to just indicate the depth by manual spaces. > (and > doesn't permit a node to appear at different parent nodes / > depths). For I once wrote a vty_write wrapper that accepted the parent node and level of indent flexibly, so that two different binaries could hook a library vty on arbitrary node depth levels... pretty straightforward. -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 19:58:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 19:58:09 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 1: > I think it deserves wider discussion in ML because it have a chance > to break pretty much every Osmocom config file out there. I fully agree, and there already was some discussion on the ML, which lead up to this patch: see thread before and after https://lists.osmocom.org/pipermail/openbsc/2017-May/010652.html ("catch-22 VTY error") I am touching this now because I think we're releasing a burst of people needing to adjust their vty config files these days (with osmo-msc/bsc separation and osmo-ggsn, the new SIGTRAN and whatnot), and it would make sense to do this indenting change at the same time. Actually I think it might be worth it to make this indenting strictness optional, so that e.g. the old osmo-nitb can still request the old implicit-go-to-parent way, while new binaries from a given version on can switch to the new strict indenting. Though we're writing a lot here now, I would welcome more discussion on the ML... -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 20:07:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 7 Sep 2017 20:07:51 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 1: I suggest to continue the discussion here: https://lists.osmocom.org/pipermail/openbsc/2017-September/011125.html -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 20:49:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 20:49:42 +0000 Subject: libosmocore[master]: ipa: place comment "IPA Multiplex" on ipa allocated msgbs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3714dd21707bec0c4bcd0871e6ee8ff32d56b125 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 20:49:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 20:49:43 +0000 Subject: [MERGED] libosmocore[master]: ipa: place comment "IPA Multiplex" on ipa allocated msgbs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ipa: place comment "IPA Multiplex" on ipa allocated msgbs ...................................................................... ipa: place comment "IPA Multiplex" on ipa allocated msgbs libosmocore offers the ipa API as general IPA Multiplex, which is e.g. used for GSUP in osmo-msc. Looking at talloc reports, it is confusing to see "Abis/IP" as msgb comment, because osmo-msc does not have an Abis interface. Rename to "IPA Multiplex" as a more general description. Change-Id: I3714dd21707bec0c4bcd0871e6ee8ff32d56b125 --- M src/gsm/ipa.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index bc84850..fef73c3 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -582,7 +582,7 @@ headroom += sizeof(struct ipaccess_head); - nmsg = msgb_alloc_headroom(1200 + headroom, headroom, "Abis/IP"); + nmsg = msgb_alloc_headroom(1200 + headroom, headroom, "IPA Multiplex"); if (!nmsg) return NULL; return nmsg; -- To view, visit https://gerrit.osmocom.org/3890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3714dd21707bec0c4bcd0871e6ee8ff32d56b125 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 7 20:50:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 20:50:42 +0000 Subject: osmo-msc[master]: a_iface: fix memory leaks In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 20:51:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 20:51:05 +0000 Subject: osmo-gsm-tester[master]: jenkins: properly clean previous artifacts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00d246226f4c723696bb737ed707cfd0e4c33714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 20:52:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 20:52:03 +0000 Subject: osmocom-bb[master]: Add arbitrary config file location support In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 7 20:53:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 7 Sep 2017 20:53:12 +0000 Subject: osmo-bsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 01:31:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 01:31:48 +0000 Subject: [PATCH] osmo-mgw[master]: doc/examples: fix mgcp.cfg indenting, tweak Message-ID: Review at https://gerrit.osmocom.org/3891 doc/examples: fix mgcp.cfg indenting, tweak Use one space to indent mgcp.cfg, like all the other osmo*.cfg examples. Tweak the header comment. Remove the password and line vty commands. Change-Id: I52e481dbf4778dd187ce6b67d879a04ef61e8b47 --- M doc/examples/osmo-bsc_mgcp/mgcp.cfg 1 file changed, 11 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/91/3891/1 diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg index 3c43f1f..442162f 100644 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ b/doc/examples/osmo-bsc_mgcp/mgcp.cfg @@ -1,19 +1,14 @@ ! -! MGCP configuration hand edited -! ! -password foo -! -line vty - no login +! MGCP configuration example ! mgcp - !local ip 10.23.24.2 - !bts ip 10.24.24.1 - !bind ip 10.23.24.1 - bind port 2427 - rtp base 4000 - rtp force-ptime 20 - sdp audio payload number 98 - sdp audio payload name AMR/8000 - number endpoints 31 - no rtcp-omit + !local ip 10.23.24.2 + !bts ip 10.24.24.1 + !bind ip 10.23.24.1 + bind port 2427 + rtp base 4000 + rtp force-ptime 20 + sdp audio payload number 98 + sdp audio payload name AMR/8000 + number endpoints 31 + no rtcp-omit -- To view, visit https://gerrit.osmocom.org/3891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52e481dbf4778dd187ce6b67d879a04ef61e8b47 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 02:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 02:54:46 +0000 Subject: osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code In-Reply-To: References: Message-ID: Patch Set 2: I've actually now separated the two libraries (down to one common .h file with some shared definitions), going to come a bit later in change-id Ifd3a2c7cdabb31bc50cb7f671758ffb7cdd10221 (will come after some osmo-mgw changes from pmaier that are waiting for one pending unit test fix). -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 02:56:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 02:56:45 +0000 Subject: osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code In-Reply-To: References: Message-ID: Patch Set 2: see https://git.osmocom.org/osmo-mgw/commit/?h=neels/osmo-mgw&id=cb45255421ea78af05e766cb794842cb28220aca -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 03:00:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 03:00:06 +0000 Subject: osmo-mgw[master]: doc/examples: fix mgcp.cfg indenting, tweak In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3891/1//COMMIT_MSG Commit Message: Line 13: Remove the password and line vty commands. because so far I've never seen those having any effect. Should they remain in the example? -- To view, visit https://gerrit.osmocom.org/3891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52e481dbf4778dd187ce6b67d879a04ef61e8b47 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 8 03:00:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 03:00:27 +0000 Subject: [MERGED] osmo-bsc[master]: drop MGCP client from osmo-bsc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: drop MGCP client from osmo-bsc ...................................................................... drop MGCP client from osmo-bsc After osmo-mgw change I8e0b2d2a399b77086a36606f5e427271c6242df1, there now is a separated libosmo-mgcp-client, and osmo-bsc needs adjusting. But besides having an unused struct in gsm_network, osmo-bsc does not yet use its MGCP client; these are merely plans for the future. Until we do, let's just drop the dependency entirely. Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 0 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ef041d6..0aeb535 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -17,7 +17,6 @@ #include #include #include -#include /** annotations for msgb ownership */ @@ -485,11 +484,6 @@ /* Periodic location update default value */ uint8_t t3212; - - struct { - struct mgcpgw_client_conf conf; - struct mgcpgw_client *client; - } mgcpgw; struct { /* CS7 instance id number (set via VTY) */ -- To view, visit https://gerrit.osmocom.org/3789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6402c7cbe58dacae7630f7f03819f8102e54c699 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 03:00:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 03:00:48 +0000 Subject: [MERGED] osmo-msc[master]: doc/examples: add detailed cs7 config examples In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doc/examples: add detailed cs7 config examples ...................................................................... doc/examples: add detailed cs7 config examples Change-Id: I4da6724cd4348e92dfd06516f82af06c97277ef9 --- A doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg A doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg M osmoappdesc.py 3 files changed, 60 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg new file mode 100644 index 0000000..3de478a --- /dev/null +++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg @@ -0,0 +1,27 @@ +! +! OsmoMSC configuration saved from vty +! +line vty + no login +! +network + network country code 1 + mobile network code 1 + short name OsmoMSC + long name OsmoMSC + auth policy closed + location updating reject cause 13 + encryption a5 0 + rrlp mode none + mm info 1 +cs7 instance 0 + point-code 0.23.1 + asp asp-clnt-OsmoMSC-A-Iu 2905 0 m3ua + ! where to reach the STP: + remote-ip 10.23.24.1 +! local-ip 10.23.24.1 +msc + cs7-instance-a 0 + cs7-instance-iu 0 + mgcpgw remote-ip 10.23.24.1 + assign-tmsi diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg new file mode 100644 index 0000000..3c38445 --- /dev/null +++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg @@ -0,0 +1,29 @@ +! +! OsmoMSC configuration saved from vty +! +line vty + no login +! +network + network country code 1 + mobile network code 1 + short name OsmoMSC + long name OsmoMSC + auth policy closed + location updating reject cause 13 + encryption a5 0 + rrlp mode none + mm info 1 +cs7 instance 0 + point-code 0.23.1 + asp asp-clnt-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.24.1 +cs7 instance 1 + point-code 0.23.2 + asp asp-clnt-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.24.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 + mgcpgw remote-ip 10.23.24.1 + assign-tmsi diff --git a/osmoappdesc.py b/osmoappdesc.py index be97a71..886c682 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -15,7 +15,10 @@ # along with this program. If not, see app_configs = { - "msc": ["doc/examples/osmo-msc/osmo-msc.cfg"], + "msc": ["doc/examples/osmo-msc/osmo-msc.cfg", + "doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg", + "doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg", + ], } apps = [(4254, "src/osmo-msc/osmo-msc", "OsmoMSC", "msc"), -- To view, visit https://gerrit.osmocom.org/3827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4da6724cd4348e92dfd06516f82af06c97277ef9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 03:03:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 03:03:49 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: properly clean previous artifacts In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: properly clean previous artifacts ...................................................................... jenkins: properly clean previous artifacts Drop the second 'rm -f' from the rm shell command (typo). Remove all artifacts matching *.build-*.{tgz,md5} because if a job changes the name of its artifact, the previous artifacts would remain. (I hit this with the new scripts being originally wrong and all producing 'osmo-msc.*' artifacts, and those stuck around in the workspace even after the name was fixed.) Change-Id: I00d246226f4c723696bb737ed707cfd0e4c33714 --- M contrib/jenkins-build-common.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index e15c616..a5b34af 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -56,7 +56,7 @@ env | grep -v "^LESS" | sort # clean the workspace -rm -f "$base/${name}"*.tgz rm -f "$base/${name}"*.md5 +rm -f "$base"/*.build-*.{tgz,md5} rm -rf "$prefix_real" mkdir -p "$prefix_real" -- To view, visit https://gerrit.osmocom.org/3888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00d246226f4c723696bb737ed707cfd0e4c33714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 08:30:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 08:30:51 +0000 Subject: [MERGED] osmocom-bb[master]: Add arbitrary config file location support In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add arbitrary config file location support ...................................................................... Add arbitrary config file location support All other Osmocom projects use '-c' command line option to specify the location of config file. Let's do the same with fallback to existing implicit config file name logic. Also print config file path and vty host on startup. Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 --- M src/host/layer23/src/mobile/app_mobile.c M src/host/layer23/src/mobile/main.c 2 files changed, 16 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index 7dc7208..fd2c94f 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -409,12 +409,13 @@ " using: 'touch %s'\n", config_file); return rc; } + printf("Using configuration from %s\n", config_file); } vty_reading = 0; rc = telnet_init_dynif(l23_ctx, NULL, vty_ip, vty_port); if (rc < 0) return rc; - printf("VTY available on port %u.\n", vty_port); + printf("VTY available on %s %u\n", vty_ip, vty_port); osmo_signal_register_handler(SS_GLOBAL, &global_signal_cb, NULL); osmo_signal_register_handler(SS_L1CTL, &mobile_signal_cb, NULL); diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 630bc53..4a2e4ec 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ void *l23_ctx = NULL; struct llist_head ms_list; static char *gsmtap_ip = 0; +static const char *config_file = ".osmocom/bb/mobile.cfg"; +bool use_default_cfg = true; struct gsmtap_inst *gsmtap_inst = NULL; static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; @@ -96,6 +99,7 @@ printf(" -d --debug Change debug flags. default: %s\n", debug_default); printf(" -D --daemonize Run as daemon\n"); + printf(" -c --config-file filename The config file to use.\n"); printf(" -m --mncc-sock Disable built-in MNCC handler and " "offer socket\n"); } @@ -111,11 +115,12 @@ {"vty-port", 1, 0, 'v'}, {"debug", 1, 0, 'd'}, {"daemonize", 0, 0, 'D'}, + {"config-file", 1, 0, 'c'}, {"mncc-sock", 0, 0, 'm'}, {0, 0, 0, 0}, }; - c = getopt_long(argc, argv, "hi:u:v:d:Dm", + c = getopt_long(argc, argv, "hi:u:c:v:d:Dm", long_options, &option_index); if (c == -1) break; @@ -131,6 +136,10 @@ break; case 'u': vty_ip = optarg; + break; + case 'c': + config_file = optarg; + use_default_cfg = false; break; case 'v': vty_port = atoi(optarg); @@ -202,9 +211,6 @@ int quit = 0; int rc; char const * home; - size_t len; - const char osmocomcfg[] = ".osmocom/bb/mobile.cfg"; - char *config_file = NULL; printf("%s\n", openbsc_copyright); @@ -234,13 +240,11 @@ gsmtap_source_add_sink(gsmtap_inst); } - home = getenv("HOME"); - if (home != NULL) { - len = strlen(home) + 1 + sizeof(osmocomcfg); - config_file = talloc_size(l23_ctx, len); - if (config_file != NULL) - snprintf(config_file, len, "%s/%s", home, osmocomcfg); + if (use_default_cfg) { + home = talloc_strdup(l23_ctx, getenv("HOME")); + config_file = talloc_asprintf_append(home, "/%s", config_file); } + /* save the config file directory name */ config_dir = talloc_strdup(l23_ctx, config_file); config_dir = dirname(config_dir); -- To view, visit https://gerrit.osmocom.org/3884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311 Gerrit-PatchSet: 2 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 08:31:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 08:31:03 +0000 Subject: [MERGED] osmo-bsc[master]: Make TRX rf locking more visible In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Make TRX rf locking more visible ...................................................................... Make TRX rf locking more visible * log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/abis_nm.c M src/libbsc/bsc_rf_ctrl.c M src/libbsc/bsc_vty.c 4 files changed, 12 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 0aeb535..d7f7667 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -656,7 +656,7 @@ void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason); bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 3a48dee..9567cfa 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -2791,9 +2791,13 @@ *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); } -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason) { - int new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + + LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, + get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), + get_value_string(abis_nm_adm_state_names, new_state), reason); trx->mo.nm_state.administrative = new_state; if (!trx->bts || !trx->bts->oml_link) diff --git a/src/libbsc/bsc_rf_ctrl.c b/src/libbsc/bsc_rf_ctrl.c index 20115e1..f4a21b5 100644 --- a/src/libbsc/bsc_rf_ctrl.c +++ b/src/libbsc/bsc_rf_ctrl.c @@ -123,7 +123,7 @@ } } -static int lock_each_trx(struct gsm_network *net, int lock) +static int lock_each_trx(struct gsm_network *net, bool lock) { struct gsm_bts *bts; @@ -138,7 +138,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_trx_lock_rf(trx, lock); + gsm_trx_lock_rf(trx, lock, "ctrl"); } } @@ -245,7 +245,7 @@ static int switch_rf_off(struct osmo_bsc_rf *rf) { - lock_each_trx(rf->gsm_network, 1); + lock_each_trx(rf->gsm_network, true); send_signal(rf, S_RF_OFF); return 0; @@ -289,7 +289,7 @@ case RF_CMD_ON: rf->last_state_command = "RF Direct On"; osmo_timer_del(&rf->grace_timeout); - lock_each_trx(rf->gsm_network, 0); + lock_each_trx(rf->gsm_network, false); send_signal(rf, S_RF_ON); osmo_timer_schedule(&rf->rf_check, 3, 0); break; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 42c16e8..3a80f06 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3575,7 +3575,7 @@ int locked = atoi(argv[0]); struct gsm_bts_trx *trx = vty->index; - gsm_trx_lock_rf(trx, locked); + gsm_trx_lock_rf(trx, locked, "vty"); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 09:28:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 8 Sep 2017 09:28:04 +0000 Subject: meta-telephony[laforge/nightly]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/3871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 09:29:07 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 8 Sep 2017 09:29:07 +0000 Subject: meta-telephony[laforge/nightly]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 2: It became unverified after I pressed "Cherry-pick" to remove the previous non-related commit I pushed with this one. I manually verified it myself, and mergit it now. -- To view, visit https://gerrit.osmocom.org/3871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 09:29:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 8 Sep 2017 09:29:09 +0000 Subject: [MERGED] meta-telephony[laforge/nightly]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: libosmo-abis: modify PV to match recent release ...................................................................... libosmo-abis: modify PV to match recent release The upstream release commit is 7f17b8c45d094941292036143f3292a1d5789cf5. This should fix current issue with 201705/nightly package feed: $ opkg upgrade Not selecting libosmo-abis 0.3.2+gitr0+d3292913ac as installing it would break existing dependencies. $ opkg list_installed | grep libosmo-abis libosmo-abis - 0.3.2+gitr2+d3292913ac-r2.18.1.0 See that gitr in repos is 0 while the previously installed one has gitr2, which is higher. Explanations I can find for this: - PR server was somehow reset? - the value in gitr is calculated based on offset from latest tag. As new release introduced new tag, gitr may have been reset. In any case, updating PV to have the correct value should fix this issue. Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index 790dd2e..00d264a 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -5,5 +5,5 @@ S = "${WORKDIR}/git" SRCREV = "${AUTOREV}" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" -PV = "0.3.2+gitr${SRCPV}" +PV = "0.4.0+gitr${SRCPV}" PR = "${INC_PR}.1" -- To view, visit https://gerrit.osmocom.org/3871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 8 10:26:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 10:26:01 +0000 Subject: [PATCH] osmo-pcu[master]: TBF-DL: extend index check for RLC block copy Message-ID: Review at https://gerrit.osmocom.org/3892 TBF-DL: extend index check for RLC block copy Log number of RLC blocks to copy and assert if trying to copy too many blocks. Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Fixes: CID143069 --- M src/tbf_dl.cpp 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/92/3892/1 diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 1dd7dd8..a5cc372 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -757,6 +757,8 @@ OSMO_ASSERT(rlc.num_data_blocks <= ARRAY_SIZE(rlc.block_info)); OSMO_ASSERT(rlc.num_data_blocks > 0); + LOGP(DRLCMACDL, LOGL_DEBUG, "- copying %u RLC blocks, %u BSNs\n", rlc.num_data_blocks, num_bsns); + /* Copy block(s) to RLC message */ for (data_block_idx = 0; data_block_idx < rlc.num_data_blocks; data_block_idx++) @@ -782,6 +784,7 @@ OSMO_ASSERT(m_rlc.block(bsn)->next_ps >= EGPRS_PS_1); OSMO_ASSERT(m_rlc.block(bsn)->next_ps <= EGPRS_PS_3); } + OSMO_ASSERT(data_block_idx < 2); /* punct defined above as 2-element array */ punct[data_block_idx] = m_rlc.block(bsn)->next_ps; rdbi = &rlc.block_info[data_block_idx]; -- To view, visit https://gerrit.osmocom.org/3892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 10:35:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 10:35:46 +0000 Subject: [PATCH] osmo-pcu[master]: Return if failed to determine current UL CS Message-ID: Review at https://gerrit.osmocom.org/3893 Return if failed to determine current UL CS This only possible if neither GPRS or EGPRS mode is set but since code below relies on non-zero value it's better to be paranoid nevertheless. Change-Id: I8f62627b7b7b89dfa1b0d1a7e71b95b2c40fdffa Fixes: CID70466 --- M src/gprs_ms.cpp 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/93/3893/1 diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 66312fa..e9e16d0 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -630,6 +630,11 @@ return; } + if (!current_cs_num) { + LOGP(DRLCMACMEAS, LOGL_ERROR, "Current UL CS converts to 0?!\n"); + return; + } + if (!m_current_cs_ul) return; -- To view, visit https://gerrit.osmocom.org/3893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f62627b7b7b89dfa1b0d1a7e71b95b2c40fdffa Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 10:40:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 10:40:28 +0000 Subject: [PATCH] osmo-pcu[master]: TBF-DL: extend index check for RLC block copy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3892 to look at the new patch set (#2). TBF-DL: extend index check for RLC block copy Log number of RLC blocks to copy and assert if trying to copy too many blocks. Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Fixes: CID143069 --- M src/tbf_dl.cpp M tests/tbf/TbfTest.err 2 files changed, 218 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/92/3892/2 diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 1dd7dd8..3d27883 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -757,6 +757,8 @@ OSMO_ASSERT(rlc.num_data_blocks <= ARRAY_SIZE(rlc.block_info)); OSMO_ASSERT(rlc.num_data_blocks > 0); + LOGP(DRLCMACDL, LOGL_DEBUG, "- Copying %u RLC blocks, %u BSNs\n", rlc.num_data_blocks, num_bsns); + /* Copy block(s) to RLC message */ for (data_block_idx = 0; data_block_idx < rlc.num_data_blocks; data_block_idx++) @@ -782,6 +784,7 @@ OSMO_ASSERT(m_rlc.block(bsn)->next_ps >= EGPRS_PS_1); OSMO_ASSERT(m_rlc.block(bsn)->next_ps <= EGPRS_PS_3); } + OSMO_ASSERT(data_block_idx < 2); /* punct defined above as 2-element array */ punct[data_block_idx] = m_rlc.block(bsn)->next_ps; rdbi = &rlc.block_info[data_block_idx]; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 5f1e00d..602e35b 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -73,6 +73,7 @@ -- Chunk with length 200 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 @@ -83,6 +84,7 @@ -- Chunk with length 180 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 @@ -160,6 +162,7 @@ -- Chunk with length 200 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 @@ -170,6 +173,7 @@ -- Chunk with length 180 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 @@ -247,6 +251,7 @@ -- Chunk with length 200 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 @@ -257,6 +262,7 @@ -- Chunk with length 180 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 @@ -266,6 +272,7 @@ -- Chunk with length 160 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 2, CS-1): 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) msg block (BSN 2, CS-1): 07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b @@ -275,6 +282,7 @@ -- Chunk with length 140 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 3, CS-1): 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) msg block (BSN 3, CS-1): 07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f @@ -284,6 +292,7 @@ -- Chunk with length 120 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 4, CS-1): 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) msg block (BSN 4, CS-1): 07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 @@ -293,6 +302,7 @@ -- Chunk with length 100 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 5, CS-1): 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) msg block (BSN 5, CS-1): 07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 @@ -302,6 +312,7 @@ -- Chunk with length 80 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 6, CS-1): 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) msg block (BSN 6, CS-1): 07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b @@ -311,6 +322,7 @@ -- Chunk with length 60 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 7, CS-1): 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) msg block (BSN 7, CS-1): 07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f @@ -320,6 +332,7 @@ -- Chunk with length 40 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 8, CS-1): a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) msg block (BSN 8, CS-1): 07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 @@ -329,6 +342,7 @@ -- Chunk with length 20 would exactly fit into space (20): add length header with LI=0, to make frame extend to next block, and we are done data block (BSN 9, CS-1): 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) msg block (BSN 9, CS-1): 07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 @@ -341,6 +355,7 @@ -- Chunk with length 200 larger than space (18) left in block: copy only remaining space, and we are done data block (BSN 10, CS-1): 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) msg block (BSN 10, CS-1): 07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 @@ -350,6 +365,7 @@ -- Chunk with length 182 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 11, CS-1): 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) msg block (BSN 11, CS-1): 07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 @@ -359,6 +375,7 @@ -- Chunk with length 162 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 12, CS-1): 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) msg block (BSN 12, CS-1): 07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 @@ -368,6 +385,7 @@ -- Chunk with length 142 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 13, CS-1): 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) msg block (BSN 13, CS-1): 07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d @@ -377,6 +395,7 @@ -- Chunk with length 122 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 14, CS-1): 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) msg block (BSN 14, CS-1): 07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 @@ -386,6 +405,7 @@ -- Chunk with length 102 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 15, CS-1): 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) msg block (BSN 15, CS-1): 07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 @@ -395,6 +415,7 @@ -- Chunk with length 82 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 16, CS-1): 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) msg block (BSN 16, CS-1): 07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 @@ -404,6 +425,7 @@ -- Chunk with length 62 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 17, CS-1): 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) msg block (BSN 17, CS-1): 07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d @@ -413,6 +435,7 @@ -- Chunk with length 42 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 18, CS-1): 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) msg block (BSN 18, CS-1): 07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 @@ -422,6 +445,7 @@ -- Chunk with length 22 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 19, CS-1): b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) msg block (BSN 19, CS-1): 07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 @@ -436,6 +460,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW)len=16 data block (BSN 20, CS-1): 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) @@ -475,6 +500,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW)len=19 data block (BSN 21, CS-1): 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 21 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 21) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) @@ -495,6 +521,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 22, CS-1): 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 22 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 22) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) @@ -1478,6 +1505,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) (len=19) data block (BSN 0, CS-1): 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 00 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 MSG = 07 00 00 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 @@ -1489,6 +1517,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) (len=19) data block (BSN 1, CS-1): 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 02 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 MSG = 07 00 02 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 @@ -1500,6 +1529,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FINISHED data block (BSN 2, CS-1): 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling cannot be scheduled in this TS 7 (first control TS 4) @@ -1780,6 +1810,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 0, CS-4): 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) @@ -1793,6 +1824,7 @@ - Restarting at BSN 0, because all blocks have been transmitted. - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-4): 07 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -2353,6 +2385,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=00 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 @@ -2373,6 +2406,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 @@ -2396,6 +2430,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 2, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) msg block (BSN 2, CS-1): 07 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654288 block=0 data=00 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 @@ -2416,6 +2451,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 3, CS-1): 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) msg block (BSN 3, CS-1): 07 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654292 block=1 data=00 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2439,6 +2475,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 4, CS-1): 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) msg block (BSN 4, CS-1): 07 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654296 block=2 data=00 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c @@ -2459,6 +2496,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 5, CS-1): 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) msg block (BSN 5, CS-1): 07 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654301 block=3 data=00 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b @@ -2482,6 +2520,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) (len=13) data block (BSN 6, CS-1): 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) msg block (BSN 6, CS-1): 07 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654305 block=4 data=00 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 @@ -2502,6 +2541,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 7, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) msg block (BSN 7, CS-1): 07 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654309 block=5 data=00 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 @@ -2522,6 +2562,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 8, CS-1): 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) msg block (BSN 8, CS-1): 07 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654314 block=6 data=00 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 @@ -2545,6 +2586,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 9, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) msg block (BSN 9, CS-1): 07 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654318 block=7 data=00 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 @@ -2565,6 +2607,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 10, CS-1): 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) msg block (BSN 10, CS-1): 07 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654322 block=8 data=00 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2588,6 +2631,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 11, CS-1): 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) msg block (BSN 11, CS-1): 07 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=00 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c @@ -2608,6 +2652,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 12, CS-1): 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) msg block (BSN 12, CS-1): 07 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654331 block=10 data=00 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b @@ -2631,6 +2676,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) (len=13) data block (BSN 13, CS-1): 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) msg block (BSN 13, CS-1): 07 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=00 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 @@ -2651,6 +2697,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 14, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) msg block (BSN 14, CS-1): 07 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654340 block=0 data=00 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 @@ -2671,6 +2718,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 15, CS-1): 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) msg block (BSN 15, CS-1): 07 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654344 block=1 data=00 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 @@ -2694,6 +2742,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 16, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) msg block (BSN 16, CS-1): 07 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654348 block=2 data=00 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 @@ -2714,6 +2763,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 17, CS-1): 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) msg block (BSN 17, CS-1): 07 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654353 block=3 data=00 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2737,6 +2787,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 18, CS-1): 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) msg block (BSN 18, CS-1): 07 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654357 block=4 data=00 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c @@ -2757,6 +2808,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 19, CS-1): 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) msg block (BSN 19, CS-1): 07 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654361 block=5 data=00 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b @@ -2780,6 +2832,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) (len=13) data block (BSN 20, CS-1): 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) @@ -2803,6 +2856,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 21, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 21 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 21) msg block (BSN 21, CS-1): 07 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654370 block=7 data=00 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 @@ -2823,6 +2877,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 22, CS-1): 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 - need_padding 0 spb_status 0 spb 0(BSN1 22 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 22) msg block (BSN 22, CS-1): 07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654374 block=8 data=07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 @@ -2846,6 +2901,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 23, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 23 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 23) msg block (BSN 23, CS-1): 07 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654379 block=9 data=00 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 @@ -2866,6 +2922,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 24, CS-1): 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 24 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 24) msg block (BSN 24, CS-1): 07 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654383 block=10 data=00 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2889,6 +2946,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 25, CS-1): 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 25 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 25) msg block (BSN 25, CS-1): 07 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654387 block=11 data=00 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c @@ -2909,6 +2967,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 26, CS-1): 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 26 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 26) msg block (BSN 26, CS-1): 07 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654392 block=0 data=00 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b @@ -2932,6 +2991,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 27, CS-1): 16 35 45 54 20 33 38 4c 4c 43 20 50 41 43 4b 45 54 20 33 39 - need_padding 0 spb_status 0 spb 0(BSN1 27 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 27) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) @@ -3041,6 +3101,7 @@ -- Chunk with length 21 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654405 block=3 data=00 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 @@ -3061,6 +3122,7 @@ -- Chunk with length 21 larger than space (18) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654409 block=4 data=00 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 @@ -3081,6 +3143,7 @@ -- Chunk with length 21 larger than space (16) left in block: copy only remaining space, and we are done data block (BSN 2, CS-1): 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) msg block (BSN 2, CS-1): 07 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654413 block=5 data=00 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 @@ -3101,6 +3164,7 @@ -- Chunk with length 21 larger than space (14) left in block: copy only remaining space, and we are done data block (BSN 3, CS-1): 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) msg block (BSN 3, CS-1): 07 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654418 block=6 data=00 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 @@ -3121,6 +3185,7 @@ -- Chunk with length 21 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 4, CS-1): 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) msg block (BSN 4, CS-1): 07 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654422 block=7 data=00 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 @@ -3141,6 +3206,7 @@ -- Chunk with length 21 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 5, CS-1): 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) msg block (BSN 5, CS-1): 07 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654426 block=8 data=00 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 @@ -3161,6 +3227,7 @@ -- Chunk with length 21 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 6, CS-1): 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) msg block (BSN 6, CS-1): 07 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654431 block=9 data=00 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b @@ -3181,6 +3248,7 @@ -- Chunk with length 21 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 7, CS-1): 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) msg block (BSN 7, CS-1): 07 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654435 block=10 data=00 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 @@ -3201,6 +3269,7 @@ -- Chunk with length 21 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 8, CS-1): 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) msg block (BSN 8, CS-1): 07 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654439 block=11 data=00 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 @@ -3221,6 +3290,7 @@ -- Chunk with length 21 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 9, CS-1): 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) msg block (BSN 9, CS-1): 07 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654444 block=0 data=00 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c @@ -3241,6 +3311,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 10, CS-1): 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) @@ -3725,6 +3796,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 data block (BSN 0, MCS-1): 14 15 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3739,6 +3811,7 @@ -- Chunk with length 512 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3750,6 +3823,7 @@ -- Chunk with length 490 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3761,6 +3835,7 @@ -- Chunk with length 468 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3772,6 +3847,7 @@ -- Chunk with length 446 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3783,6 +3859,7 @@ -- Chunk with length 424 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3794,6 +3871,7 @@ -- Chunk with length 402 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3805,6 +3883,7 @@ -- Chunk with length 380 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3816,6 +3895,7 @@ -- Chunk with length 358 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3827,6 +3907,7 @@ -- Chunk with length 336 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3838,6 +3919,7 @@ -- Chunk with length 314 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3849,6 +3931,7 @@ -- Chunk with length 292 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3860,6 +3943,7 @@ -- Chunk with length 270 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 12, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3871,6 +3955,7 @@ -- Chunk with length 248 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 13, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3882,6 +3967,7 @@ -- Chunk with length 226 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 14, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3893,6 +3979,7 @@ -- Chunk with length 204 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 15, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3904,6 +3991,7 @@ -- Chunk with length 182 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 16, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3915,6 +4003,7 @@ -- Chunk with length 160 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 17, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3926,6 +4015,7 @@ -- Chunk with length 138 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 18, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3937,6 +4027,7 @@ -- Chunk with length 116 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 19, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3948,6 +4039,7 @@ -- Chunk with length 94 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 20, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3959,6 +4051,7 @@ -- Chunk with length 72 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 21, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 21 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 21) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3970,6 +4063,7 @@ -- Chunk with length 50 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 22, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 22 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 22) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3981,6 +4075,7 @@ -- Chunk with length 28 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 23, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 23 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 23) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3997,6 +4092,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=14 data block (BSN 24, MCS-1): 0c 1d 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 24 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 24) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4059,6 +4155,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=16 data block (BSN 0, MCS-2): 14 21 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4073,6 +4170,7 @@ -- Chunk with length 512 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4084,6 +4182,7 @@ -- Chunk with length 484 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4095,6 +4194,7 @@ -- Chunk with length 456 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4106,6 +4206,7 @@ -- Chunk with length 428 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4117,6 +4218,7 @@ -- Chunk with length 400 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4128,6 +4230,7 @@ -- Chunk with length 372 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4139,6 +4242,7 @@ -- Chunk with length 344 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4150,6 +4254,7 @@ -- Chunk with length 316 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4161,6 +4266,7 @@ -- Chunk with length 288 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4172,6 +4278,7 @@ -- Chunk with length 260 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4183,6 +4290,7 @@ -- Chunk with length 232 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4194,6 +4302,7 @@ -- Chunk with length 204 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 12, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4205,6 +4314,7 @@ -- Chunk with length 176 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 13, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4216,6 +4326,7 @@ -- Chunk with length 148 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 14, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4227,6 +4338,7 @@ -- Chunk with length 120 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 15, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4238,6 +4350,7 @@ -- Chunk with length 92 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 16, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4249,6 +4362,7 @@ -- Chunk with length 64 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 17, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4260,6 +4374,7 @@ -- Chunk with length 36 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 18, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4276,6 +4391,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=18 data block (BSN 19, MCS-2): 10 25 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4338,6 +4454,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=25 data block (BSN 0, MCS-3): 14 33 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4352,6 +4469,7 @@ -- Chunk with length 512 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4363,6 +4481,7 @@ -- Chunk with length 475 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4374,6 +4493,7 @@ -- Chunk with length 438 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4385,6 +4505,7 @@ -- Chunk with length 401 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4396,6 +4517,7 @@ -- Chunk with length 364 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4407,6 +4529,7 @@ -- Chunk with length 327 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4418,6 +4541,7 @@ -- Chunk with length 290 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4429,6 +4553,7 @@ -- Chunk with length 253 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4440,6 +4565,7 @@ -- Chunk with length 216 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4451,6 +4577,7 @@ -- Chunk with length 179 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4462,6 +4589,7 @@ -- Chunk with length 142 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4473,6 +4601,7 @@ -- Chunk with length 105 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 12, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4484,6 +4613,7 @@ -- Chunk with length 68 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 13, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4498,6 +4628,7 @@ -- Chunk with length 6 larger than space (5) left in block: copy only remaining space, and we are done data block (BSN 14, MCS-3): 3f 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4514,6 +4645,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=34 data block (BSN 15, MCS-3): 02 45 2b 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4576,6 +4708,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=32 data block (BSN 0, MCS-4): 14 41 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4590,6 +4723,7 @@ -- Chunk with length 512 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4601,6 +4735,7 @@ -- Chunk with length 468 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4612,6 +4747,7 @@ -- Chunk with length 424 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4623,6 +4759,7 @@ -- Chunk with length 380 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4634,6 +4771,7 @@ -- Chunk with length 336 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4645,6 +4783,7 @@ -- Chunk with length 292 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4656,6 +4795,7 @@ -- Chunk with length 248 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4667,6 +4807,7 @@ -- Chunk with length 204 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4678,6 +4819,7 @@ -- Chunk with length 160 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4689,6 +4831,7 @@ -- Chunk with length 116 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4700,6 +4843,7 @@ -- Chunk with length 72 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4716,6 +4860,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=14 data block (BSN 12, MCS-4): 38 1d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4778,6 +4923,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=44 data block (BSN 0, MCS-5): 14 59 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4792,6 +4938,7 @@ -- Chunk with length 512 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4803,6 +4950,7 @@ -- Chunk with length 456 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4814,6 +4962,7 @@ -- Chunk with length 400 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4825,6 +4974,7 @@ -- Chunk with length 344 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4836,6 +4986,7 @@ -- Chunk with length 288 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4847,6 +4998,7 @@ -- Chunk with length 232 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4858,6 +5010,7 @@ -- Chunk with length 176 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4869,6 +5022,7 @@ -- Chunk with length 120 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4880,6 +5034,7 @@ -- Chunk with length 64 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4896,6 +5051,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 data block (BSN 10, MCS-5): 10 5d 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4958,6 +5114,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=62 data block (BSN 0, MCS-6): 14 7d 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4972,6 +5129,7 @@ -- Chunk with length 512 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4983,6 +5141,7 @@ -- Chunk with length 438 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4994,6 +5153,7 @@ -- Chunk with length 364 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5005,6 +5165,7 @@ -- Chunk with length 290 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5016,6 +5177,7 @@ -- Chunk with length 216 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5027,6 +5189,7 @@ -- Chunk with length 142 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5041,6 +5204,7 @@ -- Chunk with length 6 larger than space (5) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-6): 89 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5057,6 +5221,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=71 data block (BSN 8, MCS-6): 02 8f 2b 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5120,6 +5285,7 @@ data block (BSN 0, MCS-7): 14 59 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5136,6 +5302,7 @@ -- Chunk with length 512 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5151,6 +5318,7 @@ -- Chunk with length 400 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 3) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 2) - Copying data unit 1 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5166,6 +5334,7 @@ -- Chunk with length 288 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 5) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 4) - Copying data unit 1 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5181,6 +5350,7 @@ -- Chunk with length 176 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 7) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 6) - Copying data unit 1 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5196,6 +5366,7 @@ -- Chunk with length 64 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 9) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 8) - Copying data unit 1 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5214,6 +5385,7 @@ data block (BSN 10, MCS-7): 10 5d 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5277,6 +5449,7 @@ data block (BSN 0, MCS-8): 14 71 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 2 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5294,6 +5467,7 @@ -- Chunk with length 512 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5309,6 +5483,7 @@ -- Chunk with length 376 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 3) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 2) - Copying data unit 1 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5324,6 +5499,7 @@ -- Chunk with length 240 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 5) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 4) - Copying data unit 1 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5339,6 +5515,7 @@ -- Chunk with length 104 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 7) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 6) - Copying data unit 1 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5357,6 +5534,7 @@ data block (BSN 8, MCS-8): 48 3d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 2 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Copying data unit 1 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5421,6 +5599,7 @@ data block (BSN 0, MCS-9): 14 7d 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5437,6 +5616,7 @@ -- Chunk with length 512 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-9): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5452,6 +5632,7 @@ -- Chunk with length 364 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-9): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 3) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 2) - Copying data unit 1 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5467,6 +5648,7 @@ -- Chunk with length 216 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-9): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 5) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 4) - Copying data unit 1 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5485,6 +5667,7 @@ -- Chunk with length 6 larger than space (5) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-9): 89 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 7) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 6) - Copying data unit 1 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5503,6 +5686,7 @@ data block (BSN 8, MCS-9): 02 8f 2b 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5552,12 +5736,14 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(6) demanded_mcs(6) cs_trans(6) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 12 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5604,12 +5790,14 @@ -- Chunk with length 100 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 96 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(1) last_mcs(1) demanded_mcs(1) cs_trans(1) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 98 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5656,12 +5844,14 @@ -- Chunk with length 100 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-2): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 92 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(2) last_mcs(2) demanded_mcs(2) cs_trans(2) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 94 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5708,6 +5898,7 @@ -- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-5): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) @@ -5720,6 +5911,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 data block (BSN 1, MCS-5): 58 15 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) @@ -5731,6 +5923,7 @@ - initial_cs_dl(5) last_mcs(5) demanded_mcs(7) cs_trans(7) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) msg block (BSN 0, MCS-7): 07 00 00 02 c0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 @@ -5778,6 +5971,7 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) @@ -5790,6 +5984,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 data block (BSN 1, MCS-6): 34 5d 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) @@ -5801,6 +5996,7 @@ - initial_cs_dl(6) last_mcs(6) demanded_mcs(9) cs_trans(9) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) msg block (BSN 0, MCS-9): 07 00 00 02 28 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 @@ -5856,6 +6052,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 data block (BSN 1, MCS-7): 58 15 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5866,12 +6063,14 @@ - initial_cs_dl(7) last_mcs(7) demanded_mcs(5) cs_trans(5) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) - initial_cs_dl(7) last_mcs(7) demanded_mcs(5) cs_trans(5) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, MCS-5): 07 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5926,6 +6125,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 data block (BSN 1, MCS-9): 34 5d 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5936,12 +6136,14 @@ - initial_cs_dl(9) last_mcs(9) demanded_mcs(6) cs_trans(6) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 12 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) - initial_cs_dl(9) last_mcs(9) demanded_mcs(6) cs_trans(6) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, MCS-6): 07 40 00 02 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5988,18 +6190,21 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(6) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 c6 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(3) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 e6 4a 4c 4e 50 52 54 56 58 5a 5c 5e 60 62 64 66 68 6a 6c 6e 70 72 74 76 78 7a 7c 7e 80 82 84 86 88 8a 8c 8e 90 92 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -6046,18 +6251,21 @@ -- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-5): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(5) last_mcs(5) demanded_mcs(2) cs_trans(2) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 d2 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(5) last_mcs(2) demanded_mcs(2) cs_trans(2) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 f2 38 3a 3c 3e 40 42 44 46 48 4a 4c 4e 50 52 54 56 58 5a 5c 5e 60 62 64 66 68 6a 6c 6e 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -6104,18 +6312,21 @@ -- Chunk with length 100 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-4): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-4): 07 00 00 80 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 4a 4c 4e 50 52 54 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(4) last_mcs(4) demanded_mcs(1) cs_trans(1) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 d6 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(4) last_mcs(1) demanded_mcs(1) cs_trans(1) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 f6 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 4a 4c 4e 50 52 54 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -6162,24 +6373,28 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(6) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 c6 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(3) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 e6 4a 4c 4e 50 52 54 56 58 5a 5c 5e 60 62 64 66 68 6a 6c 6e 70 72 74 76 78 7a 7c 7e 80 82 84 86 88 8a 8c 8e 90 92 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(3) demanded_mcs(6) cs_trans(6) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 2 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge -- To view, visit https://gerrit.osmocom.org/3892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 8 10:51:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 10:51:14 +0000 Subject: [PATCH] osmo-pcu[master]: Assert valid CS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3893 to look at the new patch set (#2). Assert valid CS The coding scheme converted to number make sense only if it's valid. This is implicitly assumed by the code using this conversion as non-zero value. Make those assumptions explicit with OSMO_ASSERT(). Change-Id: I8f62627b7b7b89dfa1b0d1a7e71b95b2c40fdffa Fixes: CID70466 --- M src/gprs_coding_scheme.h M src/gprs_ms.cpp 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/93/3893/2 diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h index 3b15372..dfad240 100644 --- a/src/gprs_coding_scheme.h +++ b/src/gprs_coding_scheme.h @@ -23,6 +23,9 @@ #include #include +extern "C" { + #include +} class GprsCodingScheme { public: @@ -236,6 +239,9 @@ const GprsCodingScheme demanded_mcs, const unsigned arq_type) { + OSMO_ASSERT(mcs.to_num() > 0); + OSMO_ASSERT(demanded_mcs.to_num() > 0); + return egprs_mcs_retx_tbl[arq_type][mcs.to_num() - 1] [demanded_mcs.to_num() - 1]; } diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 66312fa..33d9cad 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -630,6 +630,8 @@ return; } + OSMO_ASSERT(current_cs_num > 0); + if (!m_current_cs_ul) return; -- To view, visit https://gerrit.osmocom.org/3893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8f62627b7b7b89dfa1b0d1a7e71b95b2c40fdffa Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 8 10:58:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 8 Sep 2017 10:58:35 +0000 Subject: osmo-bts[master]: Check return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 4: (2 comments) https://gerrit.osmocom.org/#/c/3878/4/src/osmo-bts-litecell15/l1_transp_hw.c File src/osmo-bts-litecell15/l1_transp_hw.c: Line 208: count = (rc <= 0) ? 0 : (rc / prim_size); I'd use "<" instead of "<=" to differentiate "normal" behavior from error, but it's good this way too. I'd add a message with NOTICE or similar level to show there was an issue with readv, and printing rc. I guess l1if_fd_cb is called because we are polling some socket and we received an event on that socket, so I would not expect to receive an ERROR here and we should know what's going on next time this issue appears, as it may be showing up something's wrong somewhere else too. https://gerrit.osmocom.org/#/c/3878/4/src/osmo-bts-sysmo/l1_transp_hw.c File src/osmo-bts-sysmo/l1_transp_hw.c: Line 219: count = (rc <= 0) ? 0 : (rc / prim_size); Same here. -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 8 11:27:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 11:27:22 +0000 Subject: [PATCH] osmo-bts[master]: Check readv() return value to prevent crash In-Reply-To: References: Message-ID: Hello daniel, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3878 to look at the new patch set (#5). Check readv() return value to prevent crash Previously result of readv() was used unconditionally so when it failed and returned negative value it was treated like very large positive which lead to memory corruption. Fix this and add proper error log. Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Related: SYS#3865 --- M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-sysmo/l1_transp_hw.c 2 files changed, 16 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/3878/5 diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 6381864..b526108 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -204,9 +204,15 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); - count = rc / prim_size; + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "failed to read from fd: %s\n", strerror(errno)); + /* N. B: we do not abort to let the cycle below cleanup allocated memory properly, + the return value is ignored by the caller anyway. + TODO: use libexplain's explain_readv() to provide detailed error description */ + count = 0; + } else + count = rc / prim_size; for (i = 0; i < count; ++i) { msgb_put(msg[i], prim_size); diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index da8ac3f..9c0a514 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -215,9 +215,15 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); - count = rc / prim_size; + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "failed to read from fd: %s\n", strerror(errno)); + /* N. B: we do not abort to let the cycle below cleanup allocated memory properly, + the return value is ignored by the caller anyway. + TODO: use libexplain's explain_readv() to provide detailed error description */ + count = 0; + } else + count = rc / prim_size; for (i = 0; i < count; ++i) { msgb_put(msg[i], prim_size); -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Sep 8 11:28:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 11:28:45 +0000 Subject: osmo-bts[master]: Check readv() return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 4: I'm not sure if 0 is actually an error: according to docs it's "not an error for a successful call to transfer fewer bytes than requested" but it's unclear if this "fewer" can be as low as 0. -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:09:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 8 Sep 2017 12:09:58 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Use tmpdir to create bts pcu-socket Message-ID: Review at https://gerrit.osmocom.org/3894 Use tmpdir to create bts pcu-socket In commit 329b6f4 pcu-socket path was moved to run inside the test run dir to avoid issues between different tests creating a socket in the same place. However, it seems unix sockets paths are limited to 108 bytes (with Null char included). In some cases, the run dir for a test can be quite long, as it contains suite name, test name, etc. and the path can be longer that the limit defined above. In order to fix this issue, create a tmp dir using mkdtemp to ensure the path to be used for the pcu-socket doesn't collide between different instances of osmo-bts-trx. Clean up of tmp dir and pcu socket is done inside the cleanup() method called by suite.py. method pcu_socket_path() is added to help with new implementation, and it will be used as well as a public API later soon to be used by OsmoPcu classes. Related: OS#2507 Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/suite.py 3 files changed, 27 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/94/3894/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index b5262a2..3077b0f 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -19,6 +19,7 @@ import os import pprint +import tempfile from . import log, config, util, template, process, event_loop class OsmoBtsTrx(log.Origin): @@ -28,6 +29,7 @@ inst = None env = None trx = None + pcu_sk_tmp_dir = None BIN_BTS_TRX = 'osmo-bts-trx' BIN_PCU = 'osmo-pcu' @@ -39,6 +41,20 @@ self.suite_run = suite_run self.conf = conf self.env = {} + self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) + if len(self.pcu_socket_path().encode()) > 107: + raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path()) + + def cleanup(self): + if self.pcu_sk_tmp_dir: + try: + os.remove(self.pcu_socket_path()) + except OSError: + pass + os.rmdir(self.pcu_sk_tmp_dir) + + def pcu_socket_path(self): + return os.path.join(self.pcu_sk_tmp_dir, 'pcu_bts') def remote_addr(self): return self.conf.get('addr') @@ -105,7 +121,7 @@ 'oml_remote_ip': self.bsc.addr(), 'trx_local_ip': self.remote_addr(), 'trx_remote_ip': self.trx_remote_ip(), - 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + 'pcu_socket_path': self.pcu_socket_path(), } }) config.overlay(values, { 'osmo_bts_trx': self.conf }) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index f37f88b..e8ac7c2 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -80,6 +80,12 @@ '-i', self.bsc.addr()), remote_cwd=remote_run_dir) + def cleanup(self): + pass + + def pcu_socket_path(self): + return os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + def _process_remote(self, name, popen_args, remote_cwd=None): run_dir = self.run_dir.new_dir(name) return process.RemoteProcess(name, run_dir, self.remote_user, self.remote_addr(), remote_cwd, @@ -122,7 +128,7 @@ config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr(), - 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + 'pcu_socket_path': self.pcu_socket_path(), } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 2ac2062..9b975fd 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -351,7 +351,9 @@ return osmo_stp.OsmoStp(self, ip_address) def bts(self, specifics=None): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + bts = bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + self.register_for_cleanup(bts) + return bts def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) -- To view, visit https://gerrit.osmocom.org/3894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:19:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 8 Sep 2017 12:19:13 +0000 Subject: osmo-bts[master]: Check readv() return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3878/5/src/osmo-bts-litecell15/l1_transp_hw.c File src/osmo-bts-litecell15/l1_transp_hw.c: Line 212: TODO: use libexplain's explain_readv() to provide detailed error description */ I don't think we need to add another dep just to know this kind of things. If there's an error, read the manual and read the code of glibc + syscall. -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:50:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 8 Sep 2017 12:50:26 +0000 Subject: osmo-gsm-tester[master]: Use tmpdir to create bts pcu-socket In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:52:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 8 Sep 2017 12:52:18 +0000 Subject: osmo-bts[master]: Check readv() return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:52:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 8 Sep 2017 12:52:56 +0000 Subject: osmo-pcu[master]: Assert valid CS In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f62627b7b7b89dfa1b0d1a7e71b95b2c40fdffa Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:53:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 8 Sep 2017 12:53:26 +0000 Subject: osmo-pcu[master]: TBF-DL: extend index check for RLC block copy In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:54:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 8 Sep 2017 12:54:39 +0000 Subject: osmo-mgw[master]: doc/examples: fix mgcp.cfg indenting, tweak In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3891/1//COMMIT_MSG Commit Message: Line 13: Remove the password and line vty commands. > because so far I've never seen those having any effect. Should they remain we could/should make libosmocore avoid them. Don't think we ever intentionally used them. -- To view, visit https://gerrit.osmocom.org/3891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52e481dbf4778dd187ce6b67d879a04ef61e8b47 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:57:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 12:57:46 +0000 Subject: [MERGED] osmo-bts[master]: Check readv() return value to prevent crash In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Check readv() return value to prevent crash ...................................................................... Check readv() return value to prevent crash Previously result of readv() was used unconditionally so when it failed and returned negative value it was treated like very large positive which lead to memory corruption. Fix this and add proper error log. Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Related: SYS#3865 --- M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-sysmo/l1_transp_hw.c 2 files changed, 16 insertions(+), 4 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 6381864..b526108 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -204,9 +204,15 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); - count = rc / prim_size; + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "failed to read from fd: %s\n", strerror(errno)); + /* N. B: we do not abort to let the cycle below cleanup allocated memory properly, + the return value is ignored by the caller anyway. + TODO: use libexplain's explain_readv() to provide detailed error description */ + count = 0; + } else + count = rc / prim_size; for (i = 0; i < count; ++i) { msgb_put(msg[i], prim_size); diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index da8ac3f..9c0a514 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -215,9 +215,15 @@ iov[i].iov_len = msgb_tailroom(msg[i]); } - rc = readv(ofd->fd, iov, ARRAY_SIZE(iov)); - count = rc / prim_size; + if (rc < 0) { + LOGP(DL1C, LOGL_ERROR, "failed to read from fd: %s\n", strerror(errno)); + /* N. B: we do not abort to let the cycle below cleanup allocated memory properly, + the return value is ignored by the caller anyway. + TODO: use libexplain's explain_readv() to provide detailed error description */ + count = 0; + } else + count = rc / prim_size; for (i = 0; i < count; ++i) { msgb_put(msg[i], prim_size); -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:58:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 12:58:10 +0000 Subject: [MERGED] osmo-pcu[master]: Assert valid CS In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Assert valid CS ...................................................................... Assert valid CS The coding scheme converted to number make sense only if it's valid. This is implicitly assumed by the code using this conversion as non-zero value. Make those assumptions explicit with OSMO_ASSERT(). Change-Id: I8f62627b7b7b89dfa1b0d1a7e71b95b2c40fdffa Fixes: CID70466 --- M src/gprs_coding_scheme.h M src/gprs_ms.cpp 2 files changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h index 3b15372..dfad240 100644 --- a/src/gprs_coding_scheme.h +++ b/src/gprs_coding_scheme.h @@ -23,6 +23,9 @@ #include #include +extern "C" { + #include +} class GprsCodingScheme { public: @@ -236,6 +239,9 @@ const GprsCodingScheme demanded_mcs, const unsigned arq_type) { + OSMO_ASSERT(mcs.to_num() > 0); + OSMO_ASSERT(demanded_mcs.to_num() > 0); + return egprs_mcs_retx_tbl[arq_type][mcs.to_num() - 1] [demanded_mcs.to_num() - 1]; } diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 66312fa..33d9cad 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -630,6 +630,8 @@ return; } + OSMO_ASSERT(current_cs_num > 0); + if (!m_current_cs_ul) return; -- To view, visit https://gerrit.osmocom.org/3893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f62627b7b7b89dfa1b0d1a7e71b95b2c40fdffa Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 12:58:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 12:58:29 +0000 Subject: [MERGED] osmo-pcu[master]: TBF-DL: extend index check for RLC block copy In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF-DL: extend index check for RLC block copy ...................................................................... TBF-DL: extend index check for RLC block copy Log number of RLC blocks to copy and assert if trying to copy too many blocks. Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Fixes: CID143069 --- M src/tbf_dl.cpp M tests/tbf/TbfTest.err 2 files changed, 218 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 1dd7dd8..3d27883 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -757,6 +757,8 @@ OSMO_ASSERT(rlc.num_data_blocks <= ARRAY_SIZE(rlc.block_info)); OSMO_ASSERT(rlc.num_data_blocks > 0); + LOGP(DRLCMACDL, LOGL_DEBUG, "- Copying %u RLC blocks, %u BSNs\n", rlc.num_data_blocks, num_bsns); + /* Copy block(s) to RLC message */ for (data_block_idx = 0; data_block_idx < rlc.num_data_blocks; data_block_idx++) @@ -782,6 +784,7 @@ OSMO_ASSERT(m_rlc.block(bsn)->next_ps >= EGPRS_PS_1); OSMO_ASSERT(m_rlc.block(bsn)->next_ps <= EGPRS_PS_3); } + OSMO_ASSERT(data_block_idx < 2); /* punct defined above as 2-element array */ punct[data_block_idx] = m_rlc.block(bsn)->next_ps; rdbi = &rlc.block_info[data_block_idx]; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 5f1e00d..602e35b 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -73,6 +73,7 @@ -- Chunk with length 200 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 @@ -83,6 +84,7 @@ -- Chunk with length 180 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 @@ -160,6 +162,7 @@ -- Chunk with length 200 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 @@ -170,6 +173,7 @@ -- Chunk with length 180 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 @@ -247,6 +251,7 @@ -- Chunk with length 200 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 @@ -257,6 +262,7 @@ -- Chunk with length 180 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 @@ -266,6 +272,7 @@ -- Chunk with length 160 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 2, CS-1): 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) msg block (BSN 2, CS-1): 07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b @@ -275,6 +282,7 @@ -- Chunk with length 140 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 3, CS-1): 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) msg block (BSN 3, CS-1): 07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f @@ -284,6 +292,7 @@ -- Chunk with length 120 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 4, CS-1): 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) msg block (BSN 4, CS-1): 07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 @@ -293,6 +302,7 @@ -- Chunk with length 100 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 5, CS-1): 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) msg block (BSN 5, CS-1): 07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 @@ -302,6 +312,7 @@ -- Chunk with length 80 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 6, CS-1): 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) msg block (BSN 6, CS-1): 07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b @@ -311,6 +322,7 @@ -- Chunk with length 60 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 7, CS-1): 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) msg block (BSN 7, CS-1): 07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f @@ -320,6 +332,7 @@ -- Chunk with length 40 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 8, CS-1): a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) msg block (BSN 8, CS-1): 07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 @@ -329,6 +342,7 @@ -- Chunk with length 20 would exactly fit into space (20): add length header with LI=0, to make frame extend to next block, and we are done data block (BSN 9, CS-1): 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) msg block (BSN 9, CS-1): 07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 @@ -341,6 +355,7 @@ -- Chunk with length 200 larger than space (18) left in block: copy only remaining space, and we are done data block (BSN 10, CS-1): 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) msg block (BSN 10, CS-1): 07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 @@ -350,6 +365,7 @@ -- Chunk with length 182 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 11, CS-1): 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) msg block (BSN 11, CS-1): 07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 @@ -359,6 +375,7 @@ -- Chunk with length 162 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 12, CS-1): 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) msg block (BSN 12, CS-1): 07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 @@ -368,6 +385,7 @@ -- Chunk with length 142 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 13, CS-1): 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) msg block (BSN 13, CS-1): 07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d @@ -377,6 +395,7 @@ -- Chunk with length 122 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 14, CS-1): 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) msg block (BSN 14, CS-1): 07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 @@ -386,6 +405,7 @@ -- Chunk with length 102 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 15, CS-1): 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) msg block (BSN 15, CS-1): 07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 @@ -395,6 +415,7 @@ -- Chunk with length 82 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 16, CS-1): 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) msg block (BSN 16, CS-1): 07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 @@ -404,6 +425,7 @@ -- Chunk with length 62 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 17, CS-1): 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) msg block (BSN 17, CS-1): 07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d @@ -413,6 +435,7 @@ -- Chunk with length 42 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 18, CS-1): 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) msg block (BSN 18, CS-1): 07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 @@ -422,6 +445,7 @@ -- Chunk with length 22 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 19, CS-1): b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) msg block (BSN 19, CS-1): 07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 @@ -436,6 +460,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW)len=16 data block (BSN 20, CS-1): 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) @@ -475,6 +500,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW)len=19 data block (BSN 21, CS-1): 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 21 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 21) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) @@ -495,6 +521,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 22, CS-1): 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 22 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 22) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) @@ -1478,6 +1505,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) (len=19) data block (BSN 0, CS-1): 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 00 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 MSG = 07 00 00 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 @@ -1489,6 +1517,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) (len=19) data block (BSN 1, CS-1): 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 02 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 MSG = 07 00 02 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 @@ -1500,6 +1529,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FINISHED data block (BSN 2, CS-1): 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling cannot be scheduled in this TS 7 (first control TS 4) @@ -1780,6 +1810,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 0, CS-4): 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) @@ -1793,6 +1824,7 @@ - Restarting at BSN 0, because all blocks have been transmitted. - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-4): 07 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -2353,6 +2385,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=00 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 @@ -2373,6 +2406,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 @@ -2396,6 +2430,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 2, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) msg block (BSN 2, CS-1): 07 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654288 block=0 data=00 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 @@ -2416,6 +2451,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 3, CS-1): 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) msg block (BSN 3, CS-1): 07 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654292 block=1 data=00 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2439,6 +2475,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 4, CS-1): 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) msg block (BSN 4, CS-1): 07 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654296 block=2 data=00 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c @@ -2459,6 +2496,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 5, CS-1): 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) msg block (BSN 5, CS-1): 07 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654301 block=3 data=00 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b @@ -2482,6 +2520,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) (len=13) data block (BSN 6, CS-1): 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) msg block (BSN 6, CS-1): 07 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654305 block=4 data=00 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 @@ -2502,6 +2541,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 7, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) msg block (BSN 7, CS-1): 07 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654309 block=5 data=00 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 @@ -2522,6 +2562,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 8, CS-1): 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) msg block (BSN 8, CS-1): 07 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654314 block=6 data=00 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 @@ -2545,6 +2586,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 9, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) msg block (BSN 9, CS-1): 07 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654318 block=7 data=00 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 @@ -2565,6 +2607,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 10, CS-1): 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) msg block (BSN 10, CS-1): 07 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654322 block=8 data=00 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2588,6 +2631,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 11, CS-1): 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) msg block (BSN 11, CS-1): 07 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=00 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c @@ -2608,6 +2652,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 12, CS-1): 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) msg block (BSN 12, CS-1): 07 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654331 block=10 data=00 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b @@ -2631,6 +2676,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) (len=13) data block (BSN 13, CS-1): 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) msg block (BSN 13, CS-1): 07 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=00 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 @@ -2651,6 +2697,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 14, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) msg block (BSN 14, CS-1): 07 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654340 block=0 data=00 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 @@ -2671,6 +2718,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 15, CS-1): 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) msg block (BSN 15, CS-1): 07 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654344 block=1 data=00 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 @@ -2694,6 +2742,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 16, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) msg block (BSN 16, CS-1): 07 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654348 block=2 data=00 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 @@ -2714,6 +2763,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 17, CS-1): 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) msg block (BSN 17, CS-1): 07 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654353 block=3 data=00 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2737,6 +2787,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 18, CS-1): 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) msg block (BSN 18, CS-1): 07 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654357 block=4 data=00 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c @@ -2757,6 +2808,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 19, CS-1): 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) msg block (BSN 19, CS-1): 07 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654361 block=5 data=00 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b @@ -2780,6 +2832,7 @@ - Dequeue next LLC for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) (len=13) data block (BSN 20, CS-1): 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) @@ -2803,6 +2856,7 @@ -- Chunk with length 13 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 21, CS-1): 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 21 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 21) msg block (BSN 21, CS-1): 07 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654370 block=7 data=00 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 @@ -2823,6 +2877,7 @@ -- Chunk with length 13 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 22, CS-1): 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 - need_padding 0 spb_status 0 spb 0(BSN1 22 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 22) msg block (BSN 22, CS-1): 07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654374 block=8 data=07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 @@ -2846,6 +2901,7 @@ -- Chunk with length 13 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 23, CS-1): 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 23 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 23) msg block (BSN 23, CS-1): 07 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654379 block=9 data=00 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 @@ -2866,6 +2922,7 @@ -- Chunk with length 13 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 24, CS-1): 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 24 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 24) msg block (BSN 24, CS-1): 07 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654383 block=10 data=00 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 @@ -2889,6 +2946,7 @@ -- Chunk with length 13 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 25, CS-1): 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 25 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 25) msg block (BSN 25, CS-1): 07 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654387 block=11 data=00 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c @@ -2909,6 +2967,7 @@ -- Chunk with length 13 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 26, CS-1): 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 26 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 26) msg block (BSN 26, CS-1): 07 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654392 block=0 data=00 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b @@ -2932,6 +2991,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 27, CS-1): 16 35 45 54 20 33 38 4c 4c 43 20 50 41 43 4b 45 54 20 33 39 - need_padding 0 spb_status 0 spb 0(BSN1 27 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 27) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) @@ -3041,6 +3101,7 @@ -- Chunk with length 21 larger than space (20) left in block: copy only remaining space, and we are done data block (BSN 0, CS-1): 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654405 block=3 data=00 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 @@ -3061,6 +3122,7 @@ -- Chunk with length 21 larger than space (18) left in block: copy only remaining space, and we are done data block (BSN 1, CS-1): 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654409 block=4 data=00 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 @@ -3081,6 +3143,7 @@ -- Chunk with length 21 larger than space (16) left in block: copy only remaining space, and we are done data block (BSN 2, CS-1): 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) msg block (BSN 2, CS-1): 07 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654413 block=5 data=00 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 @@ -3101,6 +3164,7 @@ -- Chunk with length 21 larger than space (14) left in block: copy only remaining space, and we are done data block (BSN 3, CS-1): 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) msg block (BSN 3, CS-1): 07 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654418 block=6 data=00 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 @@ -3121,6 +3185,7 @@ -- Chunk with length 21 larger than space (12) left in block: copy only remaining space, and we are done data block (BSN 4, CS-1): 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) msg block (BSN 4, CS-1): 07 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654422 block=7 data=00 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 @@ -3141,6 +3206,7 @@ -- Chunk with length 21 larger than space (10) left in block: copy only remaining space, and we are done data block (BSN 5, CS-1): 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) msg block (BSN 5, CS-1): 07 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654426 block=8 data=00 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 @@ -3161,6 +3227,7 @@ -- Chunk with length 21 larger than space (8) left in block: copy only remaining space, and we are done data block (BSN 6, CS-1): 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) msg block (BSN 6, CS-1): 07 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654431 block=9 data=00 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b @@ -3181,6 +3248,7 @@ -- Chunk with length 21 larger than space (6) left in block: copy only remaining space, and we are done data block (BSN 7, CS-1): 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) msg block (BSN 7, CS-1): 07 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654435 block=10 data=00 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 @@ -3201,6 +3269,7 @@ -- Chunk with length 21 larger than space (4) left in block: copy only remaining space, and we are done data block (BSN 8, CS-1): 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) msg block (BSN 8, CS-1): 07 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654439 block=11 data=00 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 @@ -3221,6 +3290,7 @@ -- Chunk with length 21 larger than space (2) left in block: copy only remaining space, and we are done data block (BSN 9, CS-1): 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) msg block (BSN 9, CS-1): 07 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654444 block=0 data=00 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c @@ -3241,6 +3311,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) changes state from FLOW to FINISHED data block (BSN 10, CS-1): 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) @@ -3725,6 +3796,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 data block (BSN 0, MCS-1): 14 15 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3739,6 +3811,7 @@ -- Chunk with length 512 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3750,6 +3823,7 @@ -- Chunk with length 490 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3761,6 +3835,7 @@ -- Chunk with length 468 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3772,6 +3847,7 @@ -- Chunk with length 446 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3783,6 +3859,7 @@ -- Chunk with length 424 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3794,6 +3871,7 @@ -- Chunk with length 402 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3805,6 +3883,7 @@ -- Chunk with length 380 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3816,6 +3895,7 @@ -- Chunk with length 358 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3827,6 +3907,7 @@ -- Chunk with length 336 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3838,6 +3919,7 @@ -- Chunk with length 314 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3849,6 +3931,7 @@ -- Chunk with length 292 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3860,6 +3943,7 @@ -- Chunk with length 270 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 12, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3871,6 +3955,7 @@ -- Chunk with length 248 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 13, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3882,6 +3967,7 @@ -- Chunk with length 226 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 14, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3893,6 +3979,7 @@ -- Chunk with length 204 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 15, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3904,6 +3991,7 @@ -- Chunk with length 182 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 16, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3915,6 +4003,7 @@ -- Chunk with length 160 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 17, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3926,6 +4015,7 @@ -- Chunk with length 138 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 18, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3937,6 +4027,7 @@ -- Chunk with length 116 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 19, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3948,6 +4039,7 @@ -- Chunk with length 94 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 20, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3959,6 +4051,7 @@ -- Chunk with length 72 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 21, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 21 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 21) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3970,6 +4063,7 @@ -- Chunk with length 50 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 22, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 22 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 22) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3981,6 +4075,7 @@ -- Chunk with length 28 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 23, MCS-1): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 23 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 23) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -3997,6 +4092,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=14 data block (BSN 24, MCS-1): 0c 1d 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 24 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 24) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4059,6 +4155,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=16 data block (BSN 0, MCS-2): 14 21 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4073,6 +4170,7 @@ -- Chunk with length 512 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4084,6 +4182,7 @@ -- Chunk with length 484 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4095,6 +4194,7 @@ -- Chunk with length 456 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4106,6 +4206,7 @@ -- Chunk with length 428 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4117,6 +4218,7 @@ -- Chunk with length 400 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4128,6 +4230,7 @@ -- Chunk with length 372 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4139,6 +4242,7 @@ -- Chunk with length 344 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4150,6 +4254,7 @@ -- Chunk with length 316 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4161,6 +4266,7 @@ -- Chunk with length 288 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4172,6 +4278,7 @@ -- Chunk with length 260 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4183,6 +4290,7 @@ -- Chunk with length 232 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4194,6 +4302,7 @@ -- Chunk with length 204 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 12, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4205,6 +4314,7 @@ -- Chunk with length 176 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 13, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4216,6 +4326,7 @@ -- Chunk with length 148 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 14, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4227,6 +4338,7 @@ -- Chunk with length 120 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 15, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4238,6 +4350,7 @@ -- Chunk with length 92 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 16, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 16 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 16) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4249,6 +4362,7 @@ -- Chunk with length 64 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 17, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 17 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 17) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4260,6 +4374,7 @@ -- Chunk with length 36 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 18, MCS-2): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 18 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 18) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4276,6 +4391,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=18 data block (BSN 19, MCS-2): 10 25 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 19 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 19) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4338,6 +4454,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=25 data block (BSN 0, MCS-3): 14 33 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4352,6 +4469,7 @@ -- Chunk with length 512 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4363,6 +4481,7 @@ -- Chunk with length 475 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4374,6 +4493,7 @@ -- Chunk with length 438 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4385,6 +4505,7 @@ -- Chunk with length 401 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4396,6 +4517,7 @@ -- Chunk with length 364 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4407,6 +4529,7 @@ -- Chunk with length 327 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4418,6 +4541,7 @@ -- Chunk with length 290 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4429,6 +4553,7 @@ -- Chunk with length 253 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4440,6 +4565,7 @@ -- Chunk with length 216 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4451,6 +4577,7 @@ -- Chunk with length 179 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4462,6 +4589,7 @@ -- Chunk with length 142 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4473,6 +4601,7 @@ -- Chunk with length 105 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 12, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4484,6 +4613,7 @@ -- Chunk with length 68 larger than space (37) left in block: copy only remaining space, and we are done data block (BSN 13, MCS-3): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 13 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 13) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4498,6 +4628,7 @@ -- Chunk with length 6 larger than space (5) left in block: copy only remaining space, and we are done data block (BSN 14, MCS-3): 3f 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 14 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 14) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4514,6 +4645,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=34 data block (BSN 15, MCS-3): 02 45 2b 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 15 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 15) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4576,6 +4708,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=32 data block (BSN 0, MCS-4): 14 41 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4590,6 +4723,7 @@ -- Chunk with length 512 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4601,6 +4735,7 @@ -- Chunk with length 468 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4612,6 +4747,7 @@ -- Chunk with length 424 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4623,6 +4759,7 @@ -- Chunk with length 380 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4634,6 +4771,7 @@ -- Chunk with length 336 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4645,6 +4783,7 @@ -- Chunk with length 292 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4656,6 +4795,7 @@ -- Chunk with length 248 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4667,6 +4807,7 @@ -- Chunk with length 204 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4678,6 +4819,7 @@ -- Chunk with length 160 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4689,6 +4831,7 @@ -- Chunk with length 116 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 10, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4700,6 +4843,7 @@ -- Chunk with length 72 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 11, MCS-4): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 11 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 11) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4716,6 +4860,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=14 data block (BSN 12, MCS-4): 38 1d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 12 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 12) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4778,6 +4923,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=44 data block (BSN 0, MCS-5): 14 59 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4792,6 +4938,7 @@ -- Chunk with length 512 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4803,6 +4950,7 @@ -- Chunk with length 456 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4814,6 +4962,7 @@ -- Chunk with length 400 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4825,6 +4974,7 @@ -- Chunk with length 344 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4836,6 +4986,7 @@ -- Chunk with length 288 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4847,6 +4998,7 @@ -- Chunk with length 232 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4858,6 +5010,7 @@ -- Chunk with length 176 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4869,6 +5022,7 @@ -- Chunk with length 120 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 8, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4880,6 +5034,7 @@ -- Chunk with length 64 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-5): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 9 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4896,6 +5051,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 data block (BSN 10, MCS-5): 10 5d 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4958,6 +5114,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=62 data block (BSN 0, MCS-6): 14 7d 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4972,6 +5129,7 @@ -- Chunk with length 512 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4983,6 +5141,7 @@ -- Chunk with length 438 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 2, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -4994,6 +5153,7 @@ -- Chunk with length 364 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 3 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5005,6 +5165,7 @@ -- Chunk with length 290 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 4, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 4) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5016,6 +5177,7 @@ -- Chunk with length 216 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 5 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5027,6 +5189,7 @@ -- Chunk with length 142 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 6, MCS-6): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 6) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5041,6 +5204,7 @@ -- Chunk with length 6 larger than space (5) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-6): 89 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 7 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5057,6 +5221,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=71 data block (BSN 8, MCS-6): 02 8f 2b 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5120,6 +5285,7 @@ data block (BSN 0, MCS-7): 14 59 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5136,6 +5302,7 @@ -- Chunk with length 512 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5151,6 +5318,7 @@ -- Chunk with length 400 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 3) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 2) - Copying data unit 1 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5166,6 +5334,7 @@ -- Chunk with length 288 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 5) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 4) - Copying data unit 1 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5181,6 +5350,7 @@ -- Chunk with length 176 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 7) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 6) - Copying data unit 1 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5196,6 +5366,7 @@ -- Chunk with length 64 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 9, MCS-7): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 9) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 8) - Copying data unit 1 (BSN 9) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5214,6 +5385,7 @@ data block (BSN 10, MCS-7): 10 5d 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5277,6 +5449,7 @@ data block (BSN 0, MCS-8): 14 71 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 2 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5294,6 +5467,7 @@ -- Chunk with length 512 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5309,6 +5483,7 @@ -- Chunk with length 376 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 3) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 2) - Copying data unit 1 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5324,6 +5499,7 @@ -- Chunk with length 240 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 5) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 4) - Copying data unit 1 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5339,6 +5515,7 @@ -- Chunk with length 104 larger than space (68) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-8): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 7) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 6) - Copying data unit 1 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5357,6 +5534,7 @@ data block (BSN 8, MCS-8): 48 3d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 2 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Copying data unit 1 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5421,6 +5599,7 @@ data block (BSN 0, MCS-9): 14 7d 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5437,6 +5616,7 @@ -- Chunk with length 512 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 1, MCS-9): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5452,6 +5632,7 @@ -- Chunk with length 364 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 3, MCS-9): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 2 BSN2 3) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 2) - Copying data unit 1 (BSN 3) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5467,6 +5648,7 @@ -- Chunk with length 216 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 5, MCS-9): 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - need_padding 0 spb_status 0 spb 0(BSN1 4 BSN2 5) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 4) - Copying data unit 1 (BSN 5) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5485,6 +5667,7 @@ -- Chunk with length 6 larger than space (5) left in block: copy only remaining space, and we are done data block (BSN 7, MCS-9): 89 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 43 c0 01 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 6 BSN2 7) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 6) - Copying data unit 1 (BSN 7) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5503,6 +5686,7 @@ data block (BSN 8, MCS-9): 02 8f 2b 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - Restarting at BSN 0, because all blocks have been transmitted (FLOW). - need_padding 0 spb_status 0 spb 0(BSN1 8 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 8) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). Polling is already scheduled for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) @@ -5552,12 +5736,14 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(6) demanded_mcs(6) cs_trans(6) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 12 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5604,12 +5790,14 @@ -- Chunk with length 100 larger than space (22) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 96 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(1) last_mcs(1) demanded_mcs(1) cs_trans(1) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 98 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5656,12 +5844,14 @@ -- Chunk with length 100 larger than space (28) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-2): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 92 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(2) last_mcs(2) demanded_mcs(2) cs_trans(2) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 94 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5708,6 +5898,7 @@ -- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-5): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) @@ -5720,6 +5911,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 data block (BSN 1, MCS-5): 58 15 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) @@ -5731,6 +5923,7 @@ - initial_cs_dl(5) last_mcs(5) demanded_mcs(7) cs_trans(7) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) msg block (BSN 0, MCS-7): 07 00 00 02 c0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 @@ -5778,6 +5971,7 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) @@ -5790,6 +5984,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 data block (BSN 1, MCS-6): 34 5d 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) @@ -5801,6 +5996,7 @@ - initial_cs_dl(6) last_mcs(6) demanded_mcs(9) cs_trans(9) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) msg block (BSN 0, MCS-9): 07 00 00 02 28 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 @@ -5856,6 +6052,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 data block (BSN 1, MCS-7): 58 15 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5866,12 +6063,14 @@ - initial_cs_dl(7) last_mcs(7) demanded_mcs(5) cs_trans(5) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) - initial_cs_dl(7) last_mcs(7) demanded_mcs(5) cs_trans(5) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, MCS-5): 07 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5926,6 +6125,7 @@ Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 data block (BSN 1, MCS-9): 34 5d 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 1) +- Copying 2 RLC blocks, 2 BSNs - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -5936,12 +6136,14 @@ - initial_cs_dl(9) last_mcs(9) demanded_mcs(6) cs_trans(6) arq_type(1) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 12 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) - initial_cs_dl(9) last_mcs(9) demanded_mcs(6) cs_trans(6) arq_type(1) bsn(1) - Resending BSN 1 - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 1) msg block (BSN 1, MCS-6): 07 40 00 02 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -5988,18 +6190,21 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(6) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 c6 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(3) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 e6 4a 4c 4e 50 52 54 56 58 5a 5c 5e 60 62 64 66 68 6a 6c 6e 70 72 74 76 78 7a 7c 7e 80 82 84 86 88 8a 8c 8e 90 92 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -6046,18 +6251,21 @@ -- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-5): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(5) last_mcs(5) demanded_mcs(2) cs_trans(2) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 d2 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(5) last_mcs(2) demanded_mcs(2) cs_trans(2) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-2): 07 00 00 f2 38 3a 3c 3e 40 42 44 46 48 4a 4c 4e 50 52 54 56 58 5a 5c 5e 60 62 64 66 68 6a 6c 6e 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -6104,18 +6312,21 @@ -- Chunk with length 100 larger than space (44) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-4): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-4): 07 00 00 80 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 4a 4c 4e 50 52 54 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(4) last_mcs(4) demanded_mcs(1) cs_trans(1) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 d6 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(4) last_mcs(1) demanded_mcs(1) cs_trans(1) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-1): 07 00 00 f6 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 4a 4c 4e 50 52 54 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge @@ -6162,24 +6373,28 @@ -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(6) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 0 spb 2(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 c6 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 38 3a 3c 3e 40 42 44 46 48 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(3) demanded_mcs(3) cs_trans(3) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 1 spb 3(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-3): 07 00 00 e6 4a 4c 4e 50 52 54 56 58 5a 5c 5e 60 62 64 66 68 6a 6c 6e 70 72 74 76 78 7a 7c 7e 80 82 84 86 88 8a 8c 8e 90 92 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) - initial_cs_dl(6) last_mcs(3) demanded_mcs(6) cs_trans(6) arq_type(0) bsn(0) - Resending BSN 0 - need_padding 0 spb_status 2 spb 0(BSN1 0 BSN2 -1) +- Copying 1 RLC blocks, 1 BSNs - Copying data unit 0 (BSN 0) msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge -- To view, visit https://gerrit.osmocom.org/3892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 16:29:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 16:29:03 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests Message-ID: Review at https://gerrit.osmocom.org/3895 TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes * use consistent formatting for output * log essential allocation parameters on failure Changes to tests are combined with logging messages update to separate code and test changes over different commits to avoid regressions. Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2400 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/tbf/TbfTest.err 6 files changed, 3,164 insertions(+), 3,170 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/1 diff --git a/src/bts.cpp b/src/bts.cpp index 1284f11..a79d1c2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -479,7 +479,7 @@ } if (!free_tfis) { - LOGP(DRLCMAC, LOGL_NOTICE, "No TFI available.\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "No TFI available (suggested TRX: %d).\n", use_trx); return -EBUSY; } diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 52d5edd..cff4cf5 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -450,7 +450,8 @@ trx_no = find_trx(bts->bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, - "- Failed to find a usable TRX (TFI exhausted)\n"); + "algo A [%s] (suggested TRX: %d): failed to find a usable TRX (TFI exhausted)\n", + single ? "single" : "multi", use_trx); return trx_no; } if (!trx) @@ -478,14 +479,16 @@ &tfi, &usf); if (tbf->direction == GPRS_RLCMAC_UL_TBF && usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no USF available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no USF available\n", + single ? "single" : "multi", use_trx); return -EBUSY; } if (ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no TFI available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no TFI available\n", + single ? "single" : "multi", use_trx); return -EBUSY; } @@ -1073,7 +1076,8 @@ /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo A [%s] (suggested TRX: %d): failed to allocate a TFI\n", + single ? "single" : "multi", use_trx); return tfi; } @@ -1109,19 +1113,21 @@ first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo A [%s] (suggested TRX: %d): No first common slots available\n", + single ? "single" : "multi", use_trx); return -EINVAL; } if (single && slotcount) { tbf_->upgrade_to_multislot = (avail_count > slotcount); - LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", - first_ts, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo A [%s] (suggested TRX: %d): using single slot at TS %d for %s\n", + single ? "single" : "multi", use_trx, first_ts, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { tbf_->upgrade_to_multislot = 0; - LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo A [%s] (suggested TRX: %d): using %d slots for %s\n", + single ? "single" : "multi", use_trx, slotcount, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } /* The allocation will be successful, so the system state and tbf_/ms_ diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 271f966..23a68cb 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -21,6 +21,7 @@ #include "gprs_debug.h" #include "tbf.h" #include "bts.h" +#include "pcu_utils.h" #include #include @@ -473,6 +474,19 @@ TEST_MODE_UL_AFTER_DL, }; +static inline char *test_mode_descr(enum test_mode t) +{ + switch (t) { + case TEST_MODE_UL_ONLY: return (char*)"UL only"; + case TEST_MODE_DL_ONLY: return (char*)"DL only"; + case TEST_MODE_UL_AND_DL: return (char*)"UL and DL"; + case TEST_MODE_DL_AND_UL: return (char*)"DL and UL"; + case TEST_MODE_DL_AFTER_UL: return (char*)"DL after UL"; + case TEST_MODE_UL_AFTER_DL: return (char*)"UL after DL"; + default: return NULL; + } +} + static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class, enum test_mode mode) { @@ -617,24 +631,23 @@ busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", - tfi, ms_class, - get_dir_char(0x01, ul_slots, dl_slots, busy_slots), - get_dir_char(0x02, ul_slots, dl_slots, busy_slots), - get_dir_char(0x04, ul_slots, dl_slots, busy_slots), - get_dir_char(0x08, ul_slots, dl_slots, busy_slots), - get_dir_char(0x10, ul_slots, dl_slots, busy_slots), - get_dir_char(0x20, ul_slots, dl_slots, busy_slots), - get_dir_char(0x40, ul_slots, dl_slots, busy_slots), - get_dir_char(0x80, ul_slots, dl_slots, busy_slots)); + printf(" TBF[%2d] class %2d reserves %c%c%c%c%c%c%c%c [%2u /%2u /%2u ]\n", + tfi, ms_class, + get_dir_char(0x01, ul_slots, dl_slots, busy_slots), + get_dir_char(0x02, ul_slots, dl_slots, busy_slots), + get_dir_char(0x04, ul_slots, dl_slots, busy_slots), + get_dir_char(0x08, ul_slots, dl_slots, busy_slots), + get_dir_char(0x10, ul_slots, dl_slots, busy_slots), + get_dir_char(0x20, ul_slots, dl_slots, busy_slots), + get_dir_char(0x40, ul_slots, dl_slots, busy_slots), + get_dir_char(0x80, ul_slots, dl_slots, busy_slots), + pcu_bitcount(ul_slots), pcu_bitcount(dl_slots), pcu_bitcount(busy_slots)); if (tfi >= 0) { OSMO_ASSERT(ms->current_trx()); - tfi2 = the_bts->tfi_find_free(dir, &trx_no2, - ms->current_trx()->trx_no); + tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(tfi2 < 0 || - trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; @@ -645,16 +658,16 @@ return counter; } -static void test_successive_allocation(algo_t algo, unsigned min_class, - unsigned max_class, enum test_mode mode, - unsigned expect_num, const char *text) +static void test_successive_alloc(unsigned min_class, unsigned max_class, unsigned expect_num, enum test_mode mode, + algo_t algo, const char *text) { BTS the_bts; struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; unsigned counter; - printf("Going to test assignment with many TBF, %s\n", text); + printf("Going to test assignment with many TBF, algorithm %s class %u..%u (%s)\n", + text, min_class, max_class, test_mode_descr(mode)); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -692,7 +705,7 @@ TEST_MODE_DL_ONLY, }; - printf("Going to test assignment with many connections, %s\n", text); + printf("Going to test assignment with many connections, algorithm %s\n", text); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -734,60 +747,32 @@ static void test_successive_allocation() { - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL, - 35, "algorithm A (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 10 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-29 (UL and DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL, - 35, "algorithm dynamic class 1-29 (UL and DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 101, TEST_MODE_DL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_ONLY, alloc_algorithm_b, "B"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL, - 35, "algorithm A (DL and UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm B class 10 (DL and UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm dynamic class 10 (DL and UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(12, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AFTER_UL, - 160, "algorithm A (DL after UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AFTER_UL, - 32, "algorithm B class 10 (DL after UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AFTER_UL, - 95, "algorithm dynamic class 10 (DL after UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_DL_AND_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL, - 35, "algorithm A (UL after DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL, - 32, "algorithm B class 10 (UL after DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_AFTER_DL, - 35, "algorithm dynamic class 10 (UL after DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_AFTER_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AFTER_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 95, TEST_MODE_DL_AFTER_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY, - 35, "algorithm A (UL only)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY, - 32, "algorithm B class 10 (UL only)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_ONLY, - 35, "algorithm dynamic class 10 (UL only)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AFTER_DL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY, - 160, "algorithm A (DL ONLY)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_ONLY, - 32, "algorithm B class 10 (DL ONLY)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_ONLY, - 101, "algorithm dynamic class 10 (DL ONLY)"); -} - -static void test_many_connections() -{ - test_many_connections(alloc_algorithm_a, 160, "algorithm A"); - test_many_connections(alloc_algorithm_b, 32, "algorithm B"); - test_many_connections(alloc_algorithm_dynamic, 160, "algorithm dynamic"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_ONLY, alloc_algorithm_b, "B"); } static void test_2_consecutive_dl_tbfs() @@ -855,9 +840,12 @@ test_alloc_a(); test_alloc_b(); - test_successive_allocation(); - test_many_connections(); + test_many_connections(alloc_algorithm_a, 160, "A"); + test_many_connections(alloc_algorithm_b, 32, "B"); + test_many_connections(alloc_algorithm_dynamic, 160, "dynamic"); test_2_consecutive_dl_tbfs(); + test_successive_allocation(); + return EXIT_SUCCESS; } diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index a74c42b..d7b7af5 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -1,894 +1,894 @@ -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously -1) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available Allocated 35 TBFs (previously 160) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 160) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 160) -No TFI available. -No TFI available. -- Failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI Allocated 32 TBFs (previously -1) No USF available Allocated 24 TBFs (previously 32) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI Allocated 32 TBFs (previously 32) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI Allocated 32 TBFs (previously 32) -No TFI available. -No TFI available. -- Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) Allocated 97 TBFs (previously -1) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available Allocated 24 TBFs (previously 97) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 97) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -- Failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 160) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: 0): failed to allocate a TFI +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo A [multi] (suggested TRX: -1): failed to allocate a TFI diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index cbb65aa..254718f 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -8588,2211 +8588,2211 @@ Mass test: TS0(OOOOOOOO)TS7 MS_Class=27 Mass test: TS0(OOOOOOOO)TS7 MS_Class=28 Mass test: TS0(OOOOOOOO)TS7 MS_Class=29 -Going to test assignment with many TBF, algorithm A (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL and DL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DDC - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DDC.. - TBF[7] class 10 reserves .....DDC - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DDC.. - TBF[11] class 10 reserves .....DDC - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DDC.. - TBF[15] class 10 reserves .....DDC - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DDC.. - TBF[19] class 10 reserves .....DDC - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DDC.. - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DDCD. - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves .....DDC - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 12 (UL and DL) - TBF[0] class 12 reserves ...DDCD. - TBF[1] class 12 reserves .....DCD - TBF[2] class 12 reserves ...DCD.. - TBF[3] class 12 reserves .....DDC - TBF[4] class 12 reserves ...DCD.. - TBF[5] class 12 reserves .....DCD - TBF[6] class 12 reserves ...DDC.. - TBF[7] class 12 reserves .....DDC - TBF[8] class 12 reserves ...DCD.. - TBF[9] class 12 reserves .....DCD - TBF[10] class 12 reserves ...DDC.. - TBF[11] class 12 reserves .....DDC - TBF[12] class 12 reserves ...DCD.. - TBF[13] class 12 reserves .....DCD - TBF[14] class 12 reserves ...DDC.. - TBF[15] class 12 reserves .....DDC - TBF[16] class 12 reserves ...DCD.. - TBF[17] class 12 reserves .....DCD - TBF[18] class 12 reserves ...DDC.. - TBF[19] class 12 reserves .....DDC - TBF[20] class 12 reserves ...DCD.. - TBF[21] class 12 reserves .....DCD - TBF[22] class 12 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 12 reserves ...DCD.. - TBF[25] class 12 reserves .....DCD - TBF[26] class 12 reserves ...DDCD. - TBF[27] class 12 reserves ...CD... - TBF[28] class 12 reserves .....DDC - TBF[29] class 12 reserves ...CD... - TBF[30] class 12 reserves ...CD... - TBF[31] class 12 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-12 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 1 reserves ...C.... - TBF[13] class 2 reserves ......DC - TBF[14] class 3 reserves ...DC... - TBF[15] class 4 reserves ....DCD. - TBF[16] class 5 reserves ......CD - TBF[17] class 6 reserves ...CD... - TBF[18] class 7 reserves ......DC - TBF[19] class 8 reserves ...DDCD. - TBF[20] class 9 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 11 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 1 reserves ...C.... - TBF[25] class 2 reserves ......DC - TBF[26] class 3 reserves ...DC... - TBF[27] class 4 reserves .....DCD - TBF[28] class 5 reserves ...CD... - TBF[29] class 6 reserves ......CD - TBF[30] class 7 reserves ...CD... - TBF[31] class 8 reserves ...DDCD. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-29 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ....DC.. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 1-29 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ....DC.. - TBF[1] class 4 reserves ...C.... - TBF[2] class 5 reserves ...C.... - TBF[0] class 6 reserves ......C. - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL and UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm A (DL after UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[2] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[4] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[14] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[27] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[16] class 10 reserves ......C. - TBF[26] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[18] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[31] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[20] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[22] class 10 reserves ......C. - TBF[25] class 10 reserves ....C... - TBF[24] class 10 reserves ......C. - TBF[27] class 10 reserves ....C... - TBF[26] class 10 reserves ......C. - TBF[29] class 10 reserves ....C... - TBF[28] class 10 reserves ......C. - TBF[31] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - Successfully allocated 95 UL TBFs -Going to test assignment with many TBF, algorithm A (UL after DL) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (UL only) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL ONLY) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL ONLY) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL ONLY) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[2] class 10 reserves ......C. - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[4] class 10 reserves ......C. - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[22] class 10 reserves .....C.. - TBF[14] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[24] class 10 reserves .....C.. - TBF[16] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[25] class 10 reserves .....C.. - TBF[18] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[27] class 10 reserves .....C.. - TBF[20] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[26] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[30] class 10 reserves .....C.. - TBF[22] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[28] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[31] class 10 reserves .....C.. - TBF[24] class 10 reserves ......C. - TBF[25] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[25] class 10 reserves ......C. - TBF[27] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[27] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[26] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[29] class 10 reserves ....C... - TBF[31] class 10 reserves ......C. - TBF[31] class 10 reserves .......C - Successfully allocated 101 UL TBFs Going to test assignment with many connections, algorithm A - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Going to test assignment with many connections, algorithm B - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ...DC... - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ....DCD. - TBF[4] class 5 reserves ...CD... - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves ......CD - TBF[7] class 8 reserves ...DDCD. - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves ....DCD. - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves .....CDD - TBF[13] class 14 reserves ...CDDD. - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ...DC... [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves .....CDD [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ...CDDD. [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] Successfully allocated 32 TBFs Going to test assignment with many connections, algorithm dynamic - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[12] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[29] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[22] class 14 reserves ...C.... - TBF[22] class 15 reserves ....C... - TBF[30] class 16 reserves .....C.. - TBF[19] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[24] class 19 reserves ...C.... - TBF[24] class 20 reserves ....C... - TBF[31] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[23] class 23 reserves .......C - TBF[26] class 24 reserves ...C.... - TBF[26] class 25 reserves ....C... - TBF[23] class 26 reserves ......C. - TBF[25] class 27 reserves .......C - TBF[28] class 28 reserves ...C.... - TBF[28] class 29 reserves ....C... - TBF[25] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[29] class 3 reserves ...C.... - TBF[29] class 4 reserves ....C... - TBF[27] class 5 reserves ......C. - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[29] class 8 reserves ......C. - TBF[31] class 9 reserves ...C.... - TBF[31] class 10 reserves ....C... - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....DC.. - TBF[0] class 3 reserves ......DC - TBF[0] class 4 reserves ...DCD.. - TBF[0] class 5 reserves ......CD - TBF[1] class 6 reserves ...CD... - TBF[1] class 7 reserves .....CD. - TBF[1] class 8 reserves ....DDCD - TBF[1] class 9 reserves ...DCD.. - TBF[2] class 10 reserves .....DCD - TBF[2] class 11 reserves ...DCD.. - TBF[3] class 12 reserves .....DCD - TBF[2] class 13 reserves ...CDD.. - TBF[3] class 14 reserves ....CDDD - TBF[3] class 15 reserves ...CDDDD - TBF[4] class 16 reserves ...CDDDD - TBF[5] class 17 reserves ...CDDDD - TBF[6] class 18 reserves ...CDDDD - TBF[4] class 19 reserves .....DCD - TBF[4] class 20 reserves ...DCD.. - TBF[5] class 21 reserves .....DCD - TBF[5] class 22 reserves ...DCD.. - TBF[6] class 23 reserves .....DCD - TBF[6] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... - TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... - TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 0] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 1] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 1] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 1] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[ 3] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[ 3] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 5] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 6] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 5] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 6] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) TBF2: numTs(3) +Going to test assignment with many TBF, algorithm A class 1..1 (DL only) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 160 UL TBFs +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 101 UL TBFs +Going to test assignment with many TBF, algorithm B class 10..10 (DL only) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs +Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL) + TBF[ 0] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 12 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[14] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[15] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[16] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[17] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[18] class 7 reserves ......DC [ 1 / 2 / 0 ] + TBF[19] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 11 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[26] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[27] class 4 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 6 reserves ......CD [ 1 / 2 / 0 ] + TBF[30] class 7 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm B class 1..29 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ....DC.. [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm dynamic class 1..29 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 1] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 6 reserves ......C. [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs +Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs +Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 160 UL TBFs +Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + Successfully allocated 95 UL TBFs +Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL) + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs +Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 32 UL TBFs +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs +Going to test assignment with many TBF, algorithm A class 1..1 (UL only) + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs +Going to test assignment with many TBF, algorithm B class 10..10 (UL only) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 32 UL TBFs diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 5f1e00d..de49450 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1411,7 +1411,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 Slot Allocation (Algorithm A) for class 45 -- Failed to find a usable TRX (TFI exhausted) +algo A [single] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) No PDCH resource Destroying MS object, TLLI = 0x00000000 ********** TBF starts here ********** @@ -3264,7 +3264,7 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +algo A [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3303,7 +3303,7 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +algo A [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -6333,7 +6333,7 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single -Using single slot at TS 4 for DL +algo A [single] (suggested TRX: 0): using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"....C..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -6348,7 +6348,7 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. - Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +algo A [multi] (suggested TRX: -1): using 4 slots for DL - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 3 @@ -6820,7 +6820,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [single] (suggested TRX: -1): failed to allocate a TS, no USF available No PDCH resource sending Immediate Assignment Uplink (AGCH) reject Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b Destroying MS object, TLLI = 0x00000000 @@ -9010,7 +9010,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available No PDCH resource Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 17:58:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 8 Sep 2017 17:58:03 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 2: Some more thoughts after spending some time adding some units tests and looking at some examples. 1) We can have 2 different uses for scenarios, and we need to agree on which we want: - A: scenario is just a filter for a given type of object. It doesn't apply for each object in particular as in a list, but just a list of attributes to require for a given type of object. That means for instance "times" attr makes no sense here, and of course in the scenarios file we only specify 1 entry for each object type. Example: I set in scenario "bts: attrX=bla", then I ask for 2 BTS in suite.conf, I will end up after combine() with both BTS having attrX set to bla (and if any of those has an attrX set in suite.conf to something else, then it will fail). - B: Scenario is a real object-to-object specific match. That means, if you have a suite.conf with 2 BTS, then you need to pass a scenario which is written in a way to explicitly set attribute for 2 BTS. Example: In scenario file I set "bts: [{attrxX=bla}, {attrX=bla}]", then in suite.conf I also specify 2 BTS. If I use a different number of object in any of those files, then it will fail. In case we go for "A", then we need to modify code calling config.py:combine() in suite.py:combined(), to basically apply the scenario part specific for a type of object to each of the objects in suite.conf. I think though that it makes sense to use "A" as it makes scenarios reusable, and there's no point in making them that tight to a suite.conf. 2) In any of the cases, in case we call combine() for a list of complex objects, we match objects one-to-one by index. If size of arrays mismatch, we can then understand it as if only the first len(list) are defined, and treat missing indexes as empty dictionaries/lists. This is similar as methods with default parameters. This way, If I want to define the following scenario, both should match,: suite.conf = { 'bts': [ { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] }, { 'times': '2', 'trx': [] }] } scenario = { 'bts': [{'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}]}] } config.combine(suite.conf, scenario) after combine, "suite.conf" should be, for each case above: - A: { 'bts': [ { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] }, { 'times': '2', 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] }] } -B: { 'bts': [ { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] }, { 'times': '2' }] } The difference is mainly than in A, the attributes are copied to both BTS dictionaries, while in B it's only applied to the first one because we do a 1-to-1 match and we don't apply to all objects. That's why I'd personally go for A as usually that's what we'd like. Important point in any case, summary: - In an array of dictionaries in the general case (leave the object type case), we combine(dest[i], src[i]), where "i" is the same index. - In an array of dictionaries, while combining them, if dest[i] or src[i] is None (because len(dest)!=len(src)), then we use empty dict instead of accessing out of bounds. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 18:03:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 8 Sep 2017 18:03:21 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: use standard function Message-ID: Review at https://gerrit.osmocom.org/3896 TS alloc: use standard function Use ffs() from standard library instead of template magic. Change-Id: I2d14ef327b09173d56ee3bca7e3ca85897d381c7 --- M src/gprs_ms.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/pcu_utils.h 3 files changed, 2 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/3896/1 diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 33d9cad..3e3a605 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -795,7 +795,7 @@ /* Assume a multislot class 1 device */ /* TODO: For class 2 devices, this could be removed */ - slots = pcu_lsb(slots); + slots = ffs(slots); return slots; } diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..a68b1ab 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -878,7 +878,7 @@ dl_slots & ul_slots, compute_usage_by_num_tbfs, NULL, NULL); if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); + ul_slots = dl_slots = ffs(dl_slots & ul_slots); else ul_slots = dl_slots = (dl_slots & ul_slots) & (1< -inline T pcu_lsb(T x) -{ - return x & -x; -} -- To view, visit https://gerrit.osmocom.org/3896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d14ef327b09173d56ee3bca7e3ca85897d381c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 8 22:06:35 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 8 Sep 2017 22:06:35 +0000 Subject: [PATCH] osmocom-bb[master]: mobile/main.c: clean up config file selection logic Message-ID: Review at https://gerrit.osmocom.org/3897 mobile/main.c: clean up config file selection logic The 903e2515 introduced the following problems: - The home variable is allocated dynamically by talloc, but not being freed. There is no need for dynamical memory allocation, as the getenv() returns a pointer to a value in the environment or NULL. - In case of custom configuration file, a pointer to a part of stack (not heap) is passed to talloc_free(). This may cause unexpected behaviour of segfault. Let's fix both of them. Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5 --- M src/host/layer23/src/mobile/main.c 1 file changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/97/3897/1 diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 4a2e4ec..bc66557 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -52,8 +51,7 @@ void *l23_ctx = NULL; struct llist_head ms_list; static char *gsmtap_ip = 0; -static const char *config_file = ".osmocom/bb/mobile.cfg"; -bool use_default_cfg = true; +static const char *custom_cfg_file = NULL; struct gsmtap_inst *gsmtap_inst = NULL; static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; @@ -138,8 +136,7 @@ vty_ip = optarg; break; case 'c': - config_file = optarg; - use_default_cfg = false; + custom_cfg_file = optarg; break; case 'v': vty_port = atoi(optarg); @@ -208,9 +205,9 @@ int main(int argc, char **argv) { + char *config_file; int quit = 0; int rc; - char const * home; printf("%s\n", openbsc_copyright); @@ -240,9 +237,18 @@ gsmtap_source_add_sink(gsmtap_inst); } - if (use_default_cfg) { - home = talloc_strdup(l23_ctx, getenv("HOME")); - config_file = talloc_asprintf_append(home, "/%s", config_file); + if (custom_cfg_file) { + /* Use full path provided by user */ + config_file = talloc_strdup(l23_ctx, custom_cfg_file); + } else { + /* Obtain the user's home directory path */ + const char *home_dir = getenv("HOME"); + if (!home_dir) + home_dir = "~"; + + /* Concatenate it with default config path */ + config_file = talloc_asprintf(l23_ctx, "%s/%s", + home_dir, ".osmocom/bb/mobile.cfg"); } /* save the config file directory name */ -- To view, visit https://gerrit.osmocom.org/3897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:24:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:24:38 +0000 Subject: osmo-gsm-tester[master]: Use tmpdir to create bts pcu-socket In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (5 comments) If you like revisit the minor things I commented, but would already pass for a +2 which you may hand out to yourself any time. https://gerrit.osmocom.org/#/c/3894/1/src/osmo_gsm_tester/bts_osmotrx.py File src/osmo_gsm_tester/bts_osmotrx.py: Line 44: self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) lol, what is octopusk? more obvious would be 'osmo-gsm-tester' to indicate where it came from Line 45: if len(self.pcu_socket_path().encode()) > 107: nice, you thought of encode(), I'd have missed that. Line 52: except OSError: for completeness sake we could log the error. not very important though. Line 54: os.rmdir(self.pcu_sk_tmp_dir) what if removing the socket file failed or the dir is nonempty for any odd reason? do we want to crash the test? I guess we want this in a try..except too. Line 56: def pcu_socket_path(self): small cosmetic: first init self.pcu_sk_tmp_dir with None and create the dir only when pcu_socket_path() is invoked the first time -- this way in setups like unit tests we can instantiate this class without creating dirs in the file system right away. (Then also move the length sanity check along into this func.) -- To view, visit https://gerrit.osmocom.org/3894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:35:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:35:42 +0000 Subject: osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 given the time that passed, the future patch that is going to clean up the separation as well as dexter's verbal approval I got in person, I am confident enough to sneak in a +2 to myself on this one. -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:37:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:37:26 +0000 Subject: [MERGED] osmo-mgw[master]: separate libosmo-mgcp-client from mgcp server code In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: separate libosmo-mgcp-client from mgcp server code ...................................................................... separate libosmo-mgcp-client from mgcp server code When osmo-mgw is built --with-mgcp-transcoding, linking the mgcp library also requires linking libgsm, even though e.g. osmo-msc never use it. Separate the MGCP client code from the MGCP server code to avoid this dep. The mgcp client code does use some definitions from mgcp.h and mgcp_common.c. For simplicity, link mgcp_common.c in both libosmo-legacy-mgcp as well as libosmo-mgcp-client. That means it is not possible to link both libosmo-legacy-mgcp and libosmo-mgcp-client in the same binary because of duplicate symbols, but currently that is sufficient. (An alternative would be code dup or yet another libosmo-mgcp-common library.) Add libosmo-mgcp-client to debian packaging. Related: OS#2488 Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 --- M Makefile.am M configure.ac M debian/control M debian/rules M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/mgcp_client/Makefile.am R include/osmocom/mgcp_client/mgcpgw_client.h R include/osmocom/mgcp_client/mgcpgw_client_internal.h A libosmo-mgcp-client.pc.in M src/Makefile.am M src/libosmo-legacy-mgcp/Makefile.am A src/libosmo-mgcp-client/Makefile.am R src/libosmo-mgcp-client/mgcpgw_client.c R src/libosmo-mgcp-client/mgcpgw_client_vty.c M tests/Makefile.am M tests/legacy_mgcp/Makefile.am A tests/mgcp_client/Makefile.am R tests/mgcp_client/mgcpgw_client_test.c R tests/mgcp_client/mgcpgw_client_test.err R tests/mgcp_client/mgcpgw_client_test.ok M tests/testsuite.at 23 files changed, 133 insertions(+), 31 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index c5c3137..8fb6e6c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,10 @@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libosmo-legacy-mgcp.pc +pkgconfig_DATA = \ + libosmo-legacy-mgcp.pc \ + libosmo-mgcp-client.pc \ + $(NULL) BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version diff --git a/configure.ac b/configure.ac index 5482b8c..86c3bc5 100644 --- a/configure.ac +++ b/configure.ac @@ -118,15 +118,19 @@ AC_OUTPUT( libosmo-legacy-mgcp.pc + libosmo-mgcp-client.pc include/Makefile include/osmocom/Makefile include/osmocom/legacy_mgcp/Makefile + include/osmocom/mgcp_client/Makefile src/Makefile src/libosmo-legacy-mgcp/Makefile + src/libosmo-mgcp-client/Makefile src/osmo-bsc_mgcp/Makefile tests/Makefile tests/atlocal tests/legacy_mgcp/Makefile + tests/mgcp_client/Makefile doc/Makefile doc/examples/Makefile contrib/Makefile diff --git a/debian/control b/debian/control index af49dc7..6556370 100644 --- a/debian/control +++ b/debian/control @@ -47,3 +47,25 @@ Multi-Arch: same Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library + +Package: libosmo-mgcp-client0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities + +Package: libosmo-mgcp-client-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities + +Package: libosmo-mgcp-client-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities diff --git a/debian/rules b/debian/rules index ee680cc..8976ede 100755 --- a/debian/rules +++ b/debian/rules @@ -32,3 +32,4 @@ override_dh_strip: dh_strip --dbg-package=osmo-mgw-dbg dh_strip --dbg-package=libosmo-legacy-mgcp-dbg + dh_strip --dbg-package=libosmo-mgcp-client-dbg diff --git a/include/Makefile.am b/include/Makefile.am index 73b1b3e..e2baf41 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,6 +5,6 @@ nobase_include_HEADERS = \ osmocom/legacy_mgcp/mgcp.h \ osmocom/legacy_mgcp/mgcp_internal.h \ - osmocom/legacy_mgcp/mgcpgw_client.h \ osmocom/legacy_mgcp/osmux.h \ + osmocom/mgcp_client/mgcpgw_client.h \ $(NULL) diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am index 6514436..be9f1ca 100644 --- a/include/osmocom/Makefile.am +++ b/include/osmocom/Makefile.am @@ -1,3 +1,4 @@ SUBDIRS = \ legacy_mgcp \ + mgcp_client \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/Makefile.am b/include/osmocom/legacy_mgcp/Makefile.am index 52f0b5b..4a9550c 100644 --- a/include/osmocom/legacy_mgcp/Makefile.am +++ b/include/osmocom/legacy_mgcp/Makefile.am @@ -1,5 +1,4 @@ noinst_HEADERS = \ - mgcpgw_client_internal.h \ mgcp_transcode.h \ vty.h \ $(NULL) diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am new file mode 100644 index 0000000..224a7dc --- /dev/null +++ b/include/osmocom/mgcp_client/Makefile.am @@ -0,0 +1,3 @@ +noinst_HEADERS = \ + mgcpgw_client_internal.h \ + $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client.h b/include/osmocom/mgcp_client/mgcpgw_client.h similarity index 100% rename from include/osmocom/legacy_mgcp/mgcpgw_client.h rename to include/osmocom/mgcp_client/mgcpgw_client.h diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client_internal.h b/include/osmocom/mgcp_client/mgcpgw_client_internal.h similarity index 100% rename from include/osmocom/legacy_mgcp/mgcpgw_client_internal.h rename to include/osmocom/mgcp_client/mgcpgw_client_internal.h diff --git a/libosmo-mgcp-client.pc.in b/libosmo-mgcp-client.pc.in new file mode 100644 index 0000000..aee86dc --- /dev/null +++ b/libosmo-mgcp-client.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom Media Gateway Control Protocol Client library +Description: C Utility Library +Version: @VERSION@ +Libs: -L${libdir} -losmo-mgcp-client +Cflags: -I${includedir}/ diff --git a/src/Makefile.am b/src/Makefile.am index f47bc00..922bbda 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,6 +22,7 @@ # Libraries SUBDIRS = \ libosmo-legacy-mgcp \ + libosmo-mgcp-client \ $(NULL) # Programs diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 42f25c0..32902b9 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -41,8 +41,6 @@ mgcp_vty.c \ mgcp_osmux.c \ mgcp_sdp.c \ - mgcpgw_client.c \ - mgcpgw_client_vty.c \ $(NULL) if BUILD_MGCP_TRANSCODING libosmo_legacy_mgcp_la_SOURCES += \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am new file mode 100644 index 0000000..02b9177 --- /dev/null +++ b/src/libosmo-mgcp-client/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_builddir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMONETIF_LIBS) \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +# This is _NOT_ the library release version, it's an API version. +# Please read Chapter 6 "Library interface versions" of the libtool +# documentation before making any modification +MGCP_CLIENT_LIBVERSION=1:0:0 + +lib_LTLIBRARIES = \ + libosmo-mgcp-client.la \ + $(NULL) + +libosmo_mgcp_client_la_SOURCES = \ + mgcpgw_client.c \ + mgcpgw_client_vty.c \ + ../libosmo-legacy-mgcp/mgcp_common.c \ + $(NULL) + +libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client.c b/src/libosmo-mgcp-client/mgcpgw_client.c similarity index 99% rename from src/libosmo-legacy-mgcp/mgcpgw_client.c rename to src/libosmo-mgcp-client/mgcpgw_client.c index 810ba16..7ed4b07 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client.c +++ b/src/libosmo-mgcp-client/mgcpgw_client.c @@ -24,10 +24,10 @@ #include #include -#include #include #include -#include +#include +#include #include #include diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client_vty.c b/src/libosmo-mgcp-client/mgcpgw_client_vty.c similarity index 98% rename from src/libosmo-legacy-mgcp/mgcpgw_client_vty.c rename to src/libosmo-mgcp-client/mgcpgw_client_vty.c index d101ded..034c84c 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client_vty.c +++ b/src/libosmo-mgcp-client/mgcpgw_client_vty.c @@ -28,7 +28,7 @@ #include #include -#include +#include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/Makefile.am b/tests/Makefile.am index f6cb938..ae51f89 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ legacy_mgcp \ + mgcp_client \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/legacy_mgcp/Makefile.am b/tests/legacy_mgcp/Makefile.am index e5f6888..f043124 100644 --- a/tests/legacy_mgcp/Makefile.am +++ b/tests/legacy_mgcp/Makefile.am @@ -20,13 +20,10 @@ EXTRA_DIST = \ mgcp_test.ok \ mgcp_transcoding_test.ok \ - mgcpgw_client_test.ok \ - mgcpgw_client_test.err \ $(NULL) noinst_PROGRAMS = \ mgcp_test \ - mgcpgw_client_test \ $(NULL) if BUILD_MGCP_TRANSCODING noinst_PROGRAMS += \ @@ -61,17 +58,4 @@ $(LIBOSMONETIF_LIBS) \ $(LIBRARY_GSM) \ -lm \ - $(NULL) - -mgcpgw_client_test_SOURCES = \ - mgcpgw_client_test.c \ - $(NULL) - -mgcpgw_client_test_LDADD = \ - $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBRARY_DL) \ - $(LIBOSMONETIF_LIBS) \ - $(LIBRARY_GSM) \ $(NULL) diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am new file mode 100644 index 0000000..2253770 --- /dev/null +++ b/tests/mgcp_client/Makefile.am @@ -0,0 +1,38 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + mgcpgw_client_test.ok \ + mgcpgw_client_test.err \ + $(NULL) + +noinst_PROGRAMS = \ + mgcpgw_client_test \ + $(NULL) + +mgcpgw_client_test_SOURCES = \ + mgcpgw_client_test.c \ + $(NULL) + +mgcpgw_client_test_LDADD = \ + $(top_builddir)/src/libosmo-mgcp-client/libosmo-mgcp-client.la \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBRARY_DL) \ + $(LIBOSMONETIF_LIBS) \ + $(NULL) diff --git a/tests/legacy_mgcp/mgcpgw_client_test.c b/tests/mgcp_client/mgcpgw_client_test.c similarity index 97% rename from tests/legacy_mgcp/mgcpgw_client_test.c rename to tests/mgcp_client/mgcpgw_client_test.c index 51d5272..e90a4ed 100644 --- a/tests/legacy_mgcp/mgcpgw_client_test.c +++ b/tests/mgcp_client/mgcpgw_client_test.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include void *ctx; diff --git a/tests/legacy_mgcp/mgcpgw_client_test.err b/tests/mgcp_client/mgcpgw_client_test.err similarity index 100% rename from tests/legacy_mgcp/mgcpgw_client_test.err rename to tests/mgcp_client/mgcpgw_client_test.err diff --git a/tests/legacy_mgcp/mgcpgw_client_test.ok b/tests/mgcp_client/mgcpgw_client_test.ok similarity index 100% rename from tests/legacy_mgcp/mgcpgw_client_test.ok rename to tests/mgcp_client/mgcpgw_client_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index dd59f2c..37347b3 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -14,9 +14,9 @@ AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcp_transcoding_test], [], [expout], [ignore]) AT_CLEANUP -AT_SETUP([legacy_mgcpgw_client]) -AT_KEYWORDS([legacy_mgcpgw_client]) -cat $abs_srcdir/legacy_mgcp/mgcpgw_client_test.ok > expout -cat $abs_srcdir/legacy_mgcp/mgcpgw_client_test.err > experr -AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcpgw_client_test], [], [expout], [experr]) +AT_SETUP([mgcpgw_client]) +AT_KEYWORDS([mgcpgw_client]) +cat $abs_srcdir/mgcp_client/mgcpgw_client_test.ok > expout +cat $abs_srcdir/mgcp_client/mgcpgw_client_test.err > experr +AT_CHECK([$abs_top_builddir/tests/mgcp_client/mgcpgw_client_test], [], [expout], [experr]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e0b2d2a399b77086a36606f5e427271c6242df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:37:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:37:51 +0000 Subject: [MERGED] osmo-mgw[master]: rename mgcpgw_client_* to mgcp_client_* In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: rename mgcpgw_client_* to mgcp_client_* ...................................................................... rename mgcpgw_client_* to mgcp_client_* The name "mgcpgw_client" referred to an MGCP gateway, which is rather an MGW (Media Gateway). But this client code is more generally a client for the MGCP protocol, independently from what the server program is called. Rename the files as well as the function prefixes to drop the "gw". It is purely cosmetic and not strictly necessary, but a good point in time for fixes like this. osmo-msc build will be adjusted by I093ad02ca0e532f659447c785e09678b3e6f220d. osmo-bsc build will be adjusted by I6402c7cbe58dacae7630f7f03819f8102e54c699. These should be applied right after this here is merged to avoid fallout. Change-Id: I99f7faab637cfcc22ece64a1dbcbe590f2042187 --- M include/Makefile.am M include/osmocom/mgcp_client/Makefile.am A include/osmocom/mgcp_client/mgcp_client.h R include/osmocom/mgcp_client/mgcp_client_internal.h D include/osmocom/mgcp_client/mgcpgw_client.h M src/libosmo-mgcp-client/Makefile.am R src/libosmo-mgcp-client/mgcp_client.c R src/libosmo-mgcp-client/mgcp_client_vty.c M tests/mgcp_client/Makefile.am R tests/mgcp_client/mgcp_client_test.c R tests/mgcp_client/mgcp_client_test.err R tests/mgcp_client/mgcp_client_test.ok M tests/testsuite.at 13 files changed, 175 insertions(+), 175 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index e2baf41..94d74bb 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -6,5 +6,5 @@ osmocom/legacy_mgcp/mgcp.h \ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ - osmocom/mgcp_client/mgcpgw_client.h \ + osmocom/mgcp_client/mgcp_client.h \ $(NULL) diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 224a7dc..24401f1 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -1,3 +1,3 @@ noinst_HEADERS = \ - mgcpgw_client_internal.h \ + mgcp_client_internal.h \ $(NULL) diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h new file mode 100644 index 0000000..df73811 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -0,0 +1,73 @@ +#pragma once + +#include + +#define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" +#define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 +#define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" +#define MGCP_CLIENT_REMOTE_PORT_DEFAULT 2427 + +struct msgb; +struct vty; +struct mgcp_client; + +struct mgcp_client_conf { + const char *local_addr; + int local_port; + const char *remote_addr; + int remote_port; + uint16_t first_endpoint; + uint16_t last_endpoint; + uint16_t bts_base; +}; + +typedef unsigned int mgcp_trans_id_t; + +struct mgcp_response_head { + int response_code; + mgcp_trans_id_t trans_id; + const char *comment; +}; + +struct mgcp_response { + char *body; + struct mgcp_response_head head; + uint16_t audio_port; +}; + +void mgcp_client_conf_init(struct mgcp_client_conf *conf); +void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf); +int mgcp_client_config_write(struct vty *vty, const char *indent); +struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp); + +struct mgcp_client *mgcp_client_init(void *ctx, + struct mgcp_client_conf *conf); +int mgcp_client_connect(struct mgcp_client *mgcp); + +const char *mgcp_client_remote_addr_str(struct mgcp_client *mgcp); +uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp); +uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp); + +int mgcp_client_next_endpoint(struct mgcp_client *client); +void mgcp_client_release_endpoint(uint16_t id, struct mgcp_client *client); + +/* Invoked when an MGCP response is received or sending failed. When the + * response is passed as NULL, this indicates failure during transmission. */ +typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv); +int mgcp_response_parse_params(struct mgcp_response *r); + +int mgcp_client_tx(struct mgcp_client *mgcp, struct msgb *msg, + mgcp_response_cb_t response_cb, void *priv); + +enum mgcp_connection_mode; + +struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, + uint16_t rtp_endpoint, unsigned int call_id, + enum mgcp_connection_mode mode); + +struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, + uint16_t rtp_endpoint, const char *rtp_conn_addr, + uint16_t rtp_port, enum mgcp_connection_mode mode); + +struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, + unsigned int call_id); diff --git a/include/osmocom/mgcp_client/mgcpgw_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h similarity index 69% rename from include/osmocom/mgcp_client/mgcpgw_client_internal.h rename to include/osmocom/mgcp_client/mgcp_client_internal.h index d3a7849..1b149e2 100644 --- a/include/osmocom/mgcp_client/mgcpgw_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -2,8 +2,8 @@ #define MSGB_CB_MGCP_TRANS_ID 0 -struct mgcpgw_client { - struct mgcpgw_client_conf actual; +struct mgcp_client { + struct mgcp_client_conf actual; uint32_t remote_addr; struct osmo_wqueue wq; mgcp_trans_id_t next_trans_id; @@ -24,10 +24,10 @@ void *priv; }; -int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg); +int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg); -struct mgcp_response_pending * mgcpgw_client_pending_add( - struct mgcpgw_client *mgcp, +struct mgcp_response_pending * mgcp_client_pending_add( + struct mgcp_client *mgcp, mgcp_trans_id_t trans_id, mgcp_response_cb_t response_cb, void *priv); diff --git a/include/osmocom/mgcp_client/mgcpgw_client.h b/include/osmocom/mgcp_client/mgcpgw_client.h deleted file mode 100644 index 09db816..0000000 --- a/include/osmocom/mgcp_client/mgcpgw_client.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -#include - -#define MGCPGW_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" -#define MGCPGW_CLIENT_LOCAL_PORT_DEFAULT 0 -#define MGCPGW_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" -#define MGCPGW_CLIENT_REMOTE_PORT_DEFAULT 2427 - -struct msgb; -struct vty; -struct mgcpgw_client; - -struct mgcpgw_client_conf { - const char *local_addr; - int local_port; - const char *remote_addr; - int remote_port; - uint16_t first_endpoint; - uint16_t last_endpoint; - uint16_t bts_base; -}; - -typedef unsigned int mgcp_trans_id_t; - -struct mgcp_response_head { - int response_code; - mgcp_trans_id_t trans_id; - const char *comment; -}; - -struct mgcp_response { - char *body; - struct mgcp_response_head head; - uint16_t audio_port; -}; - -void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf); -void mgcpgw_client_vty_init(void *talloc_ctx, int node, struct mgcpgw_client_conf *conf); -int mgcpgw_client_config_write(struct vty *vty, const char *indent); -struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp); - -struct mgcpgw_client *mgcpgw_client_init(void *ctx, - struct mgcpgw_client_conf *conf); -int mgcpgw_client_connect(struct mgcpgw_client *mgcp); - -const char *mgcpgw_client_remote_addr_str(struct mgcpgw_client *mgcp); -uint16_t mgcpgw_client_remote_port(struct mgcpgw_client *mgcp); -uint32_t mgcpgw_client_remote_addr_n(struct mgcpgw_client *mgcp); - -int mgcpgw_client_next_endpoint(struct mgcpgw_client *client); -void mgcpgw_client_release_endpoint(uint16_t id, struct mgcpgw_client *client); - -/* Invoked when an MGCP response is received or sending failed. When the - * response is passed as NULL, this indicates failure during transmission. */ -typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv); -int mgcp_response_parse_params(struct mgcp_response *r); - -int mgcpgw_client_tx(struct mgcpgw_client *mgcp, struct msgb *msg, - mgcp_response_cb_t response_cb, void *priv); - -enum mgcp_connection_mode; - -struct msgb *mgcp_msg_crcx(struct mgcpgw_client *mgcp, - uint16_t rtp_endpoint, unsigned int call_id, - enum mgcp_connection_mode mode); - -struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp, - uint16_t rtp_endpoint, const char *rtp_conn_addr, - uint16_t rtp_port, enum mgcp_connection_mode mode); - -struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint, - unsigned int call_id); diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 02b9177..dbbd303 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -29,8 +29,8 @@ $(NULL) libosmo_mgcp_client_la_SOURCES = \ - mgcpgw_client.c \ - mgcpgw_client_vty.c \ + mgcp_client.c \ + mgcp_client_vty.c \ ../libosmo-legacy-mgcp/mgcp_common.c \ $(NULL) diff --git a/src/libosmo-mgcp-client/mgcpgw_client.c b/src/libosmo-mgcp-client/mgcp_client.c similarity index 85% rename from src/libosmo-mgcp-client/mgcpgw_client.c rename to src/libosmo-mgcp-client/mgcp_client.c index 7ed4b07..b72fc50 100644 --- a/src/libosmo-mgcp-client/mgcpgw_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -36,10 +36,10 @@ #include #include -void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf) +void mgcp_client_conf_init(struct mgcp_client_conf *conf) { - /* NULL and -1 default to MGCPGW_CLIENT_*_DEFAULT values */ - *conf = (struct mgcpgw_client_conf){ + /* NULL and -1 default to MGCP_CLIENT_*_DEFAULT values */ + *conf = (struct mgcp_client_conf){ .local_addr = NULL, .local_port = -1, .remote_addr = NULL, @@ -51,7 +51,7 @@ } /* Test if a given endpoint id is currently in use */ -static bool endpoint_in_use(uint16_t id, struct mgcpgw_client *client) +static bool endpoint_in_use(uint16_t id, struct mgcp_client *client) { struct mgcp_inuse_endpoint *endpoint; llist_for_each_entry(endpoint, &client->inuse_endpoints, entry) { @@ -63,7 +63,7 @@ } /* Find and seize an unsused endpoint id */ -int mgcpgw_client_next_endpoint(struct mgcpgw_client *client) +int mgcp_client_next_endpoint(struct mgcp_client *client) { int i; uint16_t first_endpoint = client->actual.first_endpoint; @@ -96,7 +96,7 @@ } /* Release a seized endpoint id to make it available again for other calls */ -void mgcpgw_client_release_endpoint(uint16_t id, struct mgcpgw_client *client) +void mgcp_client_release_endpoint(uint16_t id, struct mgcp_client *client) { struct mgcp_inuse_endpoint *endpoint; struct mgcp_inuse_endpoint *endpoint_tmp; @@ -108,9 +108,9 @@ } } -static void mgcpgw_client_handle_response(struct mgcpgw_client *mgcp, - struct mgcp_response_pending *pending, - struct mgcp_response *response) +static void mgcp_client_handle_response(struct mgcp_client *mgcp, + struct mgcp_response_pending *pending, + struct mgcp_response *response) { if (!pending) { LOGP(DLMGCP, LOGL_ERROR, @@ -226,8 +226,8 @@ return 0; } -static struct mgcp_response_pending *mgcpgw_client_response_pending_get( - struct mgcpgw_client *mgcp, +static struct mgcp_response_pending *mgcp_client_response_pending_get( + struct mgcp_client *mgcp, struct mgcp_response *r) { struct mgcp_response_pending *pending; @@ -248,7 +248,7 @@ * mgcp_do_read that reads from the socket connected to the MGCP gateway. This * function is published mainly to be able to feed data from the test suite. */ -int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg) +int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg) { struct mgcp_response r = { 0 }; struct mgcp_response_pending *pending; @@ -260,7 +260,7 @@ return -1; } - pending = mgcpgw_client_response_pending_get(mgcp, &r); + pending = mgcp_client_response_pending_get(mgcp, &r); if (!pending) { LOGP(DLMGCP, LOGL_ERROR, "Cannot find matching MGCP transaction for trans_id %d\n", @@ -268,13 +268,13 @@ return -1; } - mgcpgw_client_handle_response(mgcp, pending, &r); + mgcp_client_handle_response(mgcp, pending, &r); return 0; } static int mgcp_do_read(struct osmo_fd *fd) { - struct mgcpgw_client *mgcp = fd->data; + struct mgcp_client *mgcp = fd->data; struct msgb *msg; int ret; @@ -296,7 +296,7 @@ } msg->l2h = msgb_put(msg, ret); - ret = mgcpgw_client_rx(mgcp, msg); + ret = mgcp_client_rx(mgcp, msg); talloc_free(msg); return ret; } @@ -327,12 +327,12 @@ return ret; } -struct mgcpgw_client *mgcpgw_client_init(void *ctx, - struct mgcpgw_client_conf *conf) +struct mgcp_client *mgcp_client_init(void *ctx, + struct mgcp_client_conf *conf) { - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; - mgcp = talloc_zero(ctx, struct mgcpgw_client); + mgcp = talloc_zero(ctx, struct mgcp_client); INIT_LLIST_HEAD(&mgcp->responses_pending); INIT_LLIST_HEAD(&mgcp->inuse_endpoints); @@ -340,14 +340,14 @@ mgcp->next_trans_id = 1; mgcp->actual.local_addr = conf->local_addr ? conf->local_addr : - MGCPGW_CLIENT_LOCAL_ADDR_DEFAULT; + MGCP_CLIENT_LOCAL_ADDR_DEFAULT; mgcp->actual.local_port = conf->local_port >= 0 ? (uint16_t)conf->local_port : - MGCPGW_CLIENT_LOCAL_PORT_DEFAULT; + MGCP_CLIENT_LOCAL_PORT_DEFAULT; mgcp->actual.remote_addr = conf->remote_addr ? conf->remote_addr : - MGCPGW_CLIENT_REMOTE_ADDR_DEFAULT; + MGCP_CLIENT_REMOTE_ADDR_DEFAULT; mgcp->actual.remote_port = conf->remote_port >= 0 ? (uint16_t)conf->remote_port : - MGCPGW_CLIENT_REMOTE_PORT_DEFAULT; + MGCP_CLIENT_REMOTE_PORT_DEFAULT; mgcp->actual.first_endpoint = conf->first_endpoint > 0 ? (uint16_t)conf->first_endpoint : 0; mgcp->actual.last_endpoint = conf->last_endpoint > 0 ? (uint16_t)conf->last_endpoint : 0; @@ -356,7 +356,7 @@ return mgcp; } -int mgcpgw_client_connect(struct mgcpgw_client *mgcp) +int mgcp_client_connect(struct mgcp_client *mgcp) { int on; struct sockaddr_in addr; @@ -434,24 +434,24 @@ return rc; } -const char *mgcpgw_client_remote_addr_str(struct mgcpgw_client *mgcp) +const char *mgcp_client_remote_addr_str(struct mgcp_client *mgcp) { return mgcp->actual.remote_addr; } -uint16_t mgcpgw_client_remote_port(struct mgcpgw_client *mgcp) +uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp) { return mgcp->actual.remote_port; } /* Return the MGCP GW binary IPv4 address in network byte order. */ -uint32_t mgcpgw_client_remote_addr_n(struct mgcpgw_client *mgcp) +uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp) { return mgcp->remote_addr; } -struct mgcp_response_pending * mgcpgw_client_pending_add( - struct mgcpgw_client *mgcp, +struct mgcp_response_pending * mgcp_client_pending_add( + struct mgcp_client *mgcp, mgcp_trans_id_t trans_id, mgcp_response_cb_t response_cb, void *priv) @@ -472,8 +472,8 @@ * mgcp_response_parse_params(response) to get the parsed parameters -- to * potentially save some CPU cycles, only the head line has been parsed when * the response_cb is invoked. */ -int mgcpgw_client_tx(struct mgcpgw_client *mgcp, struct msgb *msg, - mgcp_response_cb_t response_cb, void *priv) +int mgcp_client_tx(struct mgcp_client *mgcp, struct msgb *msg, + mgcp_response_cb_t response_cb, void *priv) { struct mgcp_response_pending *pending; mgcp_trans_id_t trans_id; @@ -487,7 +487,7 @@ return -EINVAL; } - pending = mgcpgw_client_pending_add(mgcp, trans_id, response_cb, priv); + pending = mgcp_client_pending_add(mgcp, trans_id, response_cb, priv); if (msgb_l2len(msg) > 4096) { LOGP(DLMGCP, LOGL_ERROR, @@ -510,7 +510,7 @@ mgcp_tx_error: /* Pass NULL to response cb to indicate an error */ - mgcpgw_client_handle_response(mgcp, pending, NULL); + mgcp_client_handle_response(mgcp, pending, NULL); return -1; } @@ -562,7 +562,7 @@ return mgcp_msg_from_buf(trans_id, compose, len); } -static mgcp_trans_id_t mgcpgw_client_next_trans_id(struct mgcpgw_client *mgcp) +static mgcp_trans_id_t mgcp_client_next_trans_id(struct mgcp_client *mgcp) { /* avoid zero trans_id to distinguish from unset trans_id */ if (!mgcp->next_trans_id) @@ -570,11 +570,11 @@ return mgcp->next_trans_id ++; } -struct msgb *mgcp_msg_crcx(struct mgcpgw_client *mgcp, +struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode) { - mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp); + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); return mgcp_msg_from_str(trans_id, "CRCX %u %x at mgw MGCP 1.0\r\n" "C: %x\r\n" @@ -587,12 +587,12 @@ mgcp_cmode_name(mode)); } -struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp, +struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, const char *rtp_conn_addr, uint16_t rtp_port, enum mgcp_connection_mode mode) { - mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp); + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); return mgcp_msg_from_str(trans_id, "MDCX %u %x at mgw MGCP 1.0\r\n" "M: %s\r\n" @@ -607,16 +607,16 @@ rtp_port); } -struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint, +struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id) { - mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp); + mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); return mgcp_msg_from_str(trans_id, "DLCX %u %x at mgw MGCP 1.0\r\n" "C: %x\r\n", trans_id, rtp_endpoint, call_id); } -struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp) +struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; } diff --git a/src/libosmo-mgcp-client/mgcpgw_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c similarity index 74% rename from src/libosmo-mgcp-client/mgcpgw_client_vty.c rename to src/libosmo-mgcp-client/mgcp_client_vty.c index 034c84c..1e8bba6 100644 --- a/src/libosmo-mgcp-client/mgcpgw_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -28,23 +28,23 @@ #include #include -#include +#include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" -void *global_mgcpgw_client_ctx = NULL; -struct mgcpgw_client_conf *global_mgcpgw_client_conf = NULL; +void *global_mgcp_client_ctx = NULL; +struct mgcp_client_conf *global_mgcp_client_conf = NULL; DEFUN(cfg_mgcpgw_local_ip, cfg_mgcpgw_local_ip_cmd, "mgcpgw local-ip A.B.C.D", MGCPGW_STR "local bind to connect to MGCP gateway with\n" "local bind IP address\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - OSMO_ASSERT(global_mgcpgw_client_ctx); - global_mgcpgw_client_conf->local_addr = - talloc_strdup(global_mgcpgw_client_ctx, argv[0]); + OSMO_ASSERT(global_mgcp_client_ctx); + global_mgcp_client_conf->local_addr = + talloc_strdup(global_mgcp_client_ctx, argv[0]); return CMD_SUCCESS; } @@ -53,9 +53,9 @@ MGCPGW_STR "local bind to connect to MGCP gateway with\n" "local bind port\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - global_mgcpgw_client_conf->local_port = atoi(argv[0]); + global_mgcp_client_conf->local_port = atoi(argv[0]); return CMD_SUCCESS; } @@ -64,11 +64,11 @@ MGCPGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind IP address\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - OSMO_ASSERT(global_mgcpgw_client_ctx); - global_mgcpgw_client_conf->remote_addr = - talloc_strdup(global_mgcpgw_client_ctx, argv[0]); + OSMO_ASSERT(global_mgcp_client_ctx); + global_mgcp_client_conf->remote_addr = + talloc_strdup(global_mgcp_client_ctx, argv[0]); return CMD_SUCCESS; } @@ -77,9 +77,9 @@ MGCPGW_STR "remote bind to connect to MGCP gateway with\n" "remote bind port\n") { - if (!global_mgcpgw_client_conf) + if (!global_mgcp_client_conf) return CMD_ERR_NOTHING_TODO; - global_mgcpgw_client_conf->remote_port = atoi(argv[0]); + global_mgcp_client_conf->remote_port = atoi(argv[0]); return CMD_SUCCESS; } @@ -98,8 +98,8 @@ return CMD_SUCCESS; } - global_mgcpgw_client_conf->first_endpoint = first_endpoint; - global_mgcpgw_client_conf->last_endpoint = last_endpoint; + global_mgcp_client_conf->first_endpoint = first_endpoint; + global_mgcp_client_conf->last_endpoint = last_endpoint; return CMD_SUCCESS; } @@ -112,11 +112,11 @@ BTS_START_STR UDP_PORT_STR) { - global_mgcpgw_client_conf->bts_base = atoi(argv[0]); + global_mgcp_client_conf->bts_base = atoi(argv[0]); return CMD_SUCCESS; } -int mgcpgw_client_config_write(struct vty *vty, const char *indent) +int mgcp_client_config_write(struct vty *vty, const char *indent) { const char *addr; int port; @@ -124,32 +124,32 @@ uint16_t last_endpoint; uint16_t bts_base; - addr = global_mgcpgw_client_conf->local_addr; + addr = global_mgcp_client_conf->local_addr; if (addr) vty_out(vty, "%smgcpgw local-ip %s%s", indent, addr, VTY_NEWLINE); - port = global_mgcpgw_client_conf->local_port; + port = global_mgcp_client_conf->local_port; if (port >= 0) vty_out(vty, "%smgcpgw local-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); - addr = global_mgcpgw_client_conf->remote_addr; + addr = global_mgcp_client_conf->remote_addr; if (addr) vty_out(vty, "%smgcpgw remote-ip %s%s", indent, addr, VTY_NEWLINE); - port = global_mgcpgw_client_conf->remote_port; + port = global_mgcp_client_conf->remote_port; if (port >= 0) vty_out(vty, "%smgcpgw remote-port %u%s", indent, (uint16_t)port, VTY_NEWLINE); - first_endpoint = global_mgcpgw_client_conf->first_endpoint; - last_endpoint = global_mgcpgw_client_conf->last_endpoint; + first_endpoint = global_mgcp_client_conf->first_endpoint; + last_endpoint = global_mgcp_client_conf->last_endpoint; if (last_endpoint != 0) { vty_out(vty, "%smgcpgw endpoint-range %u %u%s", indent, first_endpoint, last_endpoint, VTY_NEWLINE); } - bts_base = global_mgcpgw_client_conf->bts_base; + bts_base = global_mgcp_client_conf->bts_base; if (bts_base) { vty_out(vty, "%smgcpgw bts-base %u%s", indent, bts_base, VTY_NEWLINE); @@ -158,10 +158,10 @@ return CMD_SUCCESS; } -void mgcpgw_client_vty_init(void *talloc_ctx, int node, struct mgcpgw_client_conf *conf) +void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf) { - global_mgcpgw_client_ctx = talloc_ctx; - global_mgcpgw_client_conf = conf; + global_mgcp_client_ctx = talloc_ctx; + global_mgcp_client_conf = conf; install_element(node, &cfg_mgcpgw_local_ip_cmd); install_element(node, &cfg_mgcpgw_local_port_cmd); diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am index 2253770..e33f0e8 100644 --- a/tests/mgcp_client/Makefile.am +++ b/tests/mgcp_client/Makefile.am @@ -17,19 +17,19 @@ $(NULL) EXTRA_DIST = \ - mgcpgw_client_test.ok \ - mgcpgw_client_test.err \ + mgcp_client_test.ok \ + mgcp_client_test.err \ $(NULL) noinst_PROGRAMS = \ - mgcpgw_client_test \ + mgcp_client_test \ $(NULL) -mgcpgw_client_test_SOURCES = \ - mgcpgw_client_test.c \ +mgcp_client_test_SOURCES = \ + mgcp_client_test.c \ $(NULL) -mgcpgw_client_test_LDADD = \ +mgcp_client_test_LDADD = \ $(top_builddir)/src/libosmo-mgcp-client/libosmo-mgcp-client.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ diff --git a/tests/mgcp_client/mgcpgw_client_test.c b/tests/mgcp_client/mgcp_client_test.c similarity index 89% rename from tests/mgcp_client/mgcpgw_client_test.c rename to tests/mgcp_client/mgcp_client_test.c index e90a4ed..6045297 100644 --- a/tests/mgcp_client/mgcpgw_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include void *ctx; @@ -71,8 +71,8 @@ return msg; } -static struct mgcpgw_client_conf conf; -struct mgcpgw_client *mgcp = NULL; +static struct mgcp_client_conf conf; +struct mgcp_client *mgcp = NULL; static void reply_to(mgcp_trans_id_t trans_id, int code, const char *comment, int conn_id, const char *params) @@ -88,7 +88,7 @@ printf("composed response:\n-----\n%s\n-----\n", compose); - mgcpgw_client_rx(mgcp, from_str(compose)); + mgcp_client_rx(mgcp, from_str(compose)); } void test_response_cb(struct mgcp_response *response, void *priv) @@ -114,7 +114,7 @@ trans_id = msg->cb[MSGB_CB_MGCP_TRANS_ID]; char *end; - OSMO_ASSERT(mgcpgw_client_pending_add(mgcp, trans_id, test_response_cb, mgcp)); + OSMO_ASSERT(mgcp_client_pending_add(mgcp, trans_id, test_response_cb, mgcp)); end = (char*)msgb_put(msg, 1); *end = '\0'; @@ -134,7 +134,7 @@ if (mgcp) talloc_free(mgcp); - mgcp = mgcpgw_client_init(ctx, &conf); + mgcp = mgcp_client_init(ctx, &conf); msg = mgcp_msg_crcx(mgcp, 23, 42, MGCP_CONN_LOOPBACK); trans_id = dummy_mgcp_send(msg); @@ -161,11 +161,11 @@ int main(int argc, char **argv) { - ctx = talloc_named_const(NULL, 1, "mgcpgw_client_test"); + ctx = talloc_named_const(NULL, 1, "mgcp_client_test"); msgb_talloc_ctx_init(ctx, 0); osmo_init_logging(&log_info); - mgcpgw_client_conf_init(&conf); + mgcp_client_conf_init(&conf); test_crcx(); diff --git a/tests/mgcp_client/mgcpgw_client_test.err b/tests/mgcp_client/mgcp_client_test.err similarity index 100% rename from tests/mgcp_client/mgcpgw_client_test.err rename to tests/mgcp_client/mgcp_client_test.err diff --git a/tests/mgcp_client/mgcpgw_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok similarity index 100% rename from tests/mgcp_client/mgcpgw_client_test.ok rename to tests/mgcp_client/mgcp_client_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index 37347b3..4f4a303 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -14,9 +14,9 @@ AT_CHECK([$abs_top_builddir/tests/legacy_mgcp/mgcp_transcoding_test], [], [expout], [ignore]) AT_CLEANUP -AT_SETUP([mgcpgw_client]) -AT_KEYWORDS([mgcpgw_client]) -cat $abs_srcdir/mgcp_client/mgcpgw_client_test.ok > expout -cat $abs_srcdir/mgcp_client/mgcpgw_client_test.err > experr -AT_CHECK([$abs_top_builddir/tests/mgcp_client/mgcpgw_client_test], [], [expout], [experr]) +AT_SETUP([mgcp_client]) +AT_KEYWORDS([mgcp_client]) +cat $abs_srcdir/mgcp_client/mgcp_client_test.ok > expout +cat $abs_srcdir/mgcp_client/mgcp_client_test.err > experr +AT_CHECK([$abs_top_builddir/tests/mgcp_client/mgcp_client_test], [], [expout], [experr]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99f7faab637cfcc22ece64a1dbcbe590f2042187 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:38:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:38:06 +0000 Subject: [MERGED] osmo-mgw[master]: doc/examples: fix mgcp.cfg indenting, tweak In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doc/examples: fix mgcp.cfg indenting, tweak ...................................................................... doc/examples: fix mgcp.cfg indenting, tweak Use one space to indent mgcp.cfg, like all the other osmo*.cfg examples. Tweak the header comment. Remove the password and line vty commands. Change-Id: I52e481dbf4778dd187ce6b67d879a04ef61e8b47 --- M doc/examples/osmo-bsc_mgcp/mgcp.cfg 1 file changed, 11 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg index 3c43f1f..442162f 100644 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ b/doc/examples/osmo-bsc_mgcp/mgcp.cfg @@ -1,19 +1,14 @@ ! -! MGCP configuration hand edited -! ! -password foo -! -line vty - no login +! MGCP configuration example ! mgcp - !local ip 10.23.24.2 - !bts ip 10.24.24.1 - !bind ip 10.23.24.1 - bind port 2427 - rtp base 4000 - rtp force-ptime 20 - sdp audio payload number 98 - sdp audio payload name AMR/8000 - number endpoints 31 - no rtcp-omit + !local ip 10.23.24.2 + !bts ip 10.24.24.1 + !bind ip 10.23.24.1 + bind port 2427 + rtp base 4000 + rtp force-ptime 20 + sdp audio payload number 98 + sdp audio payload name AMR/8000 + number endpoints 31 + no rtcp-omit -- To view, visit https://gerrit.osmocom.org/3891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I52e481dbf4778dd187ce6b67d879a04ef61e8b47 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:46:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:46:06 +0000 Subject: [PATCH] libosmocore[master]: VTY: interactive: never look for matching commands on parent... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3881 to look at the new patch set (#3). VTY: interactive: never look for matching commands on parent node For interactive telnet VTY, remove the implicit move up to the parent node when a command did not succeed on the current node level. When reading config files, this behavior was useful to allow skipping explicit 'exit' commands. (A different patch deals with that.) In the telnet VTY, this behavior was never necessary. Explicit 'exit' commands can move to the parent node, and typically uninformed users expect to require that. On a telnet VTY, counting indents like for reading config files is not an option: a user will always type from the first column or may paste some leading spaces without intended meaning. After this patch, it is thus no longer possible to paste a complete config across several node levels directly to a telnet session, unless it contains 'exit' commands. Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 --- M src/vty/command.c M tests/vty/vty_test.c M tests/vty/vty_test.ok 3 files changed, 5 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/3881/3 diff --git a/src/vty/command.c b/src/vty/command.c index 33862c0..52c7191 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2111,12 +2111,10 @@ cmd_execute_command(vector vline, struct vty *vty, struct cmd_element **cmd, int vtysh) { - int ret, saved_ret, tried = 0; + int ret; enum node_type onode; - void *oindex; onode = vty->node; - oindex = vty->index; if (cmd_try_do_shortcut(vty->node, vector_slot(vline, 0))) { vector shifted_vline; @@ -2139,29 +2137,7 @@ return ret; } - saved_ret = ret = cmd_execute_command_real(vline, vty, cmd); - - if (vtysh) - return saved_ret; - - /* Go to parent for config nodes to attempt to find the right command */ - while (ret != CMD_SUCCESS && ret != CMD_WARNING - && is_config_child(vty)) { - vty_go_parent(vty); - ret = cmd_execute_command_real(vline, vty, cmd); - tried = 1; - if (ret == CMD_SUCCESS || ret == CMD_WARNING) { - /* succesfull command, leave the node as is */ - return ret; - } - } - /* no command succeeded, reset the vty to the original node and - return the error for this node */ - if (tried) { - vty->node = onode; - vty->index = oindex; - } - return saved_ret; + return cmd_execute_command_real(vline, vty, cmd); } /* Execute command by argument readline. */ diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index 1e1b495..d84bf41 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -155,14 +155,12 @@ OSMO_ASSERT(vty->node == ENABLE_NODE); - /* Check searching the parents nodes for matching commands. */ + /* Check for not searching the parent node for matching commands. */ OSMO_ASSERT(do_vty_command(vty, "configure terminal") == CMD_SUCCESS); OSMO_ASSERT(vty->node == CONFIG_NODE); OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS); OSMO_ASSERT(vty->node == CFG_LOG_NODE); - OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_SUCCESS); - OSMO_ASSERT(vty->node == VTY_NODE); - OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_ERR_NO_MATCH); OSMO_ASSERT(vty->node == CFG_LOG_NODE); OSMO_ASSERT(do_vty_command(vty, "end") == CMD_SUCCESS); OSMO_ASSERT(vty->node == ENABLE_NODE); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index a9e283d..2b6d5a6 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -36,9 +36,7 @@ Going to execute 'log stderr' Returned: 0, Current node: 7 '%s(config-log)# ' Going to execute 'line vty' -Returned: 0, Current node: 9 '%s(config-line)# ' -Going to execute 'log stderr' -Returned: 0, Current node: 7 '%s(config-log)# ' +Returned: 2, Current node: 7 '%s(config-log)# ' Going to execute 'end' Returned: 0, Current node: 3 '%s# ' Going to execute 'exit' -- To view, visit https://gerrit.osmocom.org/3881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:46:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:46:35 +0000 Subject: libosmocore[master]: VTY: interactive: never look for matching commands on parent... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 after prev +2, just added one word to the commit summary -- To view, visit https://gerrit.osmocom.org/3881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:47:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:47:12 +0000 Subject: [MERGED] libosmocore[master]: VTY: interactive: never look for matching commands on parent... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: VTY: interactive: never look for matching commands on parent node ...................................................................... VTY: interactive: never look for matching commands on parent node For interactive telnet VTY, remove the implicit move up to the parent node when a command did not succeed on the current node level. When reading config files, this behavior was useful to allow skipping explicit 'exit' commands. (A different patch deals with that.) In the telnet VTY, this behavior was never necessary. Explicit 'exit' commands can move to the parent node, and typically uninformed users expect to require that. On a telnet VTY, counting indents like for reading config files is not an option: a user will always type from the first column or may paste some leading spaces without intended meaning. After this patch, it is thus no longer possible to paste a complete config across several node levels directly to a telnet session, unless it contains 'exit' commands. Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 --- M src/vty/command.c M tests/vty/vty_test.c M tests/vty/vty_test.ok 3 files changed, 5 insertions(+), 33 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/command.c b/src/vty/command.c index 33862c0..52c7191 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2111,12 +2111,10 @@ cmd_execute_command(vector vline, struct vty *vty, struct cmd_element **cmd, int vtysh) { - int ret, saved_ret, tried = 0; + int ret; enum node_type onode; - void *oindex; onode = vty->node; - oindex = vty->index; if (cmd_try_do_shortcut(vty->node, vector_slot(vline, 0))) { vector shifted_vline; @@ -2139,29 +2137,7 @@ return ret; } - saved_ret = ret = cmd_execute_command_real(vline, vty, cmd); - - if (vtysh) - return saved_ret; - - /* Go to parent for config nodes to attempt to find the right command */ - while (ret != CMD_SUCCESS && ret != CMD_WARNING - && is_config_child(vty)) { - vty_go_parent(vty); - ret = cmd_execute_command_real(vline, vty, cmd); - tried = 1; - if (ret == CMD_SUCCESS || ret == CMD_WARNING) { - /* succesfull command, leave the node as is */ - return ret; - } - } - /* no command succeeded, reset the vty to the original node and - return the error for this node */ - if (tried) { - vty->node = onode; - vty->index = oindex; - } - return saved_ret; + return cmd_execute_command_real(vline, vty, cmd); } /* Execute command by argument readline. */ diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index 1e1b495..d84bf41 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -155,14 +155,12 @@ OSMO_ASSERT(vty->node == ENABLE_NODE); - /* Check searching the parents nodes for matching commands. */ + /* Check for not searching the parent node for matching commands. */ OSMO_ASSERT(do_vty_command(vty, "configure terminal") == CMD_SUCCESS); OSMO_ASSERT(vty->node == CONFIG_NODE); OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS); OSMO_ASSERT(vty->node == CFG_LOG_NODE); - OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_SUCCESS); - OSMO_ASSERT(vty->node == VTY_NODE); - OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_ERR_NO_MATCH); OSMO_ASSERT(vty->node == CFG_LOG_NODE); OSMO_ASSERT(do_vty_command(vty, "end") == CMD_SUCCESS); OSMO_ASSERT(vty->node == ENABLE_NODE); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index a9e283d..2b6d5a6 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -36,9 +36,7 @@ Going to execute 'log stderr' Returned: 0, Current node: 7 '%s(config-log)# ' Going to execute 'line vty' -Returned: 0, Current node: 9 '%s(config-line)# ' -Going to execute 'log stderr' -Returned: 0, Current node: 7 '%s(config-log)# ' +Returned: 2, Current node: 7 '%s(config-log)# ' Going to execute 'end' Returned: 0, Current node: 3 '%s# ' Going to execute 'exit' -- To view, visit https://gerrit.osmocom.org/3881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 8 23:47:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 8 Sep 2017 23:47:37 +0000 Subject: [MERGED] osmo-msc[master]: use separated libosmo-mgcp-client, apply rename to mgcp_clie... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: use separated libosmo-mgcp-client, apply rename to mgcp_client_* ...................................................................... use separated libosmo-mgcp-client, apply rename to mgcp_client_* After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*. Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is used to contact the MGW (Media Gateway). Depends: I8e0b2d2a399b77086a36606f5e427271c6242df1 (osmo-mgw) I99f7faab637cfcc22ece64a1dbcbe590f2042187 (osmo-mgw) Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d --- M configure.ac M include/osmocom/msc/gsm_data.h M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am 11 files changed, 41 insertions(+), 69 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index dd61e52..8f8bdb9 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) -PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0) # Enable/disable smpp support in the msc? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], @@ -125,33 +125,6 @@ COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" AC_SUBST([COVERAGE_CFLAGS]) AC_SUBST([COVERAGE_LDFLAGS]) -fi - -AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ - AC_CACHE_CHECK( - [whether libosmo-legacy-mgcp needs -lgsm], - libosmo_cv_legacy_mgcp_needs_libgsm, [ - SAVE_LDFLAGS="${LDFLAGS}" - LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([ - #include - ], [ - mgcpgw_client_init(0, 0); - ])], - [libosmo_cv_legacy_mgcp_needs_libgsm=no], - [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) - LDFLAGS="${SAVE_LDFLAGS}" - ]) - ]) -CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM -if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], - [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi fi AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 9343c31..5d3d5ca 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include /** annotations for msgb ownership */ @@ -486,9 +486,9 @@ uint8_t t3212; struct { - struct mgcpgw_client_conf conf; - struct mgcpgw_client *client; - } mgcpgw; + struct mgcp_client_conf conf; + struct mgcp_client *client; + } mgw; struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 7a6000a..3d2013e 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -401,7 +401,7 @@ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcpgw_client_remote_addr_n(gsm_network->mgcpgw.client)); + rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 1cd6723..34d03e3 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -557,7 +557,7 @@ { struct gsm_network *network = a_conn_info->network; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct tlv_parsed tp; struct sockaddr_storage rtp_addr; struct sockaddr_in *rtp_addr_in; @@ -567,7 +567,7 @@ if (!conn) goto fail; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; OSMO_ASSERT(mgcp); LOGP(DMSC, LOGL_NOTICE, "BSC sends assignment complete message (conn_id=%i)\n", conn->a.conn_id); diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 2ef0b30..84f52c6 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -2667,7 +2667,7 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcpgw_client_remote_addr_n(net->mgcpgw.client); + uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); uint16_t port = trans->conn->rtp.port_cn; /* FIXME: This has to be set to some meaningful value, diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index b191e0d..7a04153 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -192,7 +192,7 @@ conn->rtp.port_cn = r->audio_port; - rtp_ip = mgcpgw_client_remote_addr_n(conn->network->mgcpgw.client); + rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ @@ -222,7 +222,7 @@ int msc_call_assignment(struct gsm_trans *trans) { struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; uint16_t bts_base; @@ -232,7 +232,7 @@ return -EINVAL; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; #ifdef BUILD_IU /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ @@ -242,14 +242,14 @@ #endif conn->rtp.mgcp_rtp_endpoint = - mgcpgw_client_next_endpoint(conn->network->mgcpgw.client); + mgcp_client_next_endpoint(conn->network->mgw.client); /* This will calculate the port we assign to the BTS via AoIP * assignment command (or rab-assignment on 3G) The BTS will send * its RTP traffic to that port on the MGCPGW side. The MGCPGW only * gets the endpoint ID via the CRCX. It will do the same calculation * on his side too to get knowledge of the rtp port. */ - bts_base = mgcpgw_client_conf_actual(mgcp)->bts_base; + bts_base = mgcp_client_conf_actual(mgcp)->bts_base; conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; /* Establish the RTP stream first as looping back to the originator. @@ -257,7 +257,7 @@ * tone instead. */ msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcpgw_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); + return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); } static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); @@ -268,7 +268,7 @@ { struct gsm_subscriber_connection *conn1 = from->conn; struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcpgw_client *mgcp = conn1->network->mgcpgw.client; + struct mgcp_client *mgcp = conn1->network->mgw.client; const char *ip; struct msgb *msg; @@ -278,13 +278,13 @@ from->bridge.state = state; /* Loop back to the same MGCP GW */ - ip = mgcpgw_client_remote_addr_str(mgcp); + ip = mgcp_client_remote_addr_str(mgcp); msg = mgcp_msg_mdcx(mgcp, conn1->rtp.mgcp_rtp_endpoint, ip, conn2->rtp.port_cn, mode); - if (mgcpgw_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) + if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(from->vsub)); @@ -346,7 +346,7 @@ * is in use */ struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; struct msgb *msg; if (!trans) @@ -355,10 +355,10 @@ return -EINVAL; if (!trans->conn->network) return -EINVAL; - if (!trans->conn->network->mgcpgw.client) + if (!trans->conn->network->mgw.client) return -EINVAL; - mgcp = trans->conn->network->mgcpgw.client; + mgcp = trans->conn->network->mgw.client; struct in_addr ip_addr; ip_addr.s_addr = ntohl(ip); @@ -368,7 +368,7 @@ msg = mgcp_msg_mdcx(mgcp, conn->rtp.mgcp_rtp_endpoint, inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcpgw_client_tx(mgcp, msg, NULL, trans)) + if (mgcp_client_tx(mgcp, msg, NULL, trans)) LOGP(DMGCP, LOGL_ERROR, "Failed to send MDCX message for %s\n", vlr_subscr_name(trans->vsub)); @@ -398,7 +398,7 @@ { struct msgb *msg; struct gsm_subscriber_connection *conn; - struct mgcpgw_client *mgcp; + struct mgcp_client *mgcp; if (!trans) return; @@ -408,16 +408,16 @@ return; conn = trans->conn; - mgcp = conn->network->mgcpgw.client; + mgcp = conn->network->mgw.client; /* Send DLCX */ msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, conn->rtp.mgcp_rtp_endpoint); - if (mgcpgw_client_tx(mgcp, msg, NULL, NULL)) + if (mgcp_client_tx(mgcp, msg, NULL, NULL)) LOGP(DMGCP, LOGL_ERROR, "Failed to send DLCX message for %s\n", vlr_subscr_name(trans->vsub)); /* Release endpoint id */ - mgcpgw_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); + mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 2f0f056..5c9539d 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -101,7 +101,7 @@ vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); - mgcpgw_client_config_write(vty, " "); + mgcp_client_config_write(vty, " "); #ifdef BUILD_IU ranap_iu_vty_config_write(vty, " "); #endif @@ -155,7 +155,7 @@ install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd); install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd); - mgcpgw_client_vty_init(msc_network, MSC_NODE, &msc_network->mgcpgw.conf); + mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf); #ifdef BUILD_IU ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index a26b4bd..85a5a5a 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -17,7 +17,7 @@ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -45,8 +45,7 @@ $(LIBSMPP34_LIBS) \ $(LIBCRYPTO_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBRARY_GSM) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ -ldbi \ $(NULL) if BUILD_IU diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 41dfedb..75ba19c 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -64,7 +64,7 @@ #include #include #include -#include +#include #ifdef BUILD_IU #include @@ -251,7 +251,7 @@ MSC_HLR_REMOTE_IP_DEFAULT); net->gsup_server_port = MSC_HLR_REMOTE_PORT_DEFAULT; - mgcpgw_client_conf_init(&net->mgcpgw.conf); + mgcp_client_conf_init(&net->mgw.conf); return net; } @@ -553,10 +553,10 @@ if (sms_queue_start(msc_network, 20) != 0) return -1; - msc_network->mgcpgw.client = mgcpgw_client_init( - msc_network, &msc_network->mgcpgw.conf); + msc_network->mgw.client = mgcp_client_init( + msc_network, &msc_network->mgw.conf); - if (mgcpgw_client_connect(msc_network->mgcpgw.client)) { + if (mgcp_client_connect(msc_network->mgw.client)) { printf("MGCPGW connect failed\n"); return 7; } diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index fb4857f..aa2b3fe 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -15,7 +15,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 1d3b9da..1f8ee7b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -14,7 +14,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ - $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(NULL) EXTRA_DIST = \ @@ -44,7 +44,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ -- To view, visit https://gerrit.osmocom.org/3787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 9 00:24:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 00:24:48 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 2: I agree with both the conclusions. One thing that jumps at me: at the time we are combining scenarios, are the 'times' entries still in there? Because this 'times' is just a convenience gimmick. To work correctly, I think we need to expand the 'times' things first, before combining with more scenarios. There is code in some place that takes each dict having a 'times: N' in there and simply replicates it to have N identical dicts next to each other. If not there already, we may have to move this expansion to right after parsing each scenario yaml. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 00:33:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 00:33:05 +0000 Subject: osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Patch Set 1: > I must admit I hated you a bit while reworking this to use "_" instead of " " :-P Yes, I deserve it in this instance. But we have uncovered a boundary of the current implementation, hopefully we can recall this before we run into similar issues. I'd have liked us to fix this in a generalized manner to help avoid this entire class of problem in the future, but I agree that it would be a very large scratch for a currently very small itch. Actually, if we kept the 'a5' part out of the value, we wouldn't have the problem in this instance; we'd just store and render plain integers. I'm not aware of an alternative to 'a5', the vty command 'encryption' only ever has 'a5' and nothing else so far. Consider this and if you will +2 yourself to merge. -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 00:35:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 00:35:51 +0000 Subject: osmo-gsm-tester[master]: modem: log property changes from Modem interface In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 01:03:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 01:03:45 +0000 Subject: libosmocore[master]: VTY: allow comments in the same line as vty commands In-Reply-To: References: Message-ID: Patch Set 1: > does this also work with the .LINE syntax of the parser Good point, had to check which way it goes. A comment character after space is stronger than the .LINE token, because we stop parsing tokens from the input str altogether. i.e. OsmoMSC# subscriber id 1 sms sender id 2 send yada foo ! comment % sending 'yada foo' This means after this patch we can't by VTY send SMS that contain ' #' or ' !' anymore. OTOH #1: a real programmatic SMS dispatcher shouldn't use the VTY to begin with, rather SMPP; #2: a '!' is still allowed at the end of a sentence: OsmoMSC# subscriber id 1 sms sender id 2 send your phone is burning! stop drop and roll! % sending 'your phone is burning! stop drop and roll!' (no comments here because no space before the '!') The only other instances of .LINE in use I can find: e1_line <0-255> name .LINE For the e1_line name it's more likely to want the comment to be not part of the name. Which is the case. So I think it's ok to merge this patch. If you have any doubts at all I'm ready to drop this, too. It's nice to have comments after commands, but not really that important either. -- To view, visit https://gerrit.osmocom.org/3882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 01:08:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 01:08:51 +0000 Subject: openbsc[master]: libmsc: Either route report to ESME or send it, not both In-Reply-To: References: Message-ID: Patch Set 1: little heads up: osmo-msc.git has been split from openbsc.git now. Any patch that should make it to the future must also be applied to osmo-msc.git at some point. I might still scoop commits over for some time, but it's not guaranteed. +++ end of announcement +++ -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 01:39:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 01:39:43 +0000 Subject: openbsc[master]: libmsc: Either route report to ESME or send it, not both In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3885/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 693: if (rc == 0) { > Pablo, I'm not sure how you would like to make this test here. Took a brief look at the code which I don't know well, and at it looks such that we should only go on to deliver below in case of GSM411_RP_CAUSE_MO_NUM_UNASSIGNED. In all other GSM411_RP_CAUSE cases it appears we wanted to do external SMPP but it failed, and thus we should sms_free(sms_report) and return, logging that routing to ESME failed. Shouldn't the above rc < 0 also sms_free(sms_report) and return for the same reason? But please don't take my word for it, would prefer if e.g. Pablo could confirm. What I do notice for sure: in sms_route_mt_sms(), if built without SMPP support, the rc returned is *undefined* when gsms->receiver is present. This is bound to fail and needs a separate fix. Before this patch, the rc had no functional effect apart from the log message above, but after this patch we will randomly state that the report was routed to the ESME and drop it, even though SMPP support is not even enabled -- same would happen if sms_route_mt_sms() were fixed to initialize rc = 0 :) libmsc/gsm_04_11.c static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *gsms) { int rc; <-- unset #ifdef BUILD_SMPP ... #endif /* determine gsms->receiver based on dialled number */ gsms->receiver = vlr_subscr_find_by_msisdn(conn->network->vlr, gsms->dst.addr); if (!gsms->receiver) { ... } return rc; <-- returned } -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 9 01:48:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 01:48:59 +0000 Subject: osmo-msc[master]: a_iface: fix memory leaks In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (5 comments) https://gerrit.osmocom.org/#/c/3889/1/src/libmsc/a_iface.c File src/libmsc/a_iface.c: Line 146: msg_resp = gsm0808_create_dtap(msg, link_id); ( below msgb_free(msg) could go up here, then no need to call in both if() paths below ) Line 147: (unrelated whitespace) Line 153: LOGP(DMSC, LOGL_DEBUG, "Massage will be sent as BSSMAP DTAP message!\n"); yay, I could use a massage! https://gerrit.osmocom.org/#/c/3889/1/src/libmsc/a_iface_bssap.c File src/libmsc/a_iface_bssap.c: Line 331: rc = msc_compl_l3(conn, msg, 0); ( below msgb_free(msg) could go up here, then no need to call in both if() paths below ) Line 700: return -EINVAL; good catch! looks like a potential attack door just got closed. -- To view, visit https://gerrit.osmocom.org/3889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 9 04:42:34 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 9 Sep 2017 04:42:34 +0000 Subject: osmo-bts[master]: Check readv() return value to prevent crash In-Reply-To: References: Message-ID: Patch Set 5: Under which circumstance did this happen? What was the log output then? The HW queues failing would be a pretty severe issue? -- To view, visit https://gerrit.osmocom.org/3878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 11:38:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 11:38:18 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#2). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes * use consistent formatting for output * log essential allocation parameters on failure Changes to tests are combined with logging messages update to separate code and test changes over different commits to avoid regressions. Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2400 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/tbf/TbfTest.err 6 files changed, 3,275 insertions(+), 3,281 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/2 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 9 11:39:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 11:39:45 +0000 Subject: osmocom-bb[master]: mobile/main.c: clean up config file selection logic In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 13:15:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 13:15:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split into digestible pieces In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#6). Simplify TS alloc: split into digestible pieces Algorithm B implementation is way too big and complex to maintain or even to follow the code. Split it into set of smaller functions with documented interfaces to make it easier to read and modify. This opens up the road for reusing those functions in implementation of additional allocation algorithms. The test results are intentionally left unchanged to avoid potential regressions. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2400 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 2 files changed, 233 insertions(+), 135 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/6 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index ed4a79e..146185f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -217,6 +217,16 @@ } +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in,out] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, @@ -374,18 +384,27 @@ /*! Return free TFI * * \param[in,out] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses * \param[out] trx_no_ TRX number on which TFI was found * \returns negative error code or 0 on success */ -static int tfi_find_free(BTS *bts, const GprsMs *ms, +static int tfi_find_free(BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -394,8 +413,7 @@ if (tfi < 0) return -EBUSY; - if (trx_no_) - *trx_no_ = trx_no; + *trx_no_ = trx_no; return tfi; } @@ -811,6 +829,197 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return pcu_lsb(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of UL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] usf USF array + * \param[in,out] ul_slots set of UL timeslots + * \returns negative error code or first selected TS on success + */ +static int select_ul_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t dl_slots, + uint8_t reserved_ul_slots, int8_t first_common_ts, + int *usf, uint8_t *ul_slots) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + int free_usf = -1; + + if (single) + (*ul_slots) = get_single_ts(trx, tbf, dl_slots, *ul_slots, &ts); + + if ((*ul_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No uplink slots available\n"); + return -EINVAL; + } + + if (first_common_ts >= 0) + (*ul_slots) = 1 << first_common_ts; + else + (*ul_slots) = (*ul_slots) & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, *ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + OSMO_ASSERT(ts >= 0 && ts <= 8); + + (*ul_slots) = 1 << ts; + usf[ts] = free_usf; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_ul_slots, 'u', '.'), *ul_slots, 'U'), + single ? ", single" : ""); + + return ffs(*ul_slots) - 1; +} + +/*! Find set of DL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or first selected TS on success + */ +static int select_dl_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t ul_slots, + uint8_t reserved_dl_slots, int8_t first_common_ts, + uint8_t *dl_slots) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + + if (single) + (*dl_slots) = get_single_ts(trx, tbf, *dl_slots, ul_slots, &ts); + + if ((*dl_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots available\n"); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, 'd', '.'), (*dl_slots), 'D'), + single ? ", single" : ""); + + return ffs(*dl_slots) - 1; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -833,8 +1042,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; - int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; @@ -855,18 +1062,8 @@ first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } - /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -886,95 +1083,27 @@ } /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + first_ts = select_dl_slot_set(trx, tbf, single, ul_slots, reserved_dl_slots, first_common_ts, + &dl_slots); + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - OSMO_ASSERT(ts >= 0 && ts <= 8); - - ul_slots = 1 << ts; - usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; + first_ts = select_ul_slot_set(trx, tbf, single, dl_slots, reserved_ul_slots, first_common_ts, usf, + &ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); /* We will stick to that single UL slot, unreserve the others */ + slotcount = 1; reserved_ul_slots = ul_slots; - - avail_count = pcu_bitcount(reserved_ul_slots); } + + if (first_ts < 0) + return -EINVAL; first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); - return -EINVAL; - } - if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); return -EINVAL; } @@ -993,51 +1122,16 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 271f966..13f3869 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -600,6 +600,10 @@ if (dl_tbf->pdch[i]) dl_slots |= 1 << i; + for (i = 0; ul_tbf && i < ARRAY_SIZE(ul_tbf->pdch); i += 1) + if (ul_tbf->pdch[i]) + ul_slots |= 1 << i; + for (i = 0; trx && i < ARRAY_SIZE(trx->pdch); i += 1) { struct gprs_rlcmac_pdch *pdch = &trx->pdch[i]; -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 9 13:15:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 13:15:48 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#3). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes * use consistent formatting for output * log essential allocation parameters on failure Changes to tests are combined with logging messages update to separate code and test changes over different commits to avoid regressions. Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2400 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/tbf/TbfTest.err 6 files changed, 3,282 insertions(+), 3,288 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/3 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 9 13:25:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 13:25:15 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split into digestible pieces In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#7). Simplify TS alloc: split into digestible pieces Algorithm B implementation is way too big and complex to maintain or even to follow the code. Split it into set of smaller functions with documented interfaces to make it easier to read and modify. This opens up the road for reusing those functions in implementation of additional allocation algorithms. The test results are intentionally left unchanged to avoid potential regressions. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2400 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 2 files changed, 233 insertions(+), 133 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/7 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index ed4a79e..80eacd6 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -217,6 +217,16 @@ } +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in,out] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, @@ -374,18 +384,27 @@ /*! Return free TFI * * \param[in,out] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses * \param[out] trx_no_ TRX number on which TFI was found * \returns negative error code or 0 on success */ -static int tfi_find_free(BTS *bts, const GprsMs *ms, +static int tfi_find_free(BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -394,8 +413,7 @@ if (tfi < 0) return -EBUSY; - if (trx_no_) - *trx_no_ = trx_no; + *trx_no_ = trx_no; return tfi; } @@ -811,6 +829,197 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return pcu_lsb(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of UL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] usf USF array + * \param[in,out] ul_slots set of UL timeslots + * \returns negative error code or first selected TS on success + */ +static int select_ul_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t dl_slots, + uint8_t reserved_ul_slots, int8_t first_common_ts, + int *usf, uint8_t *ul_slots) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + int free_usf = -1; + + if (single) + (*ul_slots) = get_single_ts(trx, tbf, dl_slots, *ul_slots, &ts); + + if ((*ul_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No uplink slots available\n"); + return -EINVAL; + } + + if (first_common_ts >= 0) + (*ul_slots) = 1 << first_common_ts; + else + (*ul_slots) = (*ul_slots) & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, *ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + OSMO_ASSERT(ts >= 0 && ts <= 8); + + (*ul_slots) = 1 << ts; + usf[ts] = free_usf; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_ul_slots, 'u', '.'), *ul_slots, 'U'), + single ? ", single" : ""); + + return ffs(*ul_slots) - 1; +} + +/*! Find set of DL timeslots available for allocation + * + * \param[in,out] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or first selected TS on success + */ +static int select_dl_slot_set(gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t ul_slots, + uint8_t reserved_dl_slots, int8_t first_common_ts, + uint8_t *dl_slots) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + + if (single) + (*dl_slots) = get_single_ts(trx, tbf, *dl_slots, ul_slots, &ts); + + if ((*dl_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots available\n"); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, 'd', '.'), (*dl_slots), 'D'), + single ? ", single" : ""); + + return ffs(*dl_slots) - 1; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -833,8 +1042,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; - int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; @@ -855,18 +1062,8 @@ first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } - /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -886,95 +1083,29 @@ } /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); + first_ts = select_dl_slot_set(trx, tbf, single, ul_slots, reserved_dl_slots, first_common_ts, + &dl_slots); - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - OSMO_ASSERT(ts >= 0 && ts <= 8); - - ul_slots = 1 << ts; - usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; + first_ts = select_ul_slot_set(trx, tbf, single, dl_slots, reserved_ul_slots, first_common_ts, usf, + &ul_slots); /* We will stick to that single UL slot, unreserve the others */ + slotcount = 1; reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } + + if (first_ts < 0) + return -EINVAL; first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); - return -EINVAL; - } - if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); return -EINVAL; } @@ -993,51 +1124,16 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 271f966..13f3869 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -600,6 +600,10 @@ if (dl_tbf->pdch[i]) dl_slots |= 1 << i; + for (i = 0; ul_tbf && i < ARRAY_SIZE(ul_tbf->pdch); i += 1) + if (ul_tbf->pdch[i]) + ul_slots |= 1 << i; + for (i = 0; trx && i < ARRAY_SIZE(trx->pdch); i += 1) { struct gprs_rlcmac_pdch *pdch = &trx->pdch[i]; -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 9 15:07:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 9 Sep 2017 15:07:13 +0000 Subject: [PATCH] osmo-msc[master]: ctrl: subscriber-list-active: list only attached subscribers Message-ID: Review at https://gerrit.osmocom.org/3898 ctrl: subscriber-list-active: list only attached subscribers I would have liked to add a regression test to verify this, but currently there is no easy way to run CTRL tests and at the same time have access to the osmo-msc in a way that simulates an attached subscriber. Related: OS#2285 Change-Id: I003542b208ecf3713e9e67712d84ccb4c61af14e --- M src/libmsc/ctrl_commands.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/3898/1 diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index 7e445aa..4767ddd 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -68,6 +68,9 @@ cmd->reply = talloc_strdup(cmd, ""); llist_for_each_entry(vsub, &msc_ctrl_net->vlr->subscribers, list) { + /* Do not list subscribers that aren't successfully attached. */ + if (!vsub->lu_complete) + continue; cmd->reply = talloc_asprintf_append(cmd->reply, "%s,%s\n", vsub->imsi, vsub->msisdn); } -- To view, visit https://gerrit.osmocom.org/3898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I003542b208ecf3713e9e67712d84ccb4c61af14e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 9 15:55:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 15:55:26 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split into digestible pieces In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#8). Simplify TS alloc: split into digestible pieces Algorithm B implementation is way too big and complex to maintain or even to follow the code. Split it into set of smaller functions with documented interfaces to make it easier to read and modify. This opens up the road for reusing those functions in implementation of additional allocation algorithms. The test results are intentionally left unchanged to avoid potential regressions. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2400 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 2 files changed, 227 insertions(+), 145 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/8 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index ba9734f..28943eb 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -248,9 +248,7 @@ if (free_tfi) { tfi = find_free_tfi(pdch, dir); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -258,26 +256,20 @@ if (dir == GPRS_RLCMAC_UL_TBF) { usf = find_free_usf(pdch); if (usf < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -374,7 +366,7 @@ /*! Return free TFI * * \param[in,out] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -387,6 +379,15 @@ int tfi; uint8_t trx_no; + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } + if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -394,8 +395,7 @@ if (tfi < 0) return -EBUSY; - if (trx_no_) - *trx_no_ = trx_no; + *trx_no_ = trx_no; return tfi; } @@ -811,6 +811,197 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return ffs(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of DL timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in] dl_slots set of DL timeslots + * \returns negative error code or selected TS on success + */ +static int select_dl_slot_set(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t ul_slots, + uint8_t reserved_dl_slots, int8_t first_common_ts, uint8_t dl_slots) +{ + uint8_t dls = dl_slots; + int ts = first_common_ts; + char slot_info[9] = { 0 }; + + if (single) + dls = get_single_ts(trx, tbf, dls, ul_slots, &ts); + + if (dls == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots available\n"); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, 'd', '.'), dls, 'D'), + single ? ", single" : ""); + + return dls; +} + +/*! Find set of UL timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \param[in,out] usf USF array + * \param[in,out] ul_slots set of UL timeslots + * \returns negative error code or first selected TS on success + */ +static int select_ul_slot_set(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, bool single, uint8_t dl_slots, + uint8_t reserved_ul_slots, int8_t first_common_ts, + int *usf, uint8_t *ul_slots) +{ + int ts = first_common_ts; + char slot_info[9] = { 0 }; + int free_usf = -1; + + if (single) + (*ul_slots) = get_single_ts(trx, tbf, dl_slots, *ul_slots, &ts); + + if ((*ul_slots) == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No uplink slots available\n"); + return -EINVAL; + } + + if (first_common_ts >= 0) + (*ul_slots) = 1 << first_common_ts; + else + (*ul_slots) = (*ul_slots) & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, *ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + OSMO_ASSERT(ts >= 0 && ts <= 8); + + (*ul_slots) = 1 << ts; + usf[ts] = free_usf; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", + set_flag_chars(set_flag_chars(slot_info, reserved_ul_slots, 'u', '.'), *ul_slots, 'U'), + single ? ", single" : ""); + + return ffs(*ul_slots) - 1; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -833,8 +1024,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; - int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; @@ -855,18 +1044,8 @@ first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } - /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -886,95 +1065,29 @@ } /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); + dl_slots = select_dl_slot_set(trx, tbf, single, ul_slots, reserved_dl_slots, first_common_ts, dl_slots); first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - OSMO_ASSERT(ts >= 0 && ts <= 8); - - ul_slots = 1 << ts; - usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; + first_ts = select_ul_slot_set(trx, tbf, single, dl_slots, reserved_ul_slots, first_common_ts, usf, + &ul_slots); /* We will stick to that single UL slot, unreserve the others */ + slotcount = 1; reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } + + if (first_ts < 0) + return -EINVAL; first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); - return -EINVAL; - } - if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); return -EINVAL; } @@ -993,51 +1106,16 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 271f966..13f3869 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -600,6 +600,10 @@ if (dl_tbf->pdch[i]) dl_slots |= 1 << i; + for (i = 0; ul_tbf && i < ARRAY_SIZE(ul_tbf->pdch); i += 1) + if (ul_tbf->pdch[i]) + ul_slots |= 1 << i; + for (i = 0; trx && i < ARRAY_SIZE(trx->pdch); i += 1) { struct gprs_rlcmac_pdch *pdch = &trx->pdch[i]; -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 9 15:55:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 15:55:26 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#5). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes * use consistent formatting for output * log essential allocation parameters on failure Changes to tests are combined with logging messages update to separate code and test changes over different commits to avoid regressions. Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2400 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/tbf/TbfTest.err 6 files changed, 3,282 insertions(+), 3,288 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/5 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 9 15:55:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 15:55:26 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3807 to look at the new patch set (#3). Simplify TS alloc: adjust function signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting * constify function parameters where appropriate Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2400 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 146 insertions(+), 145 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/3 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0046238 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -439,10 +439,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; @@ -652,12 +651,11 @@ /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index d65cd2f..b3a8027 100644 --- a/src/bts.h +++ b/src/bts.h @@ -204,11 +204,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; @@ -366,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..ba9734f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -103,7 +103,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -121,13 +121,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == 0xffffffffUL) return -1; @@ -140,16 +138,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -187,22 +184,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -217,11 +211,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -230,7 +232,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -300,30 +302,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -334,9 +329,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -353,32 +348,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in,out] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -396,14 +400,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -420,7 +429,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -488,9 +497,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -747,7 +762,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -796,15 +811,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -812,14 +832,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -858,7 +877,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -1025,7 +1044,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,22 +1052,27 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,8 +1081,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..6c840aa 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, 0, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 1dd7dd8..26250ab 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index e26c432..271f966 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -813,7 +811,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -823,7 +821,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 9 16:02:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 9 Sep 2017 16:02:57 +0000 Subject: osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 That's just convenience step to simplify further patches - let's not merge it until follow-up patches are finalized. -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 18:12:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 9 Sep 2017 18:12:21 +0000 Subject: osmo-gsm-tester[master]: Use tmpdir to create bts pcu-socket In-Reply-To: References: Message-ID: Patch Set 1: (4 comments) https://gerrit.osmocom.org/#/c/3894/1/src/osmo_gsm_tester/bts_osmotrx.py File src/osmo_gsm_tester/bts_osmotrx.py: Line 44: self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) > lol, what is octopusk? ogt -> OsmoGsmTester pcu-> pcu sk -> socket (normal abreviation used a lot in the kernel for instance). As we have constraint amount of bytes to use, the less the better while keeping enough info to match directories in /tmp to know they are there to hold pcu sockets for osmo-sgsm-tester. But I don't really want to spend time discussing on this kind of stuff, so I can change it to "osmo-gsm-tester_" if you think it's a blocker. (underscore is there to easily differentiate it from /var/tmp/osmo-gsm-tester/ we use for resource state lock file). Line 52: except OSError: > for completeness sake we could log the error. not very important though. Not needed, it can be expected that the pcu socket is not there, for instance if osmo-bts-trx crashed or was stopped before creating it. In this case, the crash error is printed and we arrive here through cleanup() process. Line 54: os.rmdir(self.pcu_sk_tmp_dir) > what if removing the socket file failed or the dir is nonempty for any odd IMHO we want to crash the test too, as there's something not going as expected. Removing the file should not fail, and removing the dir should not fail neither, because in this case we leak a dir in /tmp and we don't want that, so we should be alerted. Line 56: def pcu_socket_path(self): > small cosmetic: first init self.pcu_sk_tmp_dir with None and create the dir I actually prefer having it in the constructor to fail beforehand, but if you insist I can move it here. -- To view, visit https://gerrit.osmocom.org/3894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 9 18:21:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 9 Sep 2017 18:21:57 +0000 Subject: osmo-pcu[master]: TS alloc: use standard function In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3896/1/src/pcu_utils.h File src/pcu_utils.h: Line 46 I just discovered about the existence of this ffs() function in glibc, first time I heard about it. I didn't look in detail at it as I don't know much about the context, but the ffs function you are using to replace this pcu_lsb() seems to be doing more stuff, so not sure if the returned result will be the same. See https://github.com/lattera/glibc/blob/master/string/ffs.c -- To view, visit https://gerrit.osmocom.org/3896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d14ef327b09173d56ee3bca7e3ca85897d381c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 9 18:31:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 9 Sep 2017 18:31:58 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 2: > I agree with both the conclusions. > Ok. I'll implement scenarios to be applied to all resources of a given type then, as described in case A. > One thing that jumps at me: at the time we are combining scenarios, > are the 'times' entries still in there? Because this 'times' is > just a convenience gimmick. To work correctly, I think we need to > expand the 'times' things first, before combining with more > scenarios. There is code in some place that takes each dict having > a 'times: N' in there and simply replicates it to have N identical > dicts next to each other. If not there already, we may have to move > this expansion to right after parsing each scenario yaml. Yes, right now when combine(resource.conf,scenario.conf) is called, the "times" attribute is still there and resources with times>1 haven't been duplicated yet. As we decided to pick case A, then it really doesn't matter if we "duplicate" the resources before or after calling combine(), because the algorithm will work exactly the same way, because it applies/add the attributes to all resource object dcitionaries of that type. I agree thought that it's clearer to duplicate them before applying, it was more difficult to find out what was going out having to wrap my head around the "times" attribute on top of it. I will first implement it leaving duplication undone (leaving the "times" there), and once I have something working have a look whether I do it or leave it as it is. In any case i think it should go into a different patch. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 18:36:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 9 Sep 2017 18:36:10 +0000 Subject: osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Patch Set 1: > Actually, if we kept the 'a5' part out of the value, we wouldn't > have the problem in this instance; we'd just store and render plain > integers. I'm not aware of an alternative to 'a5', the vty command > 'encryption' only ever has 'a5' and nothing else so far. > In any case, this is just avoiding the general issue you mention (I don't think it's really an issue) bu pushing it into the future. I mean, we (or someone else) will have the same issue at some point: having some config option which needs some "complex" parsing before outputing it to a config template. In this case, I think it's fine to have some extra code enclosed inside the same class which uses the template to fix it. > Consider this and if you will +2 yourself to merge. -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 9 18:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 9 Sep 2017 18:36:49 +0000 Subject: [MERGED] osmo-gsm-tester[master]: modem: log property changes from Modem interface In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: modem: log property changes from Modem interface ...................................................................... modem: log property changes from Modem interface The purpose of this patch is to make sure we output to the extended log some information regarding the firwmare version of the modem being used, even if the test being run doesn't call print(modem.info) explicitly. Printing self.info() just after waiting for Powered==true doesn't always work, because the properties are not populated after a while after. Calling Modem.GetProperties() immediately after receiving Powered==true, will provide with empty strings on properties such as Revision. 18:59:55.747412 bus /sierra_1: Setting Powered True 18:59:55.938889 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Powered=True 18:59:55.964694 bus /sierra_1: DBG: Powered == True 18:59:55.987777 bus /sierra_1: DBG: interface enabled: org.ofono.VoiceCallManager 18:59:56.006278 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=[] 18:59:56.027366 bus /sierra_1: Setting Online True 18:59:56.189991 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Manufacturer=Sierra Wireless, Incorporated 18:59:56.210935 bus /sierra_1: DBG: interface enabled: org.ofono.LocationReporting 18:59:56.233217 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['gps'] 18:59:56.255807 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Model=MC7304 18:59:56.279374 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Online=True 18:59:56.315008 bus /sierra_1: DBG: Online == True 18:59:56.338779 bus /sierra_1: DBG: interface enabled: org.ofono.SimManager 18:59:56.357744 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Features=['sim', 'gps'] 18:59:56.379532 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Revision=SWI9X15C_06.03.32.04 r28324 CNSHZ-AR-BUILD 2015/05/25 01:09:15 18:59:56.401241 bus /sierra_1: DBG: 'org.ofono.Modem'.PropertyChanged() -> Serial=356853054230919 Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 3958b5e..e3858f9 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -224,6 +224,8 @@ def on_property_change(self, name, value): if name == 'Interfaces': self.on_interfaces_change(value) + else: + self.dbg('%r.PropertyChanged() -> %s=%s' % (I_MODEM, name, value)) def on_interfaces_change(self, interfaces_now): # First some logging. -- To view, visit https://gerrit.osmocom.org/3834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If215c7d63ce1b86314ed25f8e76413b15676b7f5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Sat Sep 9 18:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 9 Sep 2017 18:36:49 +0000 Subject: [MERGED] osmo-gsm-tester[master]: modem: Include serial attribute in info() In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: modem: Include serial attribute in info() ...................................................................... modem: Include serial attribute in info() Change-Id: Ifd490942ecc8ecfd0f799ed241a53d45f5870b30 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 43aa091..3958b5e 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -549,7 +549,7 @@ return True return False - def info(self, keys=('Manufacturer', 'Model', 'Revision')): + def info(self, keys=('Manufacturer', 'Model', 'Revision', 'Serial')): props = self.properties() return ', '.join(['%s: %r'%(k,props.get(k)) for k in keys]) -- To view, visit https://gerrit.osmocom.org/3833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifd490942ecc8ecfd0f799ed241a53d45f5870b30 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Sun Sep 10 12:30:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 10 Sep 2017 12:30:36 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resource: Fix list comparison in item_matches In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: resource: Fix list comparison in item_matches ...................................................................... resource: Fix list comparison in item_matches In following commits, cipher attribute containing a list of supported ciphers is introdued in osmo-gsm-tester. While developing the feature, it was found that resources containing lists are not being handled correctly. Previous implementation regarding lists in several ways: - In the list coe path, both item and wanted_item are expected to be lists. Python doesn't support to check for sublists using the "in" operand. - want_item basically contains the scenario dic, and item is each of the items available as resource of a given type. Thus, we want to check that item supports the subset of features requested by the scenario, ie. that the list in the scenario is a subset of the ones in the3 item and not the opposite. The following failing scenario is going to be checked during "make check" when the cipher attribute is added: BTS supporting cipher a50 and a51, and scenario requesting a50 succeeds. If this commit is remove, the test no longer passes, and it fails with: osmo_gsm_tester.resource.NoResourceExn: No matching resource available for bts = {'type': 'osmo-bts-sysmo', 'ciphers': ['a5 1']} Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d --- M src/osmo_gsm_tester/resource.py 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index c55140a..da543f7 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -441,9 +441,12 @@ return True if is_list(wanted_item): - # multiple possible values - if item not in wanted_item: + if not is_list(item): return False + # multiple possible values + for val in wanted_item: + if val not in item: + return False return True return item == wanted_item -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:17:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:17:17 +0000 Subject: [MERGED] libosmo-netif[master]: rtp: return offset in osmo_rtp_snprintf() In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: rtp: return offset in osmo_rtp_snprintf() ...................................................................... rtp: return offset in osmo_rtp_snprintf() Instead of the result of the last snprintf() call. Change-Id: I10066d73387be96a4e1f3349d700405beb138076 --- M src/rtp.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rtp.c b/src/rtp.c index 7ac5862..44fc217 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -222,5 +222,5 @@ ret = snprintf(buf+offset, len, "]"); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - return ret; + return offset; } -- To view, visit https://gerrit.osmocom.org/3824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10066d73387be96a4e1f3349d700405beb138076 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:19:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:19:09 +0000 Subject: libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3825/2//COMMIT_MSG Commit Message: Line 31: As in snprintf(), caller should not assume the buffer is nul-terminated. > I think this is still not true and should be removed. Right, it's sprintf() the one that does not guarantee this. I'm going to submit a new version rewriting commit description. -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:24:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:24:40 +0000 Subject: [PATCH] libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3825 to look at the new patch set (#3). osmux: fix buffer management mess in snprintf() calls SNPRINTF_BUFFER_SIZE() looks too complex, previous version maintains two different variables to account for the remaining space in the buffer, one of them is always decremented based on what snprintf() returns, which may result in underflow. These variables are swapped - not used consistently - all over this code. Replace this macro by a simplified version, with one single parameter to account for remaining space. This macro also deals with two corner cases: 1) snprintf() fails, actually never happens in practise, but documentation indicates it may return -1, so let's catch this case from here to stick to specs. 2) There is not enough space in the buffer, in that case, keep increasing offset, so we know how much would have been printed, just like snprintf() does. Thanks to Pau Espin for reporting, and Holger for clues on this. I have run osmux_test and, at quick glance, it looks good. Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 --- M src/osmux.c M src/rtp.c M tests/osmux/osmux_test.c 3 files changed, 44 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/25/3825/3 diff --git a/src/osmux.c b/src/osmux.c index b3c43e2..b18246f 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -846,19 +846,20 @@ h->rtp_ssrc = rtp_ssrc; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size -= ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; static int osmux_snprintf_header(char *buf, size_t size, struct osmux_hdr *osmuxh) { + unsigned int remain = size, offset = 0; int ret; - int len = size, offset = 0; - ret = snprintf(buf, len, "OSMUX seq=%03u ccid=%03u " + ret = snprintf(buf, remain, "OSMUX seq=%03u ccid=%03u " "ft=%01u ctr=%01u " "amr_f=%01u amr_q=%01u " "amr_ft=%02u amr_cmr=%02u ", @@ -866,7 +867,7 @@ osmuxh->ft, osmuxh->ctr, osmuxh->amr_f, osmuxh->amr_q, osmuxh->amr_ft, osmuxh->amr_cmr); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } @@ -874,19 +875,19 @@ static int osmux_snprintf_payload(char *buf, size_t size, const uint8_t *payload, int payload_len) { + unsigned int remain = size, offset = 0; int ret, i; - int len = size, offset = 0; - ret = snprintf(buf+offset, len, "[ "); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "[ "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); for (i=0; ilen, len = size; - struct osmux_hdr *osmuxh; + unsigned int remain = size; int this_len, msg_off = 0; + struct osmux_hdr *osmuxh; + unsigned int offset = 0; + int msg_len = msg->len; + int ret; while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { @@ -915,10 +917,8 @@ return -1; } - ret = osmux_snprintf_header(buf+offset, size, osmuxh); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = osmux_snprintf_header(buf + offset, remain, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); this_len = sizeof(struct osmux_hdr) + osmux_get_payload_len(osmuxh); @@ -931,12 +931,10 @@ return -1; } - ret = osmux_snprintf_payload(buf+offset, size, + ret = osmux_snprintf_payload(buf + offset, remain, osmux_get_payload(osmuxh), osmux_get_payload_len(osmuxh)); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); msg_len -= this_len; } diff --git a/src/rtp.c b/src/rtp.c index 44fc217..56fc37c 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -185,19 +185,20 @@ return msg; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size += ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; int osmo_rtp_snprintf(char *buf, size_t size, struct msgb *msg) { + unsigned int remain = size, offset = 0; struct rtp_hdr *rtph; - int ret, i; uint8_t *payload; - unsigned int len = size, offset = 0; + int ret, i; rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) @@ -205,22 +206,22 @@ payload = (uint8_t *)rtph + sizeof(struct rtp_hdr); - ret = snprintf(buf, len, "RTP ver=%01u ssrc=%u type=%02u " + ret = snprintf(buf, remain, "RTP ver=%01u ssrc=%u type=%02u " "marker=%01u ext=%01u csrc_count=%01u " "sequence=%u timestamp=%u [", rtph->version, ntohl(rtph->ssrc), rtph->payload_type, rtph->marker, rtph->extension, rtph->csrc_count, ntohs(rtph->sequence), ntohl(rtph->timestamp)); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); for (i=0; ilen - sizeof(struct rtp_hdr); i++) { - ret = snprintf(buf+offset, len, "%02x ", payload[i]); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "%02x ", payload[i]); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); } - ret = snprintf(buf+offset, len, "]"); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c index bf6174b..09b7a9a 100644 --- a/tests/osmux/osmux_test.c +++ b/tests/osmux/osmux_test.c @@ -65,8 +65,8 @@ static void tx_cb(struct msgb *msg, void *data) { - char buf[4096]; struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data; + char buf[4096]; #if OSMUX_TEST_USE_TIMING struct timeval now, diff; @@ -102,9 +102,9 @@ static void osmux_deliver(struct msgb *batch_msg, void *data) { - char buf[2048]; struct osmux_hdr *osmuxh; LLIST_HEAD(list); + char buf[2048]; osmux_snprintf(buf, sizeof(buf), batch_msg); fprintf(stderr, "OSMUX message (len=%d) %s\n", batch_msg->len, buf); @@ -182,11 +182,11 @@ static void osmux_test_loop(int ccid) { - struct msgb *msg; - char buf[1024]; struct rtp_hdr *rtph = (struct rtp_hdr *)rtp_pkt; - uint16_t seq; + struct msgb *msg; int i, j, k = 0; + char buf[1024]; + uint16_t seq; for (i = 1; i < 65; i++) { msg = msgb_alloc(1500, "test"); -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:28:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:28:03 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3830/1/src/osmux.c File src/osmux.c: Line 941: /* This _snprintf() variant always nul-terminates the buffer. */ > I still don't get why you say at least some variants of snprintf don't cont Because I got confused. I remember your original patch is trying to ensure that we leave room for the nul-termination. Anyway, bottom line is: I don't we need this patch at all. Given that snprintf() output is always nul-terminated, the last snprintf() call already guarantees that we deliver a nul-terminated buffer. So all this logic this patch adds is entirely superfluous. I'm going to abbandon this patch. -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:48:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:48:09 +0000 Subject: [PATCH] openbsc[master]: libmsc: sms_route_mt_sms() may return uninitialized return v... Message-ID: Review at https://gerrit.osmocom.org/3899 libmsc: sms_route_mt_sms() may return uninitialized return value If smpp_first is set off and there is a local receiver for this sms, then return 0. Without this patch, we return 'rc' which is uninitialized in the scenario that I'm describing above. Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/99/3899/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ddef444..ad788f2 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -363,31 +363,32 @@ /* determine gsms->receiver based on dialled number */ gsms->receiver = subscr_get_by_extension(conn->network->subscr_group, gsms->dst.addr); - if (!gsms->receiver) { -#ifdef BUILD_SMPP - /* Avoid a second look-up */ - if (smpp_first) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - } + if (gsms->receiver) + return 0; - rc = smpp_try_deliver(gsms, conn); - if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - } else if (rc < 0) { - LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", - subscr_name(conn->subscr), rc); - rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; - /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ - MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); - } -#else - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; +#ifdef BUILD_SMPP + /* Avoid a second look-up */ + if (smpp_first) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); -#endif + return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } + rc = smpp_try_deliver(gsms, conn); + if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); + } else if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", + subscr_name(conn->subscr), rc); + rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; + /* rc will be logged by gsm411_send_rp_error() */ + rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); + } +#else + rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); +#endif + return rc; } -- To view, visit https://gerrit.osmocom.org/3899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:54:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:54:10 +0000 Subject: openbsc[master]: libmsc: Either route report to ESME or send it, not both In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3885/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 693: if (rc == 0) { > Took a brief look at the code which I don't know well, and at it looks such The uninitialized return value is a real issue, I just sent a patch to address this. This may result in bogus log messages indication "Failed to send status report!". I just sent a patch to address this. Regarding sms_free(sms_report), this is just called at the end of this function, once this object is not needed at all. Given we don't return after sms_route_mt_sms() call, I see no problem with it. -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:57:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:57:33 +0000 Subject: openbsc[master]: libmsc: Either route report to ESME or send it, not both In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3885/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 693: if (rc == 0) { > The uninitialized return value is a real issue, I just sent a patch to addr Actually, this can be a real issue from gsm340_rx_tpdu(). Given rc determines what to do. -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 10 18:58:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 18:58:39 +0000 Subject: openbsc[master]: libmsc: Either route report to ESME or send it, not both In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3885/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 693: if (rc == 0) { > Pablo, I'm not sure how you would like to make this test here. Keith, could you try this patch instead to see if it cures the problem for you? https://gerrit.osmocom.org/#/c/3899/ -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 10 19:45:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Sun, 10 Sep 2017 19:45:22 +0000 Subject: [PATCH] openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... Message-ID: Review at https://gerrit.osmocom.org/3900 libmsc: annotate esme route in the sms object from deliver_to_esme() Annotate this esme route, so we can use it to return -EINPROGRESS to skip sending premature RP-ACK to the mobile station, in case we're handling sms routes through SMPP. Now that we have this information in place, we use it wherever possible to avoid kludgy checks on sms->receiver. sms_free() already releases references to this object, so we should be fine with this. Fixes: 4e5b90a594f9 ("libmsc: remove 'deferred' parameter in sms_route_mt_sms()") Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c 2 files changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/00/3900/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ad788f2..98c362f 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -520,7 +520,10 @@ rc = sms_route_mt_sms(conn, gsms); - /* This SMS got routed through SMPP or no receiver exists. */ + /* This SMS got routed through SMPP. */ + if (gsms->smpp.esme) + return -EINPROGRESS; + if (!gsms->receiver) return rc; @@ -614,8 +617,10 @@ return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); - else - return rc; + else if (rc == -EINPROGRESS) + rc = 0; + + return rc; } /* Receive a 04.11 RP-DATA message in accordance with Section 7.3.1.2 */ diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index af2d1be..02b2aba 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -714,6 +714,9 @@ if (ret < 0) return ret; + smpp_esme_get(esme); + sms->smpp.esme = esme; + return smpp_cmd_enqueue(esme, conn->subscr, sms, deliver.sequence_number); } -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Sep 10 21:13:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 10 Sep 2017 21:13:24 +0000 Subject: libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 10 21:26:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 10 Sep 2017 21:26:16 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers In-Reply-To: References: Message-ID: Patch Set 1: > Because I got confused. I remember your original patch is trying to >ensure that we leave room for the nul-termination. If I recall correctly, it does so in case at some point snprintf returns < 0, in wich case the NUll terminated buffer cannot be ensured. > Anyway, bottom line is: I don't we need this patch at all. > Given that snprintf() output is always nul-terminated, the last snprintf() call already guarantees that we deliver a nul-terminated >buffer. It only guarantees that in case there's no error returned. What if msg->len == 0? Then we need to null-terminate the buffer. -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 10 23:41:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 10 Sep 2017 23:41:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... Message-ID: Review at https://gerrit.osmocom.org/3901 modem: Fix race condition when connect() is called more than once An issue was spotted recently in tests run in production which call modem.connect() twice, first time to check that we are unable to connect with a wrong KI, then that we can connect with the correct KI. As there's no current easy way to wait for "rejected" signal, we basically wait for some time before checking if we were unable to connect. It seems that sometimes waiting for 30 seconds is not enough, and then a scan() async method is still in progress when we decide to call connect() again, which will powercycle the modem. If the scan() method returns at that time, then we try to access interfaces of the modem which are no longer available because the modem is powered off at that time. This triggers an exception and test fails. To correct way to fix this is to make sure we disable pending Scan() dbus method before powercycling the modem and starting a new Scan() method. The sleep time is also increased to make sure we let enough time to register. It seems it can take about 15 seconds to do a full scan, and sometimes during first scan iteration the BTS is still not found, probably because it's still starting. Related: OS#2510 Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b --- M src/osmo_gsm_tester/ofono_client.py M suites/aoip_encryption/register_a5_0_authreq.py M suites/aoip_encryption/register_a5_1_authreq.py 3 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/01/3901/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index e3858f9..bf2af70 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -346,13 +346,16 @@ } self.dbus.watch_interfaces() + def cancel_pending_dbus_methods(sef): + self.cancellable.cancel() + # Cancel op is applied as a signal coming from glib mainloop, so we + # need to run it and wait for the callbacks to handle cancellations. + poll_glib() + def cleanup(self): self.dbg('cleanup') if self.cancellable: - self.cancellable.cancel() - # Cancel op is applied as a signal coming from glib mainloop, so we - # need to run it and wait for the callbacks to handle cancellations. - poll_glib() + self.cancel_pending_dbus_methods() self.cancellable = None self.dbus.cleanup() self.dbus = None @@ -517,6 +520,8 @@ 'Connect to MCC+MNC' if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): raise log.Error('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + # if test called connect() before and async scanning has not finished, we need to get rid of it: + self.cancel_pending_dbus_methods() self.power_cycle() self.register_attempts = 0 if self.is_connected(mcc_mnc): diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index be8f8a1..051f5e2 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -31,7 +31,7 @@ print('Attempt connection with wrong KI...') ms.connect(msc.mcc_mnc()) -sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) print('Asserting modem did not register') # FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 # assert not ms.is_connected(msc.mcc_mnc()) diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index dd41348..11ee006 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -31,7 +31,7 @@ print('Attempt connection with wrong KI...') ms.connect(msc.mcc_mnc()) -sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) print('Asserting modem did not register') # FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 # assert not ms.is_connected(msc.mcc_mnc()) -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 10 23:44:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 10 Sep 2017 23:44:47 +0000 Subject: osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: Patch Set 1: I'll test the patch tomorrow morning and then we can merge -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 10 23:47:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 10 Sep 2017 23:47:18 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: add 'asp' / 'local-ip' command In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3826 to look at the new patch set (#2). vty: add 'asp' / 'local-ip' command We can set the ASP's remote IP (i.e. where to reach osmo-stp), but so far the only way to specify the local IP address to bind to can only be set from C code (e.g. the simple client). Allow setting the local address via VTY. For example, this is desired for the osmo-gsm-tester, to not use arbitrary IP addresses. Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d --- M src/osmo_ss7_vty.c 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/26/3826/2 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 1fb35a1..8d13865 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -556,6 +556,16 @@ return CMD_SUCCESS; } +DEFUN(asp_local_ip, asp_local_ip_cmd, + "local-ip A.B.C.D", + "Specify Local IP Address from which to contact ASP\n" + "Local IP Address from which to contact of ASP\n") +{ + struct osmo_ss7_asp *asp = vty->index; + osmo_talloc_replace_string(asp, &asp->cfg.local.host, argv[0]); + return CMD_SUCCESS; +} + DEFUN(asp_remote_ip, asp_remote_ip_cmd, "remote-ip A.B.C.D", "Specify Remote IP Address of ASP\n" @@ -633,6 +643,8 @@ osmo_ss7_asp_protocol_name(asp->cfg.proto), VTY_NEWLINE); if (asp->cfg.description) vty_out(vty, " description %s%s", asp->cfg.description, VTY_NEWLINE); + if (asp->cfg.local.host) + vty_out(vty, " local-ip %s%s", asp->cfg.local.host, VTY_NEWLINE); if (asp->cfg.remote.host) vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); if (asp->cfg.qos_class) @@ -1728,6 +1740,7 @@ install_element(L_CS7_NODE, &no_cs7_asp_cmd); install_element(L_CS7_ASP_NODE, &cfg_description_cmd); install_element(L_CS7_ASP_NODE, &asp_remote_ip_cmd); + install_element(L_CS7_ASP_NODE, &asp_local_ip_cmd); install_element(L_CS7_ASP_NODE, &asp_qos_class_cmd); install_element(L_CS7_ASP_NODE, &asp_block_cmd); install_element(L_CS7_ASP_NODE, &asp_shutdown_cmd); -- To view, visit https://gerrit.osmocom.org/3826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 01:44:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 01:44:35 +0000 Subject: [PATCH] osmo-bsc[master]: fix vty tests: vty no longer goes to parent node implicitly Message-ID: Review at https://gerrit.osmocom.org/3902 fix vty tests: vty no longer goes to parent node implicitly Fix three instances of VTY tests working because it used to include implicit 'exit' commands to the parent node. Since libosmocore change-id Id73cba2dd34676bad8a130e9c45e67a272f19588 = commit d64b6aed235f6e4d84a2cb8e84b32c3179260254, we no longer do this implicit-exit in interactive VTY shells. *) in testPingPongConfiguration, the intention is to enter the /msc 0 node. Drop prior entry of the 'network' node, which looks like an oversight. So far the 'msc 0' caused an implicit 'exit' and thus worked, now fails. *) Two instances following comments "# Check searching for outer node's commands", which look like they are intended to check for this implicit-exit behavior. This is obsolete, drop those parts of the tests. Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab --- M tests/vty_test_runner.py 1 file changed, 0 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/3902/1 diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 1727e53..3ecfd39 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -139,14 +139,6 @@ self.assertTrue(self.vty.verify("exit", [''])) self.assertTrue(self.vty.node() is None) - # Check searching for outer node's commands - self.vty.command("configure terminal") - self.vty.command('msc 0') - self.vty.command("bsc") - self.assertEquals(self.vty.node(), 'config-bsc') - self.vty.command("msc 0") - self.assertEquals(self.vty.node(), 'config-msc') - def testUssdNotificationsMsc(self): self.vty.enable() self.vty.command("configure terminal") @@ -249,7 +241,6 @@ def testPingPongConfiguration(self): self.vty.enable() self.vty.verify("configure terminal", ['']) - self.vty.verify("network", ['']) self.vty.verify("msc 0", ['']) self.vty.verify("timeout-ping 12", ['']) @@ -389,19 +380,6 @@ self.assertEquals(self.vty.node(), 'config') self.assertTrue(self.vty.verify('exit', [''])) self.assertTrue(self.vty.node() is None) - - # Check searching for outer node's commands - self.vty.command('configure terminal') - self.vty.command('mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('bsc 0') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') def testRewriteNoRewrite(self): self.vty.enable() -- To view, visit https://gerrit.osmocom.org/3902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 02:10:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 02:10:52 +0000 Subject: [PATCH] osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3832 to look at the new patch set (#3). doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg Now osmo-bsc.cfg's SCCP addresses work by internal defaults, while osmo-bsc_custom-sccp.cfg shows how to use custom STP IP address and SCCP point codes. Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd --- M doc/examples/osmo-bsc/osmo-bsc.cfg A doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg M osmoappdesc.py 3 files changed, 128 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/3832/3 diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index 7c10e9d..47123ec 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -1,11 +1,5 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login +! osmo-bsc default configuration +! (assumes STP to run on 127.0.0.1 and uses default point codes) ! e1_input e1_line 0 driver ipa @@ -15,12 +9,14 @@ short name OsmoBSC long name OsmoBSC auth policy closed + authorized-regexp .* location updating reject cause 13 encryption a5 0 - neci 1 + authentication optional + neci 0 paging any use tch 0 rrlp mode none - mm info 1 + mm info 0 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 @@ -28,21 +24,25 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 bts 0 - type nanobts + type sysmobts band DCS1800 cell_identity 0 location_area_code 1 - training_sequence_code 7 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 + radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 - dtx uplink force - dtx downlink + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden ip.access unit_id 0 0 oml ip.access stream_id 255 line 0 neighbor-list mode manual-si5 @@ -50,12 +50,14 @@ neighbor-list add arfcn 200 si5 neighbor-list add arfcn 10 si5 neighbor-list add arfcn 20 + codec-support fr gprs mode none + no force-combined-si trx 0 rf_locked 0 arfcn 871 nominal power 23 - max_power_red 20 + max_power_red 0 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 @@ -81,21 +83,24 @@ timeslot 7 phys_chan_config TCH/F hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote +msc 0 ip.access rtp-base 4000 timeout-ping 20 timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name + no timeout-ping advanced + no bsc-welcome-text + no bsc-msc-lost-text + no bsc-grace-text + type normal + allow-emergency allow + amr-config 12_2k forbidden + amr-config 10_2k forbidden + amr-config 7_95k forbidden + amr-config 7_40k forbidden + amr-config 6_70k forbidden + amr-config 5_90k allowed + amr-config 5_15k forbidden + amr-config 4_75k forbidden bsc - no access-list-name - access-list-name bsc-list + mid-call-timeout 0 + no missing-msc-text diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg new file mode 100644 index 0000000..f9c0a3c --- /dev/null +++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg @@ -0,0 +1,92 @@ +! osmo-bsc configuration example for custom SCCP addresses +! +e1_input + e1_line 0 driver ipa +network + network country code 1 + mobile network code 1 + short name OsmoBSC + long name OsmoBSC + auth policy closed + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + authentication optional + neci 0 + paging any use tch 0 + rrlp mode none + mm info 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 + bts 0 + type sysmobts + band DCS1800 + cell_identity 0 + location_area_code 1 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 0 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + max_power_red 0 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +cs7 instance 0 + point-code 0.42.1 + !asp asp-clnt-OsmoBSC 2905 0 m3ua + ! remote-ip 10.23.24.1 ! where to reach the STP + sccp-address msc_remote + point-code 0.23.1 +msc 0 + msc-addr msc_remote diff --git a/osmoappdesc.py b/osmoappdesc.py index 36eb1a7..338239c 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -15,7 +15,8 @@ # along with this program. If not, see app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg", + "doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 02:11:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 02:11:56 +0000 Subject: osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 filename fixed from *scpp* to *sccp*, otherwise identical to previous +2 -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:35:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:35:05 +0000 Subject: osmo-bsc[master]: fix vty tests: vty no longer goes to parent node implicitly In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:38:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:38:27 +0000 Subject: openbsc[master]: libmsc: sms_route_mt_sms() may return uninitialized return v... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: laforge Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:40:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:40:06 +0000 Subject: openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:46:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:46:15 +0000 Subject: osmo-bsc[master]: Wrap channel state assignment in macro In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/3828/4/src/libbsc/abis_rsl.c File src/libbsc/abis_rsl.c: Line 1228: int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, uint8_t state, const char *file, unsigned line) why are we changing from an 'int' to an uint8_t here? The gsm_lchan.state menmber is of type "enum gsm_lchan_state", so "int" is actually closer to the truth than uint8_t. And if you want to make a "proper" change, then they argument type should be of "enum gsm_lchan_state", no? -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:49:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:49:06 +0000 Subject: osmo-pcu[master]: TS alloc: use standard function In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3896/1/src/pcu_utils.h File src/pcu_utils.h: Line 46 > I just discovered about the existence of this ffs() function in glibc, firs Given that we're really only calling it with an uint8_t slots, it should be rather easy to write a small test program that iterates over all 256 possible values and calls both functions to ensure they render the same result. -- To view, visit https://gerrit.osmocom.org/3896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d14ef327b09173d56ee3bca7e3ca85897d381c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:50:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:50:02 +0000 Subject: osmo-bts[master]: OML: print actual type of report sent to BSC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:51:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:51:14 +0000 Subject: osmocom-bb[master]: mobile/main.c: clean up config file selection logic In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:51:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:51:17 +0000 Subject: [MERGED] osmocom-bb[master]: mobile/main.c: clean up config file selection logic In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mobile/main.c: clean up config file selection logic ...................................................................... mobile/main.c: clean up config file selection logic The 903e2515 introduced the following problems: - The home variable is allocated dynamically by talloc, but not being freed. There is no need for dynamical memory allocation, as the getenv() returns a pointer to a value in the environment or NULL. - In case of custom configuration file, a pointer to a part of stack (not heap) is passed to talloc_free(). This may cause unexpected behaviour of segfault. Let's fix both of them. Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5 --- M src/host/layer23/src/mobile/main.c 1 file changed, 15 insertions(+), 9 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 4a2e4ec..bc66557 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -52,8 +51,7 @@ void *l23_ctx = NULL; struct llist_head ms_list; static char *gsmtap_ip = 0; -static const char *config_file = ".osmocom/bb/mobile.cfg"; -bool use_default_cfg = true; +static const char *custom_cfg_file = NULL; struct gsmtap_inst *gsmtap_inst = NULL; static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; @@ -138,8 +136,7 @@ vty_ip = optarg; break; case 'c': - config_file = optarg; - use_default_cfg = false; + custom_cfg_file = optarg; break; case 'v': vty_port = atoi(optarg); @@ -208,9 +205,9 @@ int main(int argc, char **argv) { + char *config_file; int quit = 0; int rc; - char const * home; printf("%s\n", openbsc_copyright); @@ -240,9 +237,18 @@ gsmtap_source_add_sink(gsmtap_inst); } - if (use_default_cfg) { - home = talloc_strdup(l23_ctx, getenv("HOME")); - config_file = talloc_asprintf_append(home, "/%s", config_file); + if (custom_cfg_file) { + /* Use full path provided by user */ + config_file = talloc_strdup(l23_ctx, custom_cfg_file); + } else { + /* Obtain the user's home directory path */ + const char *home_dir = getenv("HOME"); + if (!home_dir) + home_dir = "~"; + + /* Concatenate it with default config path */ + config_file = talloc_asprintf(l23_ctx, "%s/%s", + home_dir, ".osmocom/bb/mobile.cfg"); } /* save the config file directory name */ -- To view, visit https://gerrit.osmocom.org/3897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:51:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:51:57 +0000 Subject: osmo-msc[master]: ctrl: subscriber-list-active: list only attached subscribers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I003542b208ecf3713e9e67712d84ccb4c61af14e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:52:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:52:06 +0000 Subject: [MERGED] osmo-msc[master]: ctrl: subscriber-list-active: list only attached subscribers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ctrl: subscriber-list-active: list only attached subscribers ...................................................................... ctrl: subscriber-list-active: list only attached subscribers I would have liked to add a regression test to verify this, but currently there is no easy way to run CTRL tests and at the same time have access to the osmo-msc in a way that simulates an attached subscriber. Related: OS#2285 Change-Id: I003542b208ecf3713e9e67712d84ccb4c61af14e --- M src/libmsc/ctrl_commands.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index 7e445aa..4767ddd 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -68,6 +68,9 @@ cmd->reply = talloc_strdup(cmd, ""); llist_for_each_entry(vsub, &msc_ctrl_net->vlr->subscribers, list) { + /* Do not list subscribers that aren't successfully attached. */ + if (!vsub->lu_complete) + continue; cmd->reply = talloc_asprintf_append(cmd->reply, "%s,%s\n", vsub->imsi, vsub->msisdn); } -- To view, visit https://gerrit.osmocom.org/3898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I003542b208ecf3713e9e67712d84ccb4c61af14e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:54:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:54:21 +0000 Subject: libosmo-sccp[master]: vty: add 'asp' / 'local-ip' command In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:55:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 06:55:07 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 11: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 11 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 06:56:20 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 11 Sep 2017 06:56:20 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 11: @Keith: Do you want to press submit to include the change? -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 11 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 07:50:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 07:50:19 +0000 Subject: [MERGED] osmo-bts[master]: OML: print actual type of report sent to BSC In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: OML: print actual type of report sent to BSC ...................................................................... OML: print actual type of report sent to BSC We re-use the same facility to send different data so it's better to print actual cause value to avoid confusion. Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/oml.c b/src/common/oml.c index 20f45e5..69a2642 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -73,7 +73,7 @@ struct msgb *nmsg; va_list ap; - LOGP(DOML, LOGL_NOTICE, "Reporting FAILURE to BSC: "); + LOGP(DOML, LOGL_NOTICE, "Sending %s to BSC: ", get_value_string(abis_mm_event_cause_names, cause_value)); va_start(ap, fmt); osmo_vlogp(DOML, LOGL_NOTICE, __FILE__, __LINE__, 1, fmt, ap); nmsg = abis_nm_fail_evt_vrep(NM_EVT_PROC_FAIL, NM_SEVER_CRITICAL, -- To view, visit https://gerrit.osmocom.org/3829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 08:01:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 08:01:07 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3807 to look at the new patch set (#4). Simplify TS alloc: adjust function signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting * constify function parameters where appropriate Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2400 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 147 insertions(+), 146 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/4 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0046238 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -439,10 +439,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; @@ -652,12 +651,11 @@ /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index d65cd2f..b3a8027 100644 --- a/src/bts.h +++ b/src/bts.h @@ -204,11 +204,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; @@ -366,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..47a892d 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -103,7 +103,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -121,13 +121,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == 0xffffffffUL) return -1; @@ -140,16 +138,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -187,22 +184,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -217,11 +211,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -230,7 +232,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -300,30 +302,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -334,9 +329,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -353,32 +348,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -396,14 +400,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -420,7 +429,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -488,9 +497,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -747,7 +762,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -796,15 +811,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -812,14 +832,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -847,7 +866,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -858,7 +877,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -1025,7 +1044,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,22 +1052,27 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,8 +1081,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..6c840aa 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, 0, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 1dd7dd8..26250ab 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index e26c432..271f966 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -813,7 +811,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -823,7 +821,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 08:14:30 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 11 Sep 2017 08:14:30 +0000 Subject: [PATCH] osmo-msc[master]: a_iface: fix memory leaks In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3889 to look at the new patch set (#2). a_iface: fix memory leaks Fix multiple memory leaske in A/BSSMAP code Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d --- M include/osmocom/msc/a_iface.h M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/msc_ifaces.c 4 files changed, 21 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3889/2 diff --git a/include/osmocom/msc/a_iface.h b/include/osmocom/msc/a_iface.h index a49ede2..32003eb 100644 --- a/include/osmocom/msc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -51,7 +51,7 @@ /* Initalize A interface connection between to MSC and BSC */ int a_init(struct osmo_sccp_instance *sccp, struct gsm_network *network); -/* Send DTAP message via A-interface */ +/* Send DTAP message via A-interface, take ownership of msg */ int a_iface_tx_dtap(struct msgb *msg); /* Send Cipher mode command via A-interface */ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 3d2013e..8db6173 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -127,7 +127,7 @@ return NULL; } -/* Send DTAP message via A-interface */ +/* Send DTAP message via A-interface, take ownership of msg */ int a_iface_tx_dtap(struct msgb *msg) { struct gsm_subscriber_connection *conn; @@ -144,6 +144,11 @@ msg->l3h = msg->data; msg_resp = gsm0808_create_dtap(msg, link_id); + + /* gsm0808_create_dtap() has copied the data to msg_resp, + * so msg has served its purpose now */ + msgb_free(msg); + if (!msg_resp) { LOGP(DMSC, LOGL_ERROR, "Unable to generate BSSMAP DTAP message!\n"); return -EINVAL; @@ -151,6 +156,7 @@ LOGP(DMSC, LOGL_DEBUG, "Massage will be sent as BSSMAP DTAP message!\n"); LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg_resp->data, msg_resp->len)); + /* osmo_sccp_tx_data_msg() takes ownership of msg_resp */ return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg_resp); } diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 34d03e3..3d5755a 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -150,6 +150,7 @@ if (msgb_l3len(msg) < 1) { LOGP(DMSC, LOGL_NOTICE, "Error: No data received -- discarding message!\n"); + msgb_free(msg); return; } @@ -327,9 +328,9 @@ conn = subscr_conn_allocate_a(a_conn_info, network, lac, scu, a_conn_info->conn_id); /* Handover location update to the MSC code */ - /* msc_compl_l3() takes ownership of dtap_msg - * message buffer */ rc = msc_compl_l3(conn, msg, 0); + msgb_free(msg); + if (rc == MSC_CONN_ACCEPT) { LOGP(DMSC, LOGL_NOTICE, "User has been accepted by MSC.\n"); return 0; @@ -423,9 +424,9 @@ msg = NULL; } - /* Hand over cipher mode complete message to the MSC, - * msc_cipher_mode_compl() takes ownership for msg */ + /* Hand over cipher mode complete message to the MSC */ msc_cipher_mode_compl(conn, msg, alg_id); + msgb_free(msg); return 0; fail: @@ -677,9 +678,9 @@ /* msc_dtap expects the dtap payload in l3h */ msg->l3h = msg->l2h + 3; - /* Forward dtap payload into the msc, - * msc_dtap() takes ownership for msg */ + /* Forward dtap payload into the msc */ msc_dtap(conn, conn->a.conn_id, msg); + msgb_free(msg); return 0; } @@ -696,6 +697,7 @@ if (msgb_l2len(msg) < sizeof(struct bssmap_header)) { LOGP(DMSC, LOGL_NOTICE, "The header is too short -- discarding message!\n"); msgb_free(msg); + return -EINVAL; } switch (msg->l2h[0]) { diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7a04153..f54426e 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -44,10 +44,12 @@ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) { - if (!conn) - return -EINVAL; if (!msg) return -EINVAL; + if (!conn) { + msgb_free(msg); + return -EINVAL; + } DEBUGP(DMSC, "msc_tx %u bytes to %s via %s\n", msg->len, vlr_subscr_name(conn->vsub), @@ -65,6 +67,7 @@ LOGP(DMSC, LOGL_ERROR, "msc_tx(): conn->via_ran invalid (%d)\n", conn->via_ran); + msgb_free(msg); return -1; } } -- To view, visit https://gerrit.osmocom.org/3889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 08:14:30 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 11 Sep 2017 08:14:30 +0000 Subject: [PATCH] osmo-msc[master]: a_iface: fix typo Message-ID: Review at https://gerrit.osmocom.org/3903 a_iface: fix typo Change-Id: Ia849a4043d0fb209fe6e6840908f4f7fe90dc9e5 --- M src/libmsc/a_iface.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/03/3903/1 diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 8db6173..3e86494 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -153,7 +153,7 @@ LOGP(DMSC, LOGL_ERROR, "Unable to generate BSSMAP DTAP message!\n"); return -EINVAL; } else - LOGP(DMSC, LOGL_DEBUG, "Massage will be sent as BSSMAP DTAP message!\n"); + LOGP(DMSC, LOGL_DEBUG, "Message will be sent as BSSMAP DTAP message!\n"); LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg_resp->data, msg_resp->len)); /* osmo_sccp_tx_data_msg() takes ownership of msg_resp */ -- To view, visit https://gerrit.osmocom.org/3903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia849a4043d0fb209fe6e6840908f4f7fe90dc9e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Sep 11 08:49:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 08:49:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: modem: Fix race condition when connect() is called more than once An issue was spotted recently in tests run in production which call modem.connect() twice, first time to check that we are unable to connect with a wrong KI, then that we can connect with the correct KI. As there's no current easy way to wait for "rejected" signal, we basically wait for some time before checking if we were unable to connect. It seems that sometimes waiting for 30 seconds is not enough, and then a scan() async method is still in progress when we decide to call connect() again, which will powercycle the modem. If the scan() method returns at that time, then we try to access interfaces of the modem which are no longer available because the modem is powered off at that time. This triggers an exception and test fails. To correct way to fix this is to make sure we disable pending Scan() dbus method before powercycling the modem and starting a new Scan() method. The sleep time is also increased to make sure we let enough time to register. It seems it can take about 15 seconds to do a full scan, and sometimes during first scan iteration the BTS is still not found, probably because it's still starting. Related: OS#2510 Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b --- M src/osmo_gsm_tester/ofono_client.py M suites/aoip_encryption/register_a5_0_authreq.py M suites/aoip_encryption/register_a5_1_authreq.py 3 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/01/3901/2 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index e3858f9..30e2b55 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -349,10 +349,7 @@ def cleanup(self): self.dbg('cleanup') if self.cancellable: - self.cancellable.cancel() - # Cancel op is applied as a signal coming from glib mainloop, so we - # need to run it and wait for the callbacks to handle cancellations. - poll_glib() + self.cancel_pending_dbus_methods() self.cancellable = None self.dbus.cleanup() self.dbus = None @@ -500,6 +497,12 @@ self.log('Registering with operator', matching_op_path, mcc_mnc) dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', dbus_op.Register) + def cancel_pending_dbus_methods(self): + self.cancellable.cancel() + # Cancel op is applied as a signal coming from glib mainloop, so we + # need to run it and wait for the callbacks to handle cancellations. + poll_glib() + def power_cycle(self): 'Power the modem and put it online, power cycle it if it was already on' if self.is_powered(): @@ -517,6 +520,8 @@ 'Connect to MCC+MNC' if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): raise log.Error('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + # if test called connect() before and async scanning has not finished, we need to get rid of it: + self.cancel_pending_dbus_methods() self.power_cycle() self.register_attempts = 0 if self.is_connected(mcc_mnc): diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index be8f8a1..051f5e2 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -31,7 +31,7 @@ print('Attempt connection with wrong KI...') ms.connect(msc.mcc_mnc()) -sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) print('Asserting modem did not register') # FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 # assert not ms.is_connected(msc.mcc_mnc()) diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index dd41348..11ee006 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -31,7 +31,7 @@ print('Attempt connection with wrong KI...') ms.connect(msc.mcc_mnc()) -sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) print('Asserting modem did not register') # FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 # assert not ms.is_connected(msc.mcc_mnc()) -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:24:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 10:24:28 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: re-arrange code In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#9). Simplify TS alloc: re-arrange code * consistently format log messages to make it possible to grep for test output in source code * move TRX check inside local tfi_find_free() wrapper Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 16 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/9 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c5b398f..5ae1dfb 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -248,9 +248,7 @@ if (free_tfi) { tfi = find_free_tfi(pdch, dir); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -258,26 +256,20 @@ if (dir == GPRS_RLCMAC_UL_TBF) { usf = find_free_usf(pdch); if (usf < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -374,7 +366,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -386,6 +378,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -924,16 +925,6 @@ reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:24:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 10:24:28 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3807 to look at the new patch set (#5). Simplify TS alloc: adjust function signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting * constify function parameters where appropriate Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 147 insertions(+), 146 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/5 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..0046238 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -439,10 +439,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; @@ -652,12 +651,11 @@ /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index d65cd2f..b3a8027 100644 --- a/src/bts.h +++ b/src/bts.h @@ -204,11 +204,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; @@ -366,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..47a892d 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -103,7 +103,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -121,13 +121,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == 0xffffffffUL) return -1; @@ -140,16 +138,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -187,22 +184,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -217,11 +211,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -230,7 +232,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -300,30 +302,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -334,9 +329,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -353,32 +348,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -396,14 +400,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -420,7 +429,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -488,9 +497,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -747,7 +762,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -796,15 +811,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -812,14 +832,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -847,7 +866,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -858,7 +877,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -1025,7 +1044,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,22 +1052,27 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,8 +1081,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..6c840aa 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, 0, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 1dd7dd8..26250ab 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index e26c432..271f966 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -813,7 +811,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -823,7 +821,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:24:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 10:24:40 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: properly count UL slots Message-ID: Review at https://gerrit.osmocom.org/3904 TS alloc: properly count UL slots Add cycle to mark multiple allocated UL slots similar to the way we count DL slots in AllocTest. Until multislot UL allocation is implemented it does not affect test output. Change-Id: I2705405119421da3066c6c6bdd5830df4c133a36 Related: OS#2282 --- M tests/alloc/AllocTest.cpp 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/04/3904/1 diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 271f966..13f3869 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -600,6 +600,10 @@ if (dl_tbf->pdch[i]) dl_slots |= 1 << i; + for (i = 0; ul_tbf && i < ARRAY_SIZE(ul_tbf->pdch); i += 1) + if (ul_tbf->pdch[i]) + ul_slots |= 1 << i; + for (i = 0; trx && i < ARRAY_SIZE(trx->pdch); i += 1) { struct gprs_rlcmac_pdch *pdch = &trx->pdch[i]; -- To view, visit https://gerrit.osmocom.org/3904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2705405119421da3066c6c6bdd5830df4c133a36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:24:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 10:24:41 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment Message-ID: Review at https://gerrit.osmocom.org/3905 Simplify TS alloc: move slot assignment Move into separate functionS: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 75 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 47a892d..c5b398f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -811,6 +811,76 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -993,51 +1063,16 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:24:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 10:24:41 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split allocation Message-ID: Review at https://gerrit.osmocom.org/3906 Simplify TS alloc: split allocation * generalize TS allocation and move it into separate function * move single-slot allocation into separate function * use common functions for TS allocation on both UL and DL Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 102 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3906/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5ae1dfb..6d9a27c 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -882,6 +882,93 @@ } } +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return ffs(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] ul_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \returns negative error code or selected TS on success + */ +static int tbf_select_slot_set(const gprs_rlcmac_tbf *tbf, const gprs_rlcmac_trx *trx, bool single, + uint8_t ul_slots, uint8_t dl_slots, + uint8_t reserved_ul_slots, uint8_t reserved_dl_slots, + int8_t first_common_ts) +{ + uint8_t sl; + int ts = first_common_ts; + char *dir, *abrev, slot_info[9] = { 0 }, small, big; + + if (tbf->direction != GPRS_RLCMAC_DL_TBF) { + sl = ul_slots; + small = 'u'; + big = 'U'; + dir = (char *)"uplink"; + abrev = (char *)"UL"; + } else { + sl = dl_slots; + small = 'd'; + big = 'D'; + dir = (char *)"downlink"; + abrev = (char *)"DL"; + } + + if (single) + sl = get_single_ts(trx, tbf, dl_slots, ul_slots, &ts); + + if (sl == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No %s slots available\n", dir); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected %s slots: (TS=0)\"%s\"(TS=7)%s\n", abrev, + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, small, '.'), sl, big), + single ? ", single" : ""); + + return sl; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -897,14 +984,12 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, int8_t use_trx) { - uint8_t dl_slots; - uint8_t ul_slots; + uint8_t dl_slots, ul_slots, slots; uint8_t reserved_dl_slots; uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; @@ -946,86 +1031,43 @@ reserved_ul_slots = ul_slots; } - /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + dl_slots = slots; + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { int free_usf = -1; + + ul_slots = slots; if (first_common_ts >= 0) ul_slots = 1 << first_common_ts; else ul_slots = ul_slots & dl_slots; - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); if (free_usf < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); return -EBUSY; } + OSMO_ASSERT(ts >= 0 && ts <= 8); + /* We will stick to that single UL slot, unreserve the others */ ul_slots = 1 << ts; usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; - - /* We will stick to that single UL slot, unreserve the others */ reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } first_common_ts = ffs(dl_slots & ul_slots) - 1; -- To view, visit https://gerrit.osmocom.org/3906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:46:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3731 to look at the new patch set (#4). Reserve ARFCN dynamically based on BTS band support Instead of statically specifying a band for a BTS to use, declare a list of supported bands for each BTS. At the time of BTS object creation, ask the BTS for band support and try to dynamically reserve an ARFCN resource which is compatible with any of the bands supported by the BTS. All this happens transparently to the test. Still, the test may want to use a specific band / arfcn. In this case, a test can use suite.reserve_arfcn(band, arfcn) to reserve a specific band/arfcn and pass that to the BTS at creation time, which will then use that one instead of trying to find a suitable one. It is left as future work to support BTs with multiple TRX, in which case several arfcn must be reserved. It should not be that difficult, mostly using "times: X" where X is the amount of trx, changing the API to use a list of arfcns and the configure() methods of the BTS. Related: OS#2230 Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 --- M example/default-suites.conf M example/defaults.conf M example/resources.conf A example/scenarios/band-1900.conf M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/suite_test.ok M selftest/suite_test/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py A suites/register/register_band_1900.py A suites/register/suite.conf 15 files changed, 166 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/31/3731/4 diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..7fc97d3 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -7,3 +7,4 @@ - smpp - aoip_smpp - aoip_encryption:cipher-a50+cipher-a51 +- register:band-1900 diff --git a/example/defaults.conf b/example/defaults.conf index 969fac6..e9e7846 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -34,7 +34,6 @@ osmobsc_bts_type: sysmobts trx_list: - max_power_red: 0 - arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 - phys_chan_config: SDCCH8 diff --git a/example/resources.conf b/example/resources.conf index 95cb8cf..3ebd57f 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -12,14 +12,14 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: [a5_0, a5_1, a5_3] - label: Ettus B200 type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800', 'GSM-1900'] launch_trx: true ciphers: [a5_0, a5_1] @@ -27,7 +27,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: [a5_0, a5_1] diff --git a/example/scenarios/band-1900.conf b/example/scenarios/band-1900.conf new file mode 100644 index 0000000..956c8db --- /dev/null +++ b/example/scenarios/band-1900.conf @@ -0,0 +1,4 @@ +resources: + bts: + - bands: + - GSM-1900 diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index b186737..e5fe6e6 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -12,7 +12,7 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: - 'a5_0' - 'a5_1' @@ -21,7 +21,7 @@ type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800'] launch_trx: true ciphers: - 'a5_0' @@ -31,7 +31,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: - 'a5_0' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index c946d3d..207cfb0 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,16 +46,16 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': '377ac78d5404b826d40c84efd04b4a9fd4e62b7e', + 'bts': [{'_hash': '2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3', 'addr': '10.42.42.114', - 'band': 'GSM-1800', + 'bands': ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', 'type': 'osmo-bts-sysmo'}, {'_hash': '6a9c9fbd364e1563a5b9f0826030a7888fd19575', 'addr': '10.42.42.50', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '6', 'label': 'Ettus B200', @@ -63,7 +63,7 @@ 'type': 'osmo-bts-trx'}, {'_hash': 'e50fd38e3bfe8039ac13bc315bc84f46110b7443', 'addr': '10.42.42.51', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '7', 'label': 'sysmoCell 5000', @@ -118,9 +118,13 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e +--- testowner: DBG: Picked - _hash: 2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5_0 - a5_1 @@ -129,7 +133,8 @@ type: osmo-bts-sysmo - _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5_0 - a5_1 @@ -170,10 +175,14 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e +- _hash: 2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3 _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5_0 - a5_1 @@ -183,7 +192,8 @@ - _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 _reserved_by: testowner-123-1490837279 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5_0 - a5_1 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index bc48a3e..c1281c0 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -33,23 +33,29 @@ tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}, {'times': '2'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 3 x bts (candidates: 6) -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: c8a01d42f3977e49ceff0734a1475857913dfb13 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo - _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 addr: 10.42.42.115 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '5' label: octBTS 3000 trx_list: - hw_addr: 00:0c:90:32:b5:8a type: oct -- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 +- _hash: 78f070cc5e3c6773422b0d6770e04dd4ee0497d2 addr: 10.42.42.190 - band: GSM-1900 + bands: + - GSM-1800 ipa_unit_id: '1902' label: nanoBTS 1900 trx_list: @@ -171,7 +177,8 @@ tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e addr: 10.42.42.52 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '6' label: Ettus B200 launch_trx: 'True' @@ -181,7 +188,8 @@ type: osmo-bts-trx - _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc addr: 10.42.42.53 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '7' label: sysmoCell 5000 trx_list: @@ -191,7 +199,8 @@ type: osmo-bts-trx - _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc addr: 10.42.42.53 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '7' label: sysmoCell 5000 trx_list: diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index e302373..dc1d932 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -10,13 +10,13 @@ type: sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] - label: octBTS 3000 type: oct ipa_unit_id: 5 addr: 10.42.42.115 - band: GSM-1800 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:0c:90:32:b5:8a @@ -24,7 +24,7 @@ type: nanobts ipa_unit_id: 1902 addr: 10.42.42.190 - band: GSM-1900 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:02:95:00:41:b3 @@ -32,7 +32,7 @@ type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.52 - band: GSM-1800 + bands: ['GSM-1800'] launch_trx: true trx_list: - nominal_power: 10 @@ -42,7 +42,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.53 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 trx_list: - nominal_power: 10 @@ -52,7 +52,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.53 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 trx_list: - nominal_power: 10 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index b5262a2..a53874f 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -43,6 +43,18 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + return self.band_arfcn.get('band') + + def arfcn(self): + return int(self.band_arfcn.get('arfcn')) + def trx_remote_ip(self): conf_ip = self.conf.get('trx_remote_ip', None) if conf_ip is not None: @@ -105,7 +117,8 @@ 'oml_remote_ip': self.bsc.addr(), 'trx_local_ip': self.remote_addr(), 'trx_remote_ip': self.trx_remote_ip(), - 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_trx': self.conf }) @@ -121,6 +134,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_trx')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index f37f88b..cae2828 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -29,6 +29,7 @@ remote_inst = None remote_env = None remote_dir = None + band_arfcn = None REMOTE_DIR = '/osmo-gsm-tester' BTS_SYSMO_BIN = 'osmo-bts-sysmo' @@ -110,6 +111,22 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + if not self.band_arfcn: + return None + return self.band_arfcn.get('band') + + def arfcn(self): + if not self.band_arfcn: + return None + return int(self.band_arfcn.get('arfcn')) + def configure(self): if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be configured') @@ -122,7 +139,8 @@ config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr(), - 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) @@ -138,6 +156,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_sysmo')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 886c2b9..6437386 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -53,7 +53,7 @@ 'bts[].type': schema.STR, 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, - 'bts[].band': schema.BAND, + 'bts[].bands[]': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, 'bts[].ciphers[]': schema.CIPHER, @@ -523,6 +523,11 @@ for item in item_list: item.pop(USED_KEY, None) + def add(self, more): + if more is self or more is self.reserved: + raise RuntimeError('adding a list of reserved resources to itself') + config.add(self.reserved, copy.deepcopy(more.reserved)) + def free(self): if self.reserved: self.resources_pool.free(self.origin, self.reserved) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index cdf0a04..92d7b73 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -39,7 +39,7 @@ raise ValueError('Invalid %s: %r' % (name, val)) def band(val): - if val in ('GSM-1800', 'GSM-1900'): + if val in ('GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'): return raise ValueError('Unknown GSM band: %r' % val) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b108703..f50a0b2 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -249,6 +249,11 @@ self.log('reserving resources in', self.resources_pool.state_dir, '...') self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + def reserve_resources_append(self, requirements): + new_reserved = self.resources_pool.reserve(self, requirements) + self.dbg('reserving new resources %r' % new_reserved) + self.reserved_resources.add(new_reserved) + def run_tests(self, names=None): try: log.large_separator(self.trial.name(), self.name(), sublevel=2) @@ -320,6 +325,14 @@ return self.reserved_resources.free() + def reserve_arfcn(self, band, arfcn=None): + '''To be used by tests. Returned resource can be passed when requested a bts object''' + + if arfcn is None: + return self._try_reserve_arfcn((band,)) + else: + return self.reserve_resources_append({ 'arfcn': [{'band': band, 'arfcn': arfcn, 'times': '1'}] }) + def ip_address(self, specifics=None): return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics) @@ -353,8 +366,18 @@ ip_address = self.ip_address() return osmo_stp.OsmoStp(self, ip_address) - def bts(self, specifics=None): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + def bts(self, arfcn=None, specifics=None): + return bts_obj(self, arfcn, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + + def _try_reserve_arfcn(self, supported_bands): + for band in supported_bands: + try: + self.reserve_resources_append({ 'arfcn': [{'band': band, 'times': '1'}] }) + except resource.NoResourceExn as e: + self.dbg('Band %s has no available arfcns' % band) + continue + return self.reserved_resources.get(resource.R_ARFCN) + raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) @@ -451,12 +474,17 @@ scenarios = [config.get_scenario(scenario_name) for scenario_name in scenario_names] return (suite_scenario_str, suite, scenarios) -def bts_obj(suite_run, conf): +def bts_obj(suite_run, arfcn, conf): bts_type = conf.get('type') log.dbg('create BTS object', type=bts_type) bts_class = resource.KNOWN_BTS_TYPES.get(bts_type) if bts_class is None: raise RuntimeError('No such BTS type is defined: %r' % bts_type) - return bts_class(suite_run, conf) + bts_inst = bts_class(suite_run, conf) + if arfcn is None: + supported_bands = bts_inst.supported_bands() + arfcn = suite_run._try_reserve_arfcn(supported_bands) + bts_inst.set_arfcn_resource(arfcn) + return bts_inst # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/register/register_band_1900.py b/suites/register/register_band_1900.py new file mode 100755 index 0000000..3e0f6c3 --- /dev/null +++ b/suites/register/register_band_1900.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +arfcn = suite.reserve_arfcn(band='GSM-1900') +bts = suite.bts(arfcn) +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +ms.log_info() + +print('waiting for modems to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/register/suite.conf b/suites/register/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/register/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:46:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3815 to look at the new patch set (#2). Use own format to specify encryption algorithm ... instead of using the one from from osmo vty directly. This way we avoid having multiple word attribute value and we can skip using quotes in the conf files. Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d --- M example/defaults.conf M selftest/template_test/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/util.py M suites/aoip_encryption/register_a5_0_authopt.py M suites/aoip_encryption/register_a5_0_authreq.py M suites/aoip_encryption/register_a5_1_authreq.py 9 files changed, 26 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/15/3815/2 diff --git a/example/defaults.conf b/example/defaults.conf index 082f159..969fac6 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -5,7 +5,7 @@ short_name: osmo-gsm-tester-nitb long_name: osmo-gsm-tester-nitb auth_policy: closed - encryption: a5 0 + encryption: a5_0 bsc: net: @@ -14,7 +14,7 @@ short_name: osmo-gsm-tester-msc long_name: osmo-gsm-tester-msc auth_policy: closed - encryption: a5 0 + encryption: a5_0 authentication: optional msc: @@ -24,7 +24,7 @@ short_name: osmo-gsm-tester-msc long_name: osmo-gsm-tester-msc auth_policy: closed - encryption: a5 0 + encryption: a5_0 authentication: optional bsc_bts: diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 200dfdc..2559b14 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -24,7 +24,7 @@ long name ${net_name_long} auth policy ${net_auth_policy} location updating reject cause 13 - encryption a5 ${encryption} + encryption ${encryption} neci 1 rrlp mode none mm info 1 diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index f9eb858..5fbeea6 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -81,7 +81,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(bsc=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['bsc']['net']['encryption']) + config.overlay(values, dict(bsc=dict(net=dict(encryption=encryption_vty)))) self.dbg('BSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index f023b29..67234e3 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -81,7 +81,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['msc']['net']['encryption']) + config.overlay(values, dict(msc=dict(net=dict(encryption=encryption_vty)))) if self.authentication is not None: config.overlay(values, dict(msc=dict(net=dict(authentication=self.authentication)))) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 8f91bbd..b0a706d 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -82,7 +82,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(nitb=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['nitb']['net']['encryption']) + config.overlay(values, dict(nitb=dict(net=dict(encryption=encryption_vty)))) self.config = values diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index f3655c0..2524f47 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -337,4 +337,8 @@ return () raise ValueError('type %r not supported!' % t) +def encryption2osmovty(val): + assert val[:3] == 'a5_' + return 'a5 ' + val[3:] + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py index ff93cb8..0224ee0 100755 --- a/suites/aoip_encryption/register_a5_0_authopt.py +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(False) -msc.set_encryption('a5 0') -bsc.set_encryption('a5 0') +msc.set_encryption('a5_0') +bsc.set_encryption('a5_0') hlr.start() stp.start() msc.start() diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index be8f8a1..a191008 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(True) -msc.set_encryption('a5 0') -bsc.set_encryption('a5 0') +msc.set_encryption('a5_0') +bsc.set_encryption('a5_0') hlr.start() stp.start() msc.start() diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index dd41348..bbcc3e5 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(True) -msc.set_encryption('a5 1') -bsc.set_encryption('a5 1') +msc.set_encryption('a5_1') +bsc.set_encryption('a5_1') hlr.start() stp.start() msc.start() -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:46:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3722 to look at the new patch set (#3). config: Fix combination of lists This commit fixes combination of resources containing lists. For lists containing complex types, it has been decided to handle them as sorted list, where position in list matters. In this case, combine is called recursively for each element in dest and src sharing position in the list, and assumes that if one list is shorter than the other, then it has to be combined against empty set for that tye. For instance this is useful when defining trx_list properties, where a BTS can have a different amount of TRX but we may be interested in restricting the first TRX and don't care about extra TRX. For lists containing simple types (eg. integers or strings), we just want to merge both lists and we only need to check if the value is already there, ie. handle them as unsortered sets. This case won't work if we call combine for each element of the list because for a simple case it will just end up checking if a[i] == b[i]. This kind of operation for simple types is needed in later commits where cipher attribute is introduced. Without this patch, having following 2 scenarios and trying them to use together "-s foosuite:cipher-a50+ciphera51" will fail: cipher_a50.conf: bts: - ciphers: - 'a5 0' cipher_a51.conf bts: - ciphers: - 'a5 1' ValueError: cannot combine dicts, conflicting items (values 'a5 0' and 'a5 1') Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 --- M selftest/config_test.ok M selftest/config_test.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/util.py 4 files changed, 158 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3722/3 diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 80b5a06..9647deb 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -93,3 +93,31 @@ Validation: Error --- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error +- Combine dicts: +{'times': '2', 'type': 'osmo-bts-trx'} +- Combine dicts 2: +{'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +- Combine lists: +{'a_list': ['x', 'y', 'z']} +- Combine lists 2: +{'a_list': ['x', 'w', 'u', 'y', 'z']} +- Combine lists 3: +ValueError expected +- Combine lists 4: +ValueError expected +- Combine lists 5: +ValueError expected +- Combine lists 6: +{'a_list': [{}, {}]} +- Combine lists 7: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 8: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 9: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 10: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 13: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 14: +{'times': '1', 'label': 'foo', 'trx': [], 'type': 'osmo-bts-trx'} diff --git a/selftest/config_test.py b/selftest/config_test.py index 61ec73a..94ac1f2 100755 --- a/selftest/config_test.py +++ b/selftest/config_test.py @@ -112,4 +112,94 @@ c['imsi'][2] = None val(c) +print('- Combine dicts:') +a = {'times': '2'} +b = {'type': 'osmo-bts-trx'} +config.combine(a, b) +print(a) + +print('- Combine dicts 2:') +a = {'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +b = {'type': 'osmo-bts-trx'} +config.combine(a, b) +print(a) + +print('- Combine lists:') +a = { 'a_list': ['x', 'y', 'z'] } +b = { 'a_list': ['y'] } +config.combine(a, b) +print(a) + +print('- Combine lists 2:') +a = { 'a_list': ['x'] } +b = { 'a_list': ['w', 'u', 'x', 'y', 'z'] } +config.combine(a, b) +print(a) + +print('- Combine lists 3:') +a = { 'a_list': ['x', 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 4:') +a = { 'a_list': [2, 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 5:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 6:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': [{}] } +config.combine(a, b) +print(a) + +print('- Combine lists 7:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 8:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 9:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 10:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 13:') +a = { 'times': '1', 'label': 'foo', 'trx': [{}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 14:') +a = { 'times': '1', 'label': 'foo', 'trx': [] } +b = { 'type': 'osmo-bts-trx', 'trx': [] } +config.combine(a, b) +print(a) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index f6e81ac..64abbb5 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -244,9 +244,23 @@ if is_list(dest): if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) - for i in range(len(src)): - log.ctx(idx=i) - combine(dest[i], src[i]) + # Validate that all elements in both lists are of the same type: + t = util.list_validate_same_elem_type(src + dest) + if t is None: + return # both lists are empty, return + # For lists of complex objects, we expect them to be sorted lists: + if t == dict or t == list or t == tuple: + for i in range(len(dest)): + log.ctx(idx=i) + src_it = src[i] if i < len(src) else util.empty_instance_type(t) + combine(dest[i], src_it) + for i in range(len(dest), len(src)): + log.ctx(idx=i) + dest.append(src[i]) + else: # for lists of basic elements, we handle them as unsorted sets: + for elem in src: + if elem not in dest: + dest.append(elem) return if dest == src: return diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..f3655c0 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -314,4 +314,27 @@ return True raise ValueError('Invalid BOOL field: %r' % val) +def list_validate_same_elem_type(li): + ''' + Checks that all elements in the list are of the same type and returns that type. + If the list is empty, returns None + If one of the elements is not of the same type, it throws a ValueError exception. + ''' + if len(li) == 0: + return None + t = type(li[0]) + for elem in li: + if type(elem) != t: + raise ValueError('List contains elements of different types: %r vs %r' % (t, type(elem))) + return t + +def empty_instance_type(t): + if t == dict: + return {} + elif t == list: + return [] + elif t == tuple: + return () + raise ValueError('type %r not supported!' % t) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:46:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3723 to look at the new patch set (#5). Add cipher cfg param for modem and bts This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e --- M example/default-suites.conf M example/resources.conf A example/scenarios/cipher-a50.conf A example/scenarios/cipher-a51.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 31 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/3723/5 diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..1e8d47a 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption +- aoip_encryption:cipher-a50+cipher-a51 diff --git a/example/resources.conf b/example/resources.conf index f190c2f..95cb8cf 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -13,6 +13,7 @@ ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: [a5_0, a5_1, a5_3] - label: Ettus B200 type: osmo-bts-trx @@ -20,6 +21,7 @@ addr: 10.42.42.50 band: GSM-1800 launch_trx: true + ciphers: [a5_0, a5_1] - label: sysmoCell 5000 type: osmo-bts-trx @@ -27,6 +29,7 @@ addr: 10.42.42.51 band: GSM-1800 trx_remote_ip: 10.42.42.112 + ciphers: [a5_0, a5_1] arfcn: - arfcn: 512 @@ -56,21 +59,25 @@ imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' + ciphers: [a5_0, a5_1] diff --git a/example/scenarios/cipher-a50.conf b/example/scenarios/cipher-a50.conf new file mode 100644 index 0000000..80781ed --- /dev/null +++ b/example/scenarios/cipher-a50.conf @@ -0,0 +1,7 @@ +resources: + bts: + ciphers: + - a5_0 + modem: + ciphers: + - a5_0 diff --git a/example/scenarios/cipher-a51.conf b/example/scenarios/cipher-a51.conf new file mode 100644 index 0000000..a3ff872 --- /dev/null +++ b/example/scenarios/cipher-a51.conf @@ -0,0 +1,7 @@ +resources: + bts: + ciphers: + - a5_1 + modem: + ciphers: + - a5_1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index fa876d9..886c2b9 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -56,6 +56,7 @@ 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, + 'bts[].ciphers[]': schema.CIPHER, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'bts[].trx_list[].nominal_power': schema.INT, @@ -66,6 +67,7 @@ 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, + 'modem[].ciphers[]': schema.CIPHER, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 2da80cd..cdf0a04 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -66,6 +66,11 @@ return raise ValueError('Unknown Authentication Algorithm: %r' % val) +def cipher(val): + if val in ('a5_0', 'a5_1', 'a5_2', 'a5_3', 'a5_4', 'a5_5', 'a5_6', 'a5_7'): + return + raise ValueError('Unknown Cipher value: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -76,6 +81,7 @@ KI = 'ki' MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' +CIPHER = 'cipher' SCHEMA_TYPES = { INT: int, STR: str, @@ -87,6 +93,7 @@ KI: ki, MSISDN: msisdn, AUTH_ALGO: auth_algo, + CIPHER: cipher, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:46:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:46:12 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Convert scenarios to restrict all objects of a given type Message-ID: Review at https://gerrit.osmocom.org/3907 Convert scenarios to restrict all objects of a given type Before this commit, scenarios follow the same structure as suite.conf files: resources: { bts: [{attrX: valX}, {attrY: valY}] } This was meant to match objects 1-to-1 with the ones appearing in the suite.conf. However, after discussions it was decided that what we actually prefer for scenarios (being more convinient) is to define a restriction we want to apply to all objects of a given type. Otherwise, the scenario cannot be generic and needs to have knowledge on the suite.conf details (such as amount of BTS used), and apply restrictions for each of them. Thus, structure of scenarios config file is change to the following: resource: { bts: {attrX: valX} } Then, in suite.py:combined(), we apply the dictionary "bts" for each object of type "bts" required in suite.conf. A unit test is added to confirm it works as expected. During creation of this patch, it was observed that suite.conf uses a different schema (WANT_SCHEMA), which restricts attributes which can be specified in suite.conf. It may be useful to extend that in the future to let suite.conf contain more attributes (as in resources.conf or scenarios), because it may be desirable to specify already in the suite.conf some restriction which will always need to be enforced for a given suite to work properly. This is left for future work as for now this can be workarouned by applying a scenario. Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 --- M example/scenarios/sysmo.conf M example/scenarios/trx-b200.conf M example/scenarios/trx-sysmocell5000.conf M example/scenarios/trx.conf M selftest/suite_test.ok M selftest/suite_test.py M selftest/suite_test/resources.conf M selftest/suite_test/test_suite/suite.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 10 files changed, 146 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/3907/1 diff --git a/example/scenarios/sysmo.conf b/example/scenarios/sysmo.conf index 624758b..2fff726 100644 --- a/example/scenarios/sysmo.conf +++ b/example/scenarios/sysmo.conf @@ -1,3 +1,3 @@ resources: bts: - - type: osmo-bts-sysmo + type: osmo-bts-sysmo diff --git a/example/scenarios/trx-b200.conf b/example/scenarios/trx-b200.conf index 2bad7e8..f57eada 100644 --- a/example/scenarios/trx-b200.conf +++ b/example/scenarios/trx-b200.conf @@ -1,4 +1,4 @@ resources: bts: - - label: Ettus B200 + label: Ettus B200 type: osmo-bts-trx diff --git a/example/scenarios/trx-sysmocell5000.conf b/example/scenarios/trx-sysmocell5000.conf index 62e9a3c..30e4ed7 100644 --- a/example/scenarios/trx-sysmocell5000.conf +++ b/example/scenarios/trx-sysmocell5000.conf @@ -1,4 +1,4 @@ resources: bts: - - label: sysmoCell 5000 + label: sysmoCell 5000 type: osmo-bts-trx diff --git a/example/scenarios/trx.conf b/example/scenarios/trx.conf index f1d6d13..89d0d48 100644 --- a/example/scenarios/trx.conf +++ b/example/scenarios/trx.conf @@ -1,3 +1,3 @@ resources: bts: - - type: osmo-bts-trx + type: osmo-bts-trx diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..bc48a3e 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -16,6 +16,7 @@ resources: bts: - times: '1' + - times: '2' ip_address: - times: '1' modem: @@ -30,14 +31,30 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 3) +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}, {'times': '2'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] +tst test_suite: Reserving 3 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 @@ -140,5 +157,84 @@ skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected +- test with scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}, {'times': '2'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: DBG: {conf={bts={trx_list=[{'nominal_power': '10'}, {'nominal_power': '12'}], type='osmo-bts-trx'}}, scenario='foo'} [test_suite?{combining_scenarios='resources', scenario='foo'}] [suite.py:[LINENR]] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e + addr: 10.42.42.52 + band: GSM-1800 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + trx_list: + - nominal_power: '10' + - nominal_power: '12' + type: osmo-bts-trx +- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - graceful exit. diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 86c4c25..9ea4fea 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -42,5 +42,13 @@ output = report.suite_to_text(s) print(output) +print('- test with scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': {'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]} } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..e302373 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -28,6 +28,36 @@ trx_list: - hw_addr: 00:02:95:00:41:b3 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.52 + band: GSM-1800 + launch_trx: true + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + arfcn: - arfcn: 512 band: GSM-1800 diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/test_suite/suite.conf index 376f6cd..890f66a 100644 --- a/selftest/suite_test/test_suite/suite.conf +++ b/selftest/suite_test/test_suite/suite.conf @@ -3,6 +3,7 @@ - times: 1 bts: - times: 1 + - times: 2 modem: - times: 2 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index da543f7..fa876d9 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -58,6 +58,7 @@ 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, + 'bts[].trx_list[].nominal_power': schema.INT, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 2ac2062..b108703 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -217,7 +217,10 @@ log.dbg(scenario=scenario.name(), conf=c) if c is None: continue - config.combine(combination, c) + for obj_type, obj_li in combination.items(): + obj_scenario = c.get(obj_type, {}) + for obj in obj_li: + config.combine(obj, obj_scenario) return combination def get_run_dir(self): -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:48:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:48:38 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 As we discussed, we don't want to merge this specific commit for now. We already described in the related task how to properly implement this. -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:58:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:58:01 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3763 to look at the new patch set (#2). Add features attribute to modems The idea behind this attribute is similar to the Features one in ofono: To provide an easy-to-use list of features that a modem supports. In osmo-gsm-tester this feature list can be used to create scenarios to act as a filter for modems. For instance, if an sms related feature must be tested, then a modem supporting sms features is required. This way only modems supporting that feature are going to be selected for that test when that scenario is used. We provide our own list instead of dynamically using it for two reasons: - Accessing the list from ofono means powering on + online the modem, which requires using the modem before resource resolution is done. - ofono may state that it has support for feature X, but it still doesn't have all features required by osmo-gsm-tester or there is a bug in some part of the feature which prevents it from being used for a specific test. Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 --- M example/resources.conf A example/scenarios/mfeature-gprs.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 4 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/63/3763/2 diff --git a/example/resources.conf b/example/resources.conf index 95cb8cf..3daf677 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -60,6 +60,7 @@ ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: sierra_2 path: '/sierra_2' @@ -67,6 +68,7 @@ ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: gobi_0 path: '/gobi_0' @@ -74,6 +76,7 @@ ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: gobi_3 path: '/gobi_3' @@ -81,3 +84,4 @@ ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['gprs'] diff --git a/example/scenarios/mfeature-gprs.conf b/example/scenarios/mfeature-gprs.conf new file mode 100644 index 0000000..26a186b --- /dev/null +++ b/example/scenarios/mfeature-gprs.conf @@ -0,0 +1,4 @@ +resources: + modem: + features: + - 'gprs' diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 886c2b9..55e0294 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -68,6 +68,7 @@ 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, 'modem[].ciphers[]': schema.CIPHER, + 'modem[].features[]': schema.MODEM_FEATURE, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index cdf0a04..38cd2bf 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -71,6 +71,11 @@ return raise ValueError('Unknown Cipher value: %r' % val) +def modem_feature(val): + if val in ('sms', 'gprs', 'voicecall', 'ussd'): + return + raise ValueError('Unknown Modem Feature: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -82,6 +87,8 @@ MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' CIPHER = 'cipher' +MODEM_FEATURE = 'modem_feature' + SCHEMA_TYPES = { INT: int, STR: str, @@ -94,6 +101,7 @@ MSISDN: msisdn, AUTH_ALGO: auth_algo, CIPHER: cipher, + MODEM_FEATURE: modem_feature, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:59:19 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 11 Sep 2017 10:59:19 +0000 Subject: [MERGED] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Keith Whyte has submitted this change and it was merged. Change subject: sdp.c Send octet-align in fmtp ...................................................................... sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode and can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sdp.c b/src/sdp.c index ccd000d..213e979 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,18 +166,27 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = NULL, *sdp; leg->wanted_codec = app_media_name(other->payload_msg_type); - return talloc_asprintf(leg, + + if (strcmp(leg->wanted_codec, "AMR") == 0) + fmtp_str = talloc_asprintf(leg, "a=fmtp:%d octet-align=1\r\n", other->payload_type); + + sdp = talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" "s=GSM Call\r\n" "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str ? fmtp_str : "", other->payload_type, leg->wanted_codec); + talloc_free(fmtp_str); + return sdp; } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 11 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 10:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 10:59:39 +0000 Subject: osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Patch Set 2: New version of the patch is rebased on top of changes made in arfcn branch which contain fixes for lists in combine(). I also added feature sms to ec20 modem as lynxis is using it and seems to be working correctly for him. -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 11:02:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 11:02:05 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#6). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes * use consistent formatting for output * log essential allocation parameters on failure Changes to tests are combined with logging messages update to separate code and test changes over different commits to avoid regressions. Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/tbf/TbfTest.err 6 files changed, 3,283 insertions(+), 3,287 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/6 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 11 11:02:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 11:02:30 +0000 Subject: osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:04:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 12:04:50 +0000 Subject: [MERGED] osmo-bsc[master]: fix vty tests: vty no longer goes to parent node implicitly In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix vty tests: vty no longer goes to parent node implicitly ...................................................................... fix vty tests: vty no longer goes to parent node implicitly Fix three instances of VTY tests working because it used to include implicit 'exit' commands to the parent node. Since libosmocore change-id Id73cba2dd34676bad8a130e9c45e67a272f19588 = commit d64b6aed235f6e4d84a2cb8e84b32c3179260254, we no longer do this implicit-exit in interactive VTY shells. *) in testPingPongConfiguration, the intention is to enter the /msc 0 node. Drop prior entry of the 'network' node, which looks like an oversight. So far the 'msc 0' caused an implicit 'exit' and thus worked, now fails. *) Two instances following comments "# Check searching for outer node's commands", which look like they are intended to check for this implicit-exit behavior. This is obsolete, drop those parts of the tests. Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab --- M tests/vty_test_runner.py 1 file changed, 0 insertions(+), 22 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 1727e53..3ecfd39 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -139,14 +139,6 @@ self.assertTrue(self.vty.verify("exit", [''])) self.assertTrue(self.vty.node() is None) - # Check searching for outer node's commands - self.vty.command("configure terminal") - self.vty.command('msc 0') - self.vty.command("bsc") - self.assertEquals(self.vty.node(), 'config-bsc') - self.vty.command("msc 0") - self.assertEquals(self.vty.node(), 'config-msc') - def testUssdNotificationsMsc(self): self.vty.enable() self.vty.command("configure terminal") @@ -249,7 +241,6 @@ def testPingPongConfiguration(self): self.vty.enable() self.vty.verify("configure terminal", ['']) - self.vty.verify("network", ['']) self.vty.verify("msc 0", ['']) self.vty.verify("timeout-ping 12", ['']) @@ -389,19 +380,6 @@ self.assertEquals(self.vty.node(), 'config') self.assertTrue(self.vty.verify('exit', [''])) self.assertTrue(self.vty.node() is None) - - # Check searching for outer node's commands - self.vty.command('configure terminal') - self.vty.command('mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('bsc 0') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') def testRewriteNoRewrite(self): self.vty.enable() -- To view, visit https://gerrit.osmocom.org/3902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:05:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 12:05:30 +0000 Subject: osmo-pcu[master]: TS alloc: use standard function In-Reply-To: References: Message-ID: Patch Set 1: I've tried to implement this comparison and got really weird results: ... EC 111.11..: {5} 3 != 4 FAIL ED 111.11.1: {6} 1 OK EE 111.111.: {6} 2 OK EF 111.1111: {7} 1 OK F0 1111....: {4} 5 != 16 FAIL F1 1111...1: {5} 1 OK F2 1111..1.: {5} 2 OK F3 1111..11: {6} 1 OK ... This prints the number in question (0..0xFF), it's bit representation, number of bits set, ffs() and 'OK' or psu_lsb() value if differs. It seems like ffs() does the right thing but psu_lsb() computes every 5th value wrong. Here is the code: uint8_t u = 0, x; do { fprintf(stderr, "%2X " OSMO_BIT_SPEC ": {%d} %d ", u, OSMO_BIT_PRINT(u), pcu_bitcount(u), ffs(u)); x = pcu_lsb(u); if (ffs(u) != x) { fprintf(stderr, "!= %d FAIL\n", x); } else fprintf(stderr, "OK\n"); u++; } while (u); I might be missing smth but home come lsb in a byte can be more than 8? Could it be that using negation on unsigned type somehow confused gcc? Or some sort of template optimization magic went wrong? Anyway, I think it's yet another reason to replace it with standard function which behaves as expected. -- To view, visit https://gerrit.osmocom.org/3896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d14ef327b09173d56ee3bca7e3ca85897d381c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:13:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 12:13:18 +0000 Subject: [PATCH] osmo-bsc[master]: Wrap channel state assignment in macro In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3828 to look at the new patch set (#5). Wrap channel state assignment in macro Previously we've used function so debug print always pointed to the same place which is not very useful. Wrap it with macro so proper file:line is printed. Also, make sure that we always change state only through this wrapper and log only when the state has changed. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 --- M include/osmocom/bsc/abis_rsl.h M src/libbsc/abis_rsl.c M src/libbsc/chan_alloc.c 3 files changed, 10 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/28/3828/5 diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h index f983fce..c092723 100644 --- a/include/osmocom/bsc/abis_rsl.h +++ b/include/osmocom/bsc/abis_rsl.h @@ -34,6 +34,9 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) +#define rsl_lchan_set_state(lch_, st_) \ + rsl_lchan_set_state_with_log(lch_, st_, __BASE_FILE__, __LINE__) + int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); @@ -74,7 +77,7 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, enum rsl_rel_mode release_mode); -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); +int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, enum gsm_lchan_state state, const char *file, unsigned line); int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); /* to be provided by external code */ diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 09fb14b..9968602 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1225,11 +1225,12 @@ return 0; } -int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) +int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, enum gsm_lchan_state state, const char *file, unsigned line) { - DEBUGP(DRSL, "%s state %s -> %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), - gsm_lchans_name(state)); + if (lchan->state != state) + LOGPSRC(DRSL, LOGL_DEBUG, file, line, "%s state %s -> %s\n", + gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), gsm_lchans_name(state)); + lchan->state = state; return 0; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 679ad42..f0275bc 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -448,7 +448,7 @@ osmo_timer_del(&lchan->error_timer); lchan->type = GSM_LCHAN_NONE; - lchan->state = LCHAN_S_NONE; + rsl_lchan_set_state(lchan, LCHAN_S_NONE); if (lchan->abis_ip.rtp_socket) { rtp_socket_free(lchan->abis_ip.rtp_socket); -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:18:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 12:18:07 +0000 Subject: osmo-msc[master]: a_iface: fix typo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia849a4043d0fb209fe6e6840908f4f7fe90dc9e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:36:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 12:36:06 +0000 Subject: osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (3 comments) (sorry, comments on old patch set, but still apply) -1 for the NoneType / missing None, otherwise ok. The sleep can be replaced as a separate issue, some time. https://gerrit.osmocom.org/#/c/3901/1/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 357: def properties(self, *args, **kwargs): IMHO this entire if.. including 'self.cancellable = None' should move into the new function Line 524: self.cancel_pending_dbus_methods() because now we're potentially causing a NoneType exception or forget to reset self.cancellable https://gerrit.osmocom.org/#/c/3901/1/suites/aoip_encryption/register_a5_0_authreq.py File suites/aoip_encryption/register_a5_0_authreq.py: Line 34: sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) in general, if at all possible, we should avoid arbitrary sleeps, we can never know how long a modem will cycle around to scan... since we expect a LU reject here it would indeed be nice to detect a rejection. But is this possible with the CTRL? (listening for TRAPs / add a "rejected" flag to VLR subscriber and provide a new CTRL cmd for it) ... The easiest dirty hack I can think of is grepping the osmo-msc stderr. -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:43:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 12:43:45 +0000 Subject: osmo-msc[master]: a_iface: fix typo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia849a4043d0fb209fe6e6840908f4f7fe90dc9e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:44:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 12:44:47 +0000 Subject: osmo-msc[master]: a_iface: fix memory leaks In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:44:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 12:44:52 +0000 Subject: [MERGED] osmo-msc[master]: a_iface: fix memory leaks In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: a_iface: fix memory leaks ...................................................................... a_iface: fix memory leaks Fix multiple memory leaske in A/BSSMAP code Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d --- M include/osmocom/msc/a_iface.h M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/msc_ifaces.c 4 files changed, 21 insertions(+), 10 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/a_iface.h b/include/osmocom/msc/a_iface.h index a49ede2..32003eb 100644 --- a/include/osmocom/msc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -51,7 +51,7 @@ /* Initalize A interface connection between to MSC and BSC */ int a_init(struct osmo_sccp_instance *sccp, struct gsm_network *network); -/* Send DTAP message via A-interface */ +/* Send DTAP message via A-interface, take ownership of msg */ int a_iface_tx_dtap(struct msgb *msg); /* Send Cipher mode command via A-interface */ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 3d2013e..8db6173 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -127,7 +127,7 @@ return NULL; } -/* Send DTAP message via A-interface */ +/* Send DTAP message via A-interface, take ownership of msg */ int a_iface_tx_dtap(struct msgb *msg) { struct gsm_subscriber_connection *conn; @@ -144,6 +144,11 @@ msg->l3h = msg->data; msg_resp = gsm0808_create_dtap(msg, link_id); + + /* gsm0808_create_dtap() has copied the data to msg_resp, + * so msg has served its purpose now */ + msgb_free(msg); + if (!msg_resp) { LOGP(DMSC, LOGL_ERROR, "Unable to generate BSSMAP DTAP message!\n"); return -EINVAL; @@ -151,6 +156,7 @@ LOGP(DMSC, LOGL_DEBUG, "Massage will be sent as BSSMAP DTAP message!\n"); LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg_resp->data, msg_resp->len)); + /* osmo_sccp_tx_data_msg() takes ownership of msg_resp */ return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg_resp); } diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 34d03e3..3d5755a 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -150,6 +150,7 @@ if (msgb_l3len(msg) < 1) { LOGP(DMSC, LOGL_NOTICE, "Error: No data received -- discarding message!\n"); + msgb_free(msg); return; } @@ -327,9 +328,9 @@ conn = subscr_conn_allocate_a(a_conn_info, network, lac, scu, a_conn_info->conn_id); /* Handover location update to the MSC code */ - /* msc_compl_l3() takes ownership of dtap_msg - * message buffer */ rc = msc_compl_l3(conn, msg, 0); + msgb_free(msg); + if (rc == MSC_CONN_ACCEPT) { LOGP(DMSC, LOGL_NOTICE, "User has been accepted by MSC.\n"); return 0; @@ -423,9 +424,9 @@ msg = NULL; } - /* Hand over cipher mode complete message to the MSC, - * msc_cipher_mode_compl() takes ownership for msg */ + /* Hand over cipher mode complete message to the MSC */ msc_cipher_mode_compl(conn, msg, alg_id); + msgb_free(msg); return 0; fail: @@ -677,9 +678,9 @@ /* msc_dtap expects the dtap payload in l3h */ msg->l3h = msg->l2h + 3; - /* Forward dtap payload into the msc, - * msc_dtap() takes ownership for msg */ + /* Forward dtap payload into the msc */ msc_dtap(conn, conn->a.conn_id, msg); + msgb_free(msg); return 0; } @@ -696,6 +697,7 @@ if (msgb_l2len(msg) < sizeof(struct bssmap_header)) { LOGP(DMSC, LOGL_NOTICE, "The header is too short -- discarding message!\n"); msgb_free(msg); + return -EINVAL; } switch (msg->l2h[0]) { diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7a04153..f54426e 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -44,10 +44,12 @@ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) { - if (!conn) - return -EINVAL; if (!msg) return -EINVAL; + if (!conn) { + msgb_free(msg); + return -EINVAL; + } DEBUGP(DMSC, "msc_tx %u bytes to %s via %s\n", msg->len, vlr_subscr_name(conn->vsub), @@ -65,6 +67,7 @@ LOGP(DMSC, LOGL_ERROR, "msc_tx(): conn->via_ran invalid (%d)\n", conn->via_ran); + msgb_free(msg); return -1; } } -- To view, visit https://gerrit.osmocom.org/3889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:44:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 12:44:52 +0000 Subject: [MERGED] osmo-msc[master]: a_iface: fix typo In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: a_iface: fix typo ...................................................................... a_iface: fix typo Change-Id: Ia849a4043d0fb209fe6e6840908f4f7fe90dc9e5 --- M src/libmsc/a_iface.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 8db6173..3e86494 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -153,7 +153,7 @@ LOGP(DMSC, LOGL_ERROR, "Unable to generate BSSMAP DTAP message!\n"); return -EINVAL; } else - LOGP(DMSC, LOGL_DEBUG, "Massage will be sent as BSSMAP DTAP message!\n"); + LOGP(DMSC, LOGL_DEBUG, "Message will be sent as BSSMAP DTAP message!\n"); LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg_resp->data, msg_resp->len)); /* osmo_sccp_tx_data_msg() takes ownership of msg_resp */ -- To view, visit https://gerrit.osmocom.org/3903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia849a4043d0fb209fe6e6840908f4f7fe90dc9e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 12:55:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 12:55:59 +0000 Subject: osmo-gsm-tester[master]: Use tmpdir to create bts pcu-socket In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 those are the things I'd have done differently ... but you decide. -- To view, visit https://gerrit.osmocom.org/3894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 13:11:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 13:11:46 +0000 Subject: openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3900/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 718: sms->smpp.esme = esme; check that we're not overwriting sms->smpp.esme if it is already set? (i.e to decrease the other esme->use count) -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 13:24:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 13:24:14 +0000 Subject: osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3901/1/suites/aoip_encryption/register_a5_0_authreq.py File suites/aoip_encryption/register_a5_0_authreq.py: Line 34: sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) > in general, if at all possible, we should avoid arbitrary sleeps, we can ne At some point I'd like having some common interface by which you can request a pcap file from the object, and then be able to do some checks on it through a class, which would call tshark or some python pcap module. In this case, we could check for instance that there were not Location Accept, and that there was at least one Location reject. I've worked with testing frameworks which did tests then checked everything on recorded pcap files and it's really powerful and useful. We could then use this kind of greps over pcap files together with test.wait() to poll until some event is done. -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 13:27:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 13:27:55 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 (2 comments) https://gerrit.osmocom.org/#/c/3722/3/selftest/config_test.ok File selftest/config_test.ok: Line 113: {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} (just wondering, this requirement of two distinct nominal power values is not solvable, right?) https://gerrit.osmocom.org/#/c/3722/3/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 252: if t == dict or t == list or t == tuple: cosmetic hint: if t in (dict, list, tuple) -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 13:29:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 13:29:05 +0000 Subject: osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 13:41:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 13:41:28 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/3722/3/selftest/config_test.ok File selftest/config_test.ok: Line 113: {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} > (just wondering, this requirement of two distinct nominal power values is n what do you mean? If you only want to restrict the second one, use trx_list: [{}, {'nominal power': 'X'}] in scenario. https://gerrit.osmocom.org/#/c/3722/3/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 252: if t == dict or t == list or t == tuple: > cosmetic hint: if t in (dict, list, tuple) I'll apply it. -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 13:41:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 13:41:45 +0000 Subject: osmo-gsm-tester[master]: Convert scenarios to restrict all objects of a given type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 at first sight I don't recall us coming to this conclusion and disagree, need to discuss again... -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:07:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 14:07:27 +0000 Subject: osmo-gsm-tester[master]: Convert scenarios to restrict all objects of a given type In-Reply-To: References: Message-ID: Patch Set 1: For reference, discussion can be found in https://gerrit.osmocom.org/#/c/3722 After a new quick discussion, it was decided that we want to go for case B. It probably means this commits needs to be almost reverted, and in exchange the commit must do: - Expand objects with "times" attribute > 1. Then match objects one to one, simply by calling combine(). - Rewrite unit tests to check different cases. - Rewrite/rebase commits depending on this one. -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 14:20:47 +0000 Subject: osmo-gsm-tester[master]: Convert scenarios to restrict all objects of a given type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 > - A: scenario is just a filter for a given type of object. It > doesn't apply for each object in particular as in a list, but just > a list of attributes to require for a given type of object. We need distinct attributes for each instance of an object. With A, e.g., I can only have one BTS item, so I can't select "one sysmo, one trx, please". > - B: Scenario is a real object-to-object specific match. That > means, if you have a suite.conf with 2 BTS, then you need to pass a > scenario which is written in a way to explicitly set attribute for > 2 BTS. Yes, that is the plan. The idea is to have a scenario "first_bts_is_sysmo_and_second_is_trx.conf' and be able to reverse that too. This is only possible with a list of dicts. Could be seen as a disadvantage to need distinct configs for multi-BTS cases, but that was the plan from the start (it's a feature). -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:26:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 14:26:19 +0000 Subject: osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) (decide and +2 for yourself please, if you wish) https://gerrit.osmocom.org/#/c/3815/2/selftest/template_test/osmo-nitb.cfg.tmpl File selftest/template_test/osmo-nitb.cfg.tmpl: Line 27 If we keep the 'a5' in here, we can leave 'encryption' as an integer and bypass the discussion about underscores, translation to vty format. I don't really have a strong opinion, you can merge this as far as I'm concerned. (Otherwise we need some adjustment in the other encryption patch) -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:27:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 14:27:10 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:36:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 14:36:06 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3722/3/selftest/config_test.ok File selftest/config_test.ok: Line 113: {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} > what do you mean? If you only want to restrict the second one, use trx_list ah of course, two separate trx -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:41:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 14:41:22 +0000 Subject: osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Patch Set 2: I don't expect to spend more time changing this kind of details for this specific feature. It works as it is now. If anyone wants to change it later so it fits better some specific criteria, I'll be welcome to review it. In any case, afair this depends on other patches on this branch, so let's wait until I rework other commits in the branch to merge it. -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:45:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 14:45:50 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: re-arrange code In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#10). Simplify TS alloc: re-arrange code * consistently format log messages to make it possible to grep for test output in source code * move TRX check inside local tfi_find_free() wrapper * assign reserved_*_slots only when multislot masks are found Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 21 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/10 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c5b398f..bcac45f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -248,9 +248,7 @@ if (free_tfi) { tfi = find_free_tfi(pdch, dir); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -258,26 +256,20 @@ if (dir == GPRS_RLCMAC_UL_TBF) { usf = find_free_usf(pdch); if (usf < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -374,7 +366,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -386,6 +378,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -920,20 +921,10 @@ return -EINVAL; } - reserved_dl_slots = dl_slots = ms->reserved_dl_slots(); - reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); @@ -950,11 +941,11 @@ rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; - - reserved_dl_slots = dl_slots; - reserved_ul_slots = ul_slots; } + reserved_dl_slots = dl_slots; + reserved_ul_slots = ul_slots; + /* Step 3: Derive the slot set for the current TBF */ if (single) { /* Make sure to consider the first common slot only */ -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:45:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 14:45:50 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3905 to look at the new patch set (#2). Simplify TS alloc: move slot assignment Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 75 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 47a892d..c5b398f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -811,6 +811,76 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", + set_flag_chars(set_flag_chars(set_flag_chars(slot_info, dl_slots, 'D', '.'), ul_slots, 'U'), + ul_slots & dl_slots, 'C')); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -993,51 +1063,16 @@ * may be modified from now on. */ /* Step 4: Update MS and TBF and really allocate the resources */ - - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:45:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 14:45:50 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split allocation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3906 to look at the new patch set (#2). Simplify TS alloc: split allocation * generalize TS allocation and move it into separate function * move single-slot allocation into separate function * use common functions for TS allocation on both UL and DL Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 101 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3906/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index bcac45f..70890fc 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -882,6 +882,93 @@ } } +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return ffs(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] ul_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \returns negative error code or selected TS on success + */ +static int tbf_select_slot_set(const gprs_rlcmac_tbf *tbf, const gprs_rlcmac_trx *trx, bool single, + uint8_t ul_slots, uint8_t dl_slots, + uint8_t reserved_ul_slots, uint8_t reserved_dl_slots, + int8_t first_common_ts) +{ + uint8_t sl; + int ts = first_common_ts; + char *dir, *abrev, slot_info[9] = { 0 }, small, big; + + if (tbf->direction != GPRS_RLCMAC_DL_TBF) { + sl = ul_slots; + small = 'u'; + big = 'U'; + dir = (char *)"uplink"; + abrev = (char *)"UL"; + } else { + sl = dl_slots; + small = 'd'; + big = 'D'; + dir = (char *)"downlink"; + abrev = (char *)"DL"; + } + + if (single) + sl = get_single_ts(trx, tbf, dl_slots, ul_slots, &ts); + + if (sl == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No %s slots available\n", dir); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected %s slots: (TS=0)\"%s\"(TS=7)%s\n", abrev, + set_flag_chars(set_flag_chars(slot_info, reserved_dl_slots, small, '.'), sl, big), + single ? ", single" : ""); + + return sl; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -904,7 +991,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; @@ -946,86 +1032,43 @@ reserved_dl_slots = dl_slots; reserved_ul_slots = ul_slots; - /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + dl_slots = rc; + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { int free_usf = -1; + + ul_slots = rc; if (first_common_ts >= 0) ul_slots = 1 << first_common_ts; else ul_slots = ul_slots & dl_slots; - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); if (free_usf < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); return -EBUSY; } + OSMO_ASSERT(ts >= 0 && ts <= 8); + /* We will stick to that single UL slot, unreserve the others */ ul_slots = 1 << ts; usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; - - /* We will stick to that single UL slot, unreserve the others */ reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } first_common_ts = ffs(dl_slots & ul_slots) - 1; -- To view, visit https://gerrit.osmocom.org/3906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 14:45:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 14:45:50 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#7). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes * use consistent formatting for output * log essential allocation parameters on failure Changes to tests are combined with logging messages update to separate code and test changes over different commits to avoid regressions. Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/tbf/TbfTest.err 6 files changed, 3,287 insertions(+), 3,289 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/7 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 11 15:30:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 15:30:03 +0000 Subject: osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: Patch Set 2: We can already grep osmo-msc stderr to assert no accept and one reject, without adding external dependencies. But in general if we're adding pcap grepping anyway, we might as well grep the pcap here, too. -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 15:31:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 11 Sep 2017 15:31:01 +0000 Subject: [MERGED] libosmo-sccp[master]: vty: add 'asp' / 'local-ip' command In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: add 'asp' / 'local-ip' command ...................................................................... vty: add 'asp' / 'local-ip' command We can set the ASP's remote IP (i.e. where to reach osmo-stp), but so far the only way to specify the local IP address to bind to can only be set from C code (e.g. the simple client). Allow setting the local address via VTY. For example, this is desired for the osmo-gsm-tester, to not use arbitrary IP addresses. Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d --- M src/osmo_ss7_vty.c 1 file changed, 13 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 1fb35a1..8d13865 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -556,6 +556,16 @@ return CMD_SUCCESS; } +DEFUN(asp_local_ip, asp_local_ip_cmd, + "local-ip A.B.C.D", + "Specify Local IP Address from which to contact ASP\n" + "Local IP Address from which to contact of ASP\n") +{ + struct osmo_ss7_asp *asp = vty->index; + osmo_talloc_replace_string(asp, &asp->cfg.local.host, argv[0]); + return CMD_SUCCESS; +} + DEFUN(asp_remote_ip, asp_remote_ip_cmd, "remote-ip A.B.C.D", "Specify Remote IP Address of ASP\n" @@ -633,6 +643,8 @@ osmo_ss7_asp_protocol_name(asp->cfg.proto), VTY_NEWLINE); if (asp->cfg.description) vty_out(vty, " description %s%s", asp->cfg.description, VTY_NEWLINE); + if (asp->cfg.local.host) + vty_out(vty, " local-ip %s%s", asp->cfg.local.host, VTY_NEWLINE); if (asp->cfg.remote.host) vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); if (asp->cfg.qos_class) @@ -1728,6 +1740,7 @@ install_element(L_CS7_NODE, &no_cs7_asp_cmd); install_element(L_CS7_ASP_NODE, &cfg_description_cmd); install_element(L_CS7_ASP_NODE, &asp_remote_ip_cmd); + install_element(L_CS7_ASP_NODE, &asp_local_ip_cmd); install_element(L_CS7_ASP_NODE, &asp_qos_class_cmd); install_element(L_CS7_ASP_NODE, &asp_block_cmd); install_element(L_CS7_ASP_NODE, &asp_shutdown_cmd); -- To view, visit https://gerrit.osmocom.org/3826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 11 16:11:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 16:11:26 +0000 Subject: openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3900/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 718: sms->smpp.esme = esme; > check that we're not overwriting sms->smpp.esme if it is already set? (i.e Please, if you carefully review the codepath you will notice that is always unset... However, you vote this with -1 and this is blocking a real fix, something that Keith confirms that is solving a real problem there. I don't want to add this superfluous check, it's better to agree on semantics, not just add a branch there because maybe someone else make a sloppy use of this in the future... Stop forcing people to do overly defensive programming, just because you are scared. Or develop your real concerns, instead of nacking work from others with poor arguments. Thank you. -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 16:51:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 16:51:35 +0000 Subject: libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Patch Set 3: Thanks for reviewing Pau! BTW, it seems Jenkins is experiencing problems? By reading the console output it looks the build failed for reasons other than this patch. -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 17:14:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 17:14:04 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split allocation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3906 to look at the new patch set (#3). Simplify TS alloc: split allocation * generalize TS allocation and move it into separate function * move single-slot allocation into separate function * use common functions for TS allocation on both UL and DL Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 103 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3906/3 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index bcac45f..3d490c9 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -882,6 +882,95 @@ } } +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in,out] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int *ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (*ts < 0) + *ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (*ts < 0) + return ffs(ret); + + return ret & (1 << (*ts)); +} + +/*! Find set of timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] ul_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \returns negative error code or selected TS on success + */ +static int tbf_select_slot_set(const gprs_rlcmac_tbf *tbf, const gprs_rlcmac_trx *trx, bool single, + uint8_t ul_slots, uint8_t dl_slots, + uint8_t reserved_ul_slots, uint8_t reserved_dl_slots, + int8_t first_common_ts) +{ + uint8_t sl, res; + int ts = first_common_ts; + char *dir, *abrev, slot_info[9] = { 0 }, small, big; + + if (tbf->direction != GPRS_RLCMAC_DL_TBF) { + sl = ul_slots; + res = reserved_ul_slots; + small = 'u'; + big = 'U'; + dir = (char *)"uplink"; + abrev = (char *)"UL"; + } else { + sl = dl_slots; + res = reserved_dl_slots; + small = 'd'; + big = 'D'; + dir = (char *)"downlink"; + abrev = (char *)"DL"; + } + + if (single) + sl = get_single_ts(trx, tbf, dl_slots, ul_slots, &ts); + + if (sl == 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No %s slots available\n", dir); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "- Selected %s slots: (TS=0)\"%s\"(TS=7)%s\n", abrev, + set_flag_chars(set_flag_chars(slot_info, res, small, '.'), sl, big), + single ? ", single" : ""); + + return sl; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -904,7 +993,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; @@ -946,86 +1034,43 @@ reserved_dl_slots = dl_slots; reserved_ul_slots = ul_slots; - /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + dl_slots = rc; + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { int free_usf = -1; + + ul_slots = rc; if (first_common_ts >= 0) ul_slots = 1 << first_common_ts; else ul_slots = ul_slots & dl_slots; - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); if (free_usf < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); return -EBUSY; } + OSMO_ASSERT(ts >= 0 && ts <= 8); + /* We will stick to that single UL slot, unreserve the others */ ul_slots = 1 << ts; usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; - - /* We will stick to that single UL slot, unreserve the others */ reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } first_common_ts = ffs(dl_slots & ul_slots) - 1; -- To view, visit https://gerrit.osmocom.org/3906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 11 17:14:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 11 Sep 2017 17:14:04 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#8). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes * use consistent formatting for output * log essential allocation parameters on failure Changes to tests are combined with logging messages update to separate code and test changes over different commits to avoid regressions. Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/tbf/TbfTest.err 6 files changed, 3,287 insertions(+), 3,289 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/8 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 11 17:44:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 17:44:27 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers In-Reply-To: References: Message-ID: Patch Set 1: OK. So these are the two cases that we could improve: 1) snprintf() returns -1, very much unlikely in practise. 2) msg->len == 0: In such case, I would expect this function is never called with an empty message... Frankly speaking, is there any realistic setup on your side that you believe may bite the dust because of these two overly corner cases? -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:07:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:07:04 +0000 Subject: libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:10:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:10:15 +0000 Subject: openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3900/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 718: sms->smpp.esme = esme; > Please, if you carefully review the codepath you will notice that is always Pablo, please calm down. We're all friends here. I agree with neels that it is not obvious in the current code that the callers never have set sms->smpp.esme before, particularly as the sms pointer is passed in by callers. Any later updates / extension of the code might introduce subbtle refcount leaks here, At least, I would argue for a OSMO_ASSERT(!sms->smpp.esme) before the assignment. This way, if caller code ever changes, we get a proper failure rather than a refcount leak. -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:11:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:11:31 +0000 Subject: libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Patch Set 4: > BTW, it seems Jenkins is experiencing problems? For some reason, our primary build host was down due to repeated kernel oopses earlier today. I've rebooted it, it's working again. You need to cherry-pick the patch to trigger a re-build (which i just did) -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:13:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:13:01 +0000 Subject: osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:13:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:13:18 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:13:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:13:31 +0000 Subject: osmo-pcu[master]: TS alloc: properly count UL slots In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2705405119421da3066c6c6bdd5830df4c133a36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:14:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:14:08 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:15:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 18:15:04 +0000 Subject: [PATCH] openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3900 to look at the new patch set (#2). libmsc: annotate esme route in the sms object from deliver_to_esme() Annotate this esme route, so we can use it to return -EINPROGRESS to skip sending premature RP-ACK to the mobile station, in case we're handling sms routes through SMPP. Now that we have this information in place, we use it wherever possible to avoid kludgy checks on sms->receiver. sms_free() already releases references to this object, so we should be fine with this. Fixes: 4e5b90a594f9 ("libmsc: remove 'deferred' parameter in sms_route_mt_sms()") Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c 2 files changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/00/3900/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ad788f2..98c362f 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -520,7 +520,10 @@ rc = sms_route_mt_sms(conn, gsms); - /* This SMS got routed through SMPP or no receiver exists. */ + /* This SMS got routed through SMPP. */ + if (gsms->smpp.esme) + return -EINPROGRESS; + if (!gsms->receiver) return rc; @@ -614,8 +617,10 @@ return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); - else - return rc; + else if (rc == -EINPROGRESS) + rc = 0; + + return rc; } /* Receive a 04.11 RP-DATA message in accordance with Section 7.3.1.2 */ diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index af2d1be..3fe2dfd 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -714,6 +714,10 @@ if (ret < 0) return ret; + OSMO_ASSERT(!sms->smpp.esme); + smpp_esme_get(esme); + sms->smpp.esme = esme; + return smpp_cmd_enqueue(esme, conn->subscr, sms, deliver.sequence_number); } -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 11 Sep 2017 18:17:21 +0000 Subject: [ABANDON] openbsc[master]: libmsc: Either route report to ESME or send it, not both In-Reply-To: References: Message-ID: Keith Whyte has abandoned this change. Change subject: libmsc: Either route report to ESME or send it, not both ...................................................................... Abandoned https://gerrit.osmocom.org/#/c/3899/ is dealing with this correctly -- To view, visit https://gerrit.osmocom.org/3885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I8e86a34f5d3087c9c25479192d9a690922113da2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:17:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 18:17:51 +0000 Subject: [MERGED] libosmo-netif[master]: osmux: fix buffer management mess in snprintf() calls In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: osmux: fix buffer management mess in snprintf() calls ...................................................................... osmux: fix buffer management mess in snprintf() calls SNPRINTF_BUFFER_SIZE() looks too complex, previous version maintains two different variables to account for the remaining space in the buffer, one of them is always decremented based on what snprintf() returns, which may result in underflow. These variables are swapped - not used consistently - all over this code. Replace this macro by a simplified version, with one single parameter to account for remaining space. This macro also deals with two corner cases: 1) snprintf() fails, actually never happens in practise, but documentation indicates it may return -1, so let's catch this case from here to stick to specs. 2) There is not enough space in the buffer, in that case, keep increasing offset, so we know how much would have been printed, just like snprintf() does. Thanks to Pau Espin for reporting, and Holger for clues on this. I have run osmux_test and, at quick glance, it looks good. Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 --- M src/osmux.c M src/rtp.c M tests/osmux/osmux_test.c 3 files changed, 44 insertions(+), 45 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmux.c b/src/osmux.c index b3c43e2..b18246f 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -846,19 +846,20 @@ h->rtp_ssrc = rtp_ssrc; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size -= ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; static int osmux_snprintf_header(char *buf, size_t size, struct osmux_hdr *osmuxh) { + unsigned int remain = size, offset = 0; int ret; - int len = size, offset = 0; - ret = snprintf(buf, len, "OSMUX seq=%03u ccid=%03u " + ret = snprintf(buf, remain, "OSMUX seq=%03u ccid=%03u " "ft=%01u ctr=%01u " "amr_f=%01u amr_q=%01u " "amr_ft=%02u amr_cmr=%02u ", @@ -866,7 +867,7 @@ osmuxh->ft, osmuxh->ctr, osmuxh->amr_f, osmuxh->amr_q, osmuxh->amr_ft, osmuxh->amr_cmr); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } @@ -874,19 +875,19 @@ static int osmux_snprintf_payload(char *buf, size_t size, const uint8_t *payload, int payload_len) { + unsigned int remain = size, offset = 0; int ret, i; - int len = size, offset = 0; - ret = snprintf(buf+offset, len, "[ "); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "[ "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); for (i=0; ilen, len = size; - struct osmux_hdr *osmuxh; + unsigned int remain = size; int this_len, msg_off = 0; + struct osmux_hdr *osmuxh; + unsigned int offset = 0; + int msg_len = msg->len; + int ret; while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { @@ -915,10 +917,8 @@ return -1; } - ret = osmux_snprintf_header(buf+offset, size, osmuxh); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = osmux_snprintf_header(buf + offset, remain, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); this_len = sizeof(struct osmux_hdr) + osmux_get_payload_len(osmuxh); @@ -931,12 +931,10 @@ return -1; } - ret = osmux_snprintf_payload(buf+offset, size, + ret = osmux_snprintf_payload(buf + offset, remain, osmux_get_payload(osmuxh), osmux_get_payload_len(osmuxh)); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); msg_len -= this_len; } diff --git a/src/rtp.c b/src/rtp.c index 44fc217..56fc37c 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -185,19 +185,20 @@ return msg; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size += ret; \ - if (ret > len) \ - ret = len; \ +#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \ + if (ret < 0) \ + ret = 0; \ offset += ret; \ - len -= ret; + if (ret > remain) \ + ret = remain; \ + remain -= ret; int osmo_rtp_snprintf(char *buf, size_t size, struct msgb *msg) { + unsigned int remain = size, offset = 0; struct rtp_hdr *rtph; - int ret, i; uint8_t *payload; - unsigned int len = size, offset = 0; + int ret, i; rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) @@ -205,22 +206,22 @@ payload = (uint8_t *)rtph + sizeof(struct rtp_hdr); - ret = snprintf(buf, len, "RTP ver=%01u ssrc=%u type=%02u " + ret = snprintf(buf, remain, "RTP ver=%01u ssrc=%u type=%02u " "marker=%01u ext=%01u csrc_count=%01u " "sequence=%u timestamp=%u [", rtph->version, ntohl(rtph->ssrc), rtph->payload_type, rtph->marker, rtph->extension, rtph->csrc_count, ntohs(rtph->sequence), ntohl(rtph->timestamp)); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); for (i=0; ilen - sizeof(struct rtp_hdr); i++) { - ret = snprintf(buf+offset, len, "%02x ", payload[i]); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "%02x ", payload[i]); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); } - ret = snprintf(buf+offset, len, "]"); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + offset, remain, "]"); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; } diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c index bf6174b..09b7a9a 100644 --- a/tests/osmux/osmux_test.c +++ b/tests/osmux/osmux_test.c @@ -65,8 +65,8 @@ static void tx_cb(struct msgb *msg, void *data) { - char buf[4096]; struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data; + char buf[4096]; #if OSMUX_TEST_USE_TIMING struct timeval now, diff; @@ -102,9 +102,9 @@ static void osmux_deliver(struct msgb *batch_msg, void *data) { - char buf[2048]; struct osmux_hdr *osmuxh; LLIST_HEAD(list); + char buf[2048]; osmux_snprintf(buf, sizeof(buf), batch_msg); fprintf(stderr, "OSMUX message (len=%d) %s\n", batch_msg->len, buf); @@ -182,11 +182,11 @@ static void osmux_test_loop(int ccid) { - struct msgb *msg; - char buf[1024]; struct rtp_hdr *rtph = (struct rtp_hdr *)rtp_pkt; - uint16_t seq; + struct msgb *msg; int i, j, k = 0; + char buf[1024]; + uint16_t seq; for (i = 1; i < 65; i++) { msg = msgb_alloc(1500, "test"); -- To view, visit https://gerrit.osmocom.org/3825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5b5d6ec57a02f57c23b1ae86dbd894bad28ea797 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:38:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 18:38:59 +0000 Subject: [PATCH] openbsc[master]: libmsc: sms_route_mt_sms() may return uninitialized return v... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3899 to look at the new patch set (#2). libmsc: sms_route_mt_sms() may return uninitialized return value If smpp_first is set off and there is a local receiver for this sms, then return 0. Without this patch, we return 'rc' which is uninitialized in the scenario that I'm describing above. Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/99/3899/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ddef444..eb0a8ae 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -363,31 +363,32 @@ /* determine gsms->receiver based on dialled number */ gsms->receiver = subscr_get_by_extension(conn->network->subscr_group, gsms->dst.addr); - if (!gsms->receiver) { -#ifdef BUILD_SMPP - /* Avoid a second look-up */ - if (smpp_first) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - } + if (gsms->receiver) + return 0; - rc = smpp_try_deliver(gsms, conn); - if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - } else if (rc < 0) { - LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", - subscr_name(conn->subscr), rc); - rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; - /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ - MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); - } -#else - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; +#ifdef BUILD_SMPP + /* Avoid a second look-up */ + if (smpp_first) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); -#endif + return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } + rc = smpp_try_deliver(gsms, conn); + if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); + } else if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", + subscr_name(conn->subscr), rc); + rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; + /* rc will be logged by gsm411_send_rp_error() */ + rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); + } +#else + rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); +#endif + return rc; } -- To view, visit https://gerrit.osmocom.org/3899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: laforge Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 11 Sep 2017 18:39:14 +0000 Subject: openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:41:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 18:41:18 +0000 Subject: openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Patch Set 4: Verified+1 -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:41:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 18:41:19 +0000 Subject: [MERGED] openbsc[master]: libmsc: annotate esme route in the sms object from deliver_t... In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: annotate esme route in the sms object from deliver_to_esme() ...................................................................... libmsc: annotate esme route in the sms object from deliver_to_esme() Annotate this esme route, so we can use it to return -EINPROGRESS to skip sending premature RP-ACK to the mobile station, in case we're handling sms routes through SMPP. Now that we have this information in place, we use it wherever possible to avoid kludgy checks on sms->receiver. sms_free() already releases references to this object, so we should be fine with this. Fixes: 4e5b90a594f9 ("libmsc: remove 'deferred' parameter in sms_route_mt_sms()") Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c 2 files changed, 12 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pablo Neira Ayuso: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ddef444..27bffc9 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -519,7 +519,10 @@ rc = sms_route_mt_sms(conn, gsms); - /* This SMS got routed through SMPP or no receiver exists. */ + /* This SMS got routed through SMPP. */ + if (gsms->smpp.esme) + return -EINPROGRESS; + if (!gsms->receiver) return rc; @@ -613,8 +616,10 @@ return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); - else - return rc; + else if (rc == -EINPROGRESS) + rc = 0; + + return rc; } /* Receive a 04.11 RP-DATA message in accordance with Section 7.3.1.2 */ diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index af2d1be..3fe2dfd 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -714,6 +714,10 @@ if (ret < 0) return ret; + OSMO_ASSERT(!sms->smpp.esme); + smpp_esme_get(esme); + sms->smpp.esme = esme; + return smpp_cmd_enqueue(esme, conn->subscr, sms, deliver.sequence_number); } -- To view, visit https://gerrit.osmocom.org/3900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8a8fd9bbb0d3b6aff7931e4bacbea99d000e484 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Sep 11 18:49:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 11 Sep 2017 18:49:06 +0000 Subject: openbsc[master]: libmsc: sms_route_mt_sms() may return uninitialized return v... In-Reply-To: References: Message-ID: Patch Set 2: Hm, Jenkins is complaining on VTY tests again. This patch doesn't update such bits. Any clue on what is wrong? Thanks! -- To view, visit https://gerrit.osmocom.org/3899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: laforge Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 11 20:18:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 11 Sep 2017 20:18:51 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers In-Reply-To: References: Message-ID: Patch Set 1: > OK. > > So these are the two cases that we could improve: > > 1) snprintf() returns -1, very much unlikely in practise. > 2) msg->len == 0: In such case, I would expect this function is > never called with an empty message... > > Frankly speaking, is there any realistic setup on your side that > you believe may bite the dust because of these two overly corner > cases? That's all I could find. If you want to spend time solving those, the go for it, otherwise it can already be merged as in any case it's better that what we currently have. But sticking to those cases and specs I'm just stating that you could get a crash by using this function. -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 02:39:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 12 Sep 2017 02:39:25 +0000 Subject: [PATCH] libosmocore[master]: osmo-auc-gen.c: squelch compiler warnings, move local var Message-ID: Review at https://gerrit.osmocom.org/3908 osmo-auc-gen.c: squelch compiler warnings, move local var The compiler thinks that ind or ind_mask may be used uninitialized, because it doesn't analyze the conditionality of command line arguments and other variables set accordingly. Make the compiler happy by zero initializing. Change-Id: I9ddcb0525159da520aceaeb6e908a735a003bb5a --- M utils/osmo-auc-gen.c 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/3908/1 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index fee9767..1f5c838 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -98,15 +98,14 @@ struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; uint64_t sqn; - unsigned int ind; + unsigned int ind = 0; int rc, option_index; int rand_is_set = 0; int auts_is_set = 0; int sqn_is_set = 0; int ind_is_set = 0; int fmt_triplets_dat = 0; - uint64_t seq_1; - uint64_t ind_mask; + uint64_t ind_mask = 0; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n"); @@ -270,7 +269,7 @@ memset(vec, 0, sizeof(*vec)); if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { - seq_1 = 1LL << test_aud.u.umts.ind_bitlen; + uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen; ind_mask = seq_1 - 1; if (sqn_is_set) { -- To view, visit https://gerrit.osmocom.org/3908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ddcb0525159da520aceaeb6e908a735a003bb5a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 12 02:54:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 12 Sep 2017 02:54:16 +0000 Subject: [PATCH] libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3880 to look at the new patch set (#2). VTY: implicit node exit by de-indenting, not parent lookup Note: This will break users' config files if they do not use consistent indenting. (see below for a definition of "consistent".) When reading VTY commands from a file, use indenting as means to implicitly exit child nodes. Do not look for commands in the parent node implicitly. The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the current node, but succeeds on the parent node. That is the mechanism by which our VTY config files do not need 'exit' at the end of each child node. We've hit problems with this in the following scenarios, which will show improved user experience after this patch: *) When both a parent and its child node have commands with identical names: cs7 instace 0 point-code 1.2.3 sccp-address osmo-msc point-code 0.0.1 If I put the parent's command below the child, it is still interpreted in the context of the child node: cs7 instace 0 sccp-address osmo-msc point-code 0.0.1 point-code 1.2.3 Though the indenting lets me assume I am setting the cs7 instance's global PC to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the 0.0.1. *) When a software change moves a VTY command from a child to a parent. Say 'timezone' moved from 'bts' to 'network' level: network timezone 1 2 Say a user still has an old config file with 'timezone' on the child level: network bts 0 timezone 1 2 trx 0 The user would expect an error message that 'timezone' is invalid on the 'bts' level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts' to the 'network' level, and instead says that the 'trx' command does not exist. Format: Consistent means that two adjacent indenting lines have the exact same indenting characters for the common length: Weird mix if you ask me, but correct and consistent: ROOT PARENT CHILD GRANDCHILD GRANDCHILD2 SIBLING Inconsistent: ROOT PARENT CHILD GRANDCHILD GRANDCHILD2 SIBLING Also, when going back to a parent level, the exact same indenting must be used as before in that node: Incorrect: ROOT PARENT CHILD SIBLING As not really intended side effect, it is also permitted to indent the entire file starting from the root level. We could guard against it but there's no harm: Correct and consistent: ROOT PARENT CHILD SIBLING Implementation: Track parent nodes state: whenever a command enters a child node, push a parent node onto an llist to remember the exact indentation characters used for that level. As soon as the first line on a child node is parsed, remember this new indentation (which must have a longer strlen() than its parent level) to apply to all remaining child siblings and grandchildren. If the amount of spaces that indent a following VTY command are less than this expected indentation, call vty_go_parent() until it matches up. At any level, if the common length of indentation characters mismatch, abort parsing in error. Transitions to child node are spread across VTY implementations and are hard to change. But transitions to the parent node are all handled by vty_go_parent(). By popping a parent from the list of parents in vty_go_parent(), we can also detect that a command has changed the node without changing the parent, hence it must have stepped into a child node, and we can push a parent frame. The behavior on the interactive telnet VTY remains unchanged. Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 --- M include/osmocom/vty/command.h M include/osmocom/vty/vty.h M src/vty/command.c M src/vty/vty.c M tests/Makefile.am M tests/testsuite.at A tests/vty/fail_not_de-indented.cfg A tests/vty/fail_tabs_and_spaces.cfg A tests/vty/fail_too_much_indent.cfg A tests/vty/ok.cfg A tests/vty/ok_ignore_blank.cfg A tests/vty/ok_ignore_comment.cfg A tests/vty/ok_indented_root.cfg A tests/vty/ok_more_spaces.cfg A tests/vty/ok_tabs.cfg A tests/vty/ok_tabs_and_spaces.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 18 files changed, 312 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/3880/2 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0fa5175..cb2edaa 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -161,6 +161,7 @@ #define CMD_COMPLETE_MATCH 8 #define CMD_COMPLETE_LIST_MATCH 9 #define CMD_SUCCESS_DAEMON 10 +#define CMD_ERR_INVALID_INDENT 11 /* Argc max counts. */ #define CMD_ARGC_MAX 256 @@ -368,6 +369,7 @@ char *argv_concat(const char **argv, int argc, int shift); vector cmd_make_strvec(const char *); +int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p); void cmd_free_strvec(vector); vector cmd_describe_command(); char **cmd_complete_command(); diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index 544e1fa..02ba03e 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -3,6 +3,8 @@ #include #include +#include + /*! \defgroup vty VTY (Virtual TTY) interface * @{ * \file vty.h */ @@ -43,6 +45,20 @@ VTY_FILE, VTY_SHELL, VTY_SHELL_SERV +}; + +struct vty_parent_node { + struct llist_head entry; + + /*! private data, specified by creator */ + void *priv; + + /*! Node status of this vty */ + int node; + + /*! When reading from a config file, these are the indenting characters expected for children of + * this VTY node. */ + char *indent; }; /*! Internal representation of a single VTY */ @@ -134,6 +150,13 @@ /*! In configure mode. */ int config; + + /*! List of parent nodes, last item is the outermost parent. */ + struct llist_head parent_nodes; + + /*! When reading from a config file, these are the indenting characters expected for children of + * the current VTY node. */ + char *indent; }; /* Small macro to determine newline is newline only or linefeed needed. */ diff --git a/src/vty/command.c b/src/vty/command.c index 52c7191..a65b4de 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -190,31 +190,56 @@ } } -/*! Breaking up string into each command piece. I assume given - character is separated by a space character. Return value is a - vector which includes char ** data element. */ -vector cmd_make_strvec(const char *string) +/*! Break up string in command tokens. Return leading indents. + * \param[in] string String to split. + * \param[out] indent If not NULL, return a talloc_strdup of indent characters. + * \param[out] strvec_p Returns vector of split tokens, must not be NULL. + * \returns CMD_SUCCESS or CMD_ERR_INVALID_INDENT + * + * If \a indent is passed non-NULL, only simple space ' ' indents are allowed, + * so that \a indent can simply return the count of leading spaces. + * Otherwise any isspace() characters are allowed for indenting (backwards compat). + */ +int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p) { const char *cp, *start; char *token; int strlen; vector strvec; + *strvec_p = NULL; + if (indent) + *indent = 0; + if (string == NULL) - return NULL; + return CMD_SUCCESS; cp = string; /* Skip white spaces. */ - while (isspace((int)*cp) && *cp != '\0') + while (isspace((int)*cp) && *cp != '\0') { + /* if we're counting indents, we need to be strict about them */ + if (indent && (*cp != ' ') && (*cp != '\t')) { + /* Ignore blank lines, they appear as leading whitespace with line breaks. */ + if (*cp == '\n' || *cp == '\r') { + cp++; + string = cp; + continue; + } + return CMD_ERR_INVALID_INDENT; + } cp++; + } + + if (indent) + *indent = talloc_strndup(tall_vty_cmd_ctx, string, cp - string); /* Return if there is only white spaces */ if (*cp == '\0') - return NULL; + return CMD_SUCCESS; if (*cp == '!' || *cp == '#') - return NULL; + return CMD_SUCCESS; /* Prepare return vector. */ strvec = vector_init(VECTOR_MIN_SIZE); @@ -236,8 +261,21 @@ cp++; if (*cp == '\0') - return strvec; + break; } + + *strvec_p = strvec; + return CMD_SUCCESS; +} + +/*! Breaking up string into each command piece. I assume given + character is separated by a space character. Return value is a + vector which includes char ** data element. */ +vector cmd_make_strvec(const char *string) +{ + vector strvec; + cmd_make_strvec2(string, NULL, &strvec); + return strvec; } /*! Free allocated string vector. */ @@ -1947,6 +1985,33 @@ return cmd_complete_command_real(vline, vty, status); } +static struct vty_parent_node *vty_parent(struct vty *vty) +{ + return llist_first_entry_or_null(&vty->parent_nodes, + struct vty_parent_node, + entry); +} + +static bool vty_pop_parent(struct vty *vty) +{ + struct vty_parent_node *parent = vty_parent(vty); + if (!parent) + return false; + llist_del(&parent->entry); + vty->node = parent->node; + vty->priv = parent->priv; + if (vty->indent) + talloc_free(vty->indent); + vty->indent = parent->indent; + talloc_free(parent); + return true; +} + +static void vty_clear_parents(struct vty *vty) +{ + while (vty_pop_parent(vty)); +} + /* return parent node */ /* * This function MUST eventually converge on a node when called repeatedly, @@ -1969,24 +2034,33 @@ case VIEW_NODE: case ENABLE_NODE: case CONFIG_NODE: + vty_clear_parents(vty); break; case AUTH_ENABLE_NODE: vty->node = VIEW_NODE; + vty_clear_parents(vty); break; case CFG_LOG_NODE: case VTY_NODE: vty->node = CONFIG_NODE; + vty_clear_parents(vty); break; default: - if (host.app_info->go_parent_cb) + if (host.app_info->go_parent_cb) { host.app_info->go_parent_cb(vty); - else if (is_config_child(vty)) + vty_pop_parent(vty); + } + else if (is_config_child(vty)) { vty->node = CONFIG_NODE; - else + vty_clear_parents(vty); + } + else { vty->node = VIEW_NODE; + vty_clear_parents(vty); + } break; } @@ -2252,36 +2326,130 @@ return (*matched_element->func) (matched_element, vty, argc, argv); } +static inline size_t len(const char *str) +{ + return str? strlen(str) : 0; +} + +static int indent_cmp(const char *a, const char *b) +{ + size_t al, bl; + al = len(a); + bl = len(b); + if (al > bl) { + if (bl && strncmp(a, b, bl) != 0) + return EINVAL; + return 1; + } + /* al <= bl */ + if (al && strncmp(a, b, al) != 0) + return EINVAL; + return (al < bl)? -1 : 0; +} + /* Configration make from file. */ int config_from_file(struct vty *vty, FILE * fp) { int ret; vector vline; + char *indent; + int cmp; + struct vty_parent_node this_node; + struct vty_parent_node *parent; while (fgets(vty->buf, VTY_BUFSIZ, fp)) { - vline = cmd_make_strvec(vty->buf); + indent = NULL; + vline = NULL; + ret = cmd_make_strvec2(vty->buf, &indent, &vline); - /* In case of comment line */ - if (vline == NULL) + if (ret != CMD_SUCCESS) + goto return_invalid_indent; + + /* In case of comment or empty line */ + if (vline == NULL) { + if (indent) { + talloc_free(indent); + indent = NULL; + } continue; - /* Execute configuration command : this is strict match */ - ret = cmd_execute_command_strict(vline, vty, NULL); - - /* Try again with setting node to CONFIG_NODE */ - while (ret != CMD_SUCCESS && ret != CMD_WARNING - && ret != CMD_ERR_NOTHING_TODO - && is_config_child(vty)) { - vty_go_parent(vty); - ret = cmd_execute_command_strict(vline, vty, NULL); } + /* We have a nonempty line. This might be the first on a deeper indenting level, so let's + * remember this indent if we don't have one yet. */ + if (!vty->indent) + vty->indent = talloc_strdup(vty, indent); + + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + + /* Less indent: go up the parent nodes to find matching amount of less indent. When this + * loop exits, we want to have found an exact match, i.e. cmp == 0. */ + while (cmp < 0) { + vty_go_parent(vty); + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + } + + /* More indent without having entered a child node level? Either the parent node's indent + * wasn't hit exactly (e.g. there's a space more than the parent level had further above) + * or the indentation increased even though the vty command didn't enter a child. */ + if (cmp > 0) + goto return_invalid_indent; + + /* Remember the current node before the command possibly changes it. */ + this_node = (struct vty_parent_node){ + .node = vty->node, + .priv = vty->priv, + .indent = vty->indent, + }; + + parent = vty_parent(vty); + ret = cmd_execute_command_strict(vline, vty, NULL); cmd_free_strvec(vline); if (ret != CMD_SUCCESS && ret != CMD_WARNING - && ret != CMD_ERR_NOTHING_TODO) + && ret != CMD_ERR_NOTHING_TODO) { + if (indent) { + talloc_free(indent); + indent = NULL; + } return ret; + } + + /* If we have stepped down into a child node, push a parent frame. + * The causality is such: we don't expect every single node entry implementation to push + * a parent node entry onto vty->parent_nodes. Instead we expect vty_go_parent() to *pop* + * a parent node. Hence if the node changed without the parent node changing, we must + * have stepped into a child node (and now expect a deeper indent). */ + if (vty->node != this_node.node && parent == vty_parent(vty)) { + /* Push the parent node. */ + parent = talloc_zero(vty, struct vty_parent_node); + *parent = this_node; + llist_add(&parent->entry, &vty->parent_nodes); + + /* The current talloc'ed vty->indent string will now be owned by this parent + * struct. Indicate that we don't know what deeper indent characters the user + * will choose. */ + vty->indent = NULL; + } + + if (indent) { + talloc_free(indent); + indent = NULL; + } } return CMD_SUCCESS; + +return_invalid_indent: + if (vline) + cmd_free_strvec(vline); + if (indent) { + talloc_free(indent); + indent = NULL; + } + return CMD_ERR_INVALID_INDENT; } /* Configration from terminal */ diff --git a/src/vty/vty.c b/src/vty/vty.c index 113a781..bd0d2c3 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -110,6 +110,8 @@ if (!new) goto out; + INIT_LLIST_HEAD(&new->parent_nodes); + new->obuf = buffer_new(new, 0); /* Use default buffer size. */ if (!new->obuf) goto out_new; @@ -1480,6 +1482,12 @@ case CMD_ERR_NO_MATCH: fprintf(stderr, "There is no such command.\n"); break; + case CMD_ERR_INVALID_INDENT: + fprintf(stderr, + "Inconsistent indentation -- leading whitespace must match adjacent lines, and\n" + "indentation must reflect child node levels. A mix of tabs and spaces is\n" + "allowed, but their sequence must not change within a child block.\n"); + break; } fprintf(stderr, "Error occurred during reading the below " "line:\n%s\n", vty->buf); diff --git a/tests/Makefile.am b/tests/Makefile.am index 37378fb..8526847 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -217,7 +217,9 @@ logging/logging_test.ok logging/logging_test.err \ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ - vty/vty_test.ok comp128/comp128_test.ok \ + vty/vty_test.ok vty/fail_not_de-indented.cfg \ + vty/fail_too_much_indent.cfg vty/ok.cfg \ + comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/testsuite.at b/tests/testsuite.at index f148cf5..1954e66 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -174,6 +174,7 @@ AT_SETUP([vty]) AT_KEYWORDS([vty]) cat $abs_srcdir/vty/vty_test.ok > expout +cp $abs_srcdir/vty/*.cfg . AT_CHECK([$abs_top_builddir/tests/vty/vty_test], [0], [expout], [ignore]) AT_CLEANUP diff --git a/tests/vty/fail_not_de-indented.cfg b/tests/vty/fail_not_de-indented.cfg new file mode 100644 index 0000000..5af833d --- /dev/null +++ b/tests/vty/fail_not_de-indented.cfg @@ -0,0 +1,3 @@ +line vty + no login + log stderr diff --git a/tests/vty/fail_tabs_and_spaces.cfg b/tests/vty/fail_tabs_and_spaces.cfg new file mode 100644 index 0000000..fa6ce05 --- /dev/null +++ b/tests/vty/fail_tabs_and_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/fail_too_much_indent.cfg b/tests/vty/fail_too_much_indent.cfg new file mode 100644 index 0000000..bacb3e1 --- /dev/null +++ b/tests/vty/fail_too_much_indent.cfg @@ -0,0 +1,3 @@ +line vty + no login + log stderr diff --git a/tests/vty/ok.cfg b/tests/vty/ok.cfg new file mode 100644 index 0000000..d5ef23e --- /dev/null +++ b/tests/vty/ok.cfg @@ -0,0 +1,3 @@ +line vty + no login +log stderr diff --git a/tests/vty/ok_ignore_blank.cfg b/tests/vty/ok_ignore_blank.cfg new file mode 100644 index 0000000..d16ff64 --- /dev/null +++ b/tests/vty/ok_ignore_blank.cfg @@ -0,0 +1,7 @@ +line vty + + no login + + no login + +log stderr diff --git a/tests/vty/ok_ignore_comment.cfg b/tests/vty/ok_ignore_comment.cfg new file mode 100644 index 0000000..5813fc7 --- /dev/null +++ b/tests/vty/ok_ignore_comment.cfg @@ -0,0 +1,7 @@ +line vty + ! comment + no login +! comment + no login + ! comment +log stderr diff --git a/tests/vty/ok_indented_root.cfg b/tests/vty/ok_indented_root.cfg new file mode 100644 index 0000000..313c674 --- /dev/null +++ b/tests/vty/ok_indented_root.cfg @@ -0,0 +1,3 @@ + line vty + no login + log stderr diff --git a/tests/vty/ok_more_spaces.cfg b/tests/vty/ok_more_spaces.cfg new file mode 100644 index 0000000..b66a9c2 --- /dev/null +++ b/tests/vty/ok_more_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/ok_tabs.cfg b/tests/vty/ok_tabs.cfg new file mode 100644 index 0000000..e94609b --- /dev/null +++ b/tests/vty/ok_tabs.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/ok_tabs_and_spaces.cfg b/tests/vty/ok_tabs_and_spaces.cfg new file mode 100644 index 0000000..2049b73 --- /dev/null +++ b/tests/vty/ok_tabs_and_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index d84bf41..eba9995 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -288,6 +289,15 @@ destroy_test_vty(&test, vty); } +void test_exit_by_indent(const char *fname, int expect_rc) +{ + int rc; + printf("reading file %s, expecting rc=%d\n", fname, expect_rc); + rc = vty_read_config_file(fname, NULL); + printf("got rc=%d\n", rc); + OSMO_ASSERT(rc == expect_rc); +} + int main(int argc, char **argv) { struct vty_app_info vty_info = { @@ -322,6 +332,16 @@ test_cmd_string_from_valstr(); test_node_tree_structure(); test_stats_vty(); + test_exit_by_indent("ok.cfg", 0); + test_exit_by_indent("ok_more_spaces.cfg", 0); + test_exit_by_indent("ok_tabs.cfg", 0); + test_exit_by_indent("ok_tabs_and_spaces.cfg", 0); + test_exit_by_indent("ok_ignore_comment.cfg", 0); + test_exit_by_indent("ok_ignore_blank.cfg", 0); + test_exit_by_indent("fail_not_de-indented.cfg", -EINVAL); + test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); + test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); + test_exit_by_indent("ok_indented_root.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index 2b6d5a6..b2df1a1 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -108,4 +108,24 @@ Returned: 0, Current node: 4 '%s(config)# ' Going to execute 'no stats reporter statsd' Returned: 0, Current node: 4 '%s(config)# ' +reading file ok.cfg, expecting rc=0 +got rc=0 +reading file ok_more_spaces.cfg, expecting rc=0 +got rc=0 +reading file ok_tabs.cfg, expecting rc=0 +got rc=0 +reading file ok_tabs_and_spaces.cfg, expecting rc=0 +got rc=0 +reading file ok_ignore_comment.cfg, expecting rc=0 +got rc=0 +reading file ok_ignore_blank.cfg, expecting rc=0 +got rc=0 +reading file fail_not_de-indented.cfg, expecting rc=-22 +got rc=-22 +reading file fail_too_much_indent.cfg, expecting rc=-22 +got rc=-22 +reading file fail_tabs_and_spaces.cfg, expecting rc=-22 +got rc=-22 +reading file ok_indented_root.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 12 02:54:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 12 Sep 2017 02:54:16 +0000 Subject: [PATCH] libosmocore[master]: VTY: allow comments in the same line as vty commands In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3882 to look at the new patch set (#2). VTY: allow comments in the same line as vty commands Note: this breaks users' VTY config when a command's argument starts with a '!' or '#'. Allow comments following VTY commands, on the same line. Start a comment with '!' or '#' following a space, which allows using the comment characters in command arguments -- just not at the start of an argument. This patch allows to do: remote-ip 10.23.24.1 # where to reach the STP When they are not preceded by a space, the comment characters still count as VTY command tokens, i.e. still allowing: short-name instance#23 This would parse "instance#23" as name. (We usually use '!' as the VTY comment delimiter, but the code also allowed and still allows using '#', hence add both '#' and '!' as same-line comment delimiter.) Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_comments.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/3882/2 diff --git a/src/vty/command.c b/src/vty/command.c index a65b4de..0f5538a 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -246,6 +246,9 @@ /* Copy each command piece and set into vector. */ while (1) { + if (*cp == '!' || *cp == '#') + break; + start = cp; while (!(isspace((int)*cp) || *cp == '\r' || *cp == '\n') && *cp != '\0') diff --git a/tests/Makefile.am b/tests/Makefile.am index 8526847..5a124c1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -218,7 +218,8 @@ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ vty/vty_test.ok vty/fail_not_de-indented.cfg \ - vty/fail_too_much_indent.cfg vty/ok.cfg \ + vty/fail_too_much_indent.cfg vty/ok.cfg \ + vty/ok_comments.cfg \ comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ diff --git a/tests/vty/ok_comments.cfg b/tests/vty/ok_comments.cfg new file mode 100644 index 0000000..c040892 --- /dev/null +++ b/tests/vty/ok_comments.cfg @@ -0,0 +1,3 @@ +line vty ! comments + no login # after +log stderr #commands diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index eba9995..27e5b5c 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -342,6 +342,7 @@ test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); test_exit_by_indent("ok_indented_root.cfg", 0); + test_exit_by_indent("ok_comments.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index b2df1a1..a09e7ef 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -128,4 +128,6 @@ got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 got rc=0 +reading file ok_comments.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 12 09:34:42 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 09:34:42 +0000 Subject: [PATCH] openbsc[master]: libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp... Message-ID: Review at https://gerrit.osmocom.org/3909 libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp_ack This patch just makes the log match chronologically what is happening. We receive the deliver_sm_resp before we send the RP ACK to the MS. Change-Id: I29270652957f58093be8bf7f2e898b0b4933bd93 --- M openbsc/src/libmsc/smpp_smsc.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/09/3909/1 diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 04afc49..83c29f6 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -688,14 +688,14 @@ return -1; } + LOGP(DSMPP, LOGL_INFO, "[%s] Rx DELIVER-SM RESP (%s)\n", + esme->system_id, get_value_string(smpp_status_strs, + deliver_r.command_status)); + if (deliver_r.command_status == ESME_ROK) smpp_cmd_ack(cmd); else smpp_cmd_err(cmd, deliver_r.command_status); - - LOGP(DSMPP, LOGL_INFO, "[%s] Rx DELIVER-SM RESP (%s)\n", - esme->system_id, get_value_string(smpp_status_strs, - deliver_r.command_status)); return 0; } -- To view, visit https://gerrit.osmocom.org/3909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29270652957f58093be8bf7f2e898b0b4933bd93 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Tue Sep 12 09:58:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 09:58:59 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: re-arrange code In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#11). Simplify TS alloc: re-arrange code * consistently format log messages to make it possible to grep for test output in source code * move TRX check inside local tfi_find_free() wrapper * assign reserved_*_slots only when multislot masks are found Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 38 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/11 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c5b398f..831d975 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -248,9 +248,7 @@ if (free_tfi) { tfi = find_free_tfi(pdch, dir); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -258,26 +256,20 @@ if (dir == GPRS_RLCMAC_UL_TBF) { usf = find_free_usf(pdch); if (usf < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -374,7 +366,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -386,6 +378,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -532,17 +533,14 @@ if (ms->ms_class()) { ms_class = &gprs_ms_multislot_class[ms->ms_class()]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "class %d\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", ms->ms_class()); } else { ms_class = &gprs_ms_multislot_class[12]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "unknown class (assuming 12)\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for unknown class (assuming 12)\n"); } if (ms_class->tx == MS_NA) { - LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not " - "applicable.\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not applicable.\n", ms->ms_class()); return -EINVAL; } @@ -569,8 +567,7 @@ if (Trb == MS_C) Trb = 1; - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d " - " Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, + LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, (Sum == MS_NA) ? "N/A" : digit[Sum], (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); @@ -674,12 +671,11 @@ rx_slot_count = pcu_bitcount(rx_window); #if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, tx=%02x, rx=%02x, mask=%02x, bad=%02x, " + "good=%02x, ul=%02x, dl=%02x\n", + tx_slot_count, rx_slot_count, mask_sel, + tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, + *ul_slots, *dl_slots); #endif /* Check compliance with TS 45.002, table 6.4.2.2.1 */ @@ -704,9 +700,8 @@ /* No supported row in table 6.4.2.2.1. */ #ifdef ENABLE_TS_ALLOC_DEBUG LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), combination not supported\n", + set_flag_chars(set_flag_chars(set_flag_chars( slot_info, rx_bad, 'x', '.'), rx_window, 'D'), @@ -722,10 +717,8 @@ if (!rx_good) { #ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), no DL slots available\n", + set_flag_chars(set_flag_chars(slot_info, rx_bad, 'x', '.'), tx_window, 'U')); #endif @@ -744,9 +737,8 @@ if (req_common_slots != common_slot_count) { #ifdef ENABLE_TS_ALLOC_DEBUG LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), invalid number of common TS: %d (expected %d)\n", + set_flag_chars(set_flag_chars(set_flag_chars( slot_info, rx_bad, 'x', '.'), rx_window, 'D'), @@ -780,9 +772,8 @@ #ifdef ENABLE_TS_ALLOC_DEBUG LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( + "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), capacity = %d\n", + set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( slot_info, rx_bad, 'x', '.'), rx_window, 'D'), @@ -920,20 +911,10 @@ return -EINVAL; } - reserved_dl_slots = dl_slots = ms->reserved_dl_slots(); - reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); @@ -950,11 +931,11 @@ rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; - - reserved_dl_slots = dl_slots; - reserved_ul_slots = ul_slots; } + reserved_dl_slots = dl_slots; + reserved_ul_slots = ul_slots; + /* Step 3: Derive the slot set for the current TBF */ if (single) { /* Make sure to consider the first common slot only */ -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 11 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 12 10:15:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 10:15:13 +0000 Subject: [MERGED] osmo-pcu[master]: TS alloc: properly count UL slots In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TS alloc: properly count UL slots ...................................................................... TS alloc: properly count UL slots Add cycle to mark multiple allocated UL slots similar to the way we count DL slots in AllocTest. Until multislot UL allocation is implemented it does not affect test output. Change-Id: I2705405119421da3066c6c6bdd5830df4c133a36 Related: OS#2282 --- M tests/alloc/AllocTest.cpp 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index e26c432..a88f477 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -602,6 +602,10 @@ if (dl_tbf->pdch[i]) dl_slots |= 1 << i; + for (i = 0; ul_tbf && i < ARRAY_SIZE(ul_tbf->pdch); i += 1) + if (ul_tbf->pdch[i]) + ul_slots |= 1 << i; + for (i = 0; trx && i < ARRAY_SIZE(trx->pdch); i += 1) { struct gprs_rlcmac_pdch *pdch = &trx->pdch[i]; -- To view, visit https://gerrit.osmocom.org/3904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2705405119421da3066c6c6bdd5830df4c133a36 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 10:38:47 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 10:38:47 +0000 Subject: [PATCH] openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop Message-ID: Review at https://gerrit.osmocom.org/3910 libmsc: db_subscriber_alloc_exten() remove infinite loop This is not right, but at least it prevents entering an infinite loop in the case that you actually have exhasuted all available extensions. Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 --- M openbsc/src/libmsc/db.c 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/10/3910/1 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 4ba12ca..d8f4876 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1412,8 +1412,10 @@ { dbi_result result = NULL; uint64_t try; + int i; + int max_trys = smax - smin; - for (;;) { + for (i = 0; i <= max_trys; i++) { try = (rand() % (smax - smin + 1) + smin); result = dbi_conn_queryf(conn, "SELECT * FROM Subscriber " @@ -1435,6 +1437,12 @@ } dbi_result_free(result); } + + if (i > max_trys) { + DEBUGP(DDB, "Out of Trys, no extension for IMSI %s.\n", subscriber->imsi); + return -1; + } + sprintf(subscriber->extension, "%"PRIu64, try); DEBUGP(DDB, "Allocated extension %"PRIu64 " for IMSI %s.\n", try, subscriber->imsi); return db_sync_subscriber(subscriber); -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Tue Sep 12 10:44:07 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 10:44:07 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 1: > Uploaded patch set 1. How should this be done? If we don't go sequentially, how many times to try a random extension before we give up? -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 10:50:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 12 Sep 2017 10:50:54 +0000 Subject: [PATCH] libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3830 to look at the new patch set (#2). src: _snprintf() helper functions always nul-terminate buffers This patch inconditionally initializes the buffer we get to nul-terminated, it's a very simple solution to catch two overly corner cases: 1) snprintf() returns -1, very much unlikely in practise. 2) msg->len == 0: In such case, I would expect this function is never called with an empty message, but let's be safe in this case too. Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 --- M src/osmux.c M src/rtp.c 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/30/3830/2 diff --git a/src/osmux.c b/src/osmux.c index b18246f..47def14 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -902,6 +902,8 @@ int msg_len = msg->len; int ret; + buf[0] = '\0'; + while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { LOGP(DLMIB, LOGL_ERROR, diff --git a/src/rtp.c b/src/rtp.c index 56fc37c..38bee3a 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -200,6 +200,8 @@ uint8_t *payload; int ret, i; + buf[0] = '\0'; + rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) return -1; -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 10:56:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 12 Sep 2017 10:56:19 +0000 Subject: openbsc[master]: libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29270652957f58093be8bf7f2e898b0b4933bd93 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:07:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 11:07:57 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions always nul-terminate buffers In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) Sorry for keeping you busy with this, I'm just pointing out possibilities of crash I see in the code though. If you don't want to invest more time on these then just write the requirements for each parameter in documentation of the function, and it can be fixed later to remove those extra requirements. https://gerrit.osmocom.org/#/c/3830/2/src/osmux.c File src/osmux.c: Line 905: buf[0] = '\0'; Invalid access in case it is called with size==0. -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:18:40 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 12 Sep 2017 11:18:40 +0000 Subject: [PATCH] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. Message-ID: Review at https://gerrit.osmocom.org/3911 Gerrit verification jobs as Jenkins Job Builder YAML [1] file. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- A jobs/gerrit-verifications.yml 1 file changed, 288 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/3911/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..6fcaf87 --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,288 @@ +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation is default + cmd: ./contrib/jenkins.sh + + repos: + # no drafts verified? + # gcc warnings v3 + - osmo-iuh + + # gcc warnings v3 + - osmo-gsm-manuals + + # no 'clean state'? + # gcc warnings v3 + - osmo-sip-connector + + # touchstone config without filter? + # gcc warnings v3 not v4 + - osmocom-bb + + # no drafts verified? + # gcc version 3? + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + # no gcc warnings at all? + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # gcc warnings v3 + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # gcc warnings v3 + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # no gcc warnings at all? + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # drafts not verified + # gcc warnings v3 + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # gcc warnings v3 + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # gcc warnings v3? + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # no drafts are checked? + # gcc warnings v3 + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # gcc warnings v3 not v4? + - cellmgr-ng: + concurrent: true + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + # no gcc warnings? + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: '(BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct+trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="femtobts_v2.7") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v2.4") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.0.1pre") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.1") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v5.1") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="v2017.01") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next")' + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + # no gcc warnings at all? then it should be optional? + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e SMPP="$SMPP" \ + -e MGCP="$MGCP" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -i -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build \ + -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 \ + /build/contrib/jenkins.sh + + # gcc warnings v3? + # no ./contrib/jenkins.sh script might worth putting it in repo? + - osmo-tetra: + cmd: > + rm -rf deps/install + mkdir deps || true + cd deps + osmo-deps.sh libosmocore + + cd libosmocore + autoreconf --install --force + ./configure --prefix=$PWD/../install + $MAKE $PARALLEL_MAKE install + + cd ../../src + make clean || true + PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + + triggers: + - gerrit: + trigger-on: + - draft-published-event + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: true # for testing + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + # ensure clean state + - shell: 'chmod -R +w *; rm -rf *; git checkout .' + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:19:50 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 12 Sep 2017 11:19:50 +0000 Subject: [ABANDON] osmo-msc[master]: Make use of osmo-build.sh, which introduces dependency artif... In-Reply-To: References: Message-ID: Andr? Boddenberg has abandoned this change. Change subject: Make use of osmo-build.sh, which introduces dependency artifacts. ...................................................................... Abandoned Already outdated as we will probably move to docker builds in tmpfs. -- To view, visit https://gerrit.osmocom.org/3831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6228536f6c6f79e5534361ea3653669d9bdd81e9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:29:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 12 Sep 2017 11:29:00 +0000 Subject: [PATCH] libosmo-netif[master]: src: _snprintf() helper functions nul-terminate buffers, if ... In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3830 to look at the new patch set (#3). src: _snprintf() helper functions nul-terminate buffers, if possible This patch inconditionally initializes the buffer we get to nul-terminate it, whenever possible. It's a very simple solution to catch three overly corner cases: 1) snprintf() returns -1, very much unlikely in practise. 2) msg->len == 0: In such case, I would expect this function is never called with an empty message, but let's be safe in this case too. 3) If your buffer is empty, it doesn't nul-terminate the buffer. Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 --- M src/osmux.c M src/rtp.c 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/30/3830/3 diff --git a/src/osmux.c b/src/osmux.c index b18246f..7290d99 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -902,6 +902,9 @@ int msg_len = msg->len; int ret; + if (size) + buf[0] = '\0'; + while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { LOGP(DLMIB, LOGL_ERROR, diff --git a/src/rtp.c b/src/rtp.c index 56fc37c..48cb9b0 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -200,6 +200,9 @@ uint8_t *payload; int ret, i; + if (size) + buf[0] = '\0'; + rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) return -1; -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:36:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 11:36:42 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3807 to look at the new patch set (#7). Simplify TS alloc: adjust allocator signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 87 insertions(+), 91 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/7 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..1284f11 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -652,12 +652,11 @@ /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index d65cd2f..e4b1c23 100644 --- a/src/bts.h +++ b/src/bts.h @@ -204,11 +204,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf, bool enable_debug); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..0616069 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx, bool enable_debug); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx, bool enable_debug); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx, bool enable_debug); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..14d9e17 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -396,14 +396,20 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \param[in] enable_debug Flag to enable excessive logging not suitable for production run but necessary for tests + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx, bool enable_debug) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -796,15 +802,21 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \param[in] enable_debug Flag to enable excessive logging not suitable for production run but necessary for tests + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx, bool enable_debug) { uint8_t dl_slots; uint8_t ul_slots; @@ -1025,7 +1037,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,10 +1045,16 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \param[in] enable_debug Flag to enable excessive logging not suitable for production run but necessary for tests + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx, bool enable_debug) { int rc; @@ -1048,7 +1066,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx, enable_debug); if (rc >= 0) return rc; @@ -1057,8 +1075,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx, enable_debug); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..0102c10 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, false, -1, false); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx, false); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..cbde283 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..485e514 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx, bool enable_debug); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -817,7 +815,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -827,7 +825,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:36:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 11:36:43 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures Message-ID: Review at https://gerrit.osmocom.org/3912 Simplify TS alloc: adjust function signatures * document used parameters and return values * use consistent formatting * constify function parameters where appropriate (adjusting parameter types if necessary) Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I211b10b4da59c73d509b719346774515c761886a Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp 3 files changed, 63 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/3912/1 diff --git a/src/bts.cpp b/src/bts.cpp index 1284f11..0046238 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -439,10 +439,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; diff --git a/src/bts.h b/src/bts.h index e4b1c23..611a58b 100644 --- a/src/bts.h +++ b/src/bts.h @@ -364,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 14d9e17..0cebd93 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -103,7 +103,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -121,13 +121,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == 0xffffffffUL) return -1; @@ -140,16 +138,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -187,22 +184,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -217,11 +211,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -230,7 +232,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -300,30 +302,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -334,9 +329,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -353,32 +348,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -426,7 +430,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -494,9 +498,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -753,7 +763,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -824,14 +834,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -859,7 +868,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -870,7 +879,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -1060,7 +1069,7 @@ /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:54:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 12 Sep 2017 11:54:58 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3910/1/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 1419: try = (rand() % (smax - smin + 1) + smin); Why don't we better update this code to use something better than a random function? To keep it simple, something like rand() to land on a space, then keep incrementally searching for an unused extension. If the concern is only the infinite loop and the random function is fine, then just keep a global counter on the number of available extensions, so we can early give up on it. My only concern with the random function is being _unlucky_, I mean, you get extensions that already used several times. But I'm not in touch with a real testbed, so I cannot tell how realistic this is. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 12 11:58:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 11:58:17 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions nul-terminate buffers, if ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 I think we are still not exactly fixing 1st point of commit description according to what I understand from snprintf specs. My interpretation from snprintf manual is that if an error is returned, the behavior is unexpected, meaning an implementation of snprintf which received a null-terminated buffer could return a non-null-terminated buffer when an error is returned, and thus buffer should not be used (or we should force null termination AFTER using snprintf if ret < 1). But as we discussed this current patch should be good enough and in practice I hope we never hit any kind of issue. -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 12:09:50 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 12:09:50 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 1: > (1 comment) I dunno.. I just came across this as I was taking a quick look at the failing vty tests. I configured subscriber-create-on-demand random 10000 10010 and noticed the hang. Here's a busy rhizomatica site: sqlite> select count(*) from subscriber; count(*) ---------- 21024 Still a ways away from the ~ 99,999 available. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 12:12:39 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 12:12:39 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 1: > > (1 comment) > > sqlite> select count(*) from subscriber; > count(*) > ---------- > 21024 > I guess (smax - smin) - the_above_result is your max_i in the loop at which point you should bale? -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 12:32:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 12:32:05 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: improve readability In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#13). Simplify TS alloc: improve readability * consistently format log messages to make it possible to grep for test output in source code * move TRX check inside local tfi_find_free() wrapper * assign reserved_*_slots only when multislot masks are found Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 25 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/13 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 7eaf291..4718ead 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -248,9 +248,7 @@ if (free_tfi) { tfi = find_free_tfi(pdch, dir); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -258,26 +256,20 @@ if (dir == GPRS_RLCMAC_UL_TBF) { usf = find_free_usf(pdch); if (usf < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -374,7 +366,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -386,6 +378,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -533,17 +534,14 @@ if (ms->ms_class()) { ms_class = &gprs_ms_multislot_class[ms->ms_class()]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "class %d\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", ms->ms_class()); } else { ms_class = &gprs_ms_multislot_class[12]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "unknown class (assuming 12)\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for unknown class (assuming 12)\n"); } if (ms_class->tx == MS_NA) { - LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not " - "applicable.\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not applicable.\n", ms->ms_class()); return -EINVAL; } @@ -570,8 +568,7 @@ if (Trb == MS_C) Trb = 1; - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d " - " Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, + LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, (Sum == MS_NA) ? "N/A" : digit[Sum], (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); @@ -922,20 +919,10 @@ return -EINVAL; } - reserved_dl_slots = dl_slots = ms->reserved_dl_slots(); - reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); @@ -952,11 +939,11 @@ rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; - - reserved_dl_slots = dl_slots; - reserved_ul_slots = ul_slots; } + reserved_dl_slots = dl_slots; + reserved_ul_slots = ul_slots; + /* Step 3: Derive the slot set for the current TBF */ if (single) { /* Make sure to consider the first common slot only */ -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 13 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 12 12:32:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 12:32:05 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: enable debugging instrumentation Message-ID: Review at https://gerrit.osmocom.org/3913 TS alloc: enable debugging instrumentation Previously extra debugging was disabled by preprocessor directives which means allocation tests were run without it. Enable it explicitly via boolean parameter which can be set from tests but keep it unset in main code to avoid interference with production setup. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 7 files changed, 84 insertions(+), 89 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/1 diff --git a/src/bts.cpp b/src/bts.cpp index 0046238..68c23ff 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -651,11 +651,11 @@ /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true, false); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true, false); } if (!tbf) { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index b79c6dd..c050030 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -505,9 +505,11 @@ * \param[in] ms Pointer to MS object * \param[in,out] ul_slots set of UL timeslots * \param[in,out] dl_slots set of DL timeslots + * \param[in] enable_debug Flag to enable excessive logging not suitable for production run but necessary for tests * \returns negative error code or 0 on success */ -static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots, + bool enable_debug) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -671,14 +673,13 @@ rx_window = rx_good & rx_valid_win; rx_slot_count = pcu_bitcount(rx_window); -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "n_tx=%d, n_rx=%d, mask_sel=%d, tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, ul=%02x," + " dl=%02x\n", + tx_slot_count, rx_slot_count, mask_sel, + tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, + *ul_slots, *dl_slots); /* Check compliance with TS 45.002, table 6.4.2.2.1 */ /* Whether to skip this round doesn not only depend on the bit @@ -700,16 +701,15 @@ continue; } else { /* No supported row in table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); -#endif + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), combination not supported\n", + set_flag_chars(set_flag_chars(set_flag_chars( + slot_info, + rx_bad, 'x', '.'), + rx_window, 'D'), + tx_window, 'U')); + continue; } } @@ -719,14 +719,13 @@ continue; if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); -#endif + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), no DL slots available\n", + set_flag_chars(set_flag_chars(slot_info, + rx_bad, 'x', '.'), + tx_window, 'U')); + continue; } @@ -740,18 +739,18 @@ req_common_slots = OSMO_MIN(req_common_slots, 2); if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); -#endif + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), invalid number of common TS: %d " + "(expected %d)\n", + set_flag_chars(set_flag_chars(set_flag_chars( + slot_info, + rx_bad, 'x', '.'), + rx_window, 'D'), + tx_window, 'U'), + common_slot_count, + req_common_slots); + continue; } @@ -776,18 +775,16 @@ } } -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); -#endif + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), capacity = %d\n", + set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( + slot_info, + rx_bad, 'x', '.'), + rx_window, 'D'), + tx_window, 'U'), + rx_window & tx_window, 'C'), + capacity); if (capacity <= max_capacity) continue; @@ -1024,7 +1021,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots, enable_debug); if (rc < 0) return rc; } diff --git a/src/tbf.cpp b/src/tbf.cpp index 0102c10..71a2062 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -752,7 +752,7 @@ } static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, - bool single_slot) + bool single_slot, bool enable_debug) { int rc; struct gprs_rlcmac_bts *bts; @@ -828,7 +828,7 @@ } struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot) + uint8_t egprs_ms_class, bool single_slot, bool enable_debug) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -863,7 +863,7 @@ tbf->name(), GprsCodingScheme::modeName(ms->mode())); } - rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot); + rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot, enable_debug); if (tbf->is_egprs_enabled()) tbf->egprs_calc_ulwindow_size(); @@ -918,7 +918,7 @@ } struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot) + uint8_t egprs_ms_class, bool single_slot, bool enable_debug) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -956,7 +956,7 @@ tbf->name(), GprsCodingScheme::modeName(ms->mode())); } - rc = setup_tbf(tbf, ms, use_trx, ms_class, 0, single_slot); + rc = setup_tbf(tbf, ms, use_trx, ms_class, 0, single_slot, enable_debug); /* if no resource */ if (rc < 0) { talloc_free(tbf); @@ -1310,7 +1310,7 @@ bts->tbf_reused(); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, false); + ms() ? ms()->egprs_ms_class() : 0, false, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 8f92149..4aed91f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -315,10 +315,10 @@ uint32_t tlli, uint8_t ta, GprsMs *ms); struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot); + uint8_t egprs_ms_class, bool single_slot, bool enable_debug); struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot); + uint8_t egprs_ms_class, bool single_slot, bool enable_debug); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index cbde283..0fca852 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -147,7 +147,7 @@ // Create new TBF (any TRX) /* FIXME: Copy and paste with alloc_ul_tbf */ /* set number of downlink slots according to multislot class */ - dl_tbf = tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, ss); + dl_tbf = tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, ss, false); if (!dl_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 485e514..c614d48 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -42,11 +42,9 @@ uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) - return tbf_alloc_ul_tbf(bts, ms, use_trx, - ms_class, egprs_ms_class, single_slot); - else - return tbf_alloc_dl_tbf(bts, ms, use_trx, - ms_class, egprs_ms_class, single_slot); + return tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, single_slot, true); + + return tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, single_slot, true); } static void check_tfi_usage(BTS *the_bts) @@ -202,7 +200,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +208,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +242,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +250,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false, true); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +292,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +300,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +355,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +399,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -495,7 +493,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false, true); if (tbf == NULL) return NULL; break; @@ -504,7 +502,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false, true); if (tbf == NULL) return NULL; } @@ -815,7 +813,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false, true); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -825,7 +823,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false, true); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 43a6142..4dac648 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,12 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false, true); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false, true); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -166,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2205,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2219,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2263,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 12:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 12:53:14 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: cosmetic, use proper format Message-ID: Review at https://gerrit.osmocom.org/3914 Simplify TS alloc: cosmetic, use proper format The find_multi_slots() function has 4 nested for(;;) loops but it's formatted as one. Before trying to split this into smth saner, let's first fix code formatting to make nested loops obvious. Also, fix typos in comments. Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 161 insertions(+), 159 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/14/3914/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c050030..1410e00 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -608,8 +608,7 @@ rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); } else { /* Class type 2 MS have independant RX and TX */ rx_mask[MASK_TT] = 0xff; @@ -619,180 +618,183 @@ rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); - /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ - for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; - uint16_t rx_valid_win; - uint32_t checked_rx[256/32] = {0}; + /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ + for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { + unsigned tx_slot_count; + int max_rx; + uint16_t rx_valid_win; + uint32_t checked_rx[256/32] = {0}; - /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + /* Wrap valid window */ + tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; - tx_window = tx_valid_win; + tx_window = tx_valid_win; - /* Filter out unavailable slots */ - tx_window &= *ul_slots; + /* Filter out unavailable slots */ + tx_window &= *ul_slots; - /* Skip if the the first TS (ul_ts) is not in the set */ - if ((tx_window & (1 << ul_ts)) == 0) - continue; - - /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ - if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) - continue; - - tx_slot_count = pcu_bitcount(tx_window); - - max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; - - /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ - for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { - /* Wrap valid window */ - rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; - - /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ - for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; - unsigned ts; - int capacity; - - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; - - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); - - if (enable_debug) - LOGP(DRLCMAC, LOGL_DEBUG, - "n_tx=%d, n_rx=%d, mask_sel=%d, tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, ul=%02x," - " dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ - if (enable_debug) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); - + /* Skip if the the first TS (ul_ts) is not in the set */ + if ((tx_window & (1 << ul_ts)) == 0) continue; - } - } - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) - continue; + /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ + if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) + continue; - if (!rx_good) { - if (enable_debug) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); + tx_slot_count = pcu_bitcount(tx_window); - continue; - } + max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); + rx_valid_win = (1 << max_rx) - 1; - if (!rx_window) - continue; + /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ + for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { + /* Wrap valid window */ + rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); + /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ + for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { + unsigned common_slot_count; + unsigned req_common_slots; + unsigned rx_slot_count; + uint16_t rx_bad; + uint8_t rx_good; + unsigned ts; + int capacity; - if (req_common_slots != common_slot_count) { - if (enable_debug) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), invalid number of common TS: %d " - "(expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); + /* Filter out bad slots */ + rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = *dl_slots & ~rx_bad; - continue; - } + /* TODO: CHECK this calculation -> separate function for unit testing */ - /* Compute capacity */ - capacity = 0; + rx_window = rx_good & rx_valid_win; + rx_slot_count = pcu_bitcount(rx_window); - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "n_tx=%d, n_rx=%d, mask_sel=%d, tx=%02x, rx=%02x, mask=%02x, " + "bad=%02x, good=%02x, ul=%02x, dl=%02x\n", + tx_slot_count, rx_slot_count, mask_sel, + tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, + *ul_slots, *dl_slots); + + /* Check compliance with 3GPP TS 45.002, Table 6.4.2.2.1 */ + /* Whether to skip this round does not only depend on the bit + * sets but also on mask_sel. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + unsigned slot_sum = rx_slot_count + tx_slot_count; + /* Assume down+up/dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TR) + /* Skip Tta */ + continue; + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TT) + /* Skip Tra */ + continue; + } else { + /* No supported row in 3GPP TS 45.002, Table 6.4.2.2.1. */ + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "combination not supported\n", + set_flag_chars(set_flag_chars(set_flag_chars( + slot_info, + rx_bad, 'x', '.'), + rx_window, 'D'), + tx_window, 'U')); + + continue; + } + } + + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + continue; + + if (!rx_good) { + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "no DL slots available\n", + set_flag_chars(set_flag_chars(slot_info, + rx_bad, 'x', '.'), + tx_window, 'U')); + + continue; + } + + if (!rx_window) + continue; + + /* Check number of common slots according to 3GPP TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) { + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "invalid number of common TS: %d (expected %d)\n", + set_flag_chars(set_flag_chars(set_flag_chars( + slot_info, + rx_bad, 'x', '.'), + rx_window, 'D'), + tx_window, 'U'), + common_slot_count, + req_common_slots); + + continue; + } + + /* Compute capacity */ + capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + int c; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + } + } + + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), capacity = %d\n", + set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( + slot_info, + rx_bad, 'x', '.'), + rx_window, 'D'), + tx_window, 'U'), + rx_window & tx_window, 'C'), + capacity); + + if (capacity <= max_capacity) + continue; + + max_capacity = capacity; + max_ul_slots = tx_window; + max_dl_slots = rx_window; } } } - - if (enable_debug) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); - - if (capacity <= max_capacity) - continue; - - max_capacity = capacity; - max_ul_slots = tx_window; - max_dl_slots = rx_window; - }}}} + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, -- To view, visit https://gerrit.osmocom.org/3914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 13:38:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 13:38:09 +0000 Subject: [PATCH] libosmocore[master]: Expand bit pretty-printer Message-ID: Review at https://gerrit.osmocom.org/3915 Expand bit pretty-printer Add OSMO_BIT_PRINT_EX() which is like OSMO_BIT_PRINT() but allows to specify character to be printed for set bits. It's useful to print bytes used as mask where set bit has particular semantics - for example TS mask in OsmoPCU. Change-Id: I72528bc1e376134c5a7b6e7a50c48e38c3f48b0a Related: OS#2282 --- M include/osmocom/core/bits.h 1 file changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/3915/1 diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 17fe1c6..c6a142f 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -69,15 +69,17 @@ (byte & 0x01 ? 1 : 0) #define OSMO_BIT_SPEC "%c%c%c%c%c%c%c%c" -#define OSMO_BIT_PRINT(byte) \ - (byte & 0x80 ? '1' : '.'), \ - (byte & 0x40 ? '1' : '.'), \ - (byte & 0x20 ? '1' : '.'), \ - (byte & 0x10 ? '1' : '.'), \ - (byte & 0x08 ? '1' : '.'), \ - (byte & 0x04 ? '1' : '.'), \ - (byte & 0x02 ? '1' : '.'), \ - (byte & 0x01 ? '1' : '.') +#define OSMO_BIT_PRINT_EX(byte, ch) \ + (byte & 0x80 ? ch : '.'), \ + (byte & 0x40 ? ch : '.'), \ + (byte & 0x20 ? ch : '.'), \ + (byte & 0x10 ? ch : '.'), \ + (byte & 0x08 ? ch : '.'), \ + (byte & 0x04 ? ch : '.'), \ + (byte & 0x02 ? ch : '.'), \ + (byte & 0x01 ? ch : '.') + +#define OSMO_BIT_PRINT(byte) OSMO_BIT_PRINT_EX(byte, '1') /* BIT REVERSAL */ -- To view, visit https://gerrit.osmocom.org/3915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72528bc1e376134c5a7b6e7a50c48e38c3f48b0a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 14:09:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 12 Sep 2017 14:09:12 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 1: I see... it's from the VTY itself that hangs with a valid configuration. Would you send a v2 of this patch that does something like this? ... extension_alloc(...) { range = max - min; extension = min + (rand() % range); return extension } Then: if extension is busy: extension++; if count == 100: extension = extension_alloc(); So the idea is that we don't call random() again, but try with next door extensions to see if they are available. Play around with it to see if it cures the neverending loop there. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 14:09:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 12 Sep 2017 14:09:37 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 1: I see... it's from the VTY itself that hangs with a valid configuration. Would you send a v2 of this patch that does something like this? ... extension_alloc(...) { range = max - min; extension = min + (rand() % range); return extension } Then: if extension is busy: extension++; if count == 100: extension = extension_alloc(); So the idea is that we don't call random() again, but try with next door extensions to see if they are available. Play around with it to see if it cures the neverending loop there. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 14:42:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 14:42:09 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Use tmpdir to create bts pcu-socket In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Use tmpdir to create bts pcu-socket ...................................................................... Use tmpdir to create bts pcu-socket In commit 329b6f4 pcu-socket path was moved to run inside the test run dir to avoid issues between different tests creating a socket in the same place. However, it seems unix sockets paths are limited to 108 bytes (with Null char included). In some cases, the run dir for a test can be quite long, as it contains suite name, test name, etc. and the path can be longer that the limit defined above. In order to fix this issue, create a tmp dir using mkdtemp to ensure the path to be used for the pcu-socket doesn't collide between different instances of osmo-bts-trx. Clean up of tmp dir and pcu socket is done inside the cleanup() method called by suite.py. method pcu_socket_path() is added to help with new implementation, and it will be used as well as a public API later soon to be used by OsmoPcu classes. Related: OS#2507 Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/suite.py 3 files changed, 27 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index b5262a2..3077b0f 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -19,6 +19,7 @@ import os import pprint +import tempfile from . import log, config, util, template, process, event_loop class OsmoBtsTrx(log.Origin): @@ -28,6 +29,7 @@ inst = None env = None trx = None + pcu_sk_tmp_dir = None BIN_BTS_TRX = 'osmo-bts-trx' BIN_PCU = 'osmo-pcu' @@ -39,6 +41,20 @@ self.suite_run = suite_run self.conf = conf self.env = {} + self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) + if len(self.pcu_socket_path().encode()) > 107: + raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path()) + + def cleanup(self): + if self.pcu_sk_tmp_dir: + try: + os.remove(self.pcu_socket_path()) + except OSError: + pass + os.rmdir(self.pcu_sk_tmp_dir) + + def pcu_socket_path(self): + return os.path.join(self.pcu_sk_tmp_dir, 'pcu_bts') def remote_addr(self): return self.conf.get('addr') @@ -105,7 +121,7 @@ 'oml_remote_ip': self.bsc.addr(), 'trx_local_ip': self.remote_addr(), 'trx_remote_ip': self.trx_remote_ip(), - 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + 'pcu_socket_path': self.pcu_socket_path(), } }) config.overlay(values, { 'osmo_bts_trx': self.conf }) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index f37f88b..e8ac7c2 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -80,6 +80,12 @@ '-i', self.bsc.addr()), remote_cwd=remote_run_dir) + def cleanup(self): + pass + + def pcu_socket_path(self): + return os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + def _process_remote(self, name, popen_args, remote_cwd=None): run_dir = self.run_dir.new_dir(name) return process.RemoteProcess(name, run_dir, self.remote_user, self.remote_addr(), remote_cwd, @@ -122,7 +128,7 @@ config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr(), - 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + 'pcu_socket_path': self.pcu_socket_path(), } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 2ac2062..9b975fd 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -351,7 +351,9 @@ return osmo_stp.OsmoStp(self, ip_address) def bts(self, specifics=None): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + bts = bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + self.register_for_cleanup(bts) + return bts def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) -- To view, visit https://gerrit.osmocom.org/3894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 14:44:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 14:44:08 +0000 Subject: osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) I guess we agree that removing that sleep() can be done more in the future and doesn't belong to this patch. https://gerrit.osmocom.org/#/c/3901/1/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 524: self.cancel_pending_dbus_methods() > because now we're potentially causing a NoneType exception or forget to res No, because I'm not recreating the cancellable object every time we connect, as it's not needed (or intended). A cancellable object can also manage several dbus async methods at the same time. The cancellable is created during construction time and it's expected to last until object cleanup. And as cleanup() is an API to be used only by suite.py once the test is finished, it also means no method other than destructor is expected to be called after cleanup() is called. The self.cancellable = None is there to prevent future issues in case we decide for whatever reason to call cleanup() in the destructor, but in any case the "if self.cancellable" and "self.cancellable = None" could be removed. It is basically an optimization in case cleanup() is called more than once. So, I can leave everything as it is, or I can remove the "if self.cancellable:" and "self.cancellable=None" lines. What do you prefer? -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 12 14:54:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 14:54:30 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) I think it would be easier to introduce this gradually - for example first add all the jobs which do not raise questions, make sure it works as expected and than add the remaining one, clarifying stuff on a case-by-case basis. https://gerrit.osmocom.org/#/c/3911/1/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: Line 34: # gcc warnings v3 not v4 I'm pretty sure it's just artifact of prehistoric times. We should just enable 'latest and greatest' gcc warnings version available. -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 12 14:55:43 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 14:55:43 +0000 Subject: [PATCH] openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3910 to look at the new patch set (#2). libmsc: db_subscriber_alloc_exten() remove infinite loop This is not right, but at least it prevents entering an infinite loop in the case that you actually have exhasuted all available extensions. Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 --- M openbsc/src/libmsc/db.c 1 file changed, 21 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/10/3910/2 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 4ba12ca..74ee58b 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1412,8 +1412,22 @@ { dbi_result result = NULL; uint64_t try; + int total_subs; + int i; + int max_trys; - for (;;) { + result = dbi_conn_query(conn, "SELECT count(*) AS total FROM Subscriber"); + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to get subscriber count " + "while allocating new extension.\n"); + return 1; + } + + dbi_result_next_row(result); + total_subs = atoi( dbi_result_get_string(result, "total") ); + max_trys = smax - smin - total_subs; + + for (i = 0; i <= max_trys; i++) { try = (rand() % (smax - smin + 1) + smin); result = dbi_conn_queryf(conn, "SELECT * FROM Subscriber " @@ -1435,6 +1449,12 @@ } dbi_result_free(result); } + + if (i > max_trys) { + DEBUGP(DDB, "Out of Trys, no extension for IMSI %s.\n", subscriber->imsi); + return 1; + } + sprintf(subscriber->extension, "%"PRIu64, try); DEBUGP(DDB, "Allocated extension %"PRIu64 " for IMSI %s.\n", try, subscriber->imsi); return db_sync_subscriber(subscriber); -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:06:10 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 15:06:10 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 2: > Build Failed > > http://jenkins.osmocom.org/jenkins/job/OpenBSC-gerrit/2457/ : > FAILURE Hmm that's annoying. must be a different libdbi or sqlite? string was the only type I could ask libdbi for that didn't give me this error. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:09:41 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 12 Sep 2017 15:09:41 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 2: > > Play around with it to see if it cures the neverending loop there. Seeing your comment after I pushed last patch set.. Hmm. How could it cure the loop? You need to give up at some point if all possibilities are exhausted, no? -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: suite: Replicate resources based on times attr before callin... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3907 to look at the new patch set (#2). suite: Replicate resources based on times attr before calling combine As suite.conf and scenarios need to match 1-to-1 in lists, it's important to extend the dictionaries by replicating the objects with a 'times' values higher than 1 in order to match the objects correctly. Two unit tests are added as a show case. Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 --- M selftest/suite_test.ok M selftest/suite_test.py M selftest/suite_test/resources.conf M selftest/suite_test/test_suite/suite.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 6 files changed, 215 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/3907/2 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..cdf3928 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -16,6 +16,7 @@ resources: bts: - times: '1' + - times: '2' ip_address: - times: '1' modem: @@ -30,14 +31,30 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 3) +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] +tst test_suite: Reserving 3 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 @@ -140,5 +157,151 @@ skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected +- test with half empty scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: DBG: {conf={bts=[{'type': 'sysmo'}]}, scenario='foo'} [test_suite?{combining_scenarios='resources', scenario='foo'}] [suite.py:[LINENR]] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py +- test with scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: DBG: {conf={bts=[{'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}]}, scenario='foo'} [test_suite?{combining_scenarios='resources', scenario='foo'}] [suite.py:[LINENR]] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e + addr: 10.42.42.52 + band: GSM-1800 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + trx_list: + - nominal_power: '10' + - nominal_power: '12' + type: osmo-bts-trx +- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - graceful exit. diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 86c4c25..12bd5e7 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -42,5 +42,21 @@ output = report.suite_to_text(s) print(output) +print('- test with half empty scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + +print('- test with scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..e302373 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -28,6 +28,36 @@ trx_list: - hw_addr: 00:02:95:00:41:b3 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.52 + band: GSM-1800 + launch_trx: true + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + arfcn: - arfcn: 512 band: GSM-1800 diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/test_suite/suite.conf index 376f6cd..890f66a 100644 --- a/selftest/suite_test/test_suite/suite.conf +++ b/selftest/suite_test/test_suite/suite.conf @@ -3,6 +3,7 @@ - times: 1 bts: - times: 1 + - times: 2 modem: - times: 2 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8f34bdb..c346227 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -58,6 +58,7 @@ 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, + 'bts[].trx_list[].nominal_power': schema.INT, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 9b975fd..f4cba1e 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -209,11 +209,11 @@ def combined(self, conf_name): log.dbg(combining=conf_name) log.ctx(combining_scenarios=conf_name) - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + combination = config.replicate_times(self.definition.conf.get(conf_name, {})) log.dbg(definition_conf=combination) for scenario in self.scenarios: log.ctx(combining_scenarios=conf_name, scenario=scenario.name()) - c = scenario.get(conf_name) + c = config.replicate_times(scenario.get(conf_name, {})) log.dbg(scenario=scenario.name(), conf=c) if c is None: continue -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3763 to look at the new patch set (#3). Add features attribute to modems The idea behind this attribute is similar to the Features one in ofono: To provide an easy-to-use list of features that a modem supports. In osmo-gsm-tester this feature list can be used to create scenarios to act as a filter for modems. For instance, if an sms related feature must be tested, then a modem supporting sms features is required. This way only modems supporting that feature are going to be selected for that test when that scenario is used. We provide our own list instead of dynamically using it for two reasons: - Accessing the list from ofono means powering on + online the modem, which requires using the modem before resource resolution is done. - ofono may state that it has support for feature X, but it still doesn't have all features required by osmo-gsm-tester or there is a bug in some part of the feature which prevents it from being used for a specific test. Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 --- M example/resources.conf A example/scenarios/mfeature-gprs.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 4 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/63/3763/3 diff --git a/example/resources.conf b/example/resources.conf index 95cb8cf..3daf677 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -60,6 +60,7 @@ ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: sierra_2 path: '/sierra_2' @@ -67,6 +68,7 @@ ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: gobi_0 path: '/gobi_0' @@ -74,6 +76,7 @@ ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: gobi_3 path: '/gobi_3' @@ -81,3 +84,4 @@ ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['gprs'] diff --git a/example/scenarios/mfeature-gprs.conf b/example/scenarios/mfeature-gprs.conf new file mode 100644 index 0000000..c520a90 --- /dev/null +++ b/example/scenarios/mfeature-gprs.conf @@ -0,0 +1,4 @@ +resources: + modem: + - features: + - 'gprs' diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index d3deb7f..c020ef4 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -68,6 +68,7 @@ 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, 'modem[].ciphers[]': schema.CIPHER, + 'modem[].features[]': schema.MODEM_FEATURE, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 9a0906c..6d5f7ad 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -81,6 +81,11 @@ return raise ValueError('Unknown Cipher value: %r' % val) +def modem_feature(val): + if val in ('sms', 'gprs', 'voicecall', 'ussd'): + return + raise ValueError('Unknown Modem Feature: %r' % val) + INT = 'int' STR = 'str' UINT = 'uint' @@ -94,6 +99,8 @@ AUTH_ALGO = 'auth_algo' TIMES='times' CIPHER = 'cipher' +MODEM_FEATURE = 'modem_feature' + SCHEMA_TYPES = { INT: int, STR: str, @@ -108,6 +115,7 @@ AUTH_ALGO: auth_algo, TIMES: times, CIPHER: cipher, + MODEM_FEATURE: modem_feature, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3731 to look at the new patch set (#5). Reserve ARFCN dynamically based on BTS band support Instead of statically specifying a band for a BTS to use, declare a list of supported bands for each BTS. At the time of BTS object creation, ask the BTS for band support and try to dynamically reserve an ARFCN resource which is compatible with any of the bands supported by the BTS. All this happens transparently to the test. Still, the test may want to use a specific band / arfcn. In this case, a test can use suite.reserve_arfcn(band, arfcn) to reserve a specific band/arfcn and pass that to the BTS at creation time, which will then use that one instead of trying to find a suitable one. It is left as future work to support BTs with multiple TRX, in which case several arfcn must be reserved. It should not be that difficult, mostly using "times: X" where X is the amount of trx, changing the API to use a list of arfcns and the configure() methods of the BTS. Related: OS#2230 Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 --- M example/default-suites.conf M example/defaults.conf M example/resources.conf A example/scenarios/band-1900.conf M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/suite_test.ok M selftest/suite_test/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py A suites/register/register_band_1900.py A suites/register/suite.conf 15 files changed, 179 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/31/3731/5 diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..7fc97d3 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -7,3 +7,4 @@ - smpp - aoip_smpp - aoip_encryption:cipher-a50+cipher-a51 +- register:band-1900 diff --git a/example/defaults.conf b/example/defaults.conf index 969fac6..e9e7846 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -34,7 +34,6 @@ osmobsc_bts_type: sysmobts trx_list: - max_power_red: 0 - arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 - phys_chan_config: SDCCH8 diff --git a/example/resources.conf b/example/resources.conf index 3daf677..d924e8e 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -12,14 +12,14 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: [a5_0, a5_1, a5_3] - label: Ettus B200 type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800', 'GSM-1900'] launch_trx: true ciphers: [a5_0, a5_1] @@ -27,7 +27,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: [a5_0, a5_1] diff --git a/example/scenarios/band-1900.conf b/example/scenarios/band-1900.conf new file mode 100644 index 0000000..956c8db --- /dev/null +++ b/example/scenarios/band-1900.conf @@ -0,0 +1,4 @@ +resources: + bts: + - bands: + - GSM-1900 diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index b186737..e5fe6e6 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -12,7 +12,7 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: - 'a5_0' - 'a5_1' @@ -21,7 +21,7 @@ type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800'] launch_trx: true ciphers: - 'a5_0' @@ -31,7 +31,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: - 'a5_0' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index c946d3d..207cfb0 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,16 +46,16 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': '377ac78d5404b826d40c84efd04b4a9fd4e62b7e', + 'bts': [{'_hash': '2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3', 'addr': '10.42.42.114', - 'band': 'GSM-1800', + 'bands': ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', 'type': 'osmo-bts-sysmo'}, {'_hash': '6a9c9fbd364e1563a5b9f0826030a7888fd19575', 'addr': '10.42.42.50', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '6', 'label': 'Ettus B200', @@ -63,7 +63,7 @@ 'type': 'osmo-bts-trx'}, {'_hash': 'e50fd38e3bfe8039ac13bc315bc84f46110b7443', 'addr': '10.42.42.51', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '7', 'label': 'sysmoCell 5000', @@ -118,9 +118,13 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e +--- testowner: DBG: Picked - _hash: 2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5_0 - a5_1 @@ -129,7 +133,8 @@ type: osmo-bts-sysmo - _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5_0 - a5_1 @@ -170,10 +175,14 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e +- _hash: 2769d8f6cfe22f15e7dbd14f7ce929db2e56bdf3 _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5_0 - a5_1 @@ -183,7 +192,8 @@ - _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 _reserved_by: testowner-123-1490837279 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5_0 - a5_1 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index cdf3928..0104ed7 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -33,23 +33,29 @@ tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 3 x bts (candidates: 6) -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: c8a01d42f3977e49ceff0734a1475857913dfb13 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo - _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 addr: 10.42.42.115 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '5' label: octBTS 3000 trx_list: - hw_addr: 00:0c:90:32:b5:8a type: oct -- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 +- _hash: 78f070cc5e3c6773422b0d6770e04dd4ee0497d2 addr: 10.42.42.190 - band: GSM-1900 + bands: + - GSM-1800 ipa_unit_id: '1902' label: nanoBTS 1900 trx_list: @@ -169,23 +175,29 @@ tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] tst {combining_scenarios='resources', scenario='foo'}: DBG: {conf={bts=[{'type': 'sysmo'}]}, scenario='foo'} [test_suite?{combining_scenarios='resources', scenario='foo'}] [suite.py:[LINENR]] tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: c8a01d42f3977e49ceff0734a1475857913dfb13 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo - _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 addr: 10.42.42.115 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '5' label: octBTS 3000 trx_list: - hw_addr: 00:0c:90:32:b5:8a type: oct -- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 +- _hash: 78f070cc5e3c6773422b0d6770e04dd4ee0497d2 addr: 10.42.42.190 - band: GSM-1900 + bands: + - GSM-1800 ipa_unit_id: '1902' label: nanoBTS 1900 trx_list: @@ -242,7 +254,8 @@ tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e addr: 10.42.42.52 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '6' label: Ettus B200 launch_trx: 'True' @@ -252,7 +265,8 @@ type: osmo-bts-trx - _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc addr: 10.42.42.53 - band: GSM-1800 + bands: + - GSM-1800 ipa_unit_id: '7' label: sysmoCell 5000 trx_list: @@ -260,9 +274,13 @@ - nominal_power: '12' trx_remote_ip: 10.42.42.112 type: osmo-bts-trx -- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +- _hash: c8a01d42f3977e49ceff0734a1475857913dfb13 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index e302373..dc1d932 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -10,13 +10,13 @@ type: sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] - label: octBTS 3000 type: oct ipa_unit_id: 5 addr: 10.42.42.115 - band: GSM-1800 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:0c:90:32:b5:8a @@ -24,7 +24,7 @@ type: nanobts ipa_unit_id: 1902 addr: 10.42.42.190 - band: GSM-1900 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:02:95:00:41:b3 @@ -32,7 +32,7 @@ type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.52 - band: GSM-1800 + bands: ['GSM-1800'] launch_trx: true trx_list: - nominal_power: 10 @@ -42,7 +42,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.53 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 trx_list: - nominal_power: 10 @@ -52,7 +52,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.53 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 trx_list: - nominal_power: 10 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 3077b0f..39bfcae 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -59,6 +59,18 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + return self.band_arfcn.get('band') + + def arfcn(self): + return int(self.band_arfcn.get('arfcn')) + def trx_remote_ip(self): conf_ip = self.conf.get('trx_remote_ip', None) if conf_ip is not None: @@ -122,6 +134,7 @@ 'trx_local_ip': self.remote_addr(), 'trx_remote_ip': self.trx_remote_ip(), 'pcu_socket_path': self.pcu_socket_path(), + 'band': self.band(), } }) config.overlay(values, { 'osmo_bts_trx': self.conf }) @@ -137,6 +150,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_trx')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index e8ac7c2..5c4f7c0 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -29,6 +29,7 @@ remote_inst = None remote_env = None remote_dir = None + band_arfcn = None REMOTE_DIR = '/osmo-gsm-tester' BTS_SYSMO_BIN = 'osmo-bts-sysmo' @@ -116,6 +117,22 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + if not self.band_arfcn: + return None + return self.band_arfcn.get('band') + + def arfcn(self): + if not self.band_arfcn: + return None + return int(self.band_arfcn.get('arfcn')) + def configure(self): if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be configured') @@ -129,6 +146,7 @@ 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr(), 'pcu_socket_path': self.pcu_socket_path(), + 'band': self.band(), } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) @@ -144,6 +162,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_sysmo')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index c020ef4..65949c4 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -53,7 +53,7 @@ 'bts[].type': schema.STR, 'bts[].ipa_unit_id': schema.UINT, 'bts[].addr': schema.IPV4, - 'bts[].band': schema.BAND, + 'bts[].bands[]': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, 'bts[].ciphers[]': schema.CIPHER, @@ -515,6 +515,11 @@ for item in item_list: item.pop(USED_KEY, None) + def add(self, more): + if more is self or more is self.reserved: + raise RuntimeError('adding a list of reserved resources to itself') + config.add(self.reserved, copy.deepcopy(more.reserved)) + def free(self): if self.reserved: self.resources_pool.free(self.origin, self.reserved) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 6d5f7ad..043f5c1 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -39,7 +39,7 @@ raise ValueError('Invalid %s: %r' % (name, val)) def band(val): - if val in ('GSM-1800', 'GSM-1900'): + if val in ('GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'): return raise ValueError('Unknown GSM band: %r' % val) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index f4cba1e..214b8b9 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -246,6 +246,11 @@ self.log('reserving resources in', self.resources_pool.state_dir, '...') self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + def reserve_resources_append(self, requirements): + new_reserved = self.resources_pool.reserve(self, requirements) + self.dbg('reserving new resources %r' % new_reserved) + self.reserved_resources.add(new_reserved) + def run_tests(self, names=None): try: log.large_separator(self.trial.name(), self.name(), sublevel=2) @@ -317,6 +322,14 @@ return self.reserved_resources.free() + def reserve_arfcn(self, band, arfcn=None): + '''To be used by tests. Returned resource can be passed when requested a bts object''' + + if arfcn is None: + return self._try_reserve_arfcn((band,)) + else: + return self.reserve_resources_append({ 'arfcn': [{'band': band, 'arfcn': arfcn, 'times': '1'}] }) + def ip_address(self, specifics=None): return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics) @@ -350,10 +363,20 @@ ip_address = self.ip_address() return osmo_stp.OsmoStp(self, ip_address) - def bts(self, specifics=None): - bts = bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + def bts(self, arfcn=None, specifics=None): + bts = bts_obj(self, arfcn, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) self.register_for_cleanup(bts) return bts + + def _try_reserve_arfcn(self, supported_bands): + for band in supported_bands: + try: + self.reserve_resources_append({ 'arfcn': [{'band': band, 'times': '1'}] }) + except resource.NoResourceExn as e: + self.dbg('Band %s has no available arfcns' % band) + continue + return self.reserved_resources.get(resource.R_ARFCN) + raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) @@ -450,12 +473,17 @@ scenarios = [config.get_scenario(scenario_name) for scenario_name in scenario_names] return (suite_scenario_str, suite, scenarios) -def bts_obj(suite_run, conf): +def bts_obj(suite_run, arfcn, conf): bts_type = conf.get('type') log.dbg('create BTS object', type=bts_type) bts_class = resource.KNOWN_BTS_TYPES.get(bts_type) if bts_class is None: raise RuntimeError('No such BTS type is defined: %r' % bts_type) - return bts_class(suite_run, conf) + bts_inst = bts_class(suite_run, conf) + if arfcn is None: + supported_bands = bts_inst.supported_bands() + arfcn = suite_run._try_reserve_arfcn(supported_bands) + bts_inst.set_arfcn_resource(arfcn) + return bts_inst # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/register/register_band_1900.py b/suites/register/register_band_1900.py new file mode 100755 index 0000000..3e0f6c3 --- /dev/null +++ b/suites/register/register_band_1900.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +arfcn = suite.reserve_arfcn(band='GSM-1900') +bts = suite.bts(arfcn) +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +ms.log_info() + +print('waiting for modems to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/register/suite.conf b/suites/register/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/register/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3722 to look at the new patch set (#4). config: Fix combination of lists This commit fixes combination of resources containing lists. For lists containing complex types, it has been decided to handle them as sorted list, where position in list matters. In this case, combine is called recursively for each element in dest and src sharing position in the list, and assumes that if one list is shorter than the other, then it has to be combined against empty set for that tye. For instance this is useful when defining trx_list properties, where a BTS can have a different amount of TRX but we may be interested in restricting the first TRX and don't care about extra TRX. For lists containing simple types (eg. integers or strings), we just want to merge both lists and we only need to check if the value is already there, ie. handle them as unsortered sets. This case won't work if we call combine for each element of the list because for a simple case it will just end up checking if a[i] == b[i]. This kind of operation for simple types is needed in later commits where cipher attribute is introduced. Without this patch, having following 2 scenarios and trying them to use together "-s foosuite:cipher-a50+ciphera51" will fail: cipher_a50.conf: bts: - ciphers: - 'a5 0' cipher_a51.conf bts: - ciphers: - 'a5 1' ValueError: cannot combine dicts, conflicting items (values 'a5 0' and 'a5 1') Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 --- M selftest/config_test.ok M selftest/config_test.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/util.py 4 files changed, 158 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3722/4 diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 80b5a06..9647deb 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -93,3 +93,31 @@ Validation: Error --- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error +- Combine dicts: +{'times': '2', 'type': 'osmo-bts-trx'} +- Combine dicts 2: +{'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +- Combine lists: +{'a_list': ['x', 'y', 'z']} +- Combine lists 2: +{'a_list': ['x', 'w', 'u', 'y', 'z']} +- Combine lists 3: +ValueError expected +- Combine lists 4: +ValueError expected +- Combine lists 5: +ValueError expected +- Combine lists 6: +{'a_list': [{}, {}]} +- Combine lists 7: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 8: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 9: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 10: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 13: +{'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +- Combine lists 14: +{'times': '1', 'label': 'foo', 'trx': [], 'type': 'osmo-bts-trx'} diff --git a/selftest/config_test.py b/selftest/config_test.py index 61ec73a..94ac1f2 100755 --- a/selftest/config_test.py +++ b/selftest/config_test.py @@ -112,4 +112,94 @@ c['imsi'][2] = None val(c) +print('- Combine dicts:') +a = {'times': '2'} +b = {'type': 'osmo-bts-trx'} +config.combine(a, b) +print(a) + +print('- Combine dicts 2:') +a = {'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +b = {'type': 'osmo-bts-trx'} +config.combine(a, b) +print(a) + +print('- Combine lists:') +a = { 'a_list': ['x', 'y', 'z'] } +b = { 'a_list': ['y'] } +config.combine(a, b) +print(a) + +print('- Combine lists 2:') +a = { 'a_list': ['x'] } +b = { 'a_list': ['w', 'u', 'x', 'y', 'z'] } +config.combine(a, b) +print(a) + +print('- Combine lists 3:') +a = { 'a_list': ['x', 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 4:') +a = { 'a_list': [2, 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 5:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 6:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': [{}] } +config.combine(a, b) +print(a) + +print('- Combine lists 7:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 8:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 9:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 10:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 13:') +a = { 'times': '1', 'label': 'foo', 'trx': [{}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +config.combine(a, b) +print(a) + +print('- Combine lists 14:') +a = { 'times': '1', 'label': 'foo', 'trx': [] } +b = { 'type': 'osmo-bts-trx', 'trx': [] } +config.combine(a, b) +print(a) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 4e7f504..378df8c 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -245,9 +245,23 @@ if is_list(dest): if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) - for i in range(len(src)): - log.ctx(idx=i) - combine(dest[i], src[i]) + # Validate that all elements in both lists are of the same type: + t = util.list_validate_same_elem_type(src + dest) + if t is None: + return # both lists are empty, return + # For lists of complex objects, we expect them to be sorted lists: + if t in (dict, list, tuple): + for i in range(len(dest)): + log.ctx(idx=i) + src_it = src[i] if i < len(src) else util.empty_instance_type(t) + combine(dest[i], src_it) + for i in range(len(dest), len(src)): + log.ctx(idx=i) + dest.append(src[i]) + else: # for lists of basic elements, we handle them as unsorted sets: + for elem in src: + if elem not in dest: + dest.append(elem) return if dest == src: return diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..f3655c0 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -314,4 +314,27 @@ return True raise ValueError('Invalid BOOL field: %r' % val) +def list_validate_same_elem_type(li): + ''' + Checks that all elements in the list are of the same type and returns that type. + If the list is empty, returns None + If one of the elements is not of the same type, it throws a ValueError exception. + ''' + if len(li) == 0: + return None + t = type(li[0]) + for elem in li: + if type(elem) != t: + raise ValueError('List contains elements of different types: %r vs %r' % (t, type(elem))) + return t + +def empty_instance_type(t): + if t == dict: + return {} + elif t == list: + return [] + elif t == tuple: + return () + raise ValueError('type %r not supported!' % t) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3723 to look at the new patch set (#6). Add cipher cfg param for modem and bts This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e --- M example/default-suites.conf M example/resources.conf A example/scenarios/cipher-a50.conf A example/scenarios/cipher-a51.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 31 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/3723/6 diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..1e8d47a 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption +- aoip_encryption:cipher-a50+cipher-a51 diff --git a/example/resources.conf b/example/resources.conf index f190c2f..95cb8cf 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -13,6 +13,7 @@ ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: [a5_0, a5_1, a5_3] - label: Ettus B200 type: osmo-bts-trx @@ -20,6 +21,7 @@ addr: 10.42.42.50 band: GSM-1800 launch_trx: true + ciphers: [a5_0, a5_1] - label: sysmoCell 5000 type: osmo-bts-trx @@ -27,6 +29,7 @@ addr: 10.42.42.51 band: GSM-1800 trx_remote_ip: 10.42.42.112 + ciphers: [a5_0, a5_1] arfcn: - arfcn: 512 @@ -56,21 +59,25 @@ imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' + ciphers: [a5_0, a5_1] diff --git a/example/scenarios/cipher-a50.conf b/example/scenarios/cipher-a50.conf new file mode 100644 index 0000000..107172b --- /dev/null +++ b/example/scenarios/cipher-a50.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - a5_0 + modem: + - ciphers: + - a5_0 diff --git a/example/scenarios/cipher-a51.conf b/example/scenarios/cipher-a51.conf new file mode 100644 index 0000000..8539867 --- /dev/null +++ b/example/scenarios/cipher-a51.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - a5_1 + modem: + - ciphers: + - a5_1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index c346227..d3deb7f 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -56,6 +56,7 @@ 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, + 'bts[].ciphers[]': schema.CIPHER, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'bts[].trx_list[].nominal_power': schema.INT, @@ -66,6 +67,7 @@ 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, + 'modem[].ciphers[]': schema.CIPHER, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index dcdfdb1..9a0906c 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -76,6 +76,11 @@ if n < 1: raise ValueError('Positive value >0 expected instead of %d' % n) +def cipher(val): + if val in ('a5_0', 'a5_1', 'a5_2', 'a5_3', 'a5_4', 'a5_5', 'a5_6', 'a5_7'): + return + raise ValueError('Unknown Cipher value: %r' % val) + INT = 'int' STR = 'str' UINT = 'uint' @@ -88,6 +93,7 @@ MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' TIMES='times' +CIPHER = 'cipher' SCHEMA_TYPES = { INT: int, STR: str, @@ -101,6 +107,7 @@ MSISDN: msisdn, AUTH_ALGO: auth_algo, TIMES: times, + CIPHER: cipher, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 6 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:50 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource: ipa_unit_id is expected to be a positive integer Message-ID: Review at https://gerrit.osmocom.org/3916 resource: ipa_unit_id is expected to be a positive integer Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb --- M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 2 files changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/16/3916/1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index da543f7..f8acb9e 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -51,7 +51,7 @@ 'ip_address[].addr': schema.IPV4, 'bts[].label': schema.STR, 'bts[].type': schema.STR, - 'bts[].ipa_unit_id': schema.INT, + 'bts[].ipa_unit_id': schema.UINT, 'bts[].addr': schema.IPV4, 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 2da80cd..b904960 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -66,8 +66,14 @@ return raise ValueError('Unknown Authentication Algorithm: %r' % val) +def uint(val): + n = int(val) + if n < 0: + raise ValueError('Positive value expected instead of %d' % n) + INT = 'int' STR = 'str' +UINT = 'uint' BOOL_STR = 'bool_str' BAND = 'band' IPV4 = 'ipv4' @@ -79,6 +85,7 @@ SCHEMA_TYPES = { INT: int, STR: str, + UINT: uint, BOOL_STR: str2bool, BAND: band, IPV4: ipv4, -- To view, visit https://gerrit.osmocom.org/3916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:51 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource: times is expected to be a non-zero positive integer Message-ID: Review at https://gerrit.osmocom.org/3917 resource: times is expected to be a non-zero positive integer Change-Id: Ie9e313727053a411cec2f698c3bd654d27e8013f --- M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 2 files changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/17/3917/1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index f8acb9e..d8efe2f 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -68,7 +68,7 @@ } WANT_SCHEMA = util.dict_add( - dict([('%s[].times' % r, schema.INT) for r in R_ALL]), + dict([('%s[].times' % r, schema.TIMES) for r in R_ALL]), RESOURCES_SCHEMA) KNOWN_BTS_TYPES = { diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index b904960..dcdfdb1 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -71,6 +71,11 @@ if n < 0: raise ValueError('Positive value expected instead of %d' % n) +def times(val): + n = int(val) + if n < 1: + raise ValueError('Positive value >0 expected instead of %d' % n) + INT = 'int' STR = 'str' UINT = 'uint' @@ -82,6 +87,7 @@ KI = 'ki' MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' +TIMES='times' SCHEMA_TYPES = { INT: int, STR: str, @@ -94,6 +100,7 @@ KI: ki, MSISDN: msisdn, AUTH_ALGO: auth_algo, + TIMES: times, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9e313727053a411cec2f698c3bd654d27e8013f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:51 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Move code to replicate dicts based on times attr to its own ... Message-ID: Review at https://gerrit.osmocom.org/3918 Move code to replicate dicts based on times attr to its own function Change-Id: I26ddae2124813bfb63a7c97c466e056cd2ef991a --- M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py 2 files changed, 16 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/18/3918/1 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index f6e81ac..a0fe969 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -52,6 +52,7 @@ import yaml import os +import copy from . import log, schema, util from .util import is_dict, is_list, Dir, get_tempdir @@ -271,4 +272,18 @@ dest[i] = overlay(dest[i], src[i]) return dest return src + +def replicate_times(d): + 'replicate items that have a "times" > 1' + d = copy.deepcopy(d) + for key, item_list in d.items(): + more_items = [] + for item in item_list: + times = int(item.pop('times')) + if times and times > 1: + for i in range(times - 1): + more_items.append(copy.deepcopy(item)) + item_list.extend(more_items) + return d + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index d8efe2f..8f34bdb 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -134,16 +134,7 @@ ''' schema.validate(want, WANT_SCHEMA) - # replicate items that have a 'times' > 1 - want = copy.deepcopy(want) - for key, item_list in want.items(): - more_items = [] - for item in item_list: - times = int(item.pop('times')) - if times and times > 1: - for i in range(times - 1): - more_items.append(copy.deepcopy(item)) - item_list.extend(more_items) + want = config.replicate_times(want) origin_id = origin.origin_id() -- To view, visit https://gerrit.osmocom.org/3918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26ddae2124813bfb63a7c97c466e056cd2ef991a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:36:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:36:51 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: replicate_times: insert replicates in place Message-ID: Review at https://gerrit.osmocom.org/3919 config: replicate_times: insert replicates in place In the following suite.conf, position matters when matching against scenarios: [suite.conf] resources: bts: - type: sysmo times: 2 - type: osmo-bts-trx times: 1 [scenario] resources: bts: - - ip_addr: 1.2.3.4 In this case, for instance, we make it clear that we want the second sysmo bts which has IP 1.2.3.4. With old behaviour, the replicated sysmo would have been created at the end (3rd position), and the ip_addr would match against the osmo-bts-trx BTS. Change-Id: Id78e2326db964d5efb6648854b57d8addce4deb0 --- M src/osmo_gsm_tester/config.py 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/19/3919/1 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index a0fe969..4e7f504 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -277,13 +277,13 @@ 'replicate items that have a "times" > 1' d = copy.deepcopy(d) for key, item_list in d.items(): - more_items = [] - for item in item_list: - times = int(item.pop('times')) - if times and times > 1: - for i in range(times - 1): - more_items.append(copy.deepcopy(item)) - item_list.extend(more_items) + idx = 0 + while idx < len(item_list): + item = item_list[idx] + times = int(item.pop('times', 1)) + for j in range(1, times): + item_list.insert(idx + j, copy.deepcopy(item)) + idx += times return d # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id78e2326db964d5efb6648854b57d8addce4deb0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:45:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:45:22 +0000 Subject: osmo-gsm-tester[master]: suite: Replicate resources based on times attr before callin... In-Reply-To: References: Message-ID: Patch Set 2: Strange, unit tests pass in all my commits locally, but fail here -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 15:50:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 15:50:47 +0000 Subject: osmo-gsm-tester[master]: suite: Replicate resources based on times attr before callin... In-Reply-To: References: Message-ID: Patch Set 2: It seems python version in my PC prints dictionary elements in a different order that the python version running the tests. See the diff, order of "type" and "trx_list" in each dictionary is swapped. -tst {combining_scenarios='resources', scenario='foo'}: DBG: {conf={bts=[{'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}]}, scenario='foo'} [test_suite?{combining_scenarios='resources', scenario='foo'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: DBG: {conf={bts=[{'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}], 'type': 'osmo-bts-trx'}, {'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}], 'type': 'osmo-bts-trx'}, {'type': 'sysmo'}]}, scenario='foo'} [test_suite?{combining_scenarios='resources', scenario='foo'}] [suite.py:[LINENR]] -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 12 16:35:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 12 Sep 2017 16:35:19 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: use define for constant Message-ID: Review at https://gerrit.osmocom.org/3920 Simplify TS alloc: use define for constant Define and use constant for occupied TFI instead copying the same magic number all over the place. Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 4 files changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/1 diff --git a/src/bts.cpp b/src/bts.cpp index 68c23ff..f5f6f44 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -457,7 +457,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = TFI_IS_BUSY; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index 611a58b..555b393 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define TFI_IS_BUSY 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 1410e00..1141734 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -126,7 +126,7 @@ uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - if (tfi_map == 0xffffffffUL) + if (tfi_map == TFI_IS_BUSY) return -1; /* look for USF, don't use USF=7 */ @@ -203,7 +203,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == TFI_IS_BUSY) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -327,10 +327,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == TFI_IS_BUSY) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == TFI_IS_BUSY) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index c614d48..dd5f242 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -609,11 +609,11 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != TFI_IS_BUSY) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != TFI_IS_BUSY) continue; busy_slots |= 1 << i; -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 16:37:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 16:37:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: suite: Replicate resources based on times attr before callin... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3907 to look at the new patch set (#3). suite: Replicate resources based on times attr before calling combine As suite.conf and scenarios need to match 1-to-1 in lists, it's important to extend the dictionaries by replicating the objects with a 'times' values higher than 1 in order to match the objects correctly. Two unit tests are added as a show case. Unfortunately output showing scenario dictionaries needs to be ignored while verifying because it was encountered that different versions of python print dictionary elements in different order. Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 --- M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/resources.conf M selftest/suite_test/test_suite/suite.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 7 files changed, 216 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/3907/3 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..365fcaa 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -16,6 +16,7 @@ resources: bts: - times: '1' + - times: '2' ip_address: - times: '1' modem: @@ -30,14 +31,30 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 3) +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] +tst test_suite: Reserving 3 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 @@ -140,5 +157,151 @@ skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected +- test with half empty scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py +- test with scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e + addr: 10.42.42.52 + band: GSM-1800 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + trx_list: + - nominal_power: '10' + - nominal_power: '12' + type: osmo-bts-trx +- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index dcda3b6..49bd9eb 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,3 +1,4 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] \([0-9.]+ sec\) (N.N sec) +{combining_scenarios='resources', scenario='foo'}:.* {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 86c4c25..12bd5e7 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -42,5 +42,21 @@ output = report.suite_to_text(s) print(output) +print('- test with half empty scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + +print('- test with scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..e302373 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -28,6 +28,36 @@ trx_list: - hw_addr: 00:02:95:00:41:b3 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.52 + band: GSM-1800 + launch_trx: true + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + arfcn: - arfcn: 512 band: GSM-1800 diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/test_suite/suite.conf index 376f6cd..890f66a 100644 --- a/selftest/suite_test/test_suite/suite.conf +++ b/selftest/suite_test/test_suite/suite.conf @@ -3,6 +3,7 @@ - times: 1 bts: - times: 1 + - times: 2 modem: - times: 2 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8f34bdb..c346227 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -58,6 +58,7 @@ 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, + 'bts[].trx_list[].nominal_power': schema.INT, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 9b975fd..f4cba1e 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -209,11 +209,11 @@ def combined(self, conf_name): log.dbg(combining=conf_name) log.ctx(combining_scenarios=conf_name) - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + combination = config.replicate_times(self.definition.conf.get(conf_name, {})) log.dbg(definition_conf=combination) for scenario in self.scenarios: log.ctx(combining_scenarios=conf_name, scenario=scenario.name()) - c = scenario.get(conf_name) + c = config.replicate_times(scenario.get(conf_name, {})) log.dbg(scenario=scenario.name(), conf=c) if c is None: continue -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 16:56:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 12 Sep 2017 16:56:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3722 to look at the new patch set (#6). config: Fix combination of lists This commit fixes combination of resources containing lists. For lists containing complex types, it has been decided to handle them as sorted list, where position in list matters. In this case, combine is called recursively for each element in dest and src sharing position in the list, and assumes that if one list is shorter than the other, then it has to be combined against empty set for that tye. For instance this is useful when defining trx_list properties, where a BTS can have a different amount of TRX but we may be interested in restricting the first TRX and don't care about extra TRX. For lists containing simple types (eg. integers or strings), we just want to merge both lists and we only need to check if the value is already there, ie. handle them as unsortered sets. This case won't work if we call combine for each element of the list because for a simple case it will just end up checking if a[i] == b[i]. This kind of operation for simple types is needed in later commits where cipher attribute is introduced. Without this patch, having following 2 scenarios and trying them to use together "-s foosuite:cipher-a50+ciphera51" will fail: cipher_a50.conf: bts: - ciphers: - 'a5 0' cipher_a51.conf bts: - ciphers: - 'a5 1' ValueError: cannot combine dicts, conflicting items (values 'a5 0' and 'a5 1') Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 --- M selftest/config_test.ok M selftest/config_test.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/util.py 4 files changed, 158 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3722/6 diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 80b5a06..e1fb87d 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -93,3 +93,20 @@ Validation: Error --- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error +- Combine dicts: +- Combine dicts 2: +- Combine lists: +- Combine lists 2: +- Combine lists 3: +ValueError expected +- Combine lists 4: +ValueError expected +- Combine lists 5: +ValueError expected +- Combine lists 6: +- Combine lists 7: +- Combine lists 8: +- Combine lists 9: +- Combine lists 10: +- Combine lists 13: +- Combine lists 14: diff --git a/selftest/config_test.py b/selftest/config_test.py index 61ec73a..fa86adc 100755 --- a/selftest/config_test.py +++ b/selftest/config_test.py @@ -112,4 +112,105 @@ c['imsi'][2] = None val(c) +print('- Combine dicts:') +a = {'times': '2'} +b = {'type': 'osmo-bts-trx'} +res = {'times': '2', 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine dicts 2:') +a = {'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +b = {'type': 'osmo-bts-trx'} +res = {'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists:') +a = { 'a_list': ['x', 'y', 'z'] } +b = { 'a_list': ['y'] } +res = {'a_list': ['x', 'y', 'z']} +config.combine(a, b) +assert a == res + +print('- Combine lists 2:') +a = { 'a_list': ['x'] } +b = { 'a_list': ['w', 'u', 'x', 'y', 'z'] } +res = {'a_list': ['x', 'w', 'u', 'y', 'z']} +config.combine(a, b) +assert a == res + +print('- Combine lists 3:') +a = { 'a_list': ['x', 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 4:') +a = { 'a_list': [2, 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 5:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 6:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': [{}] } +res = {'a_list': [{}, {}]} +config.combine(a, b) +assert a == res + +print('- Combine lists 7:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 8:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 9:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 10:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 13:') +a = { 'times': '1', 'label': 'foo', 'trx': [{}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 14:') +a = { 'times': '1', 'label': 'foo', 'trx': [] } +b = { 'type': 'osmo-bts-trx', 'trx': [] } +res = {'times': '1', 'label': 'foo', 'trx': [], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 4e7f504..378df8c 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -245,9 +245,23 @@ if is_list(dest): if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) - for i in range(len(src)): - log.ctx(idx=i) - combine(dest[i], src[i]) + # Validate that all elements in both lists are of the same type: + t = util.list_validate_same_elem_type(src + dest) + if t is None: + return # both lists are empty, return + # For lists of complex objects, we expect them to be sorted lists: + if t in (dict, list, tuple): + for i in range(len(dest)): + log.ctx(idx=i) + src_it = src[i] if i < len(src) else util.empty_instance_type(t) + combine(dest[i], src_it) + for i in range(len(dest), len(src)): + log.ctx(idx=i) + dest.append(src[i]) + else: # for lists of basic elements, we handle them as unsorted sets: + for elem in src: + if elem not in dest: + dest.append(elem) return if dest == src: return diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..f3655c0 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -314,4 +314,27 @@ return True raise ValueError('Invalid BOOL field: %r' % val) +def list_validate_same_elem_type(li): + ''' + Checks that all elements in the list are of the same type and returns that type. + If the list is empty, returns None + If one of the elements is not of the same type, it throws a ValueError exception. + ''' + if len(li) == 0: + return None + t = type(li[0]) + for elem in li: + if type(elem) != t: + raise ValueError('List contains elements of different types: %r vs %r' % (t, type(elem))) + return t + +def empty_instance_type(t): + if t == dict: + return {} + elif t == list: + return [] + elif t == tuple: + return () + raise ValueError('type %r not supported!' % t) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 6 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 12 17:37:57 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 12 Sep 2017 17:37:57 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Of course, we can remove jobs which raise questions, but they may just point out "unwanted" deviations e.g. compiler warnings v3/v4. Which jobs should be removed in your opinion? https://gerrit.osmocom.org/#/c/3911/1/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: Line 34: # gcc warnings v3 not v4 > I'm pretty sure it's just artifact of prehistoric times. We should just ena Thanks, I will remove related comments, because v4 is default. -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 12 17:40:19 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 12 Sep 2017 17:40:19 +0000 Subject: [PATCH] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- A jobs/gerrit-verifications.yml 1 file changed, 273 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/3911/2 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..b079201 --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,273 @@ +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation is default + cmd: ./contrib/jenkins.sh + + repos: + # no drafts verified? + - osmo-iuh + + - osmo-gsm-manuals + + # no 'clean state'? + - osmo-sip-connector + + # touchstone config without filter? + - osmocom-bb + + # no drafts verified? + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + # no gcc warnings at all? + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # drafts not verified + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # no drafts are checked? + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - cellmgr-ng: + concurrent: true + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + # no gcc warnings? + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: '(BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct+trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="femtobts_v2.7") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v2.4") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.0.1pre") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.1") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v5.1") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="v2017.01") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next")' + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + # no gcc warnings at all? + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e SMPP="$SMPP" \ + -e MGCP="$MGCP" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -i -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build \ + -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 \ + /build/contrib/jenkins.sh + + # no ./contrib/jenkins.sh script might worth putting it in repo? + - osmo-tetra: + cmd: > + rm -rf deps/install + mkdir deps || true + cd deps + osmo-deps.sh libosmocore + + cd libosmocore + autoreconf --install --force + ./configure --prefix=$PWD/../install + $MAKE $PARALLEL_MAKE install + + cd ../../src + make clean || true + PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + + triggers: + - gerrit: + trigger-on: + - draft-published-event + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: true # for testing + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + # ensure clean state + - shell: 'chmod -R +w *; rm -rf *; git checkout .' + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 17:42:50 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 12 Sep 2017 17:42:50 +0000 Subject: [PATCH] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- A jobs/gerrit-verifications.yml 1 file changed, 273 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/3911/3 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..3ac1dd2 --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,273 @@ +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation is default + cmd: ./contrib/jenkins.sh + + repos: + # no drafts verified? + - osmo-iuh + + - osmo-gsm-manuals + + # no 'clean state'? + - osmo-sip-connector + + # touchstone config without filter? + - osmocom-bb + + # no drafts verified? + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + # no gcc warnings at all? + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # drafts not verified + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + # no drafts are checked? + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - cellmgr-ng: + concurrent: true + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + # no gcc warnings? + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: '(BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct+trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="femtobts_v2.7") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v2.4") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.0.1pre") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.1") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v5.1") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="v2017.01") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next")' + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + # no gcc warnings at all? + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e SMPP="$SMPP" \ + -e MGCP="$MGCP" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -i -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build \ + -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 \ + /build/contrib/jenkins.sh + + # no ./contrib/jenkins.sh script might worth putting it in repo? + - osmo-tetra: + cmd: > + rm -rf deps/install + mkdir deps || true + cd deps + osmo-deps.sh libosmocore + + cd libosmocore + autoreconf --install --force + ./configure --prefix=$PWD/../install + $MAKE $PARALLEL_MAKE install + + cd ../../src + make clean || true + PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + + triggers: + - gerrit: + trigger-on: + - draft-published-event + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: true # for testing + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + # ensure clean state + - shell: 'chmod -R +w *; rm -rf *; git checkout .' + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 12 23:32:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 12 Sep 2017 23:32:00 +0000 Subject: [PATCH] openbsc[master]: fix vty tests: vty no longer goes to parent node implicitly Message-ID: Review at https://gerrit.osmocom.org/3921 fix vty tests: vty no longer goes to parent node implicitly Fix three instances of VTY tests working because it used to include implicit 'exit' commands to the parent node. Since libosmocore change-id Id73cba2dd34676bad8a130e9c45e67a272f19588 = commit d64b6aed235f6e4d84a2cb8e84b32c3179260254, we no longer do this implicit-exit in interactive VTY shells. *) in testPingPongConfiguration, the intention is to enter the /msc 0 node. Drop prior entry of the 'network' node, which looks like an oversight. So far the 'msc 0' caused an implicit 'exit' and thus worked, now fails. *) Two instances following comments "# Check searching for outer node's commands", which look like they are intended to check for this implicit-exit behavior. This is obsolete, drop those parts of the tests. Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab --- M openbsc/tests/vty_test_runner.py 1 file changed, 0 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/3921/1 diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 92775d5..accabae 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -606,14 +606,6 @@ self.assertTrue(self.vty.verify("exit", [''])) self.assertTrue(self.vty.node() is None) - # Check searching for outer node's commands - self.vty.command("configure terminal") - self.vty.command('msc 0') - self.vty.command("bsc") - self.assertEquals(self.vty.node(), 'config-bsc') - self.vty.command("msc 0") - self.assertEquals(self.vty.node(), 'config-msc') - def testUssdNotificationsMsc(self): self.vty.enable() self.vty.command("configure terminal") @@ -716,7 +708,6 @@ def testPingPongConfiguration(self): self.vty.enable() self.vty.verify("configure terminal", ['']) - self.vty.verify("network", ['']) self.vty.verify("msc 0", ['']) self.vty.verify("timeout-ping 12", ['']) @@ -856,19 +847,6 @@ self.assertEquals(self.vty.node(), 'config') self.assertTrue(self.vty.verify('exit', [''])) self.assertTrue(self.vty.node() is None) - - # Check searching for outer node's commands - self.vty.command('configure terminal') - self.vty.command('mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('bsc 0') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') def testRewriteNoRewrite(self): self.vty.enable() -- To view, visit https://gerrit.osmocom.org/3921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 12 23:40:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 12 Sep 2017 23:40:40 +0000 Subject: [PATCH] openbsc[master]: vty tests: drop testBSCreload Message-ID: Review at https://gerrit.osmocom.org/3922 vty tests: drop testBSCreload We are having continued problems with the testBSCreload reliability on the jenkins builds. The trouble the test makes outweighs its benefit, so drop it. We may want to add this test to be built on a build that is not critical for Gerrit patch verification, but in the lack of a mechanism to enable/disable this single test, it is easiest to revert this patch manually for such a build. Change-Id: Ib042cd24857cc58a4297d666a8a525e05bd4c917 --- M openbsc/tests/vty_test_runner.py 1 file changed, 0 insertions(+), 78 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/3922/1 diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 92775d5..181e5ee 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -779,61 +779,6 @@ def vty_app(self): return (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat") - def testBSCreload(self): - # Use different port for the mock msc to avoid clashing with - # the osmo-bsc_nat itself - ip = "127.0.0.1" - port = 5522 - self.vty.enable() - bscs1 = self.vty.command("show bscs-config") - nat_bsc_reload(self) - bscs2 = self.vty.command("show bscs-config") - # check that multiple calls to bscs-config-file give the same result - self.assertEquals(bscs1, bscs2) - - # add new bsc - self.vty.command("configure terminal") - self.vty.command("nat") - self.vty.command("bsc 5") - self.vty.command("token key") - self.vty.command("location_area_code 666") - self.vty.command("end") - - # update bsc token - self.vty.command("configure terminal") - self.vty.command("nat") - self.vty.command("bsc 1") - self.vty.command("token xyu") - self.vty.command("end") - - nat_msc_ip(self, ip, port) - msc_socket, msc = nat_msc_test(self, ip, port, verbose=True) - try: - b0 = nat_bsc_sock_test(0, "lol", verbose=True, proc=self.proc) - b1 = nat_bsc_sock_test(1, "xyu", verbose=True, proc=self.proc) - b2 = nat_bsc_sock_test(5, "key", verbose=True, proc=self.proc) - - self.assertEquals("3 BSCs configured", self.vty.command("show nat num-bscs-configured")) - self.assertTrue(3 == nat_bsc_num_con(self)) - self.assertEquals("MSC is connected: 1", self.vty.command("show msc connection")) - - nat_bsc_reload(self) - bscs2 = self.vty.command("show bscs-config") - # check that the reset to initial config succeeded - self.assertEquals(bscs1, bscs2) - - self.assertEquals("2 BSCs configured", self.vty.command("show nat num-bscs-configured")) - self.assertTrue(1 == nat_bsc_num_con(self)) - rem = self.vty.command("show bsc connections").split(' ') - # remaining connection is for BSC0 - self.assertEquals('0', rem[2]) - # remaining connection is authorized - self.assertEquals('1', rem[4]) - self.assertEquals("MSC is connected: 1", self.vty.command("show msc connection")) - finally: - msc.close() - msc_socket.close() - def testVtyTree(self): self.vty.enable() self.assertTrue(self.vty.verify('configure terminal', [''])) @@ -1310,29 +1255,6 @@ else: if (verbose): print "\tBSC <- NAT: ", s - -def nat_bsc_num_con(x): - return len(x.vty.command("show bsc connections").split('\n')) - -def nat_bsc_sock_test(nr, tk, verbose = False, proc=None): - bsc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - bsc.bind(('127.0.0.1', 0)) - bsc.connect(('127.0.0.1', 5000)) - if (verbose): - print "BSC%d " %nr - print "\tconnected to %s:%d" % bsc.getpeername() - if proc: - print "\tproc.poll() = %r" % proc.poll() - print "\tproc.pid = %r" % proc.pid - ipa_handle_small(bsc, verbose) - ipa_handle_resp(bsc, tk, verbose, proc=proc) - if proc: - print "\tproc.poll() = %r" % proc.poll() - bsc.recv(27) # MGCP msg - if proc: - print "\tproc.poll() = %r" % proc.poll() - ipa_handle_small(bsc, verbose) - return bsc def add_bsc_test(suite, workdir): if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): -- To view, visit https://gerrit.osmocom.org/3922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib042cd24857cc58a4297d666a8a525e05bd4c917 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 07:42:46 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 13 Sep 2017 07:42:46 +0000 Subject: [PATCH] python/osmo-python-tests[master]: vty: Print open file descriptors of the VTY test runner Message-ID: Review at https://gerrit.osmocom.org/3923 vty: Print open file descriptors of the VTY test runner /proc/self/fd refers to the process opening the file. In this case self will be "ls". Maybe it is better to look at the FDs open in the test runner itself. Change-Id: I638e94f16f4019a7b6026d1fae69e677870fb253 --- M osmopy/obscvty.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/23/3923/1 diff --git a/osmopy/obscvty.py b/osmopy/obscvty.py index f1f1c59..0371dc9 100755 --- a/osmopy/obscvty.py +++ b/osmopy/obscvty.py @@ -43,7 +43,7 @@ global debug_tcp_sockets if not debug_tcp_sockets: return - cmd('ls /proc/self/fd'); + cmd('ls /proc/' + str(os.getpid()) + '/fd'); cmd('ss -tn'); cmd('ss -tln'); cmd('ps xua | grep osmo'); -- To view, visit https://gerrit.osmocom.org/3923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I638e94f16f4019a7b6026d1fae69e677870fb253 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Sep 13 07:42:50 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 13 Sep 2017 07:42:50 +0000 Subject: [PATCH] python/osmo-python-tests[master]: vty: Follow links to see what is a file and what is a socket Message-ID: Review at https://gerrit.osmocom.org/3924 vty: Follow links to see what is a file and what is a socket Change-Id: I3d94cde8523a2ed26a66b8b8b3f651606aa17a9d --- M osmopy/obscvty.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/24/3924/1 diff --git a/osmopy/obscvty.py b/osmopy/obscvty.py index 0371dc9..1e05d77 100755 --- a/osmopy/obscvty.py +++ b/osmopy/obscvty.py @@ -43,7 +43,7 @@ global debug_tcp_sockets if not debug_tcp_sockets: return - cmd('ls /proc/' + str(os.getpid()) + '/fd'); + cmd('ls -l /proc/' + str(os.getpid()) + '/fd'); cmd('ss -tn'); cmd('ss -tln'); cmd('ps xua | grep osmo'); -- To view, visit https://gerrit.osmocom.org/3924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d94cde8523a2ed26a66b8b8b3f651606aa17a9d Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Sep 13 09:51:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 13 Sep 2017 09:51:44 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 2: Ok, let me reformulate my question: Do you ever see this message after this patch? "Out of Trys, no extension for IMSI %s" What I see from the code you're posting is that we now have a loop that is limited by the number of extensions that are available, however, we still use a random function. So I see this as a lottery game, where the less extensions are available, the less chances you have to land on a spare extension, since candidates are selected randomly. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 09:55:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 13 Sep 2017 09:55:49 +0000 Subject: [PATCH] openbsc[master]: libmsc: sms_route_mt_sms() may return uninitialized return v... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3899 to look at the new patch set (#4). libmsc: sms_route_mt_sms() may return uninitialized return value If smpp_first is set off and there is a local receiver for this sms, then return 0. Without this patch, we return 'rc' which is uninitialized in the scenario that I'm describing above. Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/99/3899/4 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 27bffc9..25ef487 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -363,31 +363,32 @@ /* determine gsms->receiver based on dialled number */ gsms->receiver = subscr_get_by_extension(conn->network->subscr_group, gsms->dst.addr); - if (!gsms->receiver) { -#ifdef BUILD_SMPP - /* Avoid a second look-up */ - if (smpp_first) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - } + if (gsms->receiver) + return 0; - rc = smpp_try_deliver(gsms, conn); - if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - } else if (rc < 0) { - LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", - subscr_name(conn->subscr), rc); - rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; - /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ - MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); - } -#else - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; +#ifdef BUILD_SMPP + /* Avoid a second look-up */ + if (smpp_first) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); -#endif + return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } + rc = smpp_try_deliver(gsms, conn); + if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); + } else if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", + subscr_name(conn->subscr), rc); + rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; + /* rc will be logged by gsm411_send_rp_error() */ + rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); + } +#else + rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); +#endif + return rc; } -- To view, visit https://gerrit.osmocom.org/3899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: laforge Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Sep 13 10:00:25 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 13 Sep 2017 10:00:25 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 2: Yes, I get avoiding many calls of rand(). Not sure I/we should spend so much time on this. I spotted it and am being very nit picky, and thought it was an opportunity to learn.. It's very unlikely one would run out of extensions, unless one did happen to configure a very limited number of them. I would do what you suggest to avoid so much rand() but right now I'm stuck trying to get the output of select count(*) from libdbi, which is frustrating. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 10:54:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 10:54:34 +0000 Subject: [PATCH] openbsc[master]: fix vty tests: vty no longer goes to parent node implicitly In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3921 to look at the new patch set (#2). fix vty tests: vty no longer goes to parent node implicitly Fix four instances of VTY tests working because it used to include implicit 'exit' commands to the parent node. Since libosmocore change-id Id73cba2dd34676bad8a130e9c45e67a272f19588 = commit d64b6aed235f6e4d84a2cb8e84b32c3179260254, we no longer do this implicit-exit in interactive VTY shells. *) the nitb node lacked the default command set (including 'end' and 'exit'), so it was impossible to leave the nitb node. This hit in testSubscriberCreateDelete. Add vty_install_default(NITB_NODE). *) in testPingPongConfiguration, the intention is to enter the /msc 0 node. Drop prior entry of the 'network' node, which looks like an oversight. So far the 'msc 0' caused an implicit 'exit' and thus worked, now fails. *) Two instances following comments "# Check searching for outer node's commands", which look like they are intended to check for this implicit-exit behavior. This is obsolete, drop those parts of the tests. Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab --- M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/vty_test_runner.py 2 files changed, 1 insertion(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/3921/2 diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 4a99cf1..f66769b 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -1294,6 +1294,7 @@ install_element(CONFIG_NODE, &cfg_nitb_cmd); install_node(&nitb_node, config_write_nitb); + vty_install_default(NITB_NODE); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 92775d5..accabae 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -606,14 +606,6 @@ self.assertTrue(self.vty.verify("exit", [''])) self.assertTrue(self.vty.node() is None) - # Check searching for outer node's commands - self.vty.command("configure terminal") - self.vty.command('msc 0') - self.vty.command("bsc") - self.assertEquals(self.vty.node(), 'config-bsc') - self.vty.command("msc 0") - self.assertEquals(self.vty.node(), 'config-msc') - def testUssdNotificationsMsc(self): self.vty.enable() self.vty.command("configure terminal") @@ -716,7 +708,6 @@ def testPingPongConfiguration(self): self.vty.enable() self.vty.verify("configure terminal", ['']) - self.vty.verify("network", ['']) self.vty.verify("msc 0", ['']) self.vty.verify("timeout-ping 12", ['']) @@ -856,19 +847,6 @@ self.assertEquals(self.vty.node(), 'config') self.assertTrue(self.vty.verify('exit', [''])) self.assertTrue(self.vty.node() is None) - - # Check searching for outer node's commands - self.vty.command('configure terminal') - self.vty.command('mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('bsc 0') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') def testRewriteNoRewrite(self): self.vty.enable() -- To view, visit https://gerrit.osmocom.org/3921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:03:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:03:34 +0000 Subject: openbsc[master]: fix vty tests: vty no longer goes to parent node implicitly In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:03:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:03:36 +0000 Subject: [MERGED] openbsc[master]: fix vty tests: vty no longer goes to parent node implicitly In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix vty tests: vty no longer goes to parent node implicitly ...................................................................... fix vty tests: vty no longer goes to parent node implicitly Fix four instances of VTY tests working because it used to include implicit 'exit' commands to the parent node. Since libosmocore change-id Id73cba2dd34676bad8a130e9c45e67a272f19588 = commit d64b6aed235f6e4d84a2cb8e84b32c3179260254, we no longer do this implicit-exit in interactive VTY shells. *) the nitb node lacked the default command set (including 'end' and 'exit'), so it was impossible to leave the nitb node. This hit in testSubscriberCreateDelete. Add vty_install_default(NITB_NODE). *) in testPingPongConfiguration, the intention is to enter the /msc 0 node. Drop prior entry of the 'network' node, which looks like an oversight. So far the 'msc 0' caused an implicit 'exit' and thus worked, now fails. *) Two instances following comments "# Check searching for outer node's commands", which look like they are intended to check for this implicit-exit behavior. This is obsolete, drop those parts of the tests. Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab --- M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/vty_test_runner.py 2 files changed, 1 insertion(+), 22 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 4a99cf1..f66769b 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -1294,6 +1294,7 @@ install_element(CONFIG_NODE, &cfg_nitb_cmd); install_node(&nitb_node, config_write_nitb); + vty_install_default(NITB_NODE); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 92775d5..accabae 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -606,14 +606,6 @@ self.assertTrue(self.vty.verify("exit", [''])) self.assertTrue(self.vty.node() is None) - # Check searching for outer node's commands - self.vty.command("configure terminal") - self.vty.command('msc 0') - self.vty.command("bsc") - self.assertEquals(self.vty.node(), 'config-bsc') - self.vty.command("msc 0") - self.assertEquals(self.vty.node(), 'config-msc') - def testUssdNotificationsMsc(self): self.vty.enable() self.vty.command("configure terminal") @@ -716,7 +708,6 @@ def testPingPongConfiguration(self): self.vty.enable() self.vty.verify("configure terminal", ['']) - self.vty.verify("network", ['']) self.vty.verify("msc 0", ['']) self.vty.verify("timeout-ping 12", ['']) @@ -856,19 +847,6 @@ self.assertEquals(self.vty.node(), 'config') self.assertTrue(self.vty.verify('exit', [''])) self.assertTrue(self.vty.node() is None) - - # Check searching for outer node's commands - self.vty.command('configure terminal') - self.vty.command('mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') - self.vty.command('nat') - self.assertEquals(self.vty.node(), 'config-nat') - self.vty.command('bsc 0') - self.vty.command('mgcp') - self.assertEquals(self.vty.node(), 'config-mgcp') def testRewriteNoRewrite(self): self.vty.enable() -- To view, visit https://gerrit.osmocom.org/3921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:13:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:13:34 +0000 Subject: osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 If the cancellable object remains valid and usable after calling cancel(), then it should indeed remain. But if calling self.cancellable.cancel() somehow invalidates that object / makes it not useful anymore, then please set it to None whenever you cancel()ed, and also check for not-None before using self.cancellable. -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:14:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:14:48 +0000 Subject: python/osmo-python-tests[master]: vty: Print open file descriptors of the VTY test runner In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 lol that was my fault -- To view, visit https://gerrit.osmocom.org/3923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I638e94f16f4019a7b6026d1fae69e677870fb253 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:15:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:15:20 +0000 Subject: python/osmo-python-tests[master]: vty: Follow links to see what is a file and what is a socket In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d94cde8523a2ed26a66b8b8b3f651606aa17a9d Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:24:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:24:10 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-2 as a reminder to not merge, -2 to keep it sticky. Main reason that all resources shall be reserved before the tests start running. -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:36:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:36:46 +0000 Subject: osmo-gsm-tester[master]: config: replicate_times: insert replicates in place In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3919/1/src/osmo_gsm_tester/config.py File src/osmo_gsm_tester/config.py: Line 286: idx += times (might be more obvious code to create an entirely new list on the side, but nevermind if it works) -- To view, visit https://gerrit.osmocom.org/3919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id78e2326db964d5efb6648854b57d8addce4deb0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:39:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:39:54 +0000 Subject: osmo-gsm-tester[master]: suite: Replicate resources based on times attr before callin... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/3907/3/selftest/suite_test/test_suite/suite.conf File selftest/suite_test/test_suite/suite.conf: Line 6: - times: 2 this makes little sense besides being an artificial example, maybe. This wants one BTS without specific traits, and then two more without specific traits. Might as well just times: 3 to begin with. To make more sense, e.g.: bts: - type: sysmo #times: 1 is implicit - times: 2 # two more BTS of any type The yaml is a bit weird there, btw. These are distinct situations: bts: - type: sysmo times: 2 ^ requests two sysmoBTS bts: - type: sysmo - times: 2 ^ requests one sysmoBTS plus two others. It's more obvious with more traits: bts: - type: sysmo goo: moo - bar: baz times: 2 Maybe we should have an example like that in the manual... https://gerrit.osmocom.org/#/c/3907/3/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 61: 'bts[].trx_list[].nominal_power': schema.INT, unrelated? https://gerrit.osmocom.org/#/c/3907/3/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 212: combination = config.replicate_times(self.definition.conf.get(conf_name, {})) since we're moving the expansion of 'times' here, shouldn't we also drop the expansion from resource.py? -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:40:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:40:51 +0000 Subject: osmo-gsm-tester[master]: Move code to replicate dicts based on times attr to its own ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I26ddae2124813bfb63a7c97c466e056cd2ef991a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:41:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:41:34 +0000 Subject: osmo-gsm-tester[master]: resource: times is expected to be a non-zero positive integer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9e313727053a411cec2f698c3bd654d27e8013f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:42:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:42:02 +0000 Subject: osmo-gsm-tester[master]: resource: ipa_unit_id is expected to be a positive integer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:47:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:47:18 +0000 Subject: openbsc[master]: libmsc: sms_route_mt_sms() may return uninitialized return v... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: laforge Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:47:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:47:27 +0000 Subject: [MERGED] openbsc[master]: libmsc: sms_route_mt_sms() may return uninitialized return v... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: sms_route_mt_sms() may return uninitialized return value ...................................................................... libmsc: sms_route_mt_sms() may return uninitialized return value If smpp_first is set off and there is a local receiver for this sms, then return 0. Without this patch, we return 'rc' which is uninitialized in the scenario that I'm describing above. Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 21 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 27bffc9..25ef487 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -363,31 +363,32 @@ /* determine gsms->receiver based on dialled number */ gsms->receiver = subscr_get_by_extension(conn->network->subscr_group, gsms->dst.addr); - if (!gsms->receiver) { -#ifdef BUILD_SMPP - /* Avoid a second look-up */ - if (smpp_first) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - } + if (gsms->receiver) + return 0; - rc = smpp_try_deliver(gsms, conn); - if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { - rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); - } else if (rc < 0) { - LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", - subscr_name(conn->subscr), rc); - rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; - /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ - MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); - } -#else - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; +#ifdef BUILD_SMPP + /* Avoid a second look-up */ + if (smpp_first) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); -#endif + return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } + rc = smpp_try_deliver(gsms, conn); + if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); + } else if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", + subscr_name(conn->subscr), rc); + rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; + /* rc will be logged by gsm411_send_rp_error() */ + rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); + } +#else + rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); +#endif + return rc; } -- To view, visit https://gerrit.osmocom.org/3899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c0bcd919cc3275d491995d17c6a32bb61c6afe1 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: laforge Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:48:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:48:17 +0000 Subject: python/osmo-python-tests[master]: vty: Follow links to see what is a file and what is a socket In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d94cde8523a2ed26a66b8b8b3f651606aa17a9d Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:48:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:48:20 +0000 Subject: python/osmo-python-tests[master]: vty: Print open file descriptors of the VTY test runner In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I638e94f16f4019a7b6026d1fae69e677870fb253 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:48:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:48:24 +0000 Subject: [MERGED] python/osmo-python-tests[master]: vty: Print open file descriptors of the VTY test runner In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: Print open file descriptors of the VTY test runner ...................................................................... vty: Print open file descriptors of the VTY test runner /proc/self/fd refers to the process opening the file. In this case self will be "ls". Maybe it is better to look at the FDs open in the test runner itself. Change-Id: I638e94f16f4019a7b6026d1fae69e677870fb253 --- M osmopy/obscvty.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/osmopy/obscvty.py b/osmopy/obscvty.py index f1f1c59..0371dc9 100755 --- a/osmopy/obscvty.py +++ b/osmopy/obscvty.py @@ -43,7 +43,7 @@ global debug_tcp_sockets if not debug_tcp_sockets: return - cmd('ls /proc/self/fd'); + cmd('ls /proc/' + str(os.getpid()) + '/fd'); cmd('ss -tn'); cmd('ss -tln'); cmd('ps xua | grep osmo'); -- To view, visit https://gerrit.osmocom.org/3923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I638e94f16f4019a7b6026d1fae69e677870fb253 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:48:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:48:25 +0000 Subject: [MERGED] python/osmo-python-tests[master]: vty: Follow links to see what is a file and what is a socket In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: Follow links to see what is a file and what is a socket ...................................................................... vty: Follow links to see what is a file and what is a socket Change-Id: I3d94cde8523a2ed26a66b8b8b3f651606aa17a9d --- M osmopy/obscvty.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/osmopy/obscvty.py b/osmopy/obscvty.py index 0371dc9..1e05d77 100755 --- a/osmopy/obscvty.py +++ b/osmopy/obscvty.py @@ -43,7 +43,7 @@ global debug_tcp_sockets if not debug_tcp_sockets: return - cmd('ls /proc/' + str(os.getpid()) + '/fd'); + cmd('ls -l /proc/' + str(os.getpid()) + '/fd'); cmd('ss -tn'); cmd('ss -tln'); cmd('ps xua | grep osmo'); -- To view, visit https://gerrit.osmocom.org/3924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d94cde8523a2ed26a66b8b8b3f651606aa17a9d Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 11:51:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 11:51:19 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Discover modem path from imsi In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 related: https://osmocom.org/issues/2509 -- To view, visit https://gerrit.osmocom.org/2696 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I602604d25f51b24d87877bc8ac798525b7be61dd Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 12:00:07 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 12:00:07 +0000 Subject: osmo-gsm-tester[master]: suite: Replicate resources based on times attr before callin... In-Reply-To: References: Message-ID: Patch Set 3: (3 comments) https://gerrit.osmocom.org/#/c/3907/3/selftest/suite_test/test_suite/suite.conf File selftest/suite_test/test_suite/suite.conf: Line 6: - times: 2 > this makes little sense besides being an artificial example, maybe. This wa It really doesn't matter if I add more attributes or not for the test case I am doing here. Of course I can write times:3 instead of times:1 + times:2, but I wanted to test this kind of case. If still you feel it may be clearer adding a new attribute in one of the two dictionaries, I'll do so and update the output. https://gerrit.osmocom.org/#/c/3907/3/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 61: 'bts[].trx_list[].nominal_power': schema.INT, > unrelated? I wanted to use an attribute from trx_list[] to test different more complex scenarios than what we were already testing. We are not using hw_addr or net_device and I really don't know how those are used or if we are going to use it at any point. nominal_power is an attribute I know and which we can easily add in the future. What do you propose in exchange? Is it really important? https://gerrit.osmocom.org/#/c/3907/3/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 212: combination = config.replicate_times(self.definition.conf.get(conf_name, {})) > since we're moving the expansion of 'times' here, shouldn't we also drop th Good point. I'll have a look and do some tests and I'll come with an answer. -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 13 13:11:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 13:11:49 +0000 Subject: [PATCH] meta-telephony[201705]: Add git-review config Message-ID: Review at https://gerrit.osmocom.org/3925 Add git-review config Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/25/3925/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..30ca929 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=meta-telephony -- To view, visit https://gerrit.osmocom.org/3925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 13:13:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 13:13:01 +0000 Subject: meta-telephony[201705]: Add git-review config In-Reply-To: References: Message-ID: Patch Set 1: Original patch in gerrit was submited and merged against master. However, we don't user master branch in meta-telephony and it may even disapear at some point. The patch should be applied against 201705 which is the current base branch. -- To view, visit https://gerrit.osmocom.org/3925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 15:07:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 15:07:57 +0000 Subject: [PATCH] osmo-gsm-tester[master]: bts_osmotrx: Fix mkdtemp use inf python < 3.5 Message-ID: Review at https://gerrit.osmocom.org/3926 bts_osmotrx: Fix mkdtemp use inf python < 3.5 We are currently seeing this issues in prod setup, which uses python 3.4: File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/bts_osmotrx.py", line 44, in __init__ self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) File "/usr/lib/python3.4/tempfile.py", line 432, in mkdtemp file = _os.path.join(dir, prefix + name + suffix) TypeError: Can't convert 'NoneType' object to str implicitly Acording to mkdtemp man in python3: "Changed in version 3.5: suffix, prefix, and dir may now be supplied in bytes in order to obtain a bytes return value. Prior to this, only str was allowed. suffix and prefix now accept and default to None to cause an appropriate default value to be used." This issue went unnoticed because the RnD env is running debian 9, which probably has python version >= 3.5. Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/26/3926/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 3077b0f..6130ca9 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -41,7 +41,7 @@ self.suite_run = suite_run self.conf = conf self.env = {} - self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) + self.pcu_sk_tmp_dir = tempfile.mkdtemp('', 'ogtpcusk') if len(self.pcu_socket_path().encode()) > 107: raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path()) -- To view, visit https://gerrit.osmocom.org/3926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 13 15:08:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 15:08:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: bts_osmotrx: Fix mkdtemp use in python < 3.5 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3926 to look at the new patch set (#2). bts_osmotrx: Fix mkdtemp use in python < 3.5 We are currently seeing this issues in prod setup, which uses python 3.4: File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/bts_osmotrx.py", line 44, in __init__ self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) File "/usr/lib/python3.4/tempfile.py", line 432, in mkdtemp file = _os.path.join(dir, prefix + name + suffix) TypeError: Can't convert 'NoneType' object to str implicitly Acording to mkdtemp man in python3: "Changed in version 3.5: suffix, prefix, and dir may now be supplied in bytes in order to obtain a bytes return value. Prior to this, only str was allowed. suffix and prefix now accept and default to None to cause an appropriate default value to be used." This issue went unnoticed because the RnD env is running debian 9, which probably has python version >= 3.5. Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/26/3926/2 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 3077b0f..6130ca9 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -41,7 +41,7 @@ self.suite_run = suite_run self.conf = conf self.env = {} - self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) + self.pcu_sk_tmp_dir = tempfile.mkdtemp('', 'ogtpcusk') if len(self.pcu_socket_path().encode()) > 107: raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path()) -- To view, visit https://gerrit.osmocom.org/3926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 15:09:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 15:09:21 +0000 Subject: osmo-gsm-tester[master]: bts_osmotrx: Fix mkdtemp use in python < 3.5 In-Reply-To: References: Message-ID: Patch Set 2: A job has been queued with this commit in a branch to test if it solves the issue: https://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/2896/ -- To view, visit https://gerrit.osmocom.org/3926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 15:40:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 15:40:43 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib: Fix regexp issue deleting previous artifacts Message-ID: Review at https://gerrit.osmocom.org/3927 contrib: Fix regexp issue deleting previous artifacts Commit 36e0404f456b32898d174b8bdfb363dbe580db2e recently modified the line to fix an issue, but it seems the new introduced regexp is not handled properly by jenkins jobs (it works in my terminal locally thought). As a result, the previous artificats are not being deleted and copied over to next jobs in the chain, and osmo-gsm-tester fails because it finds several tar.gz of the same type for a given inst. I did some tests in a jenkins job (osmo-gsm-tester_osmo-pcu-sysmo) which contained several non-deleted artficats and found out a regexp which is supported correctly. Change-Id: I2cda58dde9c5ad26ec71081403a38cf1b6dd0e7b --- M contrib/jenkins-build-common.sh 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/3927/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index a5b34af..39046ef 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -56,7 +56,8 @@ env | grep -v "^LESS" | sort # clean the workspace -rm -f "$base"/*.build-*.{tgz,md5} +rm -f "$base"/*.build-*.tgz +rm -f "$base"/*.build-*.md5 rm -rf "$prefix_real" mkdir -p "$prefix_real" -- To view, visit https://gerrit.osmocom.org/3927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2cda58dde9c5ad26ec71081403a38cf1b6dd0e7b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:12:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 16:12:29 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib: Build octphy osmo-bts variant and make it generic Message-ID: Review at https://gerrit.osmocom.org/3928 contrib: Build octphy osmo-bts variant and make it generic This is a first step to add support for osmo-bts-octpy to osmo-gsm-tester. There's no point in building separate insts for different osmo-bts variants which run on the main unit and which come from the same git repository, this we make the osmo-bts-trx one generic to handle all variants which fall into the description above. Tested locally on my laptop that it builds susccessfully. To coordinate together with this patch: - Update build jobs in jenkins (run_all for RnD, rename the osmo-bts-trx for prod). - Modify bts_osmotrx.py to use inst 'osmo-bts' instead of 'osmo-bts-trx'. Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 --- R contrib/jenkins-build-osmo-bts.sh 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/3928/1 diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts.sh similarity index 61% rename from contrib/jenkins-build-osmo-bts-trx.sh rename to contrib/jenkins-build-osmo-bts.sh index 6188be1..7349ce5 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts.sh @@ -1,14 +1,15 @@ #!/bin/sh set -e -x base="$PWD" -name="osmo-bts-trx" +name="osmo-bts" . "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +have_repo octphy-2g-headers build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include --enable-octphy --with-octsdr-2g=$base/octphy-2g-headers -create_bin_tgz osmo-bts-trx +create_bin_tgz osmo-bts-trx osmo-bts-octphy -- To view, visit https://gerrit.osmocom.org/3928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:25 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3905 to look at the new patch set (#5). Simplify TS alloc: move slot assignment Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 74 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/5 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 9eb8464..81b19a5 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -802,6 +802,75 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + ts_print(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -982,46 +1051,15 @@ /* Step 4: Update MS and TBF and really allocate the resources */ - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - ts_print(slot_info, dl_slots, ul_slots); - LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); - } - + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:25 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split allocation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3906 to look at the new patch set (#7). Simplify TS alloc: split allocation * generalize TS allocation and move it into separate function * move single-slot allocation into separate function * use common functions for TS allocation on both UL and DL Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 95 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3906/7 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index fac2132..268c75e 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -868,6 +868,87 @@ } } +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (ts < 0) + ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (ts < 0) + return ffs(ret); + + return ret & (1 << ts); +} + +/*! Find set of timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \returns negative error code or selected TS on success + */ +static int tbf_select_slot_set(const gprs_rlcmac_tbf *tbf, const gprs_rlcmac_trx *trx, bool single, + uint8_t ul_slots, uint8_t dl_slots, + uint8_t reserved_ul_slots, uint8_t reserved_dl_slots, + int8_t first_common_ts) +{ + uint8_t sl = tbf->direction != GPRS_RLCMAC_DL_TBF ? ul_slots : dl_slots; + char slot_info[9] = { 0 }; + + if (single) + sl = get_single_ts(trx, tbf, dl_slots, ul_slots, first_common_ts); + + if (!sl) { + LOGP(DRLCMAC, LOGL_NOTICE, "No %s slots available\n", + tbf->direction != GPRS_RLCMAC_DL_TBF ? "uplink" : "downlink"); + return -EINVAL; + } + + if (tbf->direction != GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, sl, 'U'); + LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected UL"); + } else { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, sl, 'D'); + LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); + } + + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + + return sl; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -891,7 +972,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; @@ -933,82 +1013,43 @@ reserved_dl_slots = dl_slots; reserved_ul_slots = ul_slots; - /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); - masked_override_with(slot_info, dl_slots, 'D'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + dl_slots = rc; + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { int free_usf = -1; + + ul_slots = rc; if (first_common_ts >= 0) ul_slots = 1 << first_common_ts; else ul_slots = ul_slots & dl_slots; - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); if (free_usf < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); return -EBUSY; } + OSMO_ASSERT(ts >= 0 && ts <= 8); + /* We will stick to that single UL slot, unreserve the others */ ul_slots = 1 << ts; usf[ts] = free_usf; - - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); - masked_override_with(slot_info, ul_slots, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n",slot_info, single ? ", single" : ""); - - slotcount++; - first_ts = ts; - - /* We will stick to that single UL slot, unreserve the others */ reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } first_common_ts = ffs(dl_slots & ul_slots) - 1; -- To view, visit https://gerrit.osmocom.org/3906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:25 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: expand tests log In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#14). TS alloc: expand tests log * restructure code for easier reading * use consistent formatting for output * log essential allocation parameters on failure Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 3 files changed, 192 insertions(+), 184 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/14 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 49e0391..43f1602 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -429,13 +429,14 @@ const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx = ms->current_trx(); - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " - "%d\n", tbf->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class %d [%s]\n", + tbf->ms_class(), (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, - "- Failed to find a usable TRX (TFI exhausted)\n"); + "algo A [%s] (suggested TRX: %d): failed to find a usable TRX (TFI exhausted) for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return trx_no; } if (!trx) @@ -463,14 +464,16 @@ &tfi, &usf); if (tbf->direction == GPRS_RLCMAC_UL_TBF && usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no USF available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no USF available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } if (ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no TFI available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no TFI available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } @@ -948,7 +951,7 @@ LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); } - LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7), %s\n", slot_info, single ? "single" : "multi"); return sl; } @@ -1037,7 +1040,8 @@ /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): failed to allocate a TFI for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return tfi; } @@ -1081,23 +1085,27 @@ first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first common slots available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } + if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first slot available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } if (single && slotcount) { tbf_->upgrade_to_multislot = (avail_count > slotcount); - LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", - first_ts, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using single slot at TS %d for %s\n", + single ? "single" : "multi", use_trx, first_ts, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { tbf_->upgrade_to_multislot = 0; - LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using %d slots for %s\n", + single ? "single" : "multi", use_trx, slotcount, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } /* The allocation will be successful, so the system state and tbf_/ms_ diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index a804bab..47dcefc 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -1,53 +1,53 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -111,53 +111,53 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -227,15 +227,15 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously -1) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 35 TBFs (previously 160) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -397,7 +397,7 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 160) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -559,11 +559,11 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL Allocated 32 TBFs (previously -1) No USF available Allocated 24 TBFs (previously 32) @@ -600,7 +600,7 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -635,11 +635,11 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -705,9 +705,9 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 97 TBFs (previously -1) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 24 TBFs (previously 97) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -728,7 +728,7 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 97) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -890,5 +890,5 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9016eb1..ad5aaf9 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1,7 +1,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 4, because not enabled @@ -18,7 +18,7 @@ Modifying MS object, TLLI = 0x00002342, TA 220 -> 4 ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 3, because need to reuse TS @@ -41,7 +41,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -94,7 +94,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer 3193. ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -130,7 +130,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -183,7 +183,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer 3193. ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -219,7 +219,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -544,7 +544,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -565,7 +565,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -605,7 +605,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -631,7 +631,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -657,7 +657,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -683,7 +683,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -709,7 +709,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -735,7 +735,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -761,7 +761,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -787,7 +787,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -813,7 +813,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -839,7 +839,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -865,7 +865,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -891,7 +891,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -917,7 +917,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -943,7 +943,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -969,7 +969,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -995,7 +995,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1021,7 +1021,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1047,7 +1047,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1073,7 +1073,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1099,7 +1099,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1125,7 +1125,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1151,7 +1151,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1177,7 +1177,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1203,7 +1203,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1229,7 +1229,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1255,7 +1255,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1281,7 +1281,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1307,7 +1307,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1333,7 +1333,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1359,7 +1359,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1385,7 +1385,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1411,7 +1411,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1437,15 +1437,15 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 -- Failed to find a usable TRX (TFI exhausted) +Slot Allocation (Algorithm A) for class 45 [DL] +algo A [single] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No PDCH resource Destroying MS object, TLLI = 0x00000000 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1476,7 +1476,7 @@ ********** TBF ends here ********** ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1541,7 +1541,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1588,7 +1588,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1627,7 +1627,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1674,7 +1674,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1711,7 +1711,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1757,7 +1757,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1848,7 +1848,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1919,7 +1919,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1965,7 +1965,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2016,7 +2016,7 @@ MS requests UL TBF in packet resource request of single block, so we provide one: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2046,7 +2046,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2094,7 +2094,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2140,7 +2140,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2175,7 +2175,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2247,7 +2247,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2293,7 +2293,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3049,7 +3049,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) starting timer 3193. ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3334,8 +3334,8 @@ - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3373,8 +3373,8 @@ - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3419,7 +3419,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3471,7 +3471,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3513,7 +3513,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3728,7 +3728,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3758,7 +3758,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4117,7 +4117,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4416,7 +4416,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4670,7 +4670,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4885,7 +4885,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5076,7 +5076,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5246,7 +5246,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5410,7 +5410,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5560,7 +5560,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5711,7 +5711,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5765,7 +5765,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5819,7 +5819,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5873,7 +5873,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5946,7 +5946,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6019,7 +6019,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6092,7 +6092,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6165,7 +6165,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6226,7 +6226,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6287,7 +6287,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6348,7 +6348,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6428,7 +6428,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6510,7 +6510,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6548,7 +6548,7 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single -Using single slot at TS 4 for DL +algo B [single] (suggested TRX: 0): using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -6562,8 +6562,8 @@ PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Searching for first unallocated TFI: TRX=0 Found TFI=0. -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: -1): using 4 slots for DL - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 3 @@ -6604,7 +6604,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6674,7 +6674,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6704,7 +6704,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6851,7 +6851,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6876,7 +6876,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6901,7 +6901,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6926,7 +6926,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6951,7 +6951,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6976,7 +6976,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7001,7 +7001,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7026,7 +7026,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7035,7 +7035,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [single] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No PDCH resource sending Immediate Assignment Uplink (AGCH) reject Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b Destroying MS object, TLLI = 0x00000000 @@ -7064,7 +7064,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7928,7 +7928,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9013,7 +9013,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9034,7 +9034,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9059,7 +9059,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9084,7 +9084,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9109,7 +9109,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9134,7 +9134,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9159,7 +9159,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9184,7 +9184,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9216,7 +9216,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9225,7 +9225,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No PDCH resource Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 14 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:25 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: enable debugging instrumentation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3913 to look at the new patch set (#2). TS alloc: enable debugging instrumentation Previously extra debugging was disabled by preprocessor directives which means allocation tests were run without it. Enable it explicitly via boolean parameter which can be set from tests but keep it unset in main code to avoid interference with production setup. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/bts.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 7 files changed, 83 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/2 diff --git a/src/bts.cpp b/src/bts.cpp index 6e5a018..f5f6f44 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -651,11 +651,11 @@ /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true, false); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true, false); } if (!tbf) { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 6dfb13b..49e0391 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -506,9 +506,11 @@ * \param[in] ms Pointer to MS object * \param[in,out] ul_slots set of UL timeslots * \param[in,out] dl_slots set of DL timeslots + * \param[in] enable_debug Flag to enable excessive logging not suitable for production run but necessary for tests * \returns negative error code or 0 on success */ -static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots, + bool enable_debug) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -667,14 +669,13 @@ rx_window = rx_good & rx_valid_win; rx_slot_count = pcu_bitcount(rx_window); -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " + "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " + "ul=%02x, dl=%02x\n", + tx_slot_count, rx_slot_count, mask_sel, + tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, + *ul_slots, *dl_slots); /* Check compliance with TS 45.002, table 6.4.2.2.1 */ /* Whether to skip this round doesn not only depend on the bit @@ -695,15 +696,15 @@ continue; } else { /* No supported row in TS 45.002, table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, - OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", slot_info); -#endif + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, + OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "combination not supported\n", slot_info); + } continue; } } @@ -713,13 +714,14 @@ continue; if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", slot_info); -#endif + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, + OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "no DL slots available\n", slot_info); + } continue; } @@ -733,15 +735,16 @@ req_common_slots = OSMO_MIN(req_common_slots, 2); if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - slot_info, common_slot_count, req_common_slots); -#endif + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, + OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "invalid number of common TS: %d (expected %d)\n", + slot_info, common_slot_count, req_common_slots); + } continue; } @@ -766,16 +769,16 @@ } } -#ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - masked_override_with(slot_info, rx_window& tx_window, 'C'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - slot_info, capacity); -#endif + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + masked_override_with(slot_info, rx_window& tx_window, 'C'); + LOGP(DRLCMAC, LOGL_DEBUG, + " Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " + "capacity = %d\n", + slot_info, capacity); + } if (capacity <= max_capacity) continue; @@ -1043,7 +1046,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots, enable_debug); if (rc < 0) return rc; } diff --git a/src/tbf.cpp b/src/tbf.cpp index 0102c10..71a2062 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -752,7 +752,7 @@ } static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, - bool single_slot) + bool single_slot, bool enable_debug) { int rc; struct gprs_rlcmac_bts *bts; @@ -828,7 +828,7 @@ } struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot) + uint8_t egprs_ms_class, bool single_slot, bool enable_debug) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -863,7 +863,7 @@ tbf->name(), GprsCodingScheme::modeName(ms->mode())); } - rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot); + rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot, enable_debug); if (tbf->is_egprs_enabled()) tbf->egprs_calc_ulwindow_size(); @@ -918,7 +918,7 @@ } struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot) + uint8_t egprs_ms_class, bool single_slot, bool enable_debug) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -956,7 +956,7 @@ tbf->name(), GprsCodingScheme::modeName(ms->mode())); } - rc = setup_tbf(tbf, ms, use_trx, ms_class, 0, single_slot); + rc = setup_tbf(tbf, ms, use_trx, ms_class, 0, single_slot, enable_debug); /* if no resource */ if (rc < 0) { talloc_free(tbf); @@ -1310,7 +1310,7 @@ bts->tbf_reused(); new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, false); + ms() ? ms()->egprs_ms_class() : 0, false, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 8f92149..4aed91f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -315,10 +315,10 @@ uint32_t tlli, uint8_t ta, GprsMs *ms); struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot); + uint8_t egprs_ms_class, bool single_slot, bool enable_debug); struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, - uint8_t egprs_ms_class, bool single_slot); + uint8_t egprs_ms_class, bool single_slot, bool enable_debug); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index cbde283..0fca852 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -147,7 +147,7 @@ // Create new TBF (any TRX) /* FIXME: Copy and paste with alloc_ul_tbf */ /* set number of downlink slots according to multislot class */ - dl_tbf = tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, ss); + dl_tbf = tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, ss, false); if (!dl_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 5fd2882..dd5f242 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -42,11 +42,9 @@ uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) - return tbf_alloc_ul_tbf(bts, ms, use_trx, - ms_class, egprs_ms_class, single_slot); - else - return tbf_alloc_dl_tbf(bts, ms, use_trx, - ms_class, egprs_ms_class, single_slot); + return tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, single_slot, true); + + return tbf_alloc_dl_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, single_slot, true); } static void check_tfi_usage(BTS *the_bts) @@ -202,7 +200,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +208,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +242,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +250,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false, true); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +292,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +300,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +355,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +399,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false, true); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -495,7 +493,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false, true); if (tbf == NULL) return NULL; break; @@ -504,7 +502,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false, true); if (tbf == NULL) return NULL; } @@ -815,7 +813,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false, true); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -825,7 +823,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false, true); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 43a6142..4dac648 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,12 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false, true); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false, true); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -166,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2205,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2219,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2263,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:25 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: cosmetic, use proper formatting In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3914 to look at the new patch set (#2). Simplify TS alloc: cosmetic, use proper formatting The find_multi_slots() function has 4 nested for(;;) loops but it's formatted as one. Before trying to split this into smth saner, let's first fix code formatting to make nested loops obvious. Also, fix typos in comments. Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 142 insertions(+), 141 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/14/3914/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 301b2eb..cfef05a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -604,8 +604,7 @@ rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); } else { /* Class type 2 MS have independant RX and TX */ rx_mask[MASK_TT] = 0xff; @@ -615,177 +614,179 @@ rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); - /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ - for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; - uint16_t rx_valid_win; - uint32_t checked_rx[256/32] = {0}; + /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ + for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { + unsigned tx_slot_count; + int max_rx; + uint16_t rx_valid_win; + uint32_t checked_rx[256/32] = {0}; - /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + /* Wrap valid window */ + tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; - tx_window = tx_valid_win; + tx_window = tx_valid_win; - /* Filter out unavailable slots */ - tx_window &= *ul_slots; + /* Filter out unavailable slots */ + tx_window &= *ul_slots; - /* Skip if the the first TS (ul_ts) is not in the set */ - if ((tx_window & (1 << ul_ts)) == 0) - continue; + /* Skip if the the first TS (ul_ts) is not in the set */ + if ((tx_window & (1 << ul_ts)) == 0) + continue; - /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ - if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) - continue; + /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ + if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) + continue; - tx_slot_count = pcu_bitcount(tx_window); + tx_slot_count = pcu_bitcount(tx_window); - max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); + rx_valid_win = (1 << max_rx) - 1; - /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ - for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { - /* Wrap valid window */ - rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; + /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ + for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { + /* Wrap valid window */ + rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; - /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ - for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; - unsigned ts; - int capacity; + /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ + for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { + unsigned common_slot_count; + unsigned req_common_slots; + unsigned rx_slot_count; + uint16_t rx_bad; + uint8_t rx_good; + unsigned ts; + int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; + /* Filter out bad slots */ + rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = *dl_slots & ~rx_bad; - /* TODO: CHECK this calculation -> separate function for unit - * testing */ + /* TODO: CHECK this calculation -> separate function for unit testing */ - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); + rx_window = rx_good & rx_valid_win; + rx_slot_count = pcu_bitcount(rx_window); #if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " + "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " + "ul=%02x, dl=%02x\n", + tx_slot_count, rx_slot_count, mask_sel, + tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, + *ul_slots, *dl_slots); #endif - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on mask_sel. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + unsigned slot_sum = rx_slot_count + tx_slot_count; + /* Assume down+up/dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TR) + /* Skip Tta */ + continue; + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TT) + /* Skip Tra */ + continue; + } else { + /* No supported row in TS 45.002, table 6.4.2.2.1. */ #ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", slot_info); + snprintf(slot_info, 9, OSMO_BIT_SPEC, + OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "combination not supported\n", slot_info); #endif - continue; - } - } + continue; + } + } - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) - continue; + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + continue; - if (!rx_good) { + if (!rx_good) { #ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", slot_info); + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "no DL slots available\n", slot_info); #endif - continue; - } + continue; + } - if (!rx_window) - continue; + if (!rx_window) + continue; - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); - if (req_common_slots != common_slot_count) { + if (req_common_slots != common_slot_count) { #ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - slot_info, common_slot_count, req_common_slots); + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "invalid number of common TS: %d (expected %d)\n", + slot_info, common_slot_count, req_common_slots); #endif - continue; - } + continue; + } - /* Compute capacity */ - capacity = 0; + /* Compute capacity */ + capacity = 0; - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + int c; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + } + } + +#ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + masked_override_with(slot_info, rx_window& tx_window, 'C'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " + "capacity = %d\n", + slot_info, capacity); +#endif + + if (capacity <= max_capacity) + continue; + + max_capacity = capacity; + max_ul_slots = tx_window; + max_dl_slots = rx_window; } } } - -#ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - masked_override_with(slot_info, rx_window& tx_window, 'C'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - slot_info, capacity); -#endif - - if (capacity <= max_capacity) - continue; - - max_capacity = capacity; - max_ul_slots = tx_window; - max_dl_slots = rx_window; - }}}} + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, -- To view, visit https://gerrit.osmocom.org/3914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:26 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer Message-ID: Review at https://gerrit.osmocom.org/3929 Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 3 files changed, 44 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/1 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index 0616069..004f77a 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -65,6 +65,8 @@ uint8_t block_payload; }; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 0cebd93..9eb8464 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -81,18 +81,19 @@ /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } +} - return buf; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); } static bool test_and_set_bit(uint32_t *bits, size_t elem) @@ -588,11 +589,8 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_print(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ @@ -704,14 +702,12 @@ } else { /* No supported row in table 6.4.2.2.1. */ #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "combination not supported\n", slot_info); #endif continue; } @@ -723,12 +719,11 @@ if (!rx_good) { #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, tx_window, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "no DL slots available\n", slot_info); #endif continue; } @@ -744,16 +739,13 @@ if (req_common_slots != common_slot_count) { #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "invalid number of common TS: %d (expected %d)\n", + slot_info, common_slot_count, req_common_slots); #endif continue; } @@ -780,16 +772,14 @@ } #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + masked_override_with(slot_info, rx_window& tx_window, 'C'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); + "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " + "capacity = %d\n", + slot_info, capacity); #endif if (capacity <= max_capacity) @@ -915,12 +905,10 @@ } if (tbf->direction == GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, dl_slots, 'D'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); + "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); /* assign downlink */ if (dl_slots == 0) { @@ -953,12 +941,10 @@ ul_slots = 1 << ts; usf[ts] = free_usf; + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, ul_slots, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); + "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n",slot_info, single ? ", single" : ""); slotcount++; first_ts = ts; @@ -1003,12 +989,8 @@ ms_->set_reserved_slots(trx, reserved_ul_slots, reserved_dl_slots); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); + ts_print(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); } tbf_->trx = trx; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 602e35b..9016eb1 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6549,7 +6549,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:27 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split USF/UL allocation Message-ID: Review at https://gerrit.osmocom.org/3930 Simplify TS alloc: split USF/UL allocation * move USF allocation into separate function * document USF allocation This allows to clearly see where selected UL TS is forced into single TS in algorithm B allocator. Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 42 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/30/3930/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index cfef05a..6dfb13b 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -950,6 +950,44 @@ return sl; } +/*! Allocate USF according to a given UL TS mapping + * + * N. B: this is legacy implementation which ignores given selected_ul_slots + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] first_common_ts First TS which is common to both UL and DL + * \param[in] selected_ul_slots set of UL timeslots selected for allocation + * \param[in] dl_slots set of DL timeslots + * \param[out] usf array for allocated USF + * \returns updated UL TS or negative on error + */ +static int allocate_usf(const gprs_rlcmac_trx *trx, int8_t first_common_ts, uint8_t selected_ul_slots, uint8_t dl_slots, + int *usf) +{ + int free_usf = -1, ts; + uint8_t ul_slots = selected_ul_slots; + + if (first_common_ts >= 0) + ul_slots = 1 << first_common_ts; + else + ul_slots = ul_slots & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0 || ts < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + + OSMO_ASSERT(ts >= 0 && ts <= 8); + + /* We will stick to that single UL slot, unreserve the others */ + ul_slots = 1 << ts; + usf[ts] = free_usf; + + return ul_slots; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -973,7 +1011,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; @@ -1027,27 +1064,12 @@ dl_slots = rc; update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - ul_slots = rc; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - - OSMO_ASSERT(ts >= 0 && ts <= 8); + rc = allocate_usf(trx, first_common_ts, rc, dl_slots, usf); + if (rc < 0) + return rc; /* We will stick to that single UL slot, unreserve the others */ - ul_slots = 1 << ts; - usf[ts] = free_usf; + ul_slots = rc; reserved_ul_slots = ul_slots; update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); -- To view, visit https://gerrit.osmocom.org/3930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:27 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: print suggested TRX on allocation errors Message-ID: Review at https://gerrit.osmocom.org/3931 TS alloc: print suggested TRX on allocation errors If TS allocation fails due to unavailable TFI, print TRX which was suggested to allocator. This simplifies allocator debugging but requires cosmetic modifications to test output. Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Related: OS#2282 --- M src/bts.cpp M tests/alloc/AllocTest.err 2 files changed, 833 insertions(+), 833 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/31/3931/1 diff --git a/src/bts.cpp b/src/bts.cpp index f5f6f44..172008f 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -478,7 +478,7 @@ } if (!free_tfis) { - LOGP(DRLCMAC, LOGL_NOTICE, "No TFI available.\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "No TFI available (suggested TRX: %d).\n", use_trx); return -EBUSY; } diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index a74c42b..a804bab 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -1,894 +1,894 @@ -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) - Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) - Failed to allocate a TS, no USF available - Failed to allocate a TS, no USF available -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TS, no USF available - Failed to allocate a TS, no USF available -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI - Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) - Failed to allocate a TS, no USF available -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI - Failed to allocate a TS, no USF available - Failed to allocate a TS, no USF available -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI - Failed to allocate a TS, no USF available -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously -1) - Failed to allocate a TS, no USF available Allocated 35 TBFs (previously 160) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 160) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 160) -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI Allocated 32 TBFs (previously -1) No USF available Allocated 24 TBFs (previously 32) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI Allocated 32 TBFs (previously 32) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). - Failed to allocate a TFI Allocated 32 TBFs (previously 32) -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) Allocated 97 TBFs (previously -1) - Failed to allocate a TS, no USF available Allocated 24 TBFs (previously 97) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 97) -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). - Failed to find a usable TRX (TFI exhausted) Allocated 160 TBFs (previously 160) -- To view, visit https://gerrit.osmocom.org/3931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:15:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:15:28 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests Message-ID: Review at https://gerrit.osmocom.org/3932 TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err 2 files changed, 282 insertions(+), 292 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/3932/1 diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index dd5f242..64ff0d1 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -21,6 +21,7 @@ #include "gprs_debug.h" #include "tbf.h" #include "bts.h" +#include "pcu_utils.h" #include #include @@ -471,6 +472,19 @@ TEST_MODE_UL_AFTER_DL, }; +static inline char *test_mode_descr(enum test_mode t) +{ + switch (t) { + case TEST_MODE_UL_ONLY: return (char*)"UL only"; + case TEST_MODE_DL_ONLY: return (char*)"DL only"; + case TEST_MODE_UL_AND_DL: return (char*)"UL and DL"; + case TEST_MODE_DL_AND_UL: return (char*)"DL and UL"; + case TEST_MODE_DL_AFTER_UL: return (char*)"DL after UL"; + case TEST_MODE_UL_AFTER_DL: return (char*)"UL after DL"; + default: return NULL; + } +} + static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class, enum test_mode mode) { @@ -619,24 +633,23 @@ busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", - tfi, ms_class, - get_dir_char(0x01, ul_slots, dl_slots, busy_slots), - get_dir_char(0x02, ul_slots, dl_slots, busy_slots), - get_dir_char(0x04, ul_slots, dl_slots, busy_slots), - get_dir_char(0x08, ul_slots, dl_slots, busy_slots), - get_dir_char(0x10, ul_slots, dl_slots, busy_slots), - get_dir_char(0x20, ul_slots, dl_slots, busy_slots), - get_dir_char(0x40, ul_slots, dl_slots, busy_slots), - get_dir_char(0x80, ul_slots, dl_slots, busy_slots)); + printf(" TBF[%2d] class %2d reserves %c%c%c%c%c%c%c%c [%2u /%2u /%2u ]\n", + tfi, ms_class, + get_dir_char(0x01, ul_slots, dl_slots, busy_slots), + get_dir_char(0x02, ul_slots, dl_slots, busy_slots), + get_dir_char(0x04, ul_slots, dl_slots, busy_slots), + get_dir_char(0x08, ul_slots, dl_slots, busy_slots), + get_dir_char(0x10, ul_slots, dl_slots, busy_slots), + get_dir_char(0x20, ul_slots, dl_slots, busy_slots), + get_dir_char(0x40, ul_slots, dl_slots, busy_slots), + get_dir_char(0x80, ul_slots, dl_slots, busy_slots), + pcu_bitcount(ul_slots), pcu_bitcount(dl_slots), pcu_bitcount(busy_slots)); if (tfi >= 0) { OSMO_ASSERT(ms->current_trx()); - tfi2 = the_bts->tfi_find_free(dir, &trx_no2, - ms->current_trx()->trx_no); + tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(tfi2 < 0 || - trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; @@ -647,16 +660,16 @@ return counter; } -static void test_successive_allocation(algo_t algo, unsigned min_class, - unsigned max_class, enum test_mode mode, - unsigned expect_num, const char *text) +static void test_successive_alloc(unsigned min_class, unsigned max_class, unsigned expect_num, enum test_mode mode, + algo_t algo, const char *text) { BTS the_bts; struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; unsigned counter; - printf("Going to test assignment with many TBF, %s\n", text); + printf("Going to test assignment with many TBF, algorithm %s class %u..%u (%s)\n", + text, min_class, max_class, test_mode_descr(mode)); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -670,9 +683,11 @@ counter = alloc_many_tbfs(&the_bts, min_class, max_class, mode); - printf(" Successfully allocated %d UL TBFs\n", counter); + printf(" Successfully allocated %d UL TBFs, algorithm %s class %u..%u (%s)\n", + counter, text, min_class, max_class, test_mode_descr(mode)); if (counter != expect_num) - fprintf(stderr, " Expected %d TBFs for %s\n", expect_num, text); + fprintf(stderr, " Expected %d TBFs, algorithm %s class %u..%u (%s)\n", + expect_num, text, min_class, max_class, test_mode_descr(mode)); OSMO_ASSERT(counter == expect_num); @@ -694,7 +709,7 @@ TEST_MODE_DL_ONLY, }; - printf("Going to test assignment with many connections, %s\n", text); + printf("Going to test assignment with many connections, algorithm %s\n", text); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -736,60 +751,32 @@ static void test_successive_allocation() { - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL, - 35, "algorithm A (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 10 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-29 (UL and DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL, - 35, "algorithm dynamic class 1-29 (UL and DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 101, TEST_MODE_DL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_ONLY, alloc_algorithm_b, "B"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL, - 35, "algorithm A (DL and UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm B class 10 (DL and UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm dynamic class 10 (DL and UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(12, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AFTER_UL, - 160, "algorithm A (DL after UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AFTER_UL, - 32, "algorithm B class 10 (DL after UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AFTER_UL, - 95, "algorithm dynamic class 10 (DL after UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_DL_AND_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL, - 35, "algorithm A (UL after DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL, - 32, "algorithm B class 10 (UL after DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_AFTER_DL, - 35, "algorithm dynamic class 10 (UL after DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_AFTER_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AFTER_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 95, TEST_MODE_DL_AFTER_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY, - 35, "algorithm A (UL only)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY, - 32, "algorithm B class 10 (UL only)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_ONLY, - 35, "algorithm dynamic class 10 (UL only)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AFTER_DL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY, - 160, "algorithm A (DL ONLY)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_ONLY, - 32, "algorithm B class 10 (DL ONLY)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_ONLY, - 101, "algorithm dynamic class 10 (DL ONLY)"); -} - -static void test_many_connections() -{ - test_many_connections(alloc_algorithm_a, 160, "algorithm A"); - test_many_connections(alloc_algorithm_b, 32, "algorithm B"); - test_many_connections(alloc_algorithm_dynamic, 160, "algorithm dynamic"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_ONLY, alloc_algorithm_b, "B"); } static void test_2_consecutive_dl_tbfs() @@ -857,9 +844,12 @@ test_alloc_a(); test_alloc_b(); - test_successive_allocation(); - test_many_connections(); + test_many_connections(alloc_algorithm_a, 160, "A"); + test_many_connections(alloc_algorithm_b, 32, "B"); + test_many_connections(alloc_algorithm_dynamic, 160, "dynamic"); test_2_consecutive_dl_tbfs(); + test_successive_allocation(); + return EXIT_SUCCESS; } diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index 47dcefc..aefa1ca 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -8,226 +8,6 @@ No TFI available (suggested TRX: 0). algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -892,3 +672,223 @@ No TFI available (suggested TRX: 0). algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -- To view, visit https://gerrit.osmocom.org/3932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:19:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 13 Sep 2017 16:19:35 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib: Build octphy osmo-bts variant and make it generic In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3928 to look at the new patch set (#2). contrib: Build octphy osmo-bts variant and make it generic This is a first step to add support for osmo-bts-octpy to osmo-gsm-tester. There's no point in building separate insts for different osmo-bts variants which run on the main unit and which come from the same git repository, this we make the osmo-bts-trx one generic to handle all variants which fall into the description above. Tested locally on my laptop that it builds susccessfully. Once this patch is applied, jenkins jobs need to be adjusted: - RnD: osmo-gsm-tester_manual-build-all - Prod: osmo-gsm-tester_build-osmo-bts-trx (and rename it) Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 --- R contrib/jenkins-build-osmo-bts.sh M src/osmo_gsm_tester/bts_osmotrx.py 2 files changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/3928/2 diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts.sh similarity index 61% rename from contrib/jenkins-build-osmo-bts-trx.sh rename to contrib/jenkins-build-osmo-bts.sh index 6188be1..7349ce5 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts.sh @@ -1,14 +1,15 @@ #!/bin/sh set -e -x base="$PWD" -name="osmo-bts-trx" +name="osmo-bts" . "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +have_repo octphy-2g-headers build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include --enable-octphy --with-octsdr-2g=$base/octphy-2g-headers -create_bin_tgz osmo-bts-trx +create_bin_tgz osmo-bts-trx osmo-bts-octphy diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 3077b0f..23d5a29 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -84,7 +84,7 @@ self.log('Waiting for osmo-trx to start up...') event_loop.wait(self, self.trx.trx_ready) - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-bts'))) lib = self.inst.child('lib') if not os.path.isdir(lib): raise RuntimeError('No lib/ in %r' % self.inst) -- To view, visit https://gerrit.osmocom.org/3928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Sep 13 16:21:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 16:21:56 +0000 Subject: meta-telephony[201705]: Add git-review config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 17:19:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 17:19:06 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix build: properly remove artifacts Message-ID: Review at https://gerrit.osmocom.org/3933 fix build: properly remove artifacts The jenkins scripts are run by sh, which does not support the {a,b} syntax shell glob. As a result, old build artifacts pile up in the workspaces. Use two separate lines to remove .tgz and .md5. Change-Id: Ib7e5995aa6914e34f8b7bbb8a8ed46ff9230a913 --- M contrib/jenkins-build-common.sh 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/33/3933/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index a5b34af..39046ef 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -56,7 +56,8 @@ env | grep -v "^LESS" | sort # clean the workspace -rm -f "$base"/*.build-*.{tgz,md5} +rm -f "$base"/*.build-*.tgz +rm -f "$base"/*.build-*.md5 rm -rf "$prefix_real" mkdir -p "$prefix_real" -- To view, visit https://gerrit.osmocom.org/3933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7e5995aa6914e34f8b7bbb8a8ed46ff9230a913 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 17:25:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 17:25:01 +0000 Subject: osmo-gsm-tester[master]: fix build: properly remove artifacts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7e5995aa6914e34f8b7bbb8a8ed46ff9230a913 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 17:25:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 17:25:03 +0000 Subject: [MERGED] osmo-gsm-tester[master]: fix build: properly remove artifacts In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix build: properly remove artifacts ...................................................................... fix build: properly remove artifacts The jenkins scripts are run by sh, which does not support the {a,b} syntax shell glob. As a result, old build artifacts pile up in the workspaces. Use two separate lines to remove .tgz and .md5. Change-Id: Ib7e5995aa6914e34f8b7bbb8a8ed46ff9230a913 --- M contrib/jenkins-build-common.sh 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index a5b34af..39046ef 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -56,7 +56,8 @@ env | grep -v "^LESS" | sort # clean the workspace -rm -f "$base"/*.build-*.{tgz,md5} +rm -f "$base"/*.build-*.tgz +rm -f "$base"/*.build-*.md5 rm -rf "$prefix_real" mkdir -p "$prefix_real" -- To view, visit https://gerrit.osmocom.org/3933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7e5995aa6914e34f8b7bbb8a8ed46ff9230a913 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 17:49:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 17:49:52 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: cosmetic, use proper formatting In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3914 to look at the new patch set (#3). Simplify TS alloc: cosmetic, use proper formatting The find_multi_slots() function has 5 nested for(;;) loops but it's formatted as one. Before trying to split this into smth saner, let's first fix code formatting to make nested loops obvious. Also, fix typos in comments. Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 142 insertions(+), 141 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/14/3914/3 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 301b2eb..cfef05a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -604,8 +604,7 @@ rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); } else { /* Class type 2 MS have independant RX and TX */ rx_mask[MASK_TT] = 0xff; @@ -615,177 +614,179 @@ rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); - /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ - for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; - uint16_t rx_valid_win; - uint32_t checked_rx[256/32] = {0}; + /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ + for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { + unsigned tx_slot_count; + int max_rx; + uint16_t rx_valid_win; + uint32_t checked_rx[256/32] = {0}; - /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + /* Wrap valid window */ + tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; - tx_window = tx_valid_win; + tx_window = tx_valid_win; - /* Filter out unavailable slots */ - tx_window &= *ul_slots; + /* Filter out unavailable slots */ + tx_window &= *ul_slots; - /* Skip if the the first TS (ul_ts) is not in the set */ - if ((tx_window & (1 << ul_ts)) == 0) - continue; + /* Skip if the the first TS (ul_ts) is not in the set */ + if ((tx_window & (1 << ul_ts)) == 0) + continue; - /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ - if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) - continue; + /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ + if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) + continue; - tx_slot_count = pcu_bitcount(tx_window); + tx_slot_count = pcu_bitcount(tx_window); - max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); + rx_valid_win = (1 << max_rx) - 1; - /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ - for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { - /* Wrap valid window */ - rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; + /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ + for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { + /* Wrap valid window */ + rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; - /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ - for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; - unsigned ts; - int capacity; + /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ + for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { + unsigned common_slot_count; + unsigned req_common_slots; + unsigned rx_slot_count; + uint16_t rx_bad; + uint8_t rx_good; + unsigned ts; + int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; + /* Filter out bad slots */ + rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = *dl_slots & ~rx_bad; - /* TODO: CHECK this calculation -> separate function for unit - * testing */ + /* TODO: CHECK this calculation -> separate function for unit testing */ - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); + rx_window = rx_good & rx_valid_win; + rx_slot_count = pcu_bitcount(rx_window); #if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " + "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " + "ul=%02x, dl=%02x\n", + tx_slot_count, rx_slot_count, mask_sel, + tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, + *ul_slots, *dl_slots); #endif - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on mask_sel. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + unsigned slot_sum = rx_slot_count + tx_slot_count; + /* Assume down+up/dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TR) + /* Skip Tta */ + continue; + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TT) + /* Skip Tra */ + continue; + } else { + /* No supported row in TS 45.002, table 6.4.2.2.1. */ #ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", slot_info); + snprintf(slot_info, 9, OSMO_BIT_SPEC, + OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "combination not supported\n", slot_info); #endif - continue; - } - } + continue; + } + } - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) - continue; + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + continue; - if (!rx_good) { + if (!rx_good) { #ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", slot_info); + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "no DL slots available\n", slot_info); #endif - continue; - } + continue; + } - if (!rx_window) - continue; + if (!rx_window) + continue; - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); - if (req_common_slots != common_slot_count) { + if (req_common_slots != common_slot_count) { #ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - slot_info, common_slot_count, req_common_slots); + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "invalid number of common TS: %d (expected %d)\n", + slot_info, common_slot_count, req_common_slots); #endif - continue; - } + continue; + } - /* Compute capacity */ - capacity = 0; + /* Compute capacity */ + capacity = 0; - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + int c; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + } + } + +#ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + masked_override_with(slot_info, rx_window& tx_window, 'C'); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " + "capacity = %d\n", + slot_info, capacity); +#endif + + if (capacity <= max_capacity) + continue; + + max_capacity = capacity; + max_ul_slots = tx_window; + max_dl_slots = rx_window; } } } - -#ifdef ENABLE_TS_ALLOC_DEBUG - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - masked_override_with(slot_info, rx_window& tx_window, 'C'); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - slot_info, capacity); -#endif - - if (capacity <= max_capacity) - continue; - - max_capacity = capacity; - max_ul_slots = tx_window; - max_dl_slots = rx_window; - }}}} + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, -- To view, visit https://gerrit.osmocom.org/3914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 17:49:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 17:49:52 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok 3 files changed, 2,481 insertions(+), 2,491 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/3932/2 diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index dd5f242..64ff0d1 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -21,6 +21,7 @@ #include "gprs_debug.h" #include "tbf.h" #include "bts.h" +#include "pcu_utils.h" #include #include @@ -471,6 +472,19 @@ TEST_MODE_UL_AFTER_DL, }; +static inline char *test_mode_descr(enum test_mode t) +{ + switch (t) { + case TEST_MODE_UL_ONLY: return (char*)"UL only"; + case TEST_MODE_DL_ONLY: return (char*)"DL only"; + case TEST_MODE_UL_AND_DL: return (char*)"UL and DL"; + case TEST_MODE_DL_AND_UL: return (char*)"DL and UL"; + case TEST_MODE_DL_AFTER_UL: return (char*)"DL after UL"; + case TEST_MODE_UL_AFTER_DL: return (char*)"UL after DL"; + default: return NULL; + } +} + static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class, enum test_mode mode) { @@ -619,24 +633,23 @@ busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", - tfi, ms_class, - get_dir_char(0x01, ul_slots, dl_slots, busy_slots), - get_dir_char(0x02, ul_slots, dl_slots, busy_slots), - get_dir_char(0x04, ul_slots, dl_slots, busy_slots), - get_dir_char(0x08, ul_slots, dl_slots, busy_slots), - get_dir_char(0x10, ul_slots, dl_slots, busy_slots), - get_dir_char(0x20, ul_slots, dl_slots, busy_slots), - get_dir_char(0x40, ul_slots, dl_slots, busy_slots), - get_dir_char(0x80, ul_slots, dl_slots, busy_slots)); + printf(" TBF[%2d] class %2d reserves %c%c%c%c%c%c%c%c [%2u /%2u /%2u ]\n", + tfi, ms_class, + get_dir_char(0x01, ul_slots, dl_slots, busy_slots), + get_dir_char(0x02, ul_slots, dl_slots, busy_slots), + get_dir_char(0x04, ul_slots, dl_slots, busy_slots), + get_dir_char(0x08, ul_slots, dl_slots, busy_slots), + get_dir_char(0x10, ul_slots, dl_slots, busy_slots), + get_dir_char(0x20, ul_slots, dl_slots, busy_slots), + get_dir_char(0x40, ul_slots, dl_slots, busy_slots), + get_dir_char(0x80, ul_slots, dl_slots, busy_slots), + pcu_bitcount(ul_slots), pcu_bitcount(dl_slots), pcu_bitcount(busy_slots)); if (tfi >= 0) { OSMO_ASSERT(ms->current_trx()); - tfi2 = the_bts->tfi_find_free(dir, &trx_no2, - ms->current_trx()->trx_no); + tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(tfi2 < 0 || - trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; @@ -647,16 +660,16 @@ return counter; } -static void test_successive_allocation(algo_t algo, unsigned min_class, - unsigned max_class, enum test_mode mode, - unsigned expect_num, const char *text) +static void test_successive_alloc(unsigned min_class, unsigned max_class, unsigned expect_num, enum test_mode mode, + algo_t algo, const char *text) { BTS the_bts; struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; unsigned counter; - printf("Going to test assignment with many TBF, %s\n", text); + printf("Going to test assignment with many TBF, algorithm %s class %u..%u (%s)\n", + text, min_class, max_class, test_mode_descr(mode)); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -670,9 +683,11 @@ counter = alloc_many_tbfs(&the_bts, min_class, max_class, mode); - printf(" Successfully allocated %d UL TBFs\n", counter); + printf(" Successfully allocated %d UL TBFs, algorithm %s class %u..%u (%s)\n", + counter, text, min_class, max_class, test_mode_descr(mode)); if (counter != expect_num) - fprintf(stderr, " Expected %d TBFs for %s\n", expect_num, text); + fprintf(stderr, " Expected %d TBFs, algorithm %s class %u..%u (%s)\n", + expect_num, text, min_class, max_class, test_mode_descr(mode)); OSMO_ASSERT(counter == expect_num); @@ -694,7 +709,7 @@ TEST_MODE_DL_ONLY, }; - printf("Going to test assignment with many connections, %s\n", text); + printf("Going to test assignment with many connections, algorithm %s\n", text); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -736,60 +751,32 @@ static void test_successive_allocation() { - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL, - 35, "algorithm A (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 10 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-29 (UL and DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL, - 35, "algorithm dynamic class 1-29 (UL and DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 101, TEST_MODE_DL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_ONLY, alloc_algorithm_b, "B"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL, - 35, "algorithm A (DL and UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm B class 10 (DL and UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm dynamic class 10 (DL and UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(12, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AFTER_UL, - 160, "algorithm A (DL after UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AFTER_UL, - 32, "algorithm B class 10 (DL after UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AFTER_UL, - 95, "algorithm dynamic class 10 (DL after UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_DL_AND_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL, - 35, "algorithm A (UL after DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL, - 32, "algorithm B class 10 (UL after DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_AFTER_DL, - 35, "algorithm dynamic class 10 (UL after DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_AFTER_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AFTER_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 95, TEST_MODE_DL_AFTER_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY, - 35, "algorithm A (UL only)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY, - 32, "algorithm B class 10 (UL only)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_ONLY, - 35, "algorithm dynamic class 10 (UL only)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AFTER_DL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY, - 160, "algorithm A (DL ONLY)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_ONLY, - 32, "algorithm B class 10 (DL ONLY)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_ONLY, - 101, "algorithm dynamic class 10 (DL ONLY)"); -} - -static void test_many_connections() -{ - test_many_connections(alloc_algorithm_a, 160, "algorithm A"); - test_many_connections(alloc_algorithm_b, 32, "algorithm B"); - test_many_connections(alloc_algorithm_dynamic, 160, "algorithm dynamic"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_ONLY, alloc_algorithm_b, "B"); } static void test_2_consecutive_dl_tbfs() @@ -857,9 +844,12 @@ test_alloc_a(); test_alloc_b(); - test_successive_allocation(); - test_many_connections(); + test_many_connections(alloc_algorithm_a, 160, "A"); + test_many_connections(alloc_algorithm_b, 32, "B"); + test_many_connections(alloc_algorithm_dynamic, 160, "dynamic"); test_2_consecutive_dl_tbfs(); + test_successive_allocation(); + return EXIT_SUCCESS; } diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index 47dcefc..aefa1ca 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -8,226 +8,6 @@ No TFI available (suggested TRX: 0). algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -892,3 +672,223 @@ No TFI available (suggested TRX: 0). algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index cbb65aa..110d1c7 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -8588,2211 +8588,2211 @@ Mass test: TS0(OOOOOOOO)TS7 MS_Class=27 Mass test: TS0(OOOOOOOO)TS7 MS_Class=28 Mass test: TS0(OOOOOOOO)TS7 MS_Class=29 -Going to test assignment with many TBF, algorithm A (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL and DL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DDC - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DDC.. - TBF[7] class 10 reserves .....DDC - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DDC.. - TBF[11] class 10 reserves .....DDC - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DDC.. - TBF[15] class 10 reserves .....DDC - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DDC.. - TBF[19] class 10 reserves .....DDC - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DDC.. - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DDCD. - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves .....DDC - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 12 (UL and DL) - TBF[0] class 12 reserves ...DDCD. - TBF[1] class 12 reserves .....DCD - TBF[2] class 12 reserves ...DCD.. - TBF[3] class 12 reserves .....DDC - TBF[4] class 12 reserves ...DCD.. - TBF[5] class 12 reserves .....DCD - TBF[6] class 12 reserves ...DDC.. - TBF[7] class 12 reserves .....DDC - TBF[8] class 12 reserves ...DCD.. - TBF[9] class 12 reserves .....DCD - TBF[10] class 12 reserves ...DDC.. - TBF[11] class 12 reserves .....DDC - TBF[12] class 12 reserves ...DCD.. - TBF[13] class 12 reserves .....DCD - TBF[14] class 12 reserves ...DDC.. - TBF[15] class 12 reserves .....DDC - TBF[16] class 12 reserves ...DCD.. - TBF[17] class 12 reserves .....DCD - TBF[18] class 12 reserves ...DDC.. - TBF[19] class 12 reserves .....DDC - TBF[20] class 12 reserves ...DCD.. - TBF[21] class 12 reserves .....DCD - TBF[22] class 12 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 12 reserves ...DCD.. - TBF[25] class 12 reserves .....DCD - TBF[26] class 12 reserves ...DDCD. - TBF[27] class 12 reserves ...CD... - TBF[28] class 12 reserves .....DDC - TBF[29] class 12 reserves ...CD... - TBF[30] class 12 reserves ...CD... - TBF[31] class 12 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-12 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 1 reserves ...C.... - TBF[13] class 2 reserves ......DC - TBF[14] class 3 reserves ...DC... - TBF[15] class 4 reserves ....DCD. - TBF[16] class 5 reserves ......CD - TBF[17] class 6 reserves ...CD... - TBF[18] class 7 reserves ......DC - TBF[19] class 8 reserves ...DDCD. - TBF[20] class 9 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 11 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 1 reserves ...C.... - TBF[25] class 2 reserves ......DC - TBF[26] class 3 reserves ...DC... - TBF[27] class 4 reserves .....DCD - TBF[28] class 5 reserves ...CD... - TBF[29] class 6 reserves ......CD - TBF[30] class 7 reserves ...CD... - TBF[31] class 8 reserves ...DDCD. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-29 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ....DC.. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 1-29 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ....DC.. - TBF[1] class 4 reserves ...C.... - TBF[2] class 5 reserves ...C.... - TBF[0] class 6 reserves ......C. - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL and UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm A (DL after UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[2] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[4] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[14] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[27] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[16] class 10 reserves ......C. - TBF[26] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[18] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[31] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[20] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[22] class 10 reserves ......C. - TBF[25] class 10 reserves ....C... - TBF[24] class 10 reserves ......C. - TBF[27] class 10 reserves ....C... - TBF[26] class 10 reserves ......C. - TBF[29] class 10 reserves ....C... - TBF[28] class 10 reserves ......C. - TBF[31] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - Successfully allocated 95 UL TBFs -Going to test assignment with many TBF, algorithm A (UL after DL) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (UL only) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL ONLY) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL ONLY) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL ONLY) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[2] class 10 reserves ......C. - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[4] class 10 reserves ......C. - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[22] class 10 reserves .....C.. - TBF[14] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[24] class 10 reserves .....C.. - TBF[16] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[25] class 10 reserves .....C.. - TBF[18] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[27] class 10 reserves .....C.. - TBF[20] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[26] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[30] class 10 reserves .....C.. - TBF[22] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[28] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[31] class 10 reserves .....C.. - TBF[24] class 10 reserves ......C. - TBF[25] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[25] class 10 reserves ......C. - TBF[27] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[27] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[26] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[29] class 10 reserves ....C... - TBF[31] class 10 reserves ......C. - TBF[31] class 10 reserves .......C - Successfully allocated 101 UL TBFs Going to test assignment with many connections, algorithm A - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Going to test assignment with many connections, algorithm B - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ...DC... - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ....DCD. - TBF[4] class 5 reserves ...CD... - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves ......CD - TBF[7] class 8 reserves ...DDCD. - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves ....DCD. - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves .....CDD - TBF[13] class 14 reserves ...CDDD. - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ...DC... [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves .....CDD [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ...CDDD. [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] Successfully allocated 32 TBFs Going to test assignment with many connections, algorithm dynamic - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[12] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[29] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[22] class 14 reserves ...C.... - TBF[22] class 15 reserves ....C... - TBF[30] class 16 reserves .....C.. - TBF[19] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[24] class 19 reserves ...C.... - TBF[24] class 20 reserves ....C... - TBF[31] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[23] class 23 reserves .......C - TBF[26] class 24 reserves ...C.... - TBF[26] class 25 reserves ....C... - TBF[23] class 26 reserves ......C. - TBF[25] class 27 reserves .......C - TBF[28] class 28 reserves ...C.... - TBF[28] class 29 reserves ....C... - TBF[25] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[29] class 3 reserves ...C.... - TBF[29] class 4 reserves ....C... - TBF[27] class 5 reserves ......C. - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[29] class 8 reserves ......C. - TBF[31] class 9 reserves ...C.... - TBF[31] class 10 reserves ....C... - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....DC.. - TBF[0] class 3 reserves ......DC - TBF[0] class 4 reserves ...DCD.. - TBF[0] class 5 reserves ......CD - TBF[1] class 6 reserves ...CD... - TBF[1] class 7 reserves .....CD. - TBF[1] class 8 reserves ....DDCD - TBF[1] class 9 reserves ...DCD.. - TBF[2] class 10 reserves .....DCD - TBF[2] class 11 reserves ...DCD.. - TBF[3] class 12 reserves .....DCD - TBF[2] class 13 reserves ...CDD.. - TBF[3] class 14 reserves ....CDDD - TBF[3] class 15 reserves ...CDDDD - TBF[4] class 16 reserves ...CDDDD - TBF[5] class 17 reserves ...CDDDD - TBF[6] class 18 reserves ...CDDDD - TBF[4] class 19 reserves .....DCD - TBF[4] class 20 reserves ...DCD.. - TBF[5] class 21 reserves .....DCD - TBF[5] class 22 reserves ...DCD.. - TBF[6] class 23 reserves .....DCD - TBF[6] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... - TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... - TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 0] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 1] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 1] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 1] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[ 3] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[ 3] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 5] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 6] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 5] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 6] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) TBF2: numTs(3) +Going to test assignment with many TBF, algorithm A class 1..1 (DL only) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL only) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 101 UL TBFs, algorithm dynamic class 10..10 (DL only) +Going to test assignment with many TBF, algorithm B class 10..10 (DL only) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL only) +Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL and DL) +Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL and DL) +Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL) + TBF[ 0] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 12 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 12..12 (UL and DL) +Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[14] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[15] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[16] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[17] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[18] class 7 reserves ......DC [ 1 / 2 / 0 ] + TBF[19] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 11 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[26] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[27] class 4 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 6 reserves ......CD [ 1 / 2 / 0 ] + TBF[30] class 7 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 1..12 (UL and DL) +Going to test assignment with many TBF, algorithm B class 1..29 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ....DC.. [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 1..29 (UL and DL) +Going to test assignment with many TBF, algorithm dynamic class 1..29 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 1] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 6 reserves ......C. [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs, algorithm dynamic class 1..29 (UL and DL) +Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (DL and UL) +Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL and UL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm dynamic class 10..10 (DL and UL) +Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL after UL) +Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL after UL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + Successfully allocated 95 UL TBFs, algorithm dynamic class 10..10 (DL after UL) +Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL) + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL after DL) +Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL after DL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL after DL) +Going to test assignment with many TBF, algorithm A class 1..1 (UL only) + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL only) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL only) +Going to test assignment with many TBF, algorithm B class 10..10 (UL only) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL only) -- To view, visit https://gerrit.osmocom.org/3932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 17:49:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 17:49:53 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: separate capacity computation Message-ID: Review at https://gerrit.osmocom.org/3934 Simplify TS alloc: separate capacity computation Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 28 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/34/3934/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index cfef05a..74e8519 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -500,6 +500,33 @@ return 0; } +/*! Compute capacity of a given TRX + * + * \param[in] trx Pointer to TRX object + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \returns non-negative capacity + */ +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +{ + const struct gprs_rlcmac_pdch *pdch; + unsigned ts, capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF), 1); + + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF), 1); + } + } + + return capacity; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -654,7 +681,6 @@ unsigned rx_slot_count; uint16_t rx_bad; uint8_t rx_good; - unsigned ts; int capacity; /* Filter out bad slots */ @@ -746,25 +772,7 @@ } /* Compute capacity */ - capacity = 0; - - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - } - } + capacity = compute_capacity(trx, rx_window, tx_window); #ifdef ENABLE_TS_ALLOC_DEBUG snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 17:49:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 13 Sep 2017 17:49:53 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into function Message-ID: Review at https://gerrit.osmocom.org/3935 Simplify TS alloc: move slot check into function Move timeslot applicability check outside of nested for loop into separate function and document it. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 116 insertions(+), 107 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index f654ffa..cb790f7 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -527,6 +527,119 @@ return capacity; } +enum { MASK_TT, MASK_TR }; + +static bool skip_slot(const struct gprs_rlcmac_trx *trx, const struct gprs_ms_multislot_class *ms_class, + uint8_t *rx_mask, unsigned mask_sel, unsigned ul_ts, int *capacity, uint32_t *checked_rx, + uint8_t dl_slots, uint8_t ul_slots, int *rx_window, int tx_window, uint16_t rx_valid_win, + unsigned tx_slot_count, bool enable_debug) +{ + char slot_info[9] = { 0 }; + unsigned common_slot_count; + unsigned req_common_slots; + unsigned rx_slot_count; + uint8_t rx_good; + + /* Filter out bad slots */ + uint16_t rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = dl_slots & ~rx_bad; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + + *rx_window = rx_good & rx_valid_win; + rx_slot_count = pcu_bitcount(*rx_window); + + if (enable_debug) + LOGP(DRLCMAC, LOGL_DEBUG, + "n_tx=%d, n_rx=%d, mask_sel=%d, tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " + "ul=%02x, dl=%02x\n", + tx_slot_count, rx_slot_count, mask_sel, + tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, + ul_slots, dl_slots); + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on mask_sel. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + unsigned slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TR) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TT) + return true; /* Skip Tra */ + } else { + /* No supported row in TS 45.002, table 6.4.2.2.1. */ + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, *rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), combination not supported\n", + slot_info); + } + + return true; + } + } + + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, *rx_window)) + return true; + + if (!rx_good) { + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), no DL slots available\n", slot_info); + } + + return true; + } + + if (!(*rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & *rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) { + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, *rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + LOGP(DRLCMAC, LOGL_DEBUG, + " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), invalid number of common TS: %d (expected %d)\n", + slot_info, common_slot_count, req_common_slots); + } + + return true; + } + + /* Compute capacity */ + *capacity = compute_capacity(trx, *rx_window, tx_window); + + if (enable_debug) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, *rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + masked_override_with(slot_info, *rx_window& tx_window, 'C'); + LOGP(DRLCMAC, LOGL_DEBUG, " Considering DL/UL slots: (TS=0)\"%s\"(TS=7), capacity = %d\n", + slot_info, *capacity); + } + + return false; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -553,7 +666,6 @@ unsigned ul_ts, dl_ts; unsigned num_tx; - enum {MASK_TT, MASK_TR}; unsigned mask_sel; if (ms->ms_class() >= 32) { @@ -678,115 +790,12 @@ /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; - - /* TODO: CHECK this calculation -> separate function for unit testing */ - - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); - - if (enable_debug) - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in TS 45.002, table 6.4.2.2.1. */ - if (enable_debug) { - snprintf(slot_info, 9, OSMO_BIT_SPEC, - OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", slot_info); - } - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) + if (skip_slot(trx, ms_class, rx_mask, mask_sel, ul_ts, &capacity, checked_rx, + *dl_slots, *ul_slots, &rx_window, tx_window, rx_valid_win, + tx_slot_count, enable_debug)) continue; - - if (!rx_good) { - if (enable_debug) { - snprintf(slot_info, 9, OSMO_BIT_SPEC, - OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", slot_info); - } - continue; - } - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) { - if (enable_debug) { - snprintf(slot_info, 9, OSMO_BIT_SPEC, - OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - LOGP(DRLCMAC, LOGL_DEBUG, - " Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - slot_info, common_slot_count, req_common_slots); - } - continue; - } - - /* Compute capacity */ - capacity = compute_capacity(trx, rx_window, tx_window); - - if (enable_debug) { - snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); - masked_override_with(slot_info, rx_window, 'D'); - masked_override_with(slot_info, tx_window, 'U'); - masked_override_with(slot_info, rx_window& tx_window, 'C'); - LOGP(DRLCMAC, LOGL_DEBUG, - " Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - slot_info, capacity); - } if (capacity <= max_capacity) continue; -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 13 21:40:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 21:40:24 +0000 Subject: [ABANDON] osmo-gsm-tester[master]: contrib: Fix regexp issue deleting previous artifacts In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: contrib: Fix regexp issue deleting previous artifacts ...................................................................... Abandoned sorry, I didn't see this and already merged the exact same patch just with a worse commit log message. -- To view, visit https://gerrit.osmocom.org/3927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2cda58dde9c5ad26ec71081403a38cf1b6dd0e7b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 22:13:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 22:13:34 +0000 Subject: [PATCH] osmo-gsm-tester[master]: add jenkins-make-check-and-run.sh Message-ID: Review at https://gerrit.osmocom.org/3936 add jenkins-make-check-and-run.sh Change-Id: I493142bb4cd6c0465e34b4171461d28455315ef4 --- A contrib/jenkins-make-check-and-run.sh 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/36/3936/1 diff --git a/contrib/jenkins-make-check-and-run.sh b/contrib/jenkins-make-check-and-run.sh new file mode 100755 index 0000000..3017fd4 --- /dev/null +++ b/contrib/jenkins-make-check-and-run.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e -x +base="$PWD" + +run_script="osmo-gsm-tester/contrib/jenkins-run.sh" +test -x "$run_script" + +cd osmo-gsm-tester +make deps +make check +cd "$base" + +PATH="$base/osmo-gsm-tester/src:$PATH" \ + "$run_script" -- To view, visit https://gerrit.osmocom.org/3936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I493142bb4cd6c0465e34b4171461d28455315ef4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 22:21:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 22:21:08 +0000 Subject: osmo-gsm-tester[master]: bts_osmotrx: Fix mkdtemp use in python < 3.5 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 verified by https://jenkins.osmocom.org/jenkins/job/osmo-gsm-tester_run/2907/ -- To view, visit https://gerrit.osmocom.org/3926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 13 22:21:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 22:21:11 +0000 Subject: [MERGED] osmo-gsm-tester[master]: bts_osmotrx: Fix mkdtemp use in python < 3.5 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: bts_osmotrx: Fix mkdtemp use in python < 3.5 ...................................................................... bts_osmotrx: Fix mkdtemp use in python < 3.5 We are currently seeing this issues in prod setup, which uses python 3.4: File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/bts_osmotrx.py", line 44, in __init__ self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) File "/usr/lib/python3.4/tempfile.py", line 432, in mkdtemp file = _os.path.join(dir, prefix + name + suffix) TypeError: Can't convert 'NoneType' object to str implicitly Acording to mkdtemp man in python3: "Changed in version 3.5: suffix, prefix, and dir may now be supplied in bytes in order to obtain a bytes return value. Prior to this, only str was allowed. suffix and prefix now accept and default to None to cause an appropriate default value to be used." This issue went unnoticed because the RnD env is running debian 9, which probably has python version >= 3.5. Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 3077b0f..6130ca9 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -41,7 +41,7 @@ self.suite_run = suite_run self.conf = conf self.env = {} - self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) + self.pcu_sk_tmp_dir = tempfile.mkdtemp('', 'ogtpcusk') if len(self.pcu_socket_path().encode()) > 107: raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path()) -- To view, visit https://gerrit.osmocom.org/3926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 13 23:05:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 23:05:11 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix util.py/FileLock and lock_test Message-ID: Review at https://gerrit.osmocom.org/3937 fix util.py/FileLock and lock_test Do not pass os.O_TRUNC to open(), that immediately empties out the lock file. Fix lock_test to be able to catch this error. So far things were happening too fast to notice it. Caught by running 'make check' on a main unit APU that has different timing behavior. Change-Id: I8a6e992836b09df3ecec89b3ec36d3641744fc0c --- M selftest/lock_test.ok M selftest/lock_test.sh M selftest/lock_test_help.py M src/osmo_gsm_tester/util.py 4 files changed, 42 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/37/3937/1 diff --git a/selftest/lock_test.ok b/selftest/lock_test.ok index 604767b..011a89c 100644 --- a/selftest/lock_test.ok +++ b/selftest/lock_test.ok @@ -1,4 +1,14 @@ +creating files +launch a program that locks a given file, it will create $dir/lock_test +wait until this lock_test lock file was created by program +expecting the lock file to reflect "long name" launched first, locked by: 'long name' +launching second program, should find the lock intact and wait launched second, locked by: 'long name' +drop the first lock, $f1 removal signals the first process to stop locking +wait for first program to carry out the lock release +now expecting second program to lock waited, locked by: 'shorter' +release the second program also +expecting the lock to be gone waited more, locked by: '' diff --git a/selftest/lock_test.sh b/selftest/lock_test.sh index 049c4d9..4f3f7ad 100755 --- a/selftest/lock_test.sh +++ b/selftest/lock_test.sh @@ -1,4 +1,6 @@ #!/bin/sh + +echo 'creating files' dir="$(mktemp -d)" n1="long name" f1="$dir/$n1" @@ -7,21 +9,45 @@ f2="$dir/$n2" touch "$f2" sync + +echo 'launch a program that locks a given file, it will create $dir/lock_test' python3 ./lock_test_help.py "$dir" "$n1" & + +echo 'wait until this lock_test lock file was created by program' while [ ! -f "$dir/lock_test" ]; do sleep .1 done +sync + +echo 'expecting the lock file to reflect "long name"' echo "launched first, locked by: '$(cat "$dir/lock_test")'" + +echo 'launching second program, should find the lock intact and wait' python3 ./lock_test_help.py "$dir" "$n2" & +while [ ! -f "$f2.ready" ]; do + sleep .1 +done +sleep 1 +sync echo "launched second, locked by: '$(cat "$dir/lock_test")'" + +echo 'drop the first lock, $f1 removal signals the first process to stop locking' rm "$f1" + +echo 'wait for first program to carry out the lock release' while [ ! -f "$f1.done" ]; do sleep .1 done + +echo 'now expecting second program to lock' echo "waited, locked by: '$(cat "$dir/lock_test")'" + +echo 'release the second program also' rm "$f2" while [ ! -f "$f2.done" ]; do sleep .1 done + +echo 'expecting the lock to be gone' echo "waited more, locked by: '$(cat "$dir/lock_test")'" rm -rf "$dir" diff --git a/selftest/lock_test_help.py b/selftest/lock_test_help.py index bdf7c64..f4e1f9b 100644 --- a/selftest/lock_test_help.py +++ b/selftest/lock_test_help.py @@ -8,11 +8,15 @@ testdir, name = sys.argv[1:] stop_signalling_file = os.path.join(testdir, name) -assert os.path.isfile(stop_signalling_file) +if not os.path.isfile(stop_signalling_file): + print('expected a stop-file %r' % stop_signalling_file) + exit(1) lockfile_path = os.path.join(testdir, 'lock_test') fl = FileLock(lockfile_path, name) +touch_file(stop_signalling_file + '.ready') + with fl: while os.path.exists(stop_signalling_file): time.sleep(.1) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..197dc97 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -101,7 +101,7 @@ def __enter__(self): if self.f is not None: return - self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY | os.O_TRUNC) + self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY) fcntl.flock(self.fd, fcntl.LOCK_EX) os.truncate(self.fd, 0) os.write(self.fd, str(self.owner).encode('utf-8')) -- To view, visit https://gerrit.osmocom.org/3937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a6e992836b09df3ecec89b3ec36d3641744fc0c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 23:31:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 23:31:01 +0000 Subject: [ABANDON] osmo-gsm-tester[master]: fix util.py/FileLock and lock_test In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: fix util.py/FileLock and lock_test ...................................................................... Abandoned bloody gerrit won't retrigger unless I resubmit this -- To view, visit https://gerrit.osmocom.org/3937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I8a6e992836b09df3ecec89b3ec36d3641744fc0c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 13 23:31:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 23:31:28 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix util.py/FileLock and lock_test Message-ID: Review at https://gerrit.osmocom.org/3938 fix util.py/FileLock and lock_test Do not pass os.O_TRUNC to open(), that immediately empties out the lock file. Fix lock_test to be able to catch this error. So far things were happening too fast to notice it. Caught by running 'make check' on a main unit APU that has different timing behavior. Change-Id: I60240179478f177fc41ce8978d3e8326fefe4427 --- M selftest/lock_test.ok M selftest/lock_test.sh M selftest/lock_test_help.py M src/osmo_gsm_tester/util.py 4 files changed, 42 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/38/3938/1 diff --git a/selftest/lock_test.ok b/selftest/lock_test.ok index 604767b..011a89c 100644 --- a/selftest/lock_test.ok +++ b/selftest/lock_test.ok @@ -1,4 +1,14 @@ +creating files +launch a program that locks a given file, it will create $dir/lock_test +wait until this lock_test lock file was created by program +expecting the lock file to reflect "long name" launched first, locked by: 'long name' +launching second program, should find the lock intact and wait launched second, locked by: 'long name' +drop the first lock, $f1 removal signals the first process to stop locking +wait for first program to carry out the lock release +now expecting second program to lock waited, locked by: 'shorter' +release the second program also +expecting the lock to be gone waited more, locked by: '' diff --git a/selftest/lock_test.sh b/selftest/lock_test.sh index 049c4d9..4f3f7ad 100755 --- a/selftest/lock_test.sh +++ b/selftest/lock_test.sh @@ -1,4 +1,6 @@ #!/bin/sh + +echo 'creating files' dir="$(mktemp -d)" n1="long name" f1="$dir/$n1" @@ -7,21 +9,45 @@ f2="$dir/$n2" touch "$f2" sync + +echo 'launch a program that locks a given file, it will create $dir/lock_test' python3 ./lock_test_help.py "$dir" "$n1" & + +echo 'wait until this lock_test lock file was created by program' while [ ! -f "$dir/lock_test" ]; do sleep .1 done +sync + +echo 'expecting the lock file to reflect "long name"' echo "launched first, locked by: '$(cat "$dir/lock_test")'" + +echo 'launching second program, should find the lock intact and wait' python3 ./lock_test_help.py "$dir" "$n2" & +while [ ! -f "$f2.ready" ]; do + sleep .1 +done +sleep 1 +sync echo "launched second, locked by: '$(cat "$dir/lock_test")'" + +echo 'drop the first lock, $f1 removal signals the first process to stop locking' rm "$f1" + +echo 'wait for first program to carry out the lock release' while [ ! -f "$f1.done" ]; do sleep .1 done + +echo 'now expecting second program to lock' echo "waited, locked by: '$(cat "$dir/lock_test")'" + +echo 'release the second program also' rm "$f2" while [ ! -f "$f2.done" ]; do sleep .1 done + +echo 'expecting the lock to be gone' echo "waited more, locked by: '$(cat "$dir/lock_test")'" rm -rf "$dir" diff --git a/selftest/lock_test_help.py b/selftest/lock_test_help.py index bdf7c64..f4e1f9b 100644 --- a/selftest/lock_test_help.py +++ b/selftest/lock_test_help.py @@ -8,11 +8,15 @@ testdir, name = sys.argv[1:] stop_signalling_file = os.path.join(testdir, name) -assert os.path.isfile(stop_signalling_file) +if not os.path.isfile(stop_signalling_file): + print('expected a stop-file %r' % stop_signalling_file) + exit(1) lockfile_path = os.path.join(testdir, 'lock_test') fl = FileLock(lockfile_path, name) +touch_file(stop_signalling_file + '.ready') + with fl: while os.path.exists(stop_signalling_file): time.sleep(.1) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..197dc97 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -101,7 +101,7 @@ def __enter__(self): if self.f is not None: return - self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY | os.O_TRUNC) + self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY) fcntl.flock(self.fd, fcntl.LOCK_EX) os.truncate(self.fd, 0) os.write(self.fd, str(self.owner).encode('utf-8')) -- To view, visit https://gerrit.osmocom.org/3938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60240179478f177fc41ce8978d3e8326fefe4427 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 23:35:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 23:35:14 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix util.py/FileLock and lock_test In-Reply-To: References: Message-ID: fix util.py/FileLock and lock_test Do not pass os.O_TRUNC to open(), that immediately empties out the lock file. Fix lock_test to be able to catch this error. So far things were happening too fast to notice it. Caught by running 'make check' on a main unit APU that has different timing behavior. Change-Id: I60240179478f177fc41ce8978d3e8326fefe4427 --- M selftest/lock_test.ok M selftest/lock_test.sh M selftest/lock_test_help.py M src/osmo_gsm_tester/util.py 4 files changed, 42 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/38/3938/2 diff --git a/selftest/lock_test.ok b/selftest/lock_test.ok index 604767b..011a89c 100644 --- a/selftest/lock_test.ok +++ b/selftest/lock_test.ok @@ -1,4 +1,14 @@ +creating files +launch a program that locks a given file, it will create $dir/lock_test +wait until this lock_test lock file was created by program +expecting the lock file to reflect "long name" launched first, locked by: 'long name' +launching second program, should find the lock intact and wait launched second, locked by: 'long name' +drop the first lock, $f1 removal signals the first process to stop locking +wait for first program to carry out the lock release +now expecting second program to lock waited, locked by: 'shorter' +release the second program also +expecting the lock to be gone waited more, locked by: '' diff --git a/selftest/lock_test.sh b/selftest/lock_test.sh index 049c4d9..4f3f7ad 100755 --- a/selftest/lock_test.sh +++ b/selftest/lock_test.sh @@ -1,4 +1,6 @@ #!/bin/sh + +echo 'creating files' dir="$(mktemp -d)" n1="long name" f1="$dir/$n1" @@ -7,21 +9,45 @@ f2="$dir/$n2" touch "$f2" sync + +echo 'launch a program that locks a given file, it will create $dir/lock_test' python3 ./lock_test_help.py "$dir" "$n1" & + +echo 'wait until this lock_test lock file was created by program' while [ ! -f "$dir/lock_test" ]; do sleep .1 done +sync + +echo 'expecting the lock file to reflect "long name"' echo "launched first, locked by: '$(cat "$dir/lock_test")'" + +echo 'launching second program, should find the lock intact and wait' python3 ./lock_test_help.py "$dir" "$n2" & +while [ ! -f "$f2.ready" ]; do + sleep .1 +done +sleep 1 +sync echo "launched second, locked by: '$(cat "$dir/lock_test")'" + +echo 'drop the first lock, $f1 removal signals the first process to stop locking' rm "$f1" + +echo 'wait for first program to carry out the lock release' while [ ! -f "$f1.done" ]; do sleep .1 done + +echo 'now expecting second program to lock' echo "waited, locked by: '$(cat "$dir/lock_test")'" + +echo 'release the second program also' rm "$f2" while [ ! -f "$f2.done" ]; do sleep .1 done + +echo 'expecting the lock to be gone' echo "waited more, locked by: '$(cat "$dir/lock_test")'" rm -rf "$dir" diff --git a/selftest/lock_test_help.py b/selftest/lock_test_help.py index bdf7c64..f4e1f9b 100644 --- a/selftest/lock_test_help.py +++ b/selftest/lock_test_help.py @@ -8,11 +8,15 @@ testdir, name = sys.argv[1:] stop_signalling_file = os.path.join(testdir, name) -assert os.path.isfile(stop_signalling_file) +if not os.path.isfile(stop_signalling_file): + print('expected a stop-file %r' % stop_signalling_file) + exit(1) lockfile_path = os.path.join(testdir, 'lock_test') fl = FileLock(lockfile_path, name) +touch_file(stop_signalling_file + '.ready') + with fl: while os.path.exists(stop_signalling_file): time.sleep(.1) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..197dc97 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -101,7 +101,7 @@ def __enter__(self): if self.f is not None: return - self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY | os.O_TRUNC) + self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY) fcntl.flock(self.fd, fcntl.LOCK_EX) os.truncate(self.fd, 0) os.write(self.fd, str(self.owner).encode('utf-8')) -- To view, visit https://gerrit.osmocom.org/3938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I60240179478f177fc41ce8978d3e8326fefe4427 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 23:41:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 23:41:30 +0000 Subject: [ABANDON] osmo-gsm-tester[master]: fix util.py/FileLock and lock_test In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: fix util.py/FileLock and lock_test ...................................................................... Abandoned how hard can it be to just fire a gerrit build! -- To view, visit https://gerrit.osmocom.org/3938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I60240179478f177fc41ce8978d3e8326fefe4427 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 23:42:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 23:42:59 +0000 Subject: [PATCH] osmo-gsm-tester[master]: add jenkins-make-check-and-run.sh, fix lock_test Message-ID: Review at https://gerrit.osmocom.org/3939 add jenkins-make-check-and-run.sh, fix lock_test fix util.py/FileLock and lock_test Do not pass os.O_TRUNC to open(), that immediately empties out the lock file. Fix lock_test to be able to catch this error. So far things were happening too fast to notice it. Caught by running 'make check' on a main unit APU that has different timing behavior. Change-Id: Iefc7fd5207c926fdeb3282d9d5b4708f1b56d20c --- A contrib/jenkins-make-check-and-run.sh M selftest/lock_test.ok M selftest/lock_test.sh M selftest/lock_test_help.py M src/osmo_gsm_tester/util.py 5 files changed, 56 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/39/3939/1 diff --git a/contrib/jenkins-make-check-and-run.sh b/contrib/jenkins-make-check-and-run.sh new file mode 100755 index 0000000..3017fd4 --- /dev/null +++ b/contrib/jenkins-make-check-and-run.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e -x +base="$PWD" + +run_script="osmo-gsm-tester/contrib/jenkins-run.sh" +test -x "$run_script" + +cd osmo-gsm-tester +make deps +make check +cd "$base" + +PATH="$base/osmo-gsm-tester/src:$PATH" \ + "$run_script" diff --git a/selftest/lock_test.ok b/selftest/lock_test.ok index 604767b..011a89c 100644 --- a/selftest/lock_test.ok +++ b/selftest/lock_test.ok @@ -1,4 +1,14 @@ +creating files +launch a program that locks a given file, it will create $dir/lock_test +wait until this lock_test lock file was created by program +expecting the lock file to reflect "long name" launched first, locked by: 'long name' +launching second program, should find the lock intact and wait launched second, locked by: 'long name' +drop the first lock, $f1 removal signals the first process to stop locking +wait for first program to carry out the lock release +now expecting second program to lock waited, locked by: 'shorter' +release the second program also +expecting the lock to be gone waited more, locked by: '' diff --git a/selftest/lock_test.sh b/selftest/lock_test.sh index 049c4d9..4f3f7ad 100755 --- a/selftest/lock_test.sh +++ b/selftest/lock_test.sh @@ -1,4 +1,6 @@ #!/bin/sh + +echo 'creating files' dir="$(mktemp -d)" n1="long name" f1="$dir/$n1" @@ -7,21 +9,45 @@ f2="$dir/$n2" touch "$f2" sync + +echo 'launch a program that locks a given file, it will create $dir/lock_test' python3 ./lock_test_help.py "$dir" "$n1" & + +echo 'wait until this lock_test lock file was created by program' while [ ! -f "$dir/lock_test" ]; do sleep .1 done +sync + +echo 'expecting the lock file to reflect "long name"' echo "launched first, locked by: '$(cat "$dir/lock_test")'" + +echo 'launching second program, should find the lock intact and wait' python3 ./lock_test_help.py "$dir" "$n2" & +while [ ! -f "$f2.ready" ]; do + sleep .1 +done +sleep 1 +sync echo "launched second, locked by: '$(cat "$dir/lock_test")'" + +echo 'drop the first lock, $f1 removal signals the first process to stop locking' rm "$f1" + +echo 'wait for first program to carry out the lock release' while [ ! -f "$f1.done" ]; do sleep .1 done + +echo 'now expecting second program to lock' echo "waited, locked by: '$(cat "$dir/lock_test")'" + +echo 'release the second program also' rm "$f2" while [ ! -f "$f2.done" ]; do sleep .1 done + +echo 'expecting the lock to be gone' echo "waited more, locked by: '$(cat "$dir/lock_test")'" rm -rf "$dir" diff --git a/selftest/lock_test_help.py b/selftest/lock_test_help.py index bdf7c64..f4e1f9b 100644 --- a/selftest/lock_test_help.py +++ b/selftest/lock_test_help.py @@ -8,11 +8,15 @@ testdir, name = sys.argv[1:] stop_signalling_file = os.path.join(testdir, name) -assert os.path.isfile(stop_signalling_file) +if not os.path.isfile(stop_signalling_file): + print('expected a stop-file %r' % stop_signalling_file) + exit(1) lockfile_path = os.path.join(testdir, 'lock_test') fl = FileLock(lockfile_path, name) +touch_file(stop_signalling_file + '.ready') + with fl: while os.path.exists(stop_signalling_file): time.sleep(.1) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..197dc97 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -101,7 +101,7 @@ def __enter__(self): if self.f is not None: return - self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY | os.O_TRUNC) + self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY) fcntl.flock(self.fd, fcntl.LOCK_EX) os.truncate(self.fd, 0) os.write(self.fd, str(self.owner).encode('utf-8')) -- To view, visit https://gerrit.osmocom.org/3939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefc7fd5207c926fdeb3282d9d5b4708f1b56d20c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 13 23:52:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 13 Sep 2017 23:52:53 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix util.py/FileLock and lock_test Message-ID: Review at https://gerrit.osmocom.org/3940 fix util.py/FileLock and lock_test Do not pass os.O_TRUNC to open(), that immediately empties out the lock file. Fix lock_test to be able to catch this error. So far things were happening too fast to notice it. Caught by running 'make check' on a main unit APU that has different timing behavior. Change-Id: I872a3d2548ac84097ac7acf13cb12c36822e076e --- M selftest/lock_test.ok M selftest/lock_test.sh M selftest/lock_test_help.py M src/osmo_gsm_tester/util.py 4 files changed, 42 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/40/3940/1 diff --git a/selftest/lock_test.ok b/selftest/lock_test.ok index 604767b..011a89c 100644 --- a/selftest/lock_test.ok +++ b/selftest/lock_test.ok @@ -1,4 +1,14 @@ +creating files +launch a program that locks a given file, it will create $dir/lock_test +wait until this lock_test lock file was created by program +expecting the lock file to reflect "long name" launched first, locked by: 'long name' +launching second program, should find the lock intact and wait launched second, locked by: 'long name' +drop the first lock, $f1 removal signals the first process to stop locking +wait for first program to carry out the lock release +now expecting second program to lock waited, locked by: 'shorter' +release the second program also +expecting the lock to be gone waited more, locked by: '' diff --git a/selftest/lock_test.sh b/selftest/lock_test.sh index 049c4d9..4f3f7ad 100755 --- a/selftest/lock_test.sh +++ b/selftest/lock_test.sh @@ -1,4 +1,6 @@ #!/bin/sh + +echo 'creating files' dir="$(mktemp -d)" n1="long name" f1="$dir/$n1" @@ -7,21 +9,45 @@ f2="$dir/$n2" touch "$f2" sync + +echo 'launch a program that locks a given file, it will create $dir/lock_test' python3 ./lock_test_help.py "$dir" "$n1" & + +echo 'wait until this lock_test lock file was created by program' while [ ! -f "$dir/lock_test" ]; do sleep .1 done +sync + +echo 'expecting the lock file to reflect "long name"' echo "launched first, locked by: '$(cat "$dir/lock_test")'" + +echo 'launching second program, should find the lock intact and wait' python3 ./lock_test_help.py "$dir" "$n2" & +while [ ! -f "$f2.ready" ]; do + sleep .1 +done +sleep 1 +sync echo "launched second, locked by: '$(cat "$dir/lock_test")'" + +echo 'drop the first lock, $f1 removal signals the first process to stop locking' rm "$f1" + +echo 'wait for first program to carry out the lock release' while [ ! -f "$f1.done" ]; do sleep .1 done + +echo 'now expecting second program to lock' echo "waited, locked by: '$(cat "$dir/lock_test")'" + +echo 'release the second program also' rm "$f2" while [ ! -f "$f2.done" ]; do sleep .1 done + +echo 'expecting the lock to be gone' echo "waited more, locked by: '$(cat "$dir/lock_test")'" rm -rf "$dir" diff --git a/selftest/lock_test_help.py b/selftest/lock_test_help.py index bdf7c64..f4e1f9b 100644 --- a/selftest/lock_test_help.py +++ b/selftest/lock_test_help.py @@ -8,11 +8,15 @@ testdir, name = sys.argv[1:] stop_signalling_file = os.path.join(testdir, name) -assert os.path.isfile(stop_signalling_file) +if not os.path.isfile(stop_signalling_file): + print('expected a stop-file %r' % stop_signalling_file) + exit(1) lockfile_path = os.path.join(testdir, 'lock_test') fl = FileLock(lockfile_path, name) +touch_file(stop_signalling_file + '.ready') + with fl: while os.path.exists(stop_signalling_file): time.sleep(.1) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..197dc97 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -101,7 +101,7 @@ def __enter__(self): if self.f is not None: return - self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY | os.O_TRUNC) + self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY) fcntl.flock(self.fd, fcntl.LOCK_EX) os.truncate(self.fd, 0) os.write(self.fd, str(self.owner).encode('utf-8')) -- To view, visit https://gerrit.osmocom.org/3940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I872a3d2548ac84097ac7acf13cb12c36822e076e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 00:37:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 00:37:36 +0000 Subject: [PATCH] osmo-msc[master]: debian: fix dependency to mgcp library Message-ID: Review at https://gerrit.osmocom.org/3941 debian: fix dependency to mgcp library osmo-mgw has split the MGCP client to a separate library in change-id I8e0b2d2a399b77086a36606f5e427271c6242df1 or commit 97df691307e48c39170ac39b2394a7095d7f0ee5. Change-Id: I9c56c218fce2264fe0acae62caed4d9ff4bfb54c --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/41/3941/1 diff --git a/debian/control b/debian/control index 13d4806..ce51a7d 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ libosmocore-dev, libosmo-sccp-dev, libosmo-abis-dev, - libosmo-legacy-mgcp-dev, + libosmo-mgcp-client-dev, libosmo-netif-dev, libosmo-ranap-dev Standards-Version: 3.9.8 -- To view, visit https://gerrit.osmocom.org/3941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c56c218fce2264fe0acae62caed4d9ff4bfb54c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:17:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 01:17:36 +0000 Subject: osmo-gsm-tester[master]: add jenkins-make-check-and-run.sh In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 +V comes from the following patch, #3940. +2ing to match what jenkins expects to find. -- To view, visit https://gerrit.osmocom.org/3936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I493142bb4cd6c0465e34b4171461d28455315ef4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:30:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 01:30:10 +0000 Subject: osmo-gsm-tester[master]: fix util.py/FileLock and lock_test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I872a3d2548ac84097ac7acf13cb12c36822e076e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:30:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 01:30:58 +0000 Subject: [MERGED] osmo-gsm-tester[master]: fix util.py/FileLock and lock_test In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix util.py/FileLock and lock_test ...................................................................... fix util.py/FileLock and lock_test Do not pass os.O_TRUNC to open(), that immediately empties out the lock file. Fix lock_test to be able to catch this error. So far things were happening too fast to notice it. Caught by running 'make check' on a main unit APU that has different timing behavior. Change-Id: I872a3d2548ac84097ac7acf13cb12c36822e076e --- M selftest/lock_test.ok M selftest/lock_test.sh M selftest/lock_test_help.py M src/osmo_gsm_tester/util.py 4 files changed, 42 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/lock_test.ok b/selftest/lock_test.ok index 604767b..011a89c 100644 --- a/selftest/lock_test.ok +++ b/selftest/lock_test.ok @@ -1,4 +1,14 @@ +creating files +launch a program that locks a given file, it will create $dir/lock_test +wait until this lock_test lock file was created by program +expecting the lock file to reflect "long name" launched first, locked by: 'long name' +launching second program, should find the lock intact and wait launched second, locked by: 'long name' +drop the first lock, $f1 removal signals the first process to stop locking +wait for first program to carry out the lock release +now expecting second program to lock waited, locked by: 'shorter' +release the second program also +expecting the lock to be gone waited more, locked by: '' diff --git a/selftest/lock_test.sh b/selftest/lock_test.sh index 049c4d9..4f3f7ad 100755 --- a/selftest/lock_test.sh +++ b/selftest/lock_test.sh @@ -1,4 +1,6 @@ #!/bin/sh + +echo 'creating files' dir="$(mktemp -d)" n1="long name" f1="$dir/$n1" @@ -7,21 +9,45 @@ f2="$dir/$n2" touch "$f2" sync + +echo 'launch a program that locks a given file, it will create $dir/lock_test' python3 ./lock_test_help.py "$dir" "$n1" & + +echo 'wait until this lock_test lock file was created by program' while [ ! -f "$dir/lock_test" ]; do sleep .1 done +sync + +echo 'expecting the lock file to reflect "long name"' echo "launched first, locked by: '$(cat "$dir/lock_test")'" + +echo 'launching second program, should find the lock intact and wait' python3 ./lock_test_help.py "$dir" "$n2" & +while [ ! -f "$f2.ready" ]; do + sleep .1 +done +sleep 1 +sync echo "launched second, locked by: '$(cat "$dir/lock_test")'" + +echo 'drop the first lock, $f1 removal signals the first process to stop locking' rm "$f1" + +echo 'wait for first program to carry out the lock release' while [ ! -f "$f1.done" ]; do sleep .1 done + +echo 'now expecting second program to lock' echo "waited, locked by: '$(cat "$dir/lock_test")'" + +echo 'release the second program also' rm "$f2" while [ ! -f "$f2.done" ]; do sleep .1 done + +echo 'expecting the lock to be gone' echo "waited more, locked by: '$(cat "$dir/lock_test")'" rm -rf "$dir" diff --git a/selftest/lock_test_help.py b/selftest/lock_test_help.py index bdf7c64..f4e1f9b 100644 --- a/selftest/lock_test_help.py +++ b/selftest/lock_test_help.py @@ -8,11 +8,15 @@ testdir, name = sys.argv[1:] stop_signalling_file = os.path.join(testdir, name) -assert os.path.isfile(stop_signalling_file) +if not os.path.isfile(stop_signalling_file): + print('expected a stop-file %r' % stop_signalling_file) + exit(1) lockfile_path = os.path.join(testdir, 'lock_test') fl = FileLock(lockfile_path, name) +touch_file(stop_signalling_file + '.ready') + with fl: while os.path.exists(stop_signalling_file): time.sleep(.1) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index af6a2f0..197dc97 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -101,7 +101,7 @@ def __enter__(self): if self.f is not None: return - self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY | os.O_TRUNC) + self.fd = os.open(self.path, os.O_CREAT | os.O_WRONLY) fcntl.flock(self.fd, fcntl.LOCK_EX) os.truncate(self.fd, 0) os.write(self.fd, str(self.owner).encode('utf-8')) -- To view, visit https://gerrit.osmocom.org/3940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I872a3d2548ac84097ac7acf13cb12c36822e076e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:30:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 01:30:58 +0000 Subject: [MERGED] osmo-gsm-tester[master]: add jenkins-make-check-and-run.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add jenkins-make-check-and-run.sh ...................................................................... add jenkins-make-check-and-run.sh Change-Id: I493142bb4cd6c0465e34b4171461d28455315ef4 --- A contrib/jenkins-make-check-and-run.sh 1 file changed, 14 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified Objections: Jenkins Builder: Fails diff --git a/contrib/jenkins-make-check-and-run.sh b/contrib/jenkins-make-check-and-run.sh new file mode 100755 index 0000000..3017fd4 --- /dev/null +++ b/contrib/jenkins-make-check-and-run.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e -x +base="$PWD" + +run_script="osmo-gsm-tester/contrib/jenkins-run.sh" +test -x "$run_script" + +cd osmo-gsm-tester +make deps +make check +cd "$base" + +PATH="$base/osmo-gsm-tester/src:$PATH" \ + "$run_script" -- To view, visit https://gerrit.osmocom.org/3936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I493142bb4cd6c0465e34b4171461d28455315ef4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:50:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:50:32 +0000 Subject: osmo-msc[master]: debian: fix dependency to mgcp library In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c56c218fce2264fe0acae62caed4d9ff4bfb54c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:51:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:51:08 +0000 Subject: osmo-gsm-tester[master]: add jenkins-make-check-and-run.sh, fix lock_test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iefc7fd5207c926fdeb3282d9d5b4708f1b56d20c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:52:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:52:09 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: use define for constant In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:52:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:52:58 +0000 Subject: osmo-gsm-tester[master]: contrib: Build octphy osmo-bts variant and make it generic In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:53:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:53:14 +0000 Subject: meta-telephony[201705]: Add git-review config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:53:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:53:18 +0000 Subject: meta-telephony[201705]: Add git-review config In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:53:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:53:21 +0000 Subject: [MERGED] meta-telephony[201705]: Add git-review config In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add git-review config ...................................................................... Add git-review config Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..30ca929 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=meta-telephony -- To view, visit https://gerrit.osmocom.org/3925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4178b4866078f20f7415772255e9c755dcb90efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:55:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:55:32 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:55:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:55:59 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:56:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:56:51 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:57:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:57:12 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:57:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:57:52 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: separate capacity computation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:58:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:58:45 +0000 Subject: libosmocore[master]: osmo-auc-gen.c: squelch compiler warnings, move local var In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ddcb0525159da520aceaeb6e908a735a003bb5a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 01:59:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 14 Sep 2017 01:59:05 +0000 Subject: [MERGED] libosmocore[master]: osmo-auc-gen.c: squelch compiler warnings, move local var In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen.c: squelch compiler warnings, move local var ...................................................................... osmo-auc-gen.c: squelch compiler warnings, move local var The compiler thinks that ind or ind_mask may be used uninitialized, because it doesn't analyze the conditionality of command line arguments and other variables set accordingly. Make the compiler happy by zero initializing. Change-Id: I9ddcb0525159da520aceaeb6e908a735a003bb5a --- M utils/osmo-auc-gen.c 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index fee9767..1f5c838 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -98,15 +98,14 @@ struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; uint64_t sqn; - unsigned int ind; + unsigned int ind = 0; int rc, option_index; int rand_is_set = 0; int auts_is_set = 0; int sqn_is_set = 0; int ind_is_set = 0; int fmt_triplets_dat = 0; - uint64_t seq_1; - uint64_t ind_mask; + uint64_t ind_mask = 0; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n"); @@ -270,7 +269,7 @@ memset(vec, 0, sizeof(*vec)); if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { - seq_1 = 1LL << test_aud.u.umts.ind_bitlen; + uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen; ind_mask = seq_1 - 1; if (sqn_is_set) { -- To view, visit https://gerrit.osmocom.org/3908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ddcb0525159da520aceaeb6e908a735a003bb5a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 02:06:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 02:06:17 +0000 Subject: libosmo-netif[master]: src: _snprintf() helper functions nul-terminate buffers, if ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 02:13:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 02:13:15 +0000 Subject: osmo-gsm-tester[master]: suite: Replicate resources based on times attr before callin... In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/3907/3/selftest/suite_test/test_suite/suite.conf File selftest/suite_test/test_suite/suite.conf: Line 6: - times: 2 > It really doesn't matter if I add more attributes or not for the test case it would serve to see which one of them got duplicated :) ...no strong opinion though, it just sprung my eye and I wondered if it was intended. https://gerrit.osmocom.org/#/c/3907/3/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 61: 'bts[].trx_list[].nominal_power': schema.INT, > I wanted to use an attribute from trx_list[] to test different more complex hw_addr and net_device will, IIRC, be useful for octphy. What are we using the nominal power for? I wouldn't add values in the production code merely to serve the unit tests... If we need nominal power, let's add it in a separate patch. -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 14 02:21:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 02:21:43 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 3: In this discussion I'd also like to plug the forward perspective that all subscriber management will move to osmo-hlr, where we also are not using libdbi anymore for its cumbersomeness. So if your problem goes away from using sqlite directly, consider that accomodating libdbi might be purely a waste of time. https://osmocom.org/issues/1591 We need/want to add vty commands for subscriber management to osmo-hlr, which still lacks those completely. However, I'm not sure whether the plan is for the osmo-hlr to automatically allocate extensions, the osmo-hlr being mostly for SIM cards with auth+ciph keys where you'd allocate extensions while running your tool to enter all sim cards into the db... but it has to allocate extensions if we're going to support the same features as osmo-nitb, right? I'm ambiguous on that. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 02:26:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 02:26:44 +0000 Subject: [ABANDON] osmo-gsm-tester[master]: add jenkins-make-check-and-run.sh, fix lock_test In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: add jenkins-make-check-and-run.sh, fix lock_test ...................................................................... Abandoned merged as two separate patches. this one was just to see what the gerrit job made of it -- To view, visit https://gerrit.osmocom.org/3939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iefc7fd5207c926fdeb3282d9d5b4708f1b56d20c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 02:32:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 02:32:52 +0000 Subject: [PATCH] libosmo-abis[master]: cosmetic: ipa.c: use msgb_dequeue() instead of code dup Message-ID: Review at https://gerrit.osmocom.org/3942 cosmetic: ipa.c: use msgb_dequeue() instead of code dup Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 --- M src/input/ipa.c 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/42/3942/1 diff --git a/src/input/ipa.c b/src/input/ipa.c index ce155ce..b7863b8 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -364,14 +364,12 @@ int ret; LOGP(DLINP, LOGL_DEBUG, "sending data\n"); + msg = msgb_dequeue(&conn->tx_queue); - if (llist_empty(&conn->tx_queue)) { + if (!msg) { ofd->when &= ~BSC_FD_WRITE; return; } - lh = conn->tx_queue.next; - llist_del(lh); - msg = llist_entry(lh, struct msgb, list); ret = send(conn->ofd.fd, msg->data, msg->len, 0); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/3942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:01:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:01:35 +0000 Subject: [PATCH] libosmo-abis[master]: cosmetic: ipa.c: use msgb_dequeue(), drop local var In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3942 to look at the new patch set (#2). cosmetic: ipa.c: use msgb_dequeue(), drop local var Make ipa_server_conn_write() a lot simpler and shorter by using msgb_dequeue() and avoiding local pointer that was used only once. Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 --- M src/input/ipa.c 1 file changed, 3 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/42/3942/2 diff --git a/src/input/ipa.c b/src/input/ipa.c index ce155ce..fbed038 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -358,20 +358,16 @@ static void ipa_server_conn_write(struct ipa_server_conn *conn) { - struct osmo_fd *ofd = &conn->ofd; struct msgb *msg; - struct llist_head *lh; int ret; LOGP(DLINP, LOGL_DEBUG, "sending data\n"); + msg = msgb_dequeue(&conn->tx_queue); - if (llist_empty(&conn->tx_queue)) { - ofd->when &= ~BSC_FD_WRITE; + if (!msg) { + conn->ofd.when &= ~BSC_FD_WRITE; return; } - lh = conn->tx_queue.next; - llist_del(lh); - msg = llist_entry(lh, struct msgb, list); ret = send(conn->ofd.fd, msg->data, msg->len, 0); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/3942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:02:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:02:23 +0000 Subject: [PATCH] osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3832 to look at the new patch set (#4). doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg Now osmo-bsc.cfg's SCCP addresses work by internal defaults, while osmo-bsc_custom-sccp.cfg shows how to use custom STP IP address and SCCP point codes. Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd --- M doc/examples/osmo-bsc/osmo-bsc.cfg A doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg M osmoappdesc.py 3 files changed, 129 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/3832/4 diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index 7c10e9d..efa27ec 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -1,11 +1,5 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login +! osmo-bsc default configuration +! (assumes STP to run on 127.0.0.1 and uses default point codes) ! e1_input e1_line 0 driver ipa @@ -15,12 +9,14 @@ short name OsmoBSC long name OsmoBSC auth policy closed + authorized-regexp .* location updating reject cause 13 encryption a5 0 - neci 1 + authentication optional + neci 0 paging any use tch 0 rrlp mode none - mm info 1 + mm info 0 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 @@ -28,21 +24,25 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 bts 0 - type nanobts + type sysmobts band DCS1800 cell_identity 0 location_area_code 1 - training_sequence_code 7 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 + radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 - dtx uplink force - dtx downlink + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden ip.access unit_id 0 0 oml ip.access stream_id 255 line 0 neighbor-list mode manual-si5 @@ -50,11 +50,14 @@ neighbor-list add arfcn 200 si5 neighbor-list add arfcn 10 si5 neighbor-list add arfcn 20 + codec-support fr gprs mode none + no force-combined-si trx 0 rf_locked 0 arfcn 871 nominal power 23 + ! to use full TRX power, set max_power_red 0 max_power_red 20 rsl e1 tei 0 timeslot 0 @@ -81,21 +84,24 @@ timeslot 7 phys_chan_config TCH/F hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote +msc 0 ip.access rtp-base 4000 timeout-ping 20 timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name + no timeout-ping advanced + no bsc-welcome-text + no bsc-msc-lost-text + no bsc-grace-text + type normal + allow-emergency allow + amr-config 12_2k forbidden + amr-config 10_2k forbidden + amr-config 7_95k forbidden + amr-config 7_40k forbidden + amr-config 6_70k forbidden + amr-config 5_90k allowed + amr-config 5_15k forbidden + amr-config 4_75k forbidden bsc - no access-list-name - access-list-name bsc-list + mid-call-timeout 0 + no missing-msc-text diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg new file mode 100644 index 0000000..59e7090 --- /dev/null +++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg @@ -0,0 +1,93 @@ +! osmo-bsc configuration example for custom SCCP addresses +! +e1_input + e1_line 0 driver ipa +network + network country code 1 + mobile network code 1 + short name OsmoBSC + long name OsmoBSC + auth policy closed + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + authentication optional + neci 0 + paging any use tch 0 + rrlp mode none + mm info 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 + bts 0 + type sysmobts + band DCS1800 + cell_identity 0 + location_area_code 1 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 0 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + ! to use full TRX power, set max_power_red 0 + max_power_red 20 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +cs7 instance 0 + point-code 0.42.1 + !asp asp-clnt-OsmoBSC 2905 0 m3ua + ! remote-ip 10.23.24.1 ! where to reach the STP + sccp-address msc_remote + point-code 0.23.1 +msc 0 + msc-addr msc_remote diff --git a/osmoappdesc.py b/osmoappdesc.py index 36eb1a7..338239c 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -15,7 +15,8 @@ # along with this program. If not, see app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg", + "doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:06:57 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 14 Sep 2017 03:06:57 +0000 Subject: [PATCH] osmo-mgw[master]: debian: rename libosmo-mgcp-client0 -> libosmo-mgcp-client1 Message-ID: Review at https://gerrit.osmocom.org/3943 debian: rename libosmo-mgcp-client0 -> libosmo-mgcp-client1 The numeral is describing the library major version. libosmo-mgcp-client has version 1.0.0 Change-Id: I66394109f909cfe0385d4519c14236bc53a10b14 --- M debian/control 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/43/3943/1 diff --git a/debian/control b/debian/control index 6556370..262ba69 100644 --- a/debian/control +++ b/debian/control @@ -48,7 +48,7 @@ Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library -Package: libosmo-mgcp-client0 +Package: libosmo-mgcp-client1 Section: libs Architecture: any Multi-Arch: same @@ -60,12 +60,12 @@ Section: debug Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities Package: libosmo-mgcp-client-dev Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities -- To view, visit https://gerrit.osmocom.org/3943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I66394109f909cfe0385d4519c14236bc53a10b14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:06:59 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 14 Sep 2017 03:06:59 +0000 Subject: [PATCH] osmo-mgw[master]: debian: .install: split mgcp-client out of legacy-mgcp Message-ID: Review at https://gerrit.osmocom.org/3944 debian: .install: split mgcp-client out of legacy-mgcp Change-Id: I681e9a1299607ff3a30de34c043da499c471bc31 --- M debian/libosmo-legacy-mgcp-dev.install M debian/libosmo-legacy-mgcp0.install A debian/libosmo-mgcp-client-dev.install A debian/libosmo-mgcp-client1.install 4 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/44/3944/1 diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install index 5bd9dd0..4184fef 100644 --- a/debian/libosmo-legacy-mgcp-dev.install +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -1,3 +1,4 @@ -usr/include -usr/lib/*/*.so -usr/lib/*/pkgconfig/*.pc +usr/include/osmocom/legacy_mgcp +usr/lib/*/*legacy-mgcp*.so +usr/lib/*/*legacy-mgcp*.a +usr/lib/*/pkgconfig/*legacy-mgcp*.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install index 3de3b10..a47cc34 100644 --- a/debian/libosmo-legacy-mgcp0.install +++ b/debian/libosmo-legacy-mgcp0.install @@ -1 +1 @@ -usr/lib/*/*.so.* +usr/lib/*/*legacy-mgcp*.so.* diff --git a/debian/libosmo-mgcp-client-dev.install b/debian/libosmo-mgcp-client-dev.install new file mode 100644 index 0000000..c12a86a --- /dev/null +++ b/debian/libosmo-mgcp-client-dev.install @@ -0,0 +1,4 @@ +usr/include/osmocom/mgcp_client +usr/lib/*/libosmo-mgcp-client.so +usr/lib/*/libosmo-mgcp-client.a +usr/lib/*/pkgconfig/libosmo-mgcp-client.pc diff --git a/debian/libosmo-mgcp-client1.install b/debian/libosmo-mgcp-client1.install new file mode 100644 index 0000000..4fc8bc6 --- /dev/null +++ b/debian/libosmo-mgcp-client1.install @@ -0,0 +1 @@ +usr/lib/*/*mgcp-client*.so.* -- To view, visit https://gerrit.osmocom.org/3944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I681e9a1299607ff3a30de34c043da499c471bc31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:06:59 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 14 Sep 2017 03:06:59 +0000 Subject: [PATCH] osmo-mgw[master]: debian/rules: compile with debug symbols Message-ID: Review at https://gerrit.osmocom.org/3945 debian/rules: compile with debug symbols The debug symbol will be stripped out of the "normal" package. Change-Id: I2428b922298c312c6071f51f23d7fd5939e5af91 --- M debian/rules 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/45/3945/1 diff --git a/debian/rules b/debian/rules index 8976ede..8514f30 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,8 @@ DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') +CFLAGS += -g + # main packaging script based on dh7 syntax %: dh $@ --with autoreconf -- To view, visit https://gerrit.osmocom.org/3945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2428b922298c312c6071f51f23d7fd5939e5af91 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:06:59 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 14 Sep 2017 03:06:59 +0000 Subject: [PATCH] osmo-mgw[master]: debian: use new dbgsym package instead of old dbg packages. Message-ID: Review at https://gerrit.osmocom.org/3946 debian: use new dbgsym package instead of old dbg packages. The new dbgsym packages gets created automatic without taken care of them. Change-Id: I4113c10d7698232217071becddd997fad918ca36 --- M debian/control M debian/rules 2 files changed, 0 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/3946/1 diff --git a/debian/control b/debian/control index 262ba69..2dfeb09 100644 --- a/debian/control +++ b/debian/control @@ -19,26 +19,12 @@ Depends: libosmo-legacy-mgcp0, ${misc:Depends}, ${shlibs:Depends} Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmo-mgw-dbg -Section: debug -Architecture: any -Multi-Arch: same -Depends: osmo-mgw (= ${binary:Version}), ${misc:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks - Package: libosmo-legacy-mgcp0 Section: libs Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library - -Package: libosmo-legacy-mgcp-dbg -Section: debug -Architecture: any -Multi-Arch: same -Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library Package: libosmo-legacy-mgcp-dev @@ -54,13 +40,6 @@ Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities - -Package: libosmo-mgcp-client-dbg -Section: debug -Architecture: any -Multi-Arch: same -Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities Package: libosmo-mgcp-client-dev diff --git a/debian/rules b/debian/rules index 8514f30..d089345 100755 --- a/debian/rules +++ b/debian/rules @@ -31,7 +31,3 @@ dh_autoreconf # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg -override_dh_strip: - dh_strip --dbg-package=osmo-mgw-dbg - dh_strip --dbg-package=libosmo-legacy-mgcp-dbg - dh_strip --dbg-package=libosmo-mgcp-client-dbg -- To view, visit https://gerrit.osmocom.org/3946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4113c10d7698232217071becddd997fad918ca36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:08:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:08:42 +0000 Subject: [PATCH] libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3880 to look at the new patch set (#4). VTY: implicit node exit by de-indenting, not parent lookup Note: This will break users' config files if they do not use consistent indenting. (see below for a definition of "consistent".) When reading VTY commands from a file, use indenting as means to implicitly exit child nodes. Do not look for commands in the parent node implicitly. The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the current node, but succeeds on the parent node. That is the mechanism by which our VTY config files do not need 'exit' at the end of each child node. We've hit problems with this in the following scenarios, which will show improved user experience after this patch: *) When both a parent and its child node have commands with identical names: cs7 instace 0 point-code 1.2.3 sccp-address osmo-msc point-code 0.0.1 If I put the parent's command below the child, it is still interpreted in the context of the child node: cs7 instace 0 sccp-address osmo-msc point-code 0.0.1 point-code 1.2.3 Though the indenting lets me assume I am setting the cs7 instance's global PC to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the 0.0.1. *) When a software change moves a VTY command from a child to a parent. Say 'timezone' moved from 'bts' to 'network' level: network timezone 1 2 Say a user still has an old config file with 'timezone' on the child level: network bts 0 timezone 1 2 trx 0 The user would expect an error message that 'timezone' is invalid on the 'bts' level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts' to the 'network' level, and instead says that the 'trx' command does not exist. Format: Consistent means that two adjacent indenting lines have the exact same indenting characters for the common length: Weird mix if you ask me, but correct and consistent: ROOT PARENT CHILD GRANDCHILD GRANDCHILD2 SIBLING Inconsistent: ROOT PARENT CHILD GRANDCHILD GRANDCHILD2 SIBLING Also, when going back to a parent level, the exact same indenting must be used as before in that node: Incorrect: ROOT PARENT CHILD SIBLING As not really intended side effect, it is also permitted to indent the entire file starting from the root level. We could guard against it but there's no harm: Correct and consistent: ROOT PARENT CHILD SIBLING Implementation: Track parent nodes state: whenever a command enters a child node, push a parent node onto an llist to remember the exact indentation characters used for that level. As soon as the first line on a child node is parsed, remember this new indentation (which must have a longer strlen() than its parent level) to apply to all remaining child siblings and grandchildren. If the amount of spaces that indent a following VTY command are less than this expected indentation, call vty_go_parent() until it matches up. At any level, if the common length of indentation characters mismatch, abort parsing in error. Transitions to child node are spread across VTY implementations and are hard to change. But transitions to the parent node are all handled by vty_go_parent(). By popping a parent from the list of parents in vty_go_parent(), we can also detect that a command has changed the node without changing the parent, hence it must have stepped into a child node, and we can push a parent frame. The behavior on the interactive telnet VTY remains unchanged. Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 --- M include/osmocom/vty/command.h M include/osmocom/vty/vty.h M src/vty/command.c M src/vty/vty.c M tests/Makefile.am M tests/testsuite.at A tests/vty/fail_not_de-indented.cfg A tests/vty/fail_tabs_and_spaces.cfg A tests/vty/fail_too_much_indent.cfg A tests/vty/ok.cfg A tests/vty/ok_ignore_blank.cfg A tests/vty/ok_ignore_comment.cfg A tests/vty/ok_indented_root.cfg A tests/vty/ok_more_spaces.cfg A tests/vty/ok_tabs.cfg A tests/vty/ok_tabs_and_spaces.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 18 files changed, 321 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/3880/4 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0fa5175..cb2edaa 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -161,6 +161,7 @@ #define CMD_COMPLETE_MATCH 8 #define CMD_COMPLETE_LIST_MATCH 9 #define CMD_SUCCESS_DAEMON 10 +#define CMD_ERR_INVALID_INDENT 11 /* Argc max counts. */ #define CMD_ARGC_MAX 256 @@ -368,6 +369,7 @@ char *argv_concat(const char **argv, int argc, int shift); vector cmd_make_strvec(const char *); +int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p); void cmd_free_strvec(vector); vector cmd_describe_command(); char **cmd_complete_command(); diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index 544e1fa..02ba03e 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -3,6 +3,8 @@ #include #include +#include + /*! \defgroup vty VTY (Virtual TTY) interface * @{ * \file vty.h */ @@ -43,6 +45,20 @@ VTY_FILE, VTY_SHELL, VTY_SHELL_SERV +}; + +struct vty_parent_node { + struct llist_head entry; + + /*! private data, specified by creator */ + void *priv; + + /*! Node status of this vty */ + int node; + + /*! When reading from a config file, these are the indenting characters expected for children of + * this VTY node. */ + char *indent; }; /*! Internal representation of a single VTY */ @@ -134,6 +150,13 @@ /*! In configure mode. */ int config; + + /*! List of parent nodes, last item is the outermost parent. */ + struct llist_head parent_nodes; + + /*! When reading from a config file, these are the indenting characters expected for children of + * the current VTY node. */ + char *indent; }; /* Small macro to determine newline is newline only or linefeed needed. */ diff --git a/src/vty/command.c b/src/vty/command.c index 52c7191..a65b4de 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -190,31 +190,56 @@ } } -/*! Breaking up string into each command piece. I assume given - character is separated by a space character. Return value is a - vector which includes char ** data element. */ -vector cmd_make_strvec(const char *string) +/*! Break up string in command tokens. Return leading indents. + * \param[in] string String to split. + * \param[out] indent If not NULL, return a talloc_strdup of indent characters. + * \param[out] strvec_p Returns vector of split tokens, must not be NULL. + * \returns CMD_SUCCESS or CMD_ERR_INVALID_INDENT + * + * If \a indent is passed non-NULL, only simple space ' ' indents are allowed, + * so that \a indent can simply return the count of leading spaces. + * Otherwise any isspace() characters are allowed for indenting (backwards compat). + */ +int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p) { const char *cp, *start; char *token; int strlen; vector strvec; + *strvec_p = NULL; + if (indent) + *indent = 0; + if (string == NULL) - return NULL; + return CMD_SUCCESS; cp = string; /* Skip white spaces. */ - while (isspace((int)*cp) && *cp != '\0') + while (isspace((int)*cp) && *cp != '\0') { + /* if we're counting indents, we need to be strict about them */ + if (indent && (*cp != ' ') && (*cp != '\t')) { + /* Ignore blank lines, they appear as leading whitespace with line breaks. */ + if (*cp == '\n' || *cp == '\r') { + cp++; + string = cp; + continue; + } + return CMD_ERR_INVALID_INDENT; + } cp++; + } + + if (indent) + *indent = talloc_strndup(tall_vty_cmd_ctx, string, cp - string); /* Return if there is only white spaces */ if (*cp == '\0') - return NULL; + return CMD_SUCCESS; if (*cp == '!' || *cp == '#') - return NULL; + return CMD_SUCCESS; /* Prepare return vector. */ strvec = vector_init(VECTOR_MIN_SIZE); @@ -236,8 +261,21 @@ cp++; if (*cp == '\0') - return strvec; + break; } + + *strvec_p = strvec; + return CMD_SUCCESS; +} + +/*! Breaking up string into each command piece. I assume given + character is separated by a space character. Return value is a + vector which includes char ** data element. */ +vector cmd_make_strvec(const char *string) +{ + vector strvec; + cmd_make_strvec2(string, NULL, &strvec); + return strvec; } /*! Free allocated string vector. */ @@ -1947,6 +1985,33 @@ return cmd_complete_command_real(vline, vty, status); } +static struct vty_parent_node *vty_parent(struct vty *vty) +{ + return llist_first_entry_or_null(&vty->parent_nodes, + struct vty_parent_node, + entry); +} + +static bool vty_pop_parent(struct vty *vty) +{ + struct vty_parent_node *parent = vty_parent(vty); + if (!parent) + return false; + llist_del(&parent->entry); + vty->node = parent->node; + vty->priv = parent->priv; + if (vty->indent) + talloc_free(vty->indent); + vty->indent = parent->indent; + talloc_free(parent); + return true; +} + +static void vty_clear_parents(struct vty *vty) +{ + while (vty_pop_parent(vty)); +} + /* return parent node */ /* * This function MUST eventually converge on a node when called repeatedly, @@ -1969,24 +2034,33 @@ case VIEW_NODE: case ENABLE_NODE: case CONFIG_NODE: + vty_clear_parents(vty); break; case AUTH_ENABLE_NODE: vty->node = VIEW_NODE; + vty_clear_parents(vty); break; case CFG_LOG_NODE: case VTY_NODE: vty->node = CONFIG_NODE; + vty_clear_parents(vty); break; default: - if (host.app_info->go_parent_cb) + if (host.app_info->go_parent_cb) { host.app_info->go_parent_cb(vty); - else if (is_config_child(vty)) + vty_pop_parent(vty); + } + else if (is_config_child(vty)) { vty->node = CONFIG_NODE; - else + vty_clear_parents(vty); + } + else { vty->node = VIEW_NODE; + vty_clear_parents(vty); + } break; } @@ -2252,36 +2326,130 @@ return (*matched_element->func) (matched_element, vty, argc, argv); } +static inline size_t len(const char *str) +{ + return str? strlen(str) : 0; +} + +static int indent_cmp(const char *a, const char *b) +{ + size_t al, bl; + al = len(a); + bl = len(b); + if (al > bl) { + if (bl && strncmp(a, b, bl) != 0) + return EINVAL; + return 1; + } + /* al <= bl */ + if (al && strncmp(a, b, al) != 0) + return EINVAL; + return (al < bl)? -1 : 0; +} + /* Configration make from file. */ int config_from_file(struct vty *vty, FILE * fp) { int ret; vector vline; + char *indent; + int cmp; + struct vty_parent_node this_node; + struct vty_parent_node *parent; while (fgets(vty->buf, VTY_BUFSIZ, fp)) { - vline = cmd_make_strvec(vty->buf); + indent = NULL; + vline = NULL; + ret = cmd_make_strvec2(vty->buf, &indent, &vline); - /* In case of comment line */ - if (vline == NULL) + if (ret != CMD_SUCCESS) + goto return_invalid_indent; + + /* In case of comment or empty line */ + if (vline == NULL) { + if (indent) { + talloc_free(indent); + indent = NULL; + } continue; - /* Execute configuration command : this is strict match */ - ret = cmd_execute_command_strict(vline, vty, NULL); - - /* Try again with setting node to CONFIG_NODE */ - while (ret != CMD_SUCCESS && ret != CMD_WARNING - && ret != CMD_ERR_NOTHING_TODO - && is_config_child(vty)) { - vty_go_parent(vty); - ret = cmd_execute_command_strict(vline, vty, NULL); } + /* We have a nonempty line. This might be the first on a deeper indenting level, so let's + * remember this indent if we don't have one yet. */ + if (!vty->indent) + vty->indent = talloc_strdup(vty, indent); + + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + + /* Less indent: go up the parent nodes to find matching amount of less indent. When this + * loop exits, we want to have found an exact match, i.e. cmp == 0. */ + while (cmp < 0) { + vty_go_parent(vty); + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + } + + /* More indent without having entered a child node level? Either the parent node's indent + * wasn't hit exactly (e.g. there's a space more than the parent level had further above) + * or the indentation increased even though the vty command didn't enter a child. */ + if (cmp > 0) + goto return_invalid_indent; + + /* Remember the current node before the command possibly changes it. */ + this_node = (struct vty_parent_node){ + .node = vty->node, + .priv = vty->priv, + .indent = vty->indent, + }; + + parent = vty_parent(vty); + ret = cmd_execute_command_strict(vline, vty, NULL); cmd_free_strvec(vline); if (ret != CMD_SUCCESS && ret != CMD_WARNING - && ret != CMD_ERR_NOTHING_TODO) + && ret != CMD_ERR_NOTHING_TODO) { + if (indent) { + talloc_free(indent); + indent = NULL; + } return ret; + } + + /* If we have stepped down into a child node, push a parent frame. + * The causality is such: we don't expect every single node entry implementation to push + * a parent node entry onto vty->parent_nodes. Instead we expect vty_go_parent() to *pop* + * a parent node. Hence if the node changed without the parent node changing, we must + * have stepped into a child node (and now expect a deeper indent). */ + if (vty->node != this_node.node && parent == vty_parent(vty)) { + /* Push the parent node. */ + parent = talloc_zero(vty, struct vty_parent_node); + *parent = this_node; + llist_add(&parent->entry, &vty->parent_nodes); + + /* The current talloc'ed vty->indent string will now be owned by this parent + * struct. Indicate that we don't know what deeper indent characters the user + * will choose. */ + vty->indent = NULL; + } + + if (indent) { + talloc_free(indent); + indent = NULL; + } } return CMD_SUCCESS; + +return_invalid_indent: + if (vline) + cmd_free_strvec(vline); + if (indent) { + talloc_free(indent); + indent = NULL; + } + return CMD_ERR_INVALID_INDENT; } /* Configration from terminal */ diff --git a/src/vty/vty.c b/src/vty/vty.c index 113a781..bd0d2c3 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -110,6 +110,8 @@ if (!new) goto out; + INIT_LLIST_HEAD(&new->parent_nodes); + new->obuf = buffer_new(new, 0); /* Use default buffer size. */ if (!new->obuf) goto out_new; @@ -1480,6 +1482,12 @@ case CMD_ERR_NO_MATCH: fprintf(stderr, "There is no such command.\n"); break; + case CMD_ERR_INVALID_INDENT: + fprintf(stderr, + "Inconsistent indentation -- leading whitespace must match adjacent lines, and\n" + "indentation must reflect child node levels. A mix of tabs and spaces is\n" + "allowed, but their sequence must not change within a child block.\n"); + break; } fprintf(stderr, "Error occurred during reading the below " "line:\n%s\n", vty->buf); diff --git a/tests/Makefile.am b/tests/Makefile.am index 37378fb..8935bf7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -217,7 +217,18 @@ logging/logging_test.ok logging/logging_test.err \ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ - vty/vty_test.ok comp128/comp128_test.ok \ + vty/vty_test.ok \ + vty/fail_not_de-indented.cfg \ + vty/fail_tabs_and_spaces.cfg \ + vty/fail_too_much_indent.cfg \ + vty/ok.cfg \ + vty/ok_ignore_blank.cfg \ + vty/ok_ignore_comment.cfg \ + vty/ok_indented_root.cfg \ + vty/ok_more_spaces.cfg \ + vty/ok_tabs_and_spaces.cfg \ + vty/ok_tabs.cfg \ + comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/testsuite.at b/tests/testsuite.at index f148cf5..1954e66 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -174,6 +174,7 @@ AT_SETUP([vty]) AT_KEYWORDS([vty]) cat $abs_srcdir/vty/vty_test.ok > expout +cp $abs_srcdir/vty/*.cfg . AT_CHECK([$abs_top_builddir/tests/vty/vty_test], [0], [expout], [ignore]) AT_CLEANUP diff --git a/tests/vty/fail_not_de-indented.cfg b/tests/vty/fail_not_de-indented.cfg new file mode 100644 index 0000000..5af833d --- /dev/null +++ b/tests/vty/fail_not_de-indented.cfg @@ -0,0 +1,3 @@ +line vty + no login + log stderr diff --git a/tests/vty/fail_tabs_and_spaces.cfg b/tests/vty/fail_tabs_and_spaces.cfg new file mode 100644 index 0000000..fa6ce05 --- /dev/null +++ b/tests/vty/fail_tabs_and_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/fail_too_much_indent.cfg b/tests/vty/fail_too_much_indent.cfg new file mode 100644 index 0000000..bacb3e1 --- /dev/null +++ b/tests/vty/fail_too_much_indent.cfg @@ -0,0 +1,3 @@ +line vty + no login + log stderr diff --git a/tests/vty/ok.cfg b/tests/vty/ok.cfg new file mode 100644 index 0000000..d5ef23e --- /dev/null +++ b/tests/vty/ok.cfg @@ -0,0 +1,3 @@ +line vty + no login +log stderr diff --git a/tests/vty/ok_ignore_blank.cfg b/tests/vty/ok_ignore_blank.cfg new file mode 100644 index 0000000..d16ff64 --- /dev/null +++ b/tests/vty/ok_ignore_blank.cfg @@ -0,0 +1,7 @@ +line vty + + no login + + no login + +log stderr diff --git a/tests/vty/ok_ignore_comment.cfg b/tests/vty/ok_ignore_comment.cfg new file mode 100644 index 0000000..5813fc7 --- /dev/null +++ b/tests/vty/ok_ignore_comment.cfg @@ -0,0 +1,7 @@ +line vty + ! comment + no login +! comment + no login + ! comment +log stderr diff --git a/tests/vty/ok_indented_root.cfg b/tests/vty/ok_indented_root.cfg new file mode 100644 index 0000000..313c674 --- /dev/null +++ b/tests/vty/ok_indented_root.cfg @@ -0,0 +1,3 @@ + line vty + no login + log stderr diff --git a/tests/vty/ok_more_spaces.cfg b/tests/vty/ok_more_spaces.cfg new file mode 100644 index 0000000..b66a9c2 --- /dev/null +++ b/tests/vty/ok_more_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/ok_tabs.cfg b/tests/vty/ok_tabs.cfg new file mode 100644 index 0000000..e94609b --- /dev/null +++ b/tests/vty/ok_tabs.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/ok_tabs_and_spaces.cfg b/tests/vty/ok_tabs_and_spaces.cfg new file mode 100644 index 0000000..2049b73 --- /dev/null +++ b/tests/vty/ok_tabs_and_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index d84bf41..eba9995 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -288,6 +289,15 @@ destroy_test_vty(&test, vty); } +void test_exit_by_indent(const char *fname, int expect_rc) +{ + int rc; + printf("reading file %s, expecting rc=%d\n", fname, expect_rc); + rc = vty_read_config_file(fname, NULL); + printf("got rc=%d\n", rc); + OSMO_ASSERT(rc == expect_rc); +} + int main(int argc, char **argv) { struct vty_app_info vty_info = { @@ -322,6 +332,16 @@ test_cmd_string_from_valstr(); test_node_tree_structure(); test_stats_vty(); + test_exit_by_indent("ok.cfg", 0); + test_exit_by_indent("ok_more_spaces.cfg", 0); + test_exit_by_indent("ok_tabs.cfg", 0); + test_exit_by_indent("ok_tabs_and_spaces.cfg", 0); + test_exit_by_indent("ok_ignore_comment.cfg", 0); + test_exit_by_indent("ok_ignore_blank.cfg", 0); + test_exit_by_indent("fail_not_de-indented.cfg", -EINVAL); + test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); + test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); + test_exit_by_indent("ok_indented_root.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index 2b6d5a6..b2df1a1 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -108,4 +108,24 @@ Returned: 0, Current node: 4 '%s(config)# ' Going to execute 'no stats reporter statsd' Returned: 0, Current node: 4 '%s(config)# ' +reading file ok.cfg, expecting rc=0 +got rc=0 +reading file ok_more_spaces.cfg, expecting rc=0 +got rc=0 +reading file ok_tabs.cfg, expecting rc=0 +got rc=0 +reading file ok_tabs_and_spaces.cfg, expecting rc=0 +got rc=0 +reading file ok_ignore_comment.cfg, expecting rc=0 +got rc=0 +reading file ok_ignore_blank.cfg, expecting rc=0 +got rc=0 +reading file fail_not_de-indented.cfg, expecting rc=-22 +got rc=-22 +reading file fail_too_much_indent.cfg, expecting rc=-22 +got rc=-22 +reading file fail_tabs_and_spaces.cfg, expecting rc=-22 +got rc=-22 +reading file ok_indented_root.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:10:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:10:35 +0000 Subject: [PATCH] libosmocore[master]: VTY: allow comments in the same line as vty commands In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3882 to look at the new patch set (#3). VTY: allow comments in the same line as vty commands Note: this breaks users' VTY config when a command's argument starts with a '!' or '#'. Allow comments following VTY commands, on the same line. Start a comment with '!' or '#' following a space, which allows using the comment characters in command arguments -- just not at the start of an argument. This patch allows to do: remote-ip 10.23.24.1 # where to reach the STP When they are not preceded by a space, the comment characters still count as VTY command tokens, i.e. still allowing: short-name instance#23 This would parse "instance#23" as name. (We usually use '!' as the VTY comment delimiter, but the code also allowed and still allows using '#', hence add both '#' and '!' as same-line comment delimiter.) Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_comments.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/3882/3 diff --git a/src/vty/command.c b/src/vty/command.c index a65b4de..0f5538a 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -246,6 +246,9 @@ /* Copy each command piece and set into vector. */ while (1) { + if (*cp == '!' || *cp == '#') + break; + start = cp; while (!(isspace((int)*cp) || *cp == '\r' || *cp == '\n') && *cp != '\0') diff --git a/tests/Makefile.am b/tests/Makefile.am index 8935bf7..b43d9b7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -222,6 +222,7 @@ vty/fail_tabs_and_spaces.cfg \ vty/fail_too_much_indent.cfg \ vty/ok.cfg \ + vty/ok_comments.cfg \ vty/ok_ignore_blank.cfg \ vty/ok_ignore_comment.cfg \ vty/ok_indented_root.cfg \ diff --git a/tests/vty/ok_comments.cfg b/tests/vty/ok_comments.cfg new file mode 100644 index 0000000..c040892 --- /dev/null +++ b/tests/vty/ok_comments.cfg @@ -0,0 +1,3 @@ +line vty ! comments + no login # after +log stderr #commands diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index eba9995..27e5b5c 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -342,6 +342,7 @@ test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); test_exit_by_indent("ok_indented_root.cfg", 0); + test_exit_by_indent("ok_comments.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index b2df1a1..a09e7ef 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -128,4 +128,6 @@ got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 got rc=0 +reading file ok_comments.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:12:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:12:10 +0000 Subject: osmo-mgw[master]: debian: rename libosmo-mgcp-client0 -> libosmo-mgcp-client1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 the plan is to move to 2.0.0 when the split is complete ... note to self, take this as a blueprint for then. -- To view, visit https://gerrit.osmocom.org/3943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I66394109f909cfe0385d4519c14236bc53a10b14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:13:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:13:13 +0000 Subject: osmo-mgw[master]: debian: .install: split mgcp-client out of legacy-mgcp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I681e9a1299607ff3a30de34c043da499c471bc31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:13:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:13:58 +0000 Subject: osmo-mgw[master]: debian/rules: compile with debug symbols In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3945/1//COMMIT_MSG Commit Message: Line 9: The debug symbol will be stripped out of the "normal" package. if you say so... -- To view, visit https://gerrit.osmocom.org/3945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2428b922298c312c6071f51f23d7fd5939e5af91 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:19:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:19:19 +0000 Subject: osmo-mgw[master]: debian: use new dbgsym package instead of old dbg packages. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 maybe mention that it is related to the CFLAGS = -g ? -- To view, visit https://gerrit.osmocom.org/3946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4113c10d7698232217071becddd997fad918ca36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:23:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:23:29 +0000 Subject: [ABANDON] osmo-msc[master]: remove contrib/soap.py, seems to apply to osmo-bsc only In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: remove contrib/soap.py, seems to apply to osmo-bsc only ...................................................................... Abandoned I don't feel competent, may others move the script or change it. -- To view, visit https://gerrit.osmocom.org/3812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I647be0a646bbc3cfee226c55061e0e57fa1211fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:24:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:24:45 +0000 Subject: openbsc[master]: vty tests: drop testBSCreload In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 Having this ready for the case that the vty tests start failing with "Broken pipe" again and we're fed up and don't want to fix it. -- To view, visit https://gerrit.osmocom.org/3922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib042cd24857cc58a4297d666a8a525e05bd4c917 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:28:21 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 14 Sep 2017 03:28:21 +0000 Subject: osmo-msc[master]: debian: fix dependency to mgcp library In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 LGTM -- To view, visit https://gerrit.osmocom.org/3941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c56c218fce2264fe0acae62caed4d9ff4bfb54c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:29:28 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 14 Sep 2017 03:29:28 +0000 Subject: [PATCH] osmo-sgsn[master]: debian: fix paths of examples Message-ID: Review at https://gerrit.osmocom.org/3947 debian: fix paths of examples Change-Id: I054e500be9527b1dd0fc0c21cde2b7b2d2fdfbff --- M debian/osmo-gbproxy.install M debian/osmo-gtphub.install M debian/osmo-sgsn.install 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/47/3947/1 diff --git a/debian/osmo-gbproxy.install b/debian/osmo-gbproxy.install index 62ebe2a..33ec570 100644 --- a/debian/osmo-gbproxy.install +++ b/debian/osmo-gbproxy.install @@ -1,2 +1,2 @@ usr/bin/osmo-gbproxy -usr/share/doc/openbsc/examples/osmo-gbproxy +usr/share/doc/osmo-sgsn/examples/osmo-gbproxy diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install index 8a5dafd..fb4c095 100644 --- a/debian/osmo-gtphub.install +++ b/debian/osmo-gtphub.install @@ -1,2 +1,2 @@ usr/bin/osmo-gtphub -usr/share/doc/openbsc/examples/osmo-gtphub +usr/share/doc/osmo-sgsn/examples/osmo-gtphub diff --git a/debian/osmo-sgsn.install b/debian/osmo-sgsn.install index a92ae18..bde329a 100644 --- a/debian/osmo-sgsn.install +++ b/debian/osmo-sgsn.install @@ -1,2 +1,2 @@ usr/bin/osmo-sgsn -usr/share/doc/openbsc/examples/osmo-sgsn +usr/share/doc/osmo-sgsn/examples/osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I054e500be9527b1dd0fc0c21cde2b7b2d2fdfbff Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:29:34 +0000 Subject: [MERGED] osmo-msc[master]: debian: fix dependency to mgcp library In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: fix dependency to mgcp library ...................................................................... debian: fix dependency to mgcp library osmo-mgw has split the MGCP client to a separate library in change-id I8e0b2d2a399b77086a36606f5e427271c6242df1 or commit 97df691307e48c39170ac39b2394a7095d7f0ee5. Change-Id: I9c56c218fce2264fe0acae62caed4d9ff4bfb54c --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: lynxis lazus: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 13d4806..ce51a7d 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ libosmocore-dev, libosmo-sccp-dev, libosmo-abis-dev, - libosmo-legacy-mgcp-dev, + libosmo-mgcp-client-dev, libosmo-netif-dev, libosmo-ranap-dev Standards-Version: 3.9.8 -- To view, visit https://gerrit.osmocom.org/3941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c56c218fce2264fe0acae62caed4d9ff4bfb54c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:33:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:33:12 +0000 Subject: osmo-sgsn[master]: debian: fix paths of examples In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I054e500be9527b1dd0fc0c21cde2b7b2d2fdfbff Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:33:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:33:20 +0000 Subject: osmo-sgsn[master]: debian: fix paths of examples In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I054e500be9527b1dd0fc0c21cde2b7b2d2fdfbff Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:33:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:33:22 +0000 Subject: [MERGED] osmo-sgsn[master]: debian: fix paths of examples In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: fix paths of examples ...................................................................... debian: fix paths of examples Change-Id: I054e500be9527b1dd0fc0c21cde2b7b2d2fdfbff --- M debian/osmo-gbproxy.install M debian/osmo-gtphub.install M debian/osmo-sgsn.install 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/debian/osmo-gbproxy.install b/debian/osmo-gbproxy.install index 62ebe2a..33ec570 100644 --- a/debian/osmo-gbproxy.install +++ b/debian/osmo-gbproxy.install @@ -1,2 +1,2 @@ usr/bin/osmo-gbproxy -usr/share/doc/openbsc/examples/osmo-gbproxy +usr/share/doc/osmo-sgsn/examples/osmo-gbproxy diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install index 8a5dafd..fb4c095 100644 --- a/debian/osmo-gtphub.install +++ b/debian/osmo-gtphub.install @@ -1,2 +1,2 @@ usr/bin/osmo-gtphub -usr/share/doc/openbsc/examples/osmo-gtphub +usr/share/doc/osmo-sgsn/examples/osmo-gtphub diff --git a/debian/osmo-sgsn.install b/debian/osmo-sgsn.install index a92ae18..bde329a 100644 --- a/debian/osmo-sgsn.install +++ b/debian/osmo-sgsn.install @@ -1,2 +1,2 @@ usr/bin/osmo-sgsn -usr/share/doc/openbsc/examples/osmo-sgsn +usr/share/doc/osmo-sgsn/examples/osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I054e500be9527b1dd0fc0c21cde2b7b2d2fdfbff Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:34:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:34:02 +0000 Subject: [MERGED] osmo-mgw[master]: debian: use new dbgsym package instead of old dbg packages. In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: use new dbgsym package instead of old dbg packages. ...................................................................... debian: use new dbgsym package instead of old dbg packages. The new dbgsym packages gets created automatic without taken care of them. Change-Id: I4113c10d7698232217071becddd997fad918ca36 --- M debian/control M debian/rules 2 files changed, 0 insertions(+), 25 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 262ba69..2dfeb09 100644 --- a/debian/control +++ b/debian/control @@ -19,26 +19,12 @@ Depends: libosmo-legacy-mgcp0, ${misc:Depends}, ${shlibs:Depends} Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmo-mgw-dbg -Section: debug -Architecture: any -Multi-Arch: same -Depends: osmo-mgw (= ${binary:Version}), ${misc:Depends} -Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks - Package: libosmo-legacy-mgcp0 Section: libs Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library - -Package: libosmo-legacy-mgcp-dbg -Section: debug -Architecture: any -Multi-Arch: same -Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library Package: libosmo-legacy-mgcp-dev @@ -54,13 +40,6 @@ Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities - -Package: libosmo-mgcp-client-dbg -Section: debug -Architecture: any -Multi-Arch: same -Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities Package: libosmo-mgcp-client-dev diff --git a/debian/rules b/debian/rules index 8514f30..d089345 100755 --- a/debian/rules +++ b/debian/rules @@ -31,7 +31,3 @@ dh_autoreconf # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg -override_dh_strip: - dh_strip --dbg-package=osmo-mgw-dbg - dh_strip --dbg-package=libosmo-legacy-mgcp-dbg - dh_strip --dbg-package=libosmo-mgcp-client-dbg -- To view, visit https://gerrit.osmocom.org/3946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4113c10d7698232217071becddd997fad918ca36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:34:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:34:02 +0000 Subject: [MERGED] osmo-mgw[master]: debian/rules: compile with debug symbols In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian/rules: compile with debug symbols ...................................................................... debian/rules: compile with debug symbols The debug symbol will be stripped out of the "normal" package. Change-Id: I2428b922298c312c6071f51f23d7fd5939e5af91 --- M debian/rules 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/rules b/debian/rules index 8976ede..8514f30 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,8 @@ DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') +CFLAGS += -g + # main packaging script based on dh7 syntax %: dh $@ --with autoreconf -- To view, visit https://gerrit.osmocom.org/3945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2428b922298c312c6071f51f23d7fd5939e5af91 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:34:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:34:02 +0000 Subject: [MERGED] osmo-mgw[master]: debian: .install: split mgcp-client out of legacy-mgcp In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: .install: split mgcp-client out of legacy-mgcp ...................................................................... debian: .install: split mgcp-client out of legacy-mgcp Change-Id: I681e9a1299607ff3a30de34c043da499c471bc31 --- M debian/libosmo-legacy-mgcp-dev.install M debian/libosmo-legacy-mgcp0.install A debian/libosmo-mgcp-client-dev.install A debian/libosmo-mgcp-client1.install 4 files changed, 10 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install index 5bd9dd0..4184fef 100644 --- a/debian/libosmo-legacy-mgcp-dev.install +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -1,3 +1,4 @@ -usr/include -usr/lib/*/*.so -usr/lib/*/pkgconfig/*.pc +usr/include/osmocom/legacy_mgcp +usr/lib/*/*legacy-mgcp*.so +usr/lib/*/*legacy-mgcp*.a +usr/lib/*/pkgconfig/*legacy-mgcp*.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install index 3de3b10..a47cc34 100644 --- a/debian/libosmo-legacy-mgcp0.install +++ b/debian/libosmo-legacy-mgcp0.install @@ -1 +1 @@ -usr/lib/*/*.so.* +usr/lib/*/*legacy-mgcp*.so.* diff --git a/debian/libosmo-mgcp-client-dev.install b/debian/libosmo-mgcp-client-dev.install new file mode 100644 index 0000000..c12a86a --- /dev/null +++ b/debian/libosmo-mgcp-client-dev.install @@ -0,0 +1,4 @@ +usr/include/osmocom/mgcp_client +usr/lib/*/libosmo-mgcp-client.so +usr/lib/*/libosmo-mgcp-client.a +usr/lib/*/pkgconfig/libosmo-mgcp-client.pc diff --git a/debian/libosmo-mgcp-client1.install b/debian/libosmo-mgcp-client1.install new file mode 100644 index 0000000..4fc8bc6 --- /dev/null +++ b/debian/libosmo-mgcp-client1.install @@ -0,0 +1 @@ +usr/lib/*/*mgcp-client*.so.* -- To view, visit https://gerrit.osmocom.org/3944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I681e9a1299607ff3a30de34c043da499c471bc31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Sep 14 03:34:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 03:34:03 +0000 Subject: [MERGED] osmo-mgw[master]: debian: rename libosmo-mgcp-client0 -> libosmo-mgcp-client1 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: rename libosmo-mgcp-client0 -> libosmo-mgcp-client1 ...................................................................... debian: rename libosmo-mgcp-client0 -> libosmo-mgcp-client1 The numeral is describing the library major version. libosmo-mgcp-client has version 1.0.0 Change-Id: I66394109f909cfe0385d4519c14236bc53a10b14 --- M debian/control 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 6556370..262ba69 100644 --- a/debian/control +++ b/debian/control @@ -48,7 +48,7 @@ Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library -Package: libosmo-mgcp-client0 +Package: libosmo-mgcp-client1 Section: libs Architecture: any Multi-Arch: same @@ -60,12 +60,12 @@ Section: debug Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities Package: libosmo-mgcp-client-dev Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities -- To view, visit https://gerrit.osmocom.org/3943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I66394109f909cfe0385d4519c14236bc53a10b14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Sep 14 09:33:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 14 Sep 2017 09:33:29 +0000 Subject: [MERGED] osmo-gsm-tester[master]: modem: Fix race condition when connect() is called more than... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: modem: Fix race condition when connect() is called more than once ...................................................................... modem: Fix race condition when connect() is called more than once An issue was spotted recently in tests run in production which call modem.connect() twice, first time to check that we are unable to connect with a wrong KI, then that we can connect with the correct KI. As there's no current easy way to wait for "rejected" signal, we basically wait for some time before checking if we were unable to connect. It seems that sometimes waiting for 30 seconds is not enough, and then a scan() async method is still in progress when we decide to call connect() again, which will powercycle the modem. If the scan() method returns at that time, then we try to access interfaces of the modem which are no longer available because the modem is powered off at that time. This triggers an exception and test fails. To correct way to fix this is to make sure we disable pending Scan() dbus method before powercycling the modem and starting a new Scan() method. The sleep time is also increased to make sure we let enough time to register. It seems it can take about 15 seconds to do a full scan, and sometimes during first scan iteration the BTS is still not found, probably because it's still starting. Related: OS#2510 Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b --- M src/osmo_gsm_tester/ofono_client.py M suites/aoip_encryption/register_a5_0_authreq.py M suites/aoip_encryption/register_a5_1_authreq.py 3 files changed, 11 insertions(+), 6 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index e3858f9..30e2b55 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -349,10 +349,7 @@ def cleanup(self): self.dbg('cleanup') if self.cancellable: - self.cancellable.cancel() - # Cancel op is applied as a signal coming from glib mainloop, so we - # need to run it and wait for the callbacks to handle cancellations. - poll_glib() + self.cancel_pending_dbus_methods() self.cancellable = None self.dbus.cleanup() self.dbus = None @@ -500,6 +497,12 @@ self.log('Registering with operator', matching_op_path, mcc_mnc) dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', dbus_op.Register) + def cancel_pending_dbus_methods(self): + self.cancellable.cancel() + # Cancel op is applied as a signal coming from glib mainloop, so we + # need to run it and wait for the callbacks to handle cancellations. + poll_glib() + def power_cycle(self): 'Power the modem and put it online, power cycle it if it was already on' if self.is_powered(): @@ -517,6 +520,8 @@ 'Connect to MCC+MNC' if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): raise log.Error('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + # if test called connect() before and async scanning has not finished, we need to get rid of it: + self.cancel_pending_dbus_methods() self.power_cycle() self.register_attempts = 0 if self.is_connected(mcc_mnc): diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index be8f8a1..051f5e2 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -31,7 +31,7 @@ print('Attempt connection with wrong KI...') ms.connect(msc.mcc_mnc()) -sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) print('Asserting modem did not register') # FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 # assert not ms.is_connected(msc.mcc_mnc()) diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index dd41348..11ee006 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -31,7 +31,7 @@ print('Attempt connection with wrong KI...') ms.connect(msc.mcc_mnc()) -sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) print('Asserting modem did not register') # FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 # assert not ms.is_connected(msc.mcc_mnc()) -- To view, visit https://gerrit.osmocom.org/3901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 14 10:15:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 10:15:21 +0000 Subject: libosmo-abis[master]: cosmetic: ipa.c: use msgb_dequeue(), drop local var In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 I don't think it's cosmetic change (it's more than updating comments, formatting etc) but seems good anyway. -- To view, visit https://gerrit.osmocom.org/3942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 10:19:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 10:19:33 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#2). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. This requires I72528bc1e376134c5a7b6e7a50c48e38c3f48b0a in libosmocore. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 3 files changed, 44 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/2 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index 0616069..004f77a 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -65,6 +65,8 @@ uint8_t block_payload; }; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 0cebd93..9eb8464 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -81,18 +81,19 @@ /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } +} - return buf; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); } static bool test_and_set_bit(uint32_t *bits, size_t elem) @@ -588,11 +589,8 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_print(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ @@ -704,14 +702,12 @@ } else { /* No supported row in table 6.4.2.2.1. */ #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "combination not supported\n", slot_info); #endif continue; } @@ -723,12 +719,11 @@ if (!rx_good) { #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, tx_window, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "no DL slots available\n", slot_info); #endif continue; } @@ -744,16 +739,13 @@ if (req_common_slots != common_slot_count) { #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); + "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " + "invalid number of common TS: %d (expected %d)\n", + slot_info, common_slot_count, req_common_slots); #endif continue; } @@ -780,16 +772,14 @@ } #ifdef ENABLE_TS_ALLOC_DEBUG + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(rx_bad, 'x')); + masked_override_with(slot_info, rx_window, 'D'); + masked_override_with(slot_info, tx_window, 'U'); + masked_override_with(slot_info, rx_window& tx_window, 'C'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); + "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " + "capacity = %d\n", + slot_info, capacity); #endif if (capacity <= max_capacity) @@ -915,12 +905,10 @@ } if (tbf->direction == GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, dl_slots, 'D'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); + "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); /* assign downlink */ if (dl_slots == 0) { @@ -953,12 +941,10 @@ ul_slots = 1 << ts; usf[ts] = free_usf; + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, ul_slots, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); + "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n",slot_info, single ? ", single" : ""); slotcount++; first_ts = ts; @@ -1003,12 +989,8 @@ ms_->set_reserved_slots(trx, reserved_ul_slots, reserved_dl_slots); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); + ts_print(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); } tbf_->trx = trx; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 602e35b..9016eb1 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6549,7 +6549,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Sep 14 11:13:11 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Thu, 14 Sep 2017 11:13:11 +0000 Subject: [PATCH] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- A jobs/gerrit-verifications.yml 1 file changed, 268 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/3911/4 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..d143f7f --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,268 @@ +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation is default + cmd: ./contrib/jenkins.sh + + repos: + + - osmo-iuh + - osmo-gsm-manuals + + # no 'clean state'? + - osmo-sip-connector + + # touchstone config without filter? + - osmocom-bb + + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + # no gcc warnings at all? + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - cellmgr-ng: + concurrent: true + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + # no gcc warnings? + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: '(BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct+trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="femtobts_v2.7") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v2.4") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.0.1pre") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.1") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v5.1") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="v2017.01") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next")' + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + # no gcc warnings at all? + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e SMPP="$SMPP" \ + -e MGCP="$MGCP" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -i -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: 'docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i \ + -e HOME=/build \ + -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" \ + -e MAKE=make \ + -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" \ + -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build \ + -u build \ + -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" osmocom:amd64 \ + /build/contrib/jenkins.sh + + # no ./contrib/jenkins.sh script might worth putting it in repo? + - osmo-tetra: + cmd: > + rm -rf deps/install + mkdir deps || true + cd deps + osmo-deps.sh libosmocore + + cd libosmocore + autoreconf --install --force + ./configure --prefix=$PWD/../install + $MAKE $PARALLEL_MAKE install + + cd ../../src + make clean || true + PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + + triggers: + - gerrit: + trigger-on: + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: true # for testing + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + # ensure clean state + - shell: 'chmod -R +w *; rm -rf *; git checkout .' + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 14 11:53:38 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 14 Sep 2017 11:53:38 +0000 Subject: [PATCH] libosmo-sccp[master]: simple client: prevent overwriting asp settings Message-ID: Review at https://gerrit.osmocom.org/3948 simple client: prevent overwriting asp settings If the user does not create an AS, but creates an ASP with a name that is equal to the default name, then the simple client detects that and trys to use this ASP. However, unfortunately it then overwrites the settings of the ASP with the default settings. If the detected ASP is not created by the simple client, use it, but preseve the settings of that ASP. Change-Id: I53d73059f804c3bbea6cb43dc73ad49a753b3b15 --- M src/sccp_user.c 1 file changed, 27 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/48/3948/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index 06a7174..21b2eed 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -414,20 +414,35 @@ * we intend to use. */ asp = osmo_ss7_asp_find_by_proto(as, prot); if (!asp) { - LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", - name); + /* Check if the user has already created an ASP elsewhere under + * the default asp name. */ asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); - asp = - osmo_ss7_asp_find_or_create(ss7, asp_name, - default_remote_port, - default_local_port, prot); - talloc_free(asp_name); - if (!asp) - goto out_rt; - asp_created = true; + asp = osmo_ss7_asp_find_by_name(ss7, asp_name); + if (!asp) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", + name); + asp = + osmo_ss7_asp_find_or_create(ss7, asp_name, + default_remote_port, + default_local_port, + prot); + talloc_free(asp_name); + if (!asp) + goto out_rt; + asp_created = true; - asp->cfg.local.host = default_local_ip ? talloc_strdup(asp, default_local_ip) : NULL; - asp->cfg.remote.host = default_remote_ip ? talloc_strdup(asp, default_remote_ip) : NULL; + asp->cfg.local.host = NULL; + asp->cfg.remote.host = NULL; + if (default_local_ip) { + asp->cfg.local.host = + talloc_strdup(asp, default_local_ip); + } + if (default_remote_ip) { + asp->cfg.remote.host = + talloc_strdup(asp, default_remote_ip); + } + } else + talloc_free(asp_name); osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53d73059f804c3bbea6cb43dc73ad49a753b3b15 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Sep 14 12:35:36 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 14 Sep 2017 12:35:36 +0000 Subject: [PATCH] openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3910 to look at the new patch set (#4). libmsc: db_subscriber_alloc_exten() remove infinite loop This patch prevents entering an infinite loop in the case that you actually have exhasuted all available extensions. FIXME: How best to check for free extensions in the pool. TODO: If there is no extension available, then do not create the subscriber. Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 --- M openbsc/src/libmsc/db.c 1 file changed, 42 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/10/3910/4 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 4ba12ca..329fa98 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1407,19 +1407,49 @@ return 0; } +uint64_t extension_alloc(uint64_t smin, uint64_t smax) { + return smin + (rand() % (smax - smin)); +} + int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, uint64_t smax) { dbi_result result = NULL; uint64_t try; + unsigned long long total; + int i; + int available; - for (;;) { - try = (rand() % (smax - smin + 1) + smin); + result = dbi_conn_query(conn, + "SELECT count(*) AS total FROM Subscriber " + "WHERE extension IS NOT NULL"); + + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to get subscriber count " + "while allocating new extension.\n"); + return 1; + } + + dbi_result_next_row(result); + total = dbi_result_get_ulonglong(result, "total"); + available = smax - smin - total; + + if (available < 0) { + LOGP(DDB, LOGL_ERROR, "Only %llu/%llu extensions available\n", available, total); + return 1; + } + + for (i = 0; i < (smax - smin)*2; i++) { + + if (!(i % 100) || try > smax) { + try = extension_alloc(smin, smax); + } + result = dbi_conn_queryf(conn, "SELECT * FROM Subscriber " "WHERE extension = %"PRIu64, - try - ); + try); + if (!result) { LOGP(DDB, LOGL_ERROR, "Failed to query Subscriber " "while allocating new extension.\n"); @@ -1427,6 +1457,7 @@ } if (dbi_result_get_numrows(result)){ dbi_result_free(result); + try++; continue; } if (!dbi_result_next_row(result)) { @@ -1435,6 +1466,13 @@ } dbi_result_free(result); } + + if (i > (smax - smin)*2 ) { + DEBUGP(DDB, "Out of Loop, no extension available for IMSI %s.\n", + subscriber->imsi); + return 1; + } + sprintf(subscriber->extension, "%"PRIu64, try); DEBUGP(DDB, "Allocated extension %"PRIu64 " for IMSI %s.\n", try, subscriber->imsi); return db_sync_subscriber(subscriber); -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Sep 14 12:54:11 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 14 Sep 2017 12:54:11 +0000 Subject: [PATCH] openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3910 to look at the new patch set (#5). libmsc: db_subscriber_alloc_exten() remove infinite loop This patch prevents entering an infinite loop in the case that you actually have exhasuted all available extensions. FIXME: How best to check for free extensions in the pool. TODO: If there is no extension available, then do not create the subscriber. Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 --- M openbsc/src/libmsc/db.c 1 file changed, 43 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/10/3910/5 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 4ba12ca..7439313 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1407,19 +1407,49 @@ return 0; } +uint64_t extension_alloc(uint64_t smin, uint64_t smax) { + return smin + (rand() % (smax - smin)); +} + int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, uint64_t smax) { dbi_result result = NULL; - uint64_t try; + uint64_t try = NULL; + unsigned long long total; + int i; + int available; - for (;;) { - try = (rand() % (smax - smin + 1) + smin); + result = dbi_conn_query(conn, + "SELECT count(*) AS total FROM Subscriber " + "WHERE extension IS NOT NULL"); + + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to get subscriber count " + "while allocating new extension.\n"); + return 1; + } + + dbi_result_next_row(result); + total = dbi_result_get_ulonglong(result, "total"); + available = smax - smin - total; + + if (available < 0) { + LOGP(DDB, LOGL_ERROR, "Only %d/%llu extensions available\n", available, total); + return 1; + } + + for (i = 0; i < (smax - smin)*2; i++) { + + if (!(i % 100) || try > smax) { + try = extension_alloc(smin, smax); + } + result = dbi_conn_queryf(conn, "SELECT * FROM Subscriber " "WHERE extension = %"PRIu64, - try - ); + try); + if (!result) { LOGP(DDB, LOGL_ERROR, "Failed to query Subscriber " "while allocating new extension.\n"); @@ -1427,6 +1457,7 @@ } if (dbi_result_get_numrows(result)){ dbi_result_free(result); + try++; continue; } if (!dbi_result_next_row(result)) { @@ -1435,6 +1466,13 @@ } dbi_result_free(result); } + + if (i > (smax - smin)*2 ) { + DEBUGP(DDB, "Out of Loop, no extension available for IMSI %s.\n", + subscriber->imsi); + return 1; + } + sprintf(subscriber->extension, "%"PRIu64, try); DEBUGP(DDB, "Allocated extension %"PRIu64 " for IMSI %s.\n", try, subscriber->imsi); return db_sync_subscriber(subscriber); -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:11:27 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 14 Sep 2017 13:11:27 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/3910/5/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 1442: for (i = 0; i < (smax - smin)*2; i++) { Is there a way to check the entire pool for a free extension, without going through them all one by one? Given that we want some level of random-ness in extention allocations we want to use rand(), but with what I do here: start at rand() and ++ 100 times (unless we reach the ceiling) then get a new rand() - with this you could take a long time to find the one free extension out of 20,000. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:15:15 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 14 Sep 2017 13:15:15 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: > So if your > problem goes away from using sqlite directly, Hmm. the gerrit failure was related to libdbi 0.8.4, but that is not related to the issue I'm trying to address, although I'm not sure - will this code fail now on a system with libdbi 0.8.4? > but it has > to allocate extensions if we're going to support the same features > as osmo-nitb, right? Absolutely, allocating extensions is central to the Rhizomatica network administration. I think a post to the mailing list on this is in order... -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split off RX mask computation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3913 to look at the new patch set (#4). Simplify TS alloc: split off RX mask computation Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 58 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/4 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5ca0c29..c310830 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -604,6 +604,56 @@ return (win | win >> 8) & 0xFF; } +enum { MASK_TT, MASK_TR }; + +/*! Fill in RX mask table for a given MS Class + * + * \param[in] ms_cl MS Class pointer + * \param[in] num_tx Number of TX slots to consider + * \param[out] rx_mask RX mask table + */ +static inline void fill_rx_mask(const struct gprs_ms_multislot_class *ms_cl, uint8_t num_tx, uint8_t *rx_mask) +{ + static const char *digit[10] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + uint8_t Tta = ms_cl->ta, Ttb = ms_cl->tb, Tra = ms_cl->ra, Trb = ms_cl->rb, /* Minimum Number of Slots */ + Tx = ms_cl->tx, Sum = ms_cl->sum, /* Maximum Number of Slots: Tx, Sum = Rx + Tx */ + Type = ms_cl->type; /* Type of Mobile */ + + /* MS_A maps to 0 if frequency hopping is disabled */ + /* TODO: Set it to 1 if FH is implemented and enabled */ + if (Ttb == MS_A) + Ttb = 0; + if (Trb == MS_A) + Trb = 0; + + /* MS_A and MS_B are 0 iff FH is disabled and there is no Tx/Rx change. + * This is never the case with the current implementation, so 1 will always be used. */ + if (Ttb == MS_B) + Ttb = 1; + if (Trb == MS_C) + Trb = 1; + + if (num_tx == 1) /* it's enough to log this once per TX slot set iteration */ + LOGP(DRLCMAC, LOGL_DEBUG, " Rx=%u, Tx=%u, Sum Rx + Tx=%s [Tta=%s Ttb=%u] [Tra=%u Trb=%u] Type=%u\n", + ms_cl->rx, Tx, + (Sum == MS_NA) ? "N/A" : digit[Sum], + (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); + + if (ms_cl->type == 1) { + rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; + rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); + rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + } else { + /* Class type 2 MS have independant RX and TX */ + rx_mask[MASK_TT] = 0xff; + rx_mask[MASK_TR] = 0xff; + } + + rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); + rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -615,17 +665,12 @@ static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; - uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ - uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ - uint8_t Type; /* Type of Mobile */ uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; int16_t rx_window, tx_window; - static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; - int max_capacity; - uint8_t max_ul_slots; - uint8_t max_dl_slots; - enum {MASK_TT, MASK_TR}; + int max_capacity = -1; + uint8_t max_ul_slots = 0; + uint8_t max_dl_slots = 0; if (ms->ms_class() >= 32) { LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", @@ -646,33 +691,6 @@ return -EINVAL; } - Tx = ms_class->tx; - Sum = ms_class->sum; - Tta = ms_class->ta; - Ttb = ms_class->tb; - Tra = ms_class->ra; - Trb = ms_class->rb; - Type = ms_class->type; - - /* MS_A maps to 0 if frequency hopping is disabled */ - /* TODO: Set it to 1 if FH is implemented and enabled */ - if (Ttb == MS_A) - Ttb = 0; - if (Trb == MS_A) - Trb = 0; - - /* MS_A and MS_B are 0 iff FH is disabled and there is no Tx/Rx change. - * This is never the case with the current implementation, so 1 will - * always be used. */ - if (Ttb == MS_B) - Ttb = 1; - if (Trb == MS_C) - Trb = 1; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, - (Sum == MS_NA) ? "N/A" : digit[Sum], - (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); - max_slots = OSMO_MAX(ms_class->rx, ms_class->tx); if (*dl_slots == 0) @@ -691,28 +709,12 @@ /* Check for each UL (TX) slot */ - max_capacity = -1; - max_ul_slots = 0; - max_dl_slots = 0; - /* Iterate through possible numbers of TX slots */ for (num_tx = 1; num_tx <= ms_class->tx; num_tx += 1) { uint16_t tx_valid_win = (1 << num_tx) - 1; - uint8_t rx_mask[MASK_TR+1]; + uint8_t rx_mask[MASK_TR + 1]; - if (ms_class->type == 1) { - rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; - rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); - rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); - } else { - /* Class type 2 MS have independant RX and TX */ - rx_mask[MASK_TT] = 0xff; - rx_mask[MASK_TR] = 0xff; - } - - rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); - rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); + fill_rx_mask(ms_class, num_tx, rx_mask); /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9016eb1..22b7746 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3328,12 +3328,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -3367,12 +3367,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -6541,12 +6541,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 11 -- Rx=4 Tx=3 Sum Rx+Tx=5 Tta=3 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=3, Sum Rx + Tx=5 [Tta=3 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: cosmetic, use proper formatting In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3914 to look at the new patch set (#4). Simplify TS alloc: cosmetic, use proper formatting The find_multi_slots() function has 5 nested for(;;) loops but it's formatted as one. Before trying to split this into smth saner, let's first fix code formatting to make nested loops obvious. Also, fix typos in comments. Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 113 insertions(+), 115 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/14/3914/4 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index a8e0df1..ea699ff 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -597,14 +597,13 @@ /* Iterate through possible numbers of TX slots */ for (num_tx = 1; num_tx <= ms_class->tx; num_tx += 1) { uint16_t tx_valid_win = (1 << num_tx) - 1; - uint8_t rx_mask[MASK_TR+1]; + if (ms_class->type == 1) { rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); } else { /* Class type 2 MS have independant RX and TX */ rx_mask[MASK_TT] = 0xff; @@ -614,133 +613,132 @@ rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); - /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ - for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; - uint16_t rx_valid_win; - uint32_t checked_rx[256/32] = {0}; + /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ + for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { + unsigned tx_slot_count; + int max_rx; + uint16_t rx_valid_win; + uint32_t checked_rx[256/32] = {0}; - /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + /* Wrap valid window */ + tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; - tx_window = tx_valid_win; + tx_window = tx_valid_win; - /* Filter out unavailable slots */ - tx_window &= *ul_slots; + /* Filter out unavailable slots */ + tx_window &= *ul_slots; - /* Skip if the the first TS (ul_ts) is not in the set */ - if ((tx_window & (1 << ul_ts)) == 0) - continue; - - /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ - if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) - continue; - - tx_slot_count = pcu_bitcount(tx_window); - - max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; - - /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ - for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { - /* Wrap valid window */ - rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; - - /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ - for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; - unsigned ts; - int capacity; - - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; - - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ + /* Skip if the the first TS (ul_ts) is not in the set */ + if ((tx_window & (1 << ul_ts)) == 0) continue; - } - } - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) - continue; + /* Skip if the the last TS (ul_ts+num_tx-1) is not in the set */ + if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) + continue; - if (!rx_good) { - continue; - } + tx_slot_count = pcu_bitcount(tx_window); - if (!rx_window) - continue; + max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); + rx_valid_win = (1 << max_rx) - 1; - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); + /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ + for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { + /* Wrap valid window */ + rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; - if (req_common_slots != common_slot_count) { - continue; - } + /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ + for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { + unsigned common_slot_count; + unsigned req_common_slots; + unsigned rx_slot_count; + uint16_t rx_bad; + uint8_t rx_good; + unsigned ts; + int capacity; - /* Compute capacity */ - capacity = 0; + /* Filter out bad slots */ + rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = *dl_slots & ~rx_bad; - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; + /* TODO: CHECK this calculation -> separate function for unit testing */ + + rx_window = rx_good & rx_valid_win; + rx_slot_count = pcu_bitcount(rx_window); + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on mask_sel. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + unsigned slot_sum = rx_slot_count + tx_slot_count; + /* Assume down+up/dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TR) + /* Skip Tta */ + continue; + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (mask_sel != MASK_TT) + /* Skip Tra */ + continue; + } else { + /* No supported row in table 6.4.2.2.1. */ + continue; + } + } + + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + continue; + + if (!rx_good) + continue; + + if (!rx_window) + continue; + + /* Check number of common slots according to TS 54.002, 6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + continue; + + /* Compute capacity */ + capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + int c; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) { + c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); + c = OSMO_MAX(c, 1); + capacity += c; + } + } + } + + if (capacity <= max_capacity) + continue; + + max_capacity = capacity; + max_ul_slots = tx_window; + max_dl_slots = rx_window; } } } - - if (capacity <= max_capacity) - continue; - - max_capacity = capacity; - max_ul_slots = tx_window; - max_dl_slots = rx_window; - }}}} + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, -- To view, visit https://gerrit.osmocom.org/3914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: use defines for constant In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3920 to look at the new patch set (#3). Simplify TS alloc: use defines for constant * define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 4 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/3 diff --git a/src/bts.cpp b/src/bts.cpp index 0046238..815cb1c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -457,7 +457,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = NO_FREE_TFI; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index b3a8027..8a9f51b 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define NO_FREE_TFI 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 47a892d..76a84c7 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -126,7 +126,7 @@ uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - if (tfi_map == 0xffffffffUL) + if (tfi_map == NO_FREE_TFI) return -1; /* look for USF, don't use USF=7 */ @@ -203,7 +203,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -335,10 +335,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == NO_FREE_TFI) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 13f3869..59eaee2 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -611,17 +611,17 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != NO_FREE_TFI) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != NO_FREE_TFI) continue; busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", + printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", tfi, ms_class, get_dir_char(0x01, ul_slots, dl_slots, busy_slots), get_dir_char(0x02, ul_slots, dl_slots, busy_slots), -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: improve readability In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#15). Simplify TS alloc: improve readability * consistently format log messages to make it possible to grep for test output in source code * move TRX check inside local tfi_find_free() wrapper * drop unused code * assign reserved_*_slots only when multislot masks are found Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 25 insertions(+), 90 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/15 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 76a84c7..a3a9670 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -248,9 +248,7 @@ if (free_tfi) { tfi = find_free_tfi(pdch, dir); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -258,26 +256,20 @@ if (dir == GPRS_RLCMAC_UL_TBF) { usf = find_free_usf(pdch); if (usf < 0) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -374,7 +366,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -386,6 +378,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -532,17 +533,14 @@ if (ms->ms_class()) { ms_class = &gprs_ms_multislot_class[ms->ms_class()]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "class %d\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", ms->ms_class()); } else { ms_class = &gprs_ms_multislot_class[12]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "unknown class (assuming 12)\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for unknown class (assuming 12)\n"); } if (ms_class->tx == MS_NA) { - LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not " - "applicable.\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not applicable.\n", ms->ms_class()); return -EINVAL; } @@ -569,8 +567,7 @@ if (Trb == MS_C) Trb = 1; - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d " - " Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, + LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, (Sum == MS_NA) ? "N/A" : digit[Sum], (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); @@ -673,15 +670,6 @@ rx_window = rx_good & rx_valid_win; rx_slot_count = pcu_bitcount(rx_window); -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ /* Whether to skip this round doesn not only depend on the bit * sets but also on mask_sel. Therefore this check must be done @@ -702,16 +690,6 @@ continue; } else { /* No supported row in table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); -#endif continue; } } @@ -721,14 +699,6 @@ continue; if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); -#endif continue; } @@ -742,18 +712,6 @@ req_common_slots = OSMO_MIN(req_common_slots, 2); if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); -#endif continue; } @@ -777,19 +735,6 @@ } } } - -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); -#endif if (capacity <= max_capacity) continue; @@ -850,20 +795,10 @@ return -EINVAL; } - reserved_dl_slots = dl_slots = ms->reserved_dl_slots(); - reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); @@ -880,11 +815,11 @@ rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; - - reserved_dl_slots = dl_slots; - reserved_ul_slots = ul_slots; } + reserved_dl_slots = dl_slots; + reserved_ul_slots = ul_slots; + /* Step 3: Derive the slot set for the current TBF */ if (single) { /* Make sure to consider the first common slot only */ -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 15 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: expand tests log In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3895 to look at the new patch set (#16). TS alloc: expand tests log * restructure code for easier reading * use consistent formatting for output * log essential allocation parameters on failure Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 3 files changed, 192 insertions(+), 184 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/16 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c310830..4065d5d 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -428,13 +428,14 @@ const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx = ms->current_trx(); - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " - "%d\n", tbf->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class %d [%s]\n", + tbf->ms_class(), (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, - "- Failed to find a usable TRX (TFI exhausted)\n"); + "algo A [%s] (suggested TRX: %d): failed to find a usable TRX (TFI exhausted) for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return trx_no; } if (!trx) @@ -462,14 +463,16 @@ &tfi, &usf); if (tbf->direction == GPRS_RLCMAC_UL_TBF && usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no USF available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no USF available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } if (ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no TFI available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no TFI available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } @@ -934,7 +937,7 @@ LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); } - LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7), %s\n", slot_info, single ? "single" : "multi"); return sl; } @@ -1022,7 +1025,8 @@ /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): failed to allocate a TFI for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return tfi; } @@ -1066,23 +1070,27 @@ first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first common slots available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } + if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first slot available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } if (single && slotcount) { tbf_->upgrade_to_multislot = (avail_count > slotcount); - LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", - first_ts, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using single slot at TS %d for %s\n", + single ? "single" : "multi", use_trx, first_ts, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { tbf_->upgrade_to_multislot = 0; - LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using %d slots for %s\n", + single ? "single" : "multi", use_trx, slotcount, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } /* The allocation will be successful, so the system state and tbf_/ms_ diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index a804bab..47dcefc 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -1,53 +1,53 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -111,53 +111,53 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -227,15 +227,15 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously -1) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 35 TBFs (previously 160) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -397,7 +397,7 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 160) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -559,11 +559,11 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL Allocated 32 TBFs (previously -1) No USF available Allocated 24 TBFs (previously 32) @@ -600,7 +600,7 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -635,11 +635,11 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -705,9 +705,9 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 97 TBFs (previously -1) -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 24 TBFs (previously 97) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -728,7 +728,7 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 97) No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -890,5 +890,5 @@ No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 22b7746..7603295 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1,7 +1,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 4, because not enabled @@ -18,7 +18,7 @@ Modifying MS object, TLLI = 0x00002342, TA 220 -> 4 ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 3, because need to reuse TS @@ -41,7 +41,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -94,7 +94,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer 3193. ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -130,7 +130,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -183,7 +183,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer 3193. ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -219,7 +219,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -544,7 +544,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -565,7 +565,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -605,7 +605,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -631,7 +631,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -657,7 +657,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -683,7 +683,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -709,7 +709,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -735,7 +735,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -761,7 +761,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -787,7 +787,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -813,7 +813,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -839,7 +839,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -865,7 +865,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -891,7 +891,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -917,7 +917,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -943,7 +943,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -969,7 +969,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -995,7 +995,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1021,7 +1021,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1047,7 +1047,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1073,7 +1073,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1099,7 +1099,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1125,7 +1125,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1151,7 +1151,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1177,7 +1177,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1203,7 +1203,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1229,7 +1229,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1255,7 +1255,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1281,7 +1281,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1307,7 +1307,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1333,7 +1333,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1359,7 +1359,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1385,7 +1385,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1411,7 +1411,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1437,15 +1437,15 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 -- Failed to find a usable TRX (TFI exhausted) +Slot Allocation (Algorithm A) for class 45 [DL] +algo A [single] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No PDCH resource Destroying MS object, TLLI = 0x00000000 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1476,7 +1476,7 @@ ********** TBF ends here ********** ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1541,7 +1541,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1588,7 +1588,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1627,7 +1627,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1674,7 +1674,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1711,7 +1711,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1757,7 +1757,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1848,7 +1848,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1919,7 +1919,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1965,7 +1965,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2016,7 +2016,7 @@ MS requests UL TBF in packet resource request of single block, so we provide one: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2046,7 +2046,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2094,7 +2094,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2140,7 +2140,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2175,7 +2175,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2247,7 +2247,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2293,7 +2293,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3049,7 +3049,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) starting timer 3193. ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3334,8 +3334,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3373,8 +3373,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3419,7 +3419,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3471,7 +3471,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3513,7 +3513,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3728,7 +3728,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3758,7 +3758,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4117,7 +4117,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4416,7 +4416,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4670,7 +4670,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4885,7 +4885,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5076,7 +5076,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5246,7 +5246,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5410,7 +5410,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5560,7 +5560,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5711,7 +5711,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5765,7 +5765,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5819,7 +5819,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5873,7 +5873,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5946,7 +5946,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6019,7 +6019,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6092,7 +6092,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6165,7 +6165,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6226,7 +6226,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6287,7 +6287,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6348,7 +6348,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6428,7 +6428,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6510,7 +6510,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6548,7 +6548,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4, Tx=3, Sum Rx + Tx=5 [Tta=3 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single -Using single slot at TS 4 for DL +algo B [single] (suggested TRX: 0): using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -6562,8 +6562,8 @@ PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Searching for first unallocated TFI: TRX=0 Found TFI=0. -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: -1): using 4 slots for DL - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 3 @@ -6604,7 +6604,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6674,7 +6674,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6704,7 +6704,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6851,7 +6851,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6876,7 +6876,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6901,7 +6901,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6926,7 +6926,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6951,7 +6951,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6976,7 +6976,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7001,7 +7001,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7026,7 +7026,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7035,7 +7035,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [single] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No PDCH resource sending Immediate Assignment Uplink (AGCH) reject Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b Destroying MS object, TLLI = 0x00000000 @@ -7064,7 +7064,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7928,7 +7928,7 @@ ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9013,7 +9013,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9034,7 +9034,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9059,7 +9059,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9084,7 +9084,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9109,7 +9109,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9134,7 +9134,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9159,7 +9159,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9184,7 +9184,7 @@ ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9216,7 +9216,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -9225,7 +9225,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No PDCH resource Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 16 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#3). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 3 files changed, 22 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/3 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index c16a954..4cbcf8c 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -65,6 +65,8 @@ uint8_t block_payload; }; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index a3a9670..3b33d22 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -81,18 +81,19 @@ /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } +} - return buf; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); } static bool test_and_set_bit(uint32_t *bits, size_t elem) @@ -584,11 +585,8 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_print(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ @@ -848,12 +846,10 @@ } if (tbf->direction == GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, dl_slots, 'D'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); + "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); /* assign downlink */ if (dl_slots == 0) { @@ -886,12 +882,10 @@ ul_slots = 1 << ts; usf[ts] = free_usf; + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, ul_slots, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); + "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n",slot_info, single ? ", single" : ""); slotcount++; first_ts = ts; @@ -936,12 +930,8 @@ ms_->set_reserved_slots(trx, reserved_ul_slots, reserved_dl_slots); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); + ts_print(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); } tbf_->trx = trx; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 602e35b..9016eb1 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6549,7 +6549,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3932 to look at the new patch set (#3). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok 3 files changed, 2,481 insertions(+), 2,491 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/3932/3 diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 59eaee2..838cfe3 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -21,6 +21,7 @@ #include "gprs_debug.h" #include "tbf.h" #include "bts.h" +#include "pcu_utils.h" #include #include @@ -473,6 +474,19 @@ TEST_MODE_UL_AFTER_DL, }; +static inline char *test_mode_descr(enum test_mode t) +{ + switch (t) { + case TEST_MODE_UL_ONLY: return (char*)"UL only"; + case TEST_MODE_DL_ONLY: return (char*)"DL only"; + case TEST_MODE_UL_AND_DL: return (char*)"UL and DL"; + case TEST_MODE_DL_AND_UL: return (char*)"DL and UL"; + case TEST_MODE_DL_AFTER_UL: return (char*)"DL after UL"; + case TEST_MODE_UL_AFTER_DL: return (char*)"UL after DL"; + default: return NULL; + } +} + static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class, enum test_mode mode) { @@ -621,24 +635,23 @@ busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", - tfi, ms_class, - get_dir_char(0x01, ul_slots, dl_slots, busy_slots), - get_dir_char(0x02, ul_slots, dl_slots, busy_slots), - get_dir_char(0x04, ul_slots, dl_slots, busy_slots), - get_dir_char(0x08, ul_slots, dl_slots, busy_slots), - get_dir_char(0x10, ul_slots, dl_slots, busy_slots), - get_dir_char(0x20, ul_slots, dl_slots, busy_slots), - get_dir_char(0x40, ul_slots, dl_slots, busy_slots), - get_dir_char(0x80, ul_slots, dl_slots, busy_slots)); + printf(" TBF[%2d] class %2d reserves " OSMO_BIT_SPEC " [%2u /%2u /%2u ]\n", + tfi, ms_class, + get_dir_char(0x01, ul_slots, dl_slots, busy_slots), + get_dir_char(0x02, ul_slots, dl_slots, busy_slots), + get_dir_char(0x04, ul_slots, dl_slots, busy_slots), + get_dir_char(0x08, ul_slots, dl_slots, busy_slots), + get_dir_char(0x10, ul_slots, dl_slots, busy_slots), + get_dir_char(0x20, ul_slots, dl_slots, busy_slots), + get_dir_char(0x40, ul_slots, dl_slots, busy_slots), + get_dir_char(0x80, ul_slots, dl_slots, busy_slots), + pcu_bitcount(ul_slots), pcu_bitcount(dl_slots), pcu_bitcount(busy_slots)); if (tfi >= 0) { OSMO_ASSERT(ms->current_trx()); - tfi2 = the_bts->tfi_find_free(dir, &trx_no2, - ms->current_trx()->trx_no); + tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(tfi2 < 0 || - trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; @@ -649,16 +662,16 @@ return counter; } -static void test_successive_allocation(algo_t algo, unsigned min_class, - unsigned max_class, enum test_mode mode, - unsigned expect_num, const char *text) +static void test_successive_alloc(unsigned min_class, unsigned max_class, unsigned expect_num, enum test_mode mode, + algo_t algo, const char *text) { BTS the_bts; struct gprs_rlcmac_bts *bts; struct gprs_rlcmac_trx *trx; unsigned counter; - printf("Going to test assignment with many TBF, %s\n", text); + printf("Going to test assignment with many TBF, algorithm %s class %u..%u (%s)\n", + text, min_class, max_class, test_mode_descr(mode)); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -672,9 +685,11 @@ counter = alloc_many_tbfs(&the_bts, min_class, max_class, mode); - printf(" Successfully allocated %d UL TBFs\n", counter); + printf(" Successfully allocated %d UL TBFs, algorithm %s class %u..%u (%s)\n", + counter, text, min_class, max_class, test_mode_descr(mode)); if (counter != expect_num) - fprintf(stderr, " Expected %d TBFs for %s\n", expect_num, text); + fprintf(stderr, " Expected %d TBFs, algorithm %s class %u..%u (%s)\n", + expect_num, text, min_class, max_class, test_mode_descr(mode)); OSMO_ASSERT(counter == expect_num); @@ -696,7 +711,7 @@ TEST_MODE_DL_ONLY, }; - printf("Going to test assignment with many connections, %s\n", text); + printf("Going to test assignment with many connections, algorithm %s\n", text); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -738,60 +753,32 @@ static void test_successive_allocation() { - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL, - 35, "algorithm A (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 10 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-29 (UL and DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL, - 35, "algorithm dynamic class 1-29 (UL and DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 101, TEST_MODE_DL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_ONLY, alloc_algorithm_b, "B"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL, - 35, "algorithm A (DL and UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm B class 10 (DL and UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm dynamic class 10 (DL and UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(12, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 12, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 32, TEST_MODE_UL_AND_DL, alloc_algorithm_b, "B"); + test_successive_alloc(1, 29, 35, TEST_MODE_UL_AND_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AFTER_UL, - 160, "algorithm A (DL after UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AFTER_UL, - 32, "algorithm B class 10 (DL after UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AFTER_UL, - 95, "algorithm dynamic class 10 (DL after UL)"); + test_successive_alloc(1, 1, 35, TEST_MODE_DL_AND_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AND_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL, - 35, "algorithm A (UL after DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL, - 32, "algorithm B class 10 (UL after DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_AFTER_DL, - 35, "algorithm dynamic class 10 (UL after DL)"); + test_successive_alloc(1, 1, 160, TEST_MODE_DL_AFTER_UL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_DL_AFTER_UL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 95, TEST_MODE_DL_AFTER_UL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY, - 35, "algorithm A (UL only)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY, - 32, "algorithm B class 10 (UL only)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_ONLY, - 35, "algorithm dynamic class 10 (UL only)"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_AFTER_DL, alloc_algorithm_b, "B"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_AFTER_DL, alloc_algorithm_dynamic, "dynamic"); - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY, - 160, "algorithm A (DL ONLY)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_ONLY, - 32, "algorithm B class 10 (DL ONLY)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_ONLY, - 101, "algorithm dynamic class 10 (DL ONLY)"); -} - -static void test_many_connections() -{ - test_many_connections(alloc_algorithm_a, 160, "algorithm A"); - test_many_connections(alloc_algorithm_b, 32, "algorithm B"); - test_many_connections(alloc_algorithm_dynamic, 160, "algorithm dynamic"); + test_successive_alloc(1, 1, 35, TEST_MODE_UL_ONLY, alloc_algorithm_a, "A"); + test_successive_alloc(10, 10, 35, TEST_MODE_UL_ONLY, alloc_algorithm_dynamic, "dynamic"); + test_successive_alloc(10, 10, 32, TEST_MODE_UL_ONLY, alloc_algorithm_b, "B"); } static void test_2_consecutive_dl_tbfs() @@ -859,9 +846,12 @@ test_alloc_a(); test_alloc_b(); - test_successive_allocation(); - test_many_connections(); + test_many_connections(alloc_algorithm_a, 160, "A"); + test_many_connections(alloc_algorithm_b, 32, "B"); + test_many_connections(alloc_algorithm_dynamic, 160, "dynamic"); test_2_consecutive_dl_tbfs(); + test_successive_allocation(); + return EXIT_SUCCESS; } diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index 47dcefc..aefa1ca 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -8,226 +8,6 @@ No TFI available (suggested TRX: 0). algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL -algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL -algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: -1). -algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -No TFI available (suggested TRX: 0). -algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). No TFI available (suggested TRX: 0). @@ -892,3 +672,223 @@ No TFI available (suggested TRX: 0). algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: 0). +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL +No TFI available (suggested TRX: 0). +No TFI available (suggested TRX: -1). +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index cbb65aa..110d1c7 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -8588,2211 +8588,2211 @@ Mass test: TS0(OOOOOOOO)TS7 MS_Class=27 Mass test: TS0(OOOOOOOO)TS7 MS_Class=28 Mass test: TS0(OOOOOOOO)TS7 MS_Class=29 -Going to test assignment with many TBF, algorithm A (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL and DL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DDC - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DDC.. - TBF[7] class 10 reserves .....DDC - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DDC.. - TBF[11] class 10 reserves .....DDC - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DDC.. - TBF[15] class 10 reserves .....DDC - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DDC.. - TBF[19] class 10 reserves .....DDC - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DDC.. - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DDCD. - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves .....DDC - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 12 (UL and DL) - TBF[0] class 12 reserves ...DDCD. - TBF[1] class 12 reserves .....DCD - TBF[2] class 12 reserves ...DCD.. - TBF[3] class 12 reserves .....DDC - TBF[4] class 12 reserves ...DCD.. - TBF[5] class 12 reserves .....DCD - TBF[6] class 12 reserves ...DDC.. - TBF[7] class 12 reserves .....DDC - TBF[8] class 12 reserves ...DCD.. - TBF[9] class 12 reserves .....DCD - TBF[10] class 12 reserves ...DDC.. - TBF[11] class 12 reserves .....DDC - TBF[12] class 12 reserves ...DCD.. - TBF[13] class 12 reserves .....DCD - TBF[14] class 12 reserves ...DDC.. - TBF[15] class 12 reserves .....DDC - TBF[16] class 12 reserves ...DCD.. - TBF[17] class 12 reserves .....DCD - TBF[18] class 12 reserves ...DDC.. - TBF[19] class 12 reserves .....DDC - TBF[20] class 12 reserves ...DCD.. - TBF[21] class 12 reserves .....DCD - TBF[22] class 12 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 12 reserves ...DCD.. - TBF[25] class 12 reserves .....DCD - TBF[26] class 12 reserves ...DDCD. - TBF[27] class 12 reserves ...CD... - TBF[28] class 12 reserves .....DDC - TBF[29] class 12 reserves ...CD... - TBF[30] class 12 reserves ...CD... - TBF[31] class 12 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-12 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 1 reserves ...C.... - TBF[13] class 2 reserves ......DC - TBF[14] class 3 reserves ...DC... - TBF[15] class 4 reserves ....DCD. - TBF[16] class 5 reserves ......CD - TBF[17] class 6 reserves ...CD... - TBF[18] class 7 reserves ......DC - TBF[19] class 8 reserves ...DDCD. - TBF[20] class 9 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 11 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 1 reserves ...C.... - TBF[25] class 2 reserves ......DC - TBF[26] class 3 reserves ...DC... - TBF[27] class 4 reserves .....DCD - TBF[28] class 5 reserves ...CD... - TBF[29] class 6 reserves ......CD - TBF[30] class 7 reserves ...CD... - TBF[31] class 8 reserves ...DDCD. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-29 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ....DC.. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 1-29 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ....DC.. - TBF[1] class 4 reserves ...C.... - TBF[2] class 5 reserves ...C.... - TBF[0] class 6 reserves ......C. - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL and UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm A (DL after UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[2] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[4] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[14] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[27] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[16] class 10 reserves ......C. - TBF[26] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[18] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[31] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[20] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[22] class 10 reserves ......C. - TBF[25] class 10 reserves ....C... - TBF[24] class 10 reserves ......C. - TBF[27] class 10 reserves ....C... - TBF[26] class 10 reserves ......C. - TBF[29] class 10 reserves ....C... - TBF[28] class 10 reserves ......C. - TBF[31] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - Successfully allocated 95 UL TBFs -Going to test assignment with many TBF, algorithm A (UL after DL) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (UL only) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL ONLY) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL ONLY) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL ONLY) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[2] class 10 reserves ......C. - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[4] class 10 reserves ......C. - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[22] class 10 reserves .....C.. - TBF[14] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[24] class 10 reserves .....C.. - TBF[16] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[25] class 10 reserves .....C.. - TBF[18] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[27] class 10 reserves .....C.. - TBF[20] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[26] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[30] class 10 reserves .....C.. - TBF[22] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[28] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[31] class 10 reserves .....C.. - TBF[24] class 10 reserves ......C. - TBF[25] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[25] class 10 reserves ......C. - TBF[27] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[27] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[26] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[29] class 10 reserves ....C... - TBF[31] class 10 reserves ......C. - TBF[31] class 10 reserves .......C - Successfully allocated 101 UL TBFs Going to test assignment with many connections, algorithm A - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 2 reserves ...C.... - TBF[6] class 3 reserves ....C... - TBF[6] class 4 reserves .....C.. - TBF[6] class 5 reserves ......C. - TBF[6] class 6 reserves .......C - TBF[7] class 7 reserves ...C.... - TBF[7] class 8 reserves ....C... - TBF[7] class 9 reserves .....C.. - TBF[7] class 10 reserves ......C. - TBF[7] class 11 reserves .......C - TBF[8] class 12 reserves ...C.... - TBF[8] class 13 reserves ....C... - TBF[8] class 14 reserves .....C.. - TBF[8] class 15 reserves ......C. - TBF[8] class 16 reserves .......C - TBF[9] class 17 reserves ...C.... - TBF[9] class 18 reserves ....C... - TBF[9] class 19 reserves .....C.. - TBF[9] class 20 reserves ......C. - TBF[9] class 21 reserves .......C - TBF[10] class 22 reserves ...C.... - TBF[10] class 23 reserves ....C... - TBF[10] class 24 reserves .....C.. - TBF[10] class 25 reserves ......C. - TBF[10] class 26 reserves .......C - TBF[11] class 27 reserves ...C.... - TBF[11] class 28 reserves ....C... - TBF[11] class 29 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 2 reserves .......C - TBF[12] class 3 reserves ...C.... - TBF[12] class 4 reserves ....C... - TBF[12] class 5 reserves .....C.. - TBF[12] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[13] class 8 reserves ...C.... - TBF[13] class 9 reserves ....C... - TBF[13] class 10 reserves .....C.. - TBF[13] class 11 reserves ......C. - TBF[13] class 12 reserves .......C - TBF[14] class 13 reserves ...C.... - TBF[14] class 14 reserves ....C... - TBF[14] class 15 reserves .....C.. - TBF[14] class 16 reserves ......C. - TBF[14] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[15] class 19 reserves ....C... - TBF[15] class 20 reserves .....C.. - TBF[15] class 21 reserves ......C. - TBF[15] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[16] class 24 reserves ....C... - TBF[16] class 25 reserves .....C.. - TBF[16] class 26 reserves ......C. - TBF[16] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 2 reserves ......C. - TBF[17] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[18] class 6 reserves .....C.. - TBF[18] class 7 reserves ......C. - TBF[18] class 8 reserves .......C - TBF[19] class 9 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[19] class 11 reserves .....C.. - TBF[19] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[20] class 14 reserves ...C.... - TBF[20] class 15 reserves ....C... - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves ......C. - TBF[20] class 18 reserves .......C - TBF[21] class 19 reserves ...C.... - TBF[21] class 20 reserves ....C... - TBF[21] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[21] class 23 reserves .......C - TBF[22] class 24 reserves ...C.... - TBF[22] class 25 reserves ....C... - TBF[22] class 26 reserves .....C.. - TBF[22] class 27 reserves ......C. - TBF[22] class 28 reserves .......C - TBF[23] class 29 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 2 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 3 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 6 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 7 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 8 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 12 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 13 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 20 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 21 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 23 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 27 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Going to test assignment with many connections, algorithm B - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ...DC... - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ....DCD. - TBF[4] class 5 reserves ...CD... - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves ......CD - TBF[7] class 8 reserves ...DDCD. - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves ....DCD. - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves .....CDD - TBF[13] class 14 reserves ...CDDD. - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves ...C.... - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ...DC... [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves .....CDD [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ...CDDD. [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] Successfully allocated 32 TBFs Going to test assignment with many connections, algorithm dynamic - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[12] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[29] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[22] class 14 reserves ...C.... - TBF[22] class 15 reserves ....C... - TBF[30] class 16 reserves .....C.. - TBF[19] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[24] class 19 reserves ...C.... - TBF[24] class 20 reserves ....C... - TBF[31] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[23] class 23 reserves .......C - TBF[26] class 24 reserves ...C.... - TBF[26] class 25 reserves ....C... - TBF[23] class 26 reserves ......C. - TBF[25] class 27 reserves .......C - TBF[28] class 28 reserves ...C.... - TBF[28] class 29 reserves ....C... - TBF[25] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[29] class 3 reserves ...C.... - TBF[29] class 4 reserves ....C... - TBF[27] class 5 reserves ......C. - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[29] class 8 reserves ......C. - TBF[31] class 9 reserves ...C.... - TBF[31] class 10 reserves ....C... - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....DC.. - TBF[0] class 3 reserves ......DC - TBF[0] class 4 reserves ...DCD.. - TBF[0] class 5 reserves ......CD - TBF[1] class 6 reserves ...CD... - TBF[1] class 7 reserves .....CD. - TBF[1] class 8 reserves ....DDCD - TBF[1] class 9 reserves ...DCD.. - TBF[2] class 10 reserves .....DCD - TBF[2] class 11 reserves ...DCD.. - TBF[3] class 12 reserves .....DCD - TBF[2] class 13 reserves ...CDD.. - TBF[3] class 14 reserves ....CDDD - TBF[3] class 15 reserves ...CDDDD - TBF[4] class 16 reserves ...CDDDD - TBF[5] class 17 reserves ...CDDDD - TBF[6] class 18 reserves ...CDDDD - TBF[4] class 19 reserves .....DCD - TBF[4] class 20 reserves ...DCD.. - TBF[5] class 21 reserves .....DCD - TBF[5] class 22 reserves ...DCD.. - TBF[6] class 23 reserves .....DCD - TBF[6] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... - TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C - TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... - TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... - TBF[31] class 12 reserves ....C... - TBF[31] class 13 reserves .....C.. - TBF[31] class 14 reserves ......C. - TBF[31] class 15 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 0] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 1] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 1] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 1] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[ 3] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[ 3] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 5] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 6] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 5] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 6] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 25 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 26 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 29 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 15 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) TBF2: numTs(3) +Going to test assignment with many TBF, algorithm A class 1..1 (DL only) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL only) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 101 UL TBFs, algorithm dynamic class 10..10 (DL only) +Going to test assignment with many TBF, algorithm B class 10..10 (DL only) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL only) +Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL and DL) +Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL and DL) +Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL) + TBF[ 0] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 12 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 12..12 (UL and DL) +Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[14] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[15] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[16] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[17] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[18] class 7 reserves ......DC [ 1 / 2 / 0 ] + TBF[19] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 11 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[26] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[27] class 4 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 6 reserves ......CD [ 1 / 2 / 0 ] + TBF[30] class 7 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 1..12 (UL and DL) +Going to test assignment with many TBF, algorithm B class 1..29 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ....DC.. [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 1..29 (UL and DL) +Going to test assignment with many TBF, algorithm dynamic class 1..29 (UL and DL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[31] class 3 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 1] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 6 reserves ......C. [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs, algorithm dynamic class 1..29 (UL and DL) +Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (DL and UL) +Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL and UL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + Successfully allocated 32 UL TBFs, algorithm dynamic class 10..10 (DL and UL) +Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL) + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] + Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL after UL) +Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL after UL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL) + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + Successfully allocated 95 UL TBFs, algorithm dynamic class 10..10 (DL after UL) +Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL) + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL after DL) +Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL after DL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL after DL) +Going to test assignment with many TBF, algorithm A class 1..1 (UL only) + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL only) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL only) +Going to test assignment with many TBF, algorithm B class 10..10 (UL only) + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL only) -- To view, visit https://gerrit.osmocom.org/3932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: separate capacity computation In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3934 to look at the new patch set (#2). Simplify TS alloc: separate capacity computation Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 28 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/34/3934/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index ea699ff..8cdfc9a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -499,6 +499,33 @@ return 0; } +/*! Compute capacity of a given TRX + * + * \param[in] trx Pointer to TRX object + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \returns non-negative capacity + */ +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +{ + const struct gprs_rlcmac_pdch *pdch; + unsigned ts, capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF), 1); + + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF), 1); + } + } + + return capacity; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -653,7 +680,6 @@ unsigned rx_slot_count; uint16_t rx_bad; uint8_t rx_good; - unsigned ts; int capacity; /* Filter out bad slots */ @@ -709,25 +735,7 @@ continue; /* Compute capacity */ - capacity = 0; - - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - } - } + capacity = compute_capacity(trx, rx_window, tx_window); if (capacity <= max_capacity) continue; -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3807 to look at the new patch set (#8). Simplify TS alloc: adjust allocator signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 9 files changed, 84 insertions(+), 91 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/8 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..1284f11 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -652,12 +652,11 @@ /* FIXME: Copy and paste with other routines.. */ if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/bts.h b/src/bts.h index d65cd2f..f15ca22 100644 --- a/src/bts.h +++ b/src/bts.h @@ -204,11 +204,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..4ce2fa6 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -396,14 +396,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -796,15 +801,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -1025,7 +1035,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,10 +1043,15 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; @@ -1048,7 +1063,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,8 +1072,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..fee4115 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,7 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, false, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; @@ -1314,9 +1309,8 @@ bts->tbf_reused(); - new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), - this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..cbde283 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..13f3869 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +244,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +252,7 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +294,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +302,7 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +357,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +401,14 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { @@ -497,7 +495,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -506,7 +504,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -817,7 +815,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -827,7 +825,7 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..43a6142 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,16 +81,12 @@ /* * Make a uplink and downlink allocation */ - gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), - NULL, - 0, 0, 0, 0); + gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); - gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), - dl_tbf->ms(), - 0, 0, 0, 0); + gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +166,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2205,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2219,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2263,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 13:54:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 13:54:46 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3935 to look at the new patch set (#2). Simplify TS alloc: move slot check into functions Move timeslot applicability check outside of nested for loop into separate functions and document them. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 97 insertions(+), 70 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 3b00dc3..5ca0c29 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -139,11 +139,11 @@ return -1; } -static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, - const char *mask_reason = NULL) +static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; - int valid_ts_set = 0; + uint8_t valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { @@ -422,7 +422,7 @@ int trx_no; int tfi = -1; int usf = -1; - int mask = 0xff; + uint8_t mask = 0xff; const char *mask_reason = NULL; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; @@ -506,7 +506,7 @@ * \param[in] tx_window Transmit window * \returns non-negative capacity */ -static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int16_t rx_window, int16_t tx_window) { const struct gprs_rlcmac_pdch *pdch; unsigned ts, capacity = 0; @@ -526,6 +526,84 @@ return capacity; } +/*! Decide if a given slot should be skipped by multislot allocator + * + * \param[in] ms_class Pointer to MS Class object + * \param[in] check_tr Flag indicating whether we should check for Tra or Tta parameters for a given MS class + * \param[in] rx_window Receive window + * \param[in] rx_slot_count Number of TS in RX + * \param[in] tx_window Transmit window + * \param[in] tx_slot_count Number of TS in TX + * \param[in,out] checked_rx array with already checked RX timeslots + * \returns true if the slot should be skipped, false otherwise + */ +static bool skip_slot(const struct gprs_ms_multislot_class *ms_class, bool check_tr, int16_t rx_window, + uint8_t rx_slot_count, int16_t tx_window, uint8_t tx_slot_count, uint32_t *checked_rx) +{ + uint8_t common_slot_count, req_common_slots; + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on check_tr. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + uint16_t slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (!check_tr) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (check_tr) + return true; /* Skip Tra */ + } else + return true; /* No supported row in TS 45.002, table 6.4.2.2.1. */ + } + + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + return true; + + return false; +} + +/*! Filter out bad slots + * + * \param[in] mask TS selection mask + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] rx_valid_win Mask for valid RX window value + * \returns negative error code or RX window on success + */ +static int16_t filter_bad_slots(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win) +{ + uint8_t rx_good; + uint16_t rx_bad = (uint16_t)(0xff & ~mask) << ul_slots; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = dl_slots & ~rx_bad; + if (!rx_good) + return -1; + + return rx_good & rx_valid_win; +} + +static inline uint16_t wrap_window(uint16_t win) +{ + return (win | win >> 8) & 0xFF; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -540,18 +618,14 @@ uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ uint8_t Type; /* Type of Mobile */ - int rx_window, tx_window, pdch_slots; + uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; + int16_t rx_window, tx_window; static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; int max_capacity; uint8_t max_ul_slots; uint8_t max_dl_slots; - unsigned max_slots; - - unsigned ul_ts, dl_ts; - unsigned num_tx; enum {MASK_TT, MASK_TR}; - unsigned mask_sel; if (ms->ms_class() >= 32) { LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", @@ -642,13 +716,12 @@ /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; + uint8_t tx_slot_count; uint16_t rx_valid_win; uint32_t checked_rx[256/32] = {0}; /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + tx_valid_win = wrap_window(tx_valid_win); tx_window = tx_valid_win; @@ -665,74 +738,28 @@ tx_slot_count = pcu_bitcount(tx_window); - max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + rx_valid_win = (1 << OSMO_MIN(ms_class->rx, ms_class->sum - num_tx)) - 1; /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { /* Wrap valid window */ - rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; + rx_valid_win = wrap_window(rx_valid_win); /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; + uint8_t rx_slot_count; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; + rx_window = filter_bad_slots(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); + if (rx_window < 0) + continue; - /* TODO: CHECK this calculation -> separate function for unit testing */ - - rx_window = rx_good & rx_valid_win; rx_slot_count = pcu_bitcount(rx_window); - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) - continue; - - if (!rx_good) - continue; - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) - continue; + if (skip_slot(ms_class, mask_sel != MASK_TT, + rx_window, rx_slot_count, + tx_window, tx_slot_count, checked_rx)) + continue; /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 14:26:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 14:26:04 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: To avoid loops altogether, I'm thinking of an SQL approach: One part of the solution is the random picking: SELECT * FROM table ORDER BY RANDOM() LIMIT 1; The other part would be to select from a list of *unused* values. This one looks promising: https://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/ " select l.id + 1 as start from sequence as l left outer join sequence as r on l.id + 1 = r.id where r.id is null; The idea is to exclusion join against the same sequence, but shifted by one position. Any number with an adjacent number will join successfully, and the WHERE clause will eliminate successful matches, leaving the missing numbers. " That could work, right? -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 14:43:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 14:43:15 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 (7 comments) all of these can be addressed after this is merged. https://gerrit.osmocom.org/#/c/3911/4/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: Line 3: # following default values can be overridden by each repo by repo you mean the individual projects listed below in this file? (and not external files from other repositories?) Line 8: slave_axis: !!python/tuple [linux_amd64_debian8] wondering about the '!!python/tuple', is that really needed? A normal list [a, b] would be much simpler to write and read. At least in python, tuple and list are pretty much interchangeable (except for the mutability) Line 25: (whitespace) Line 26: # no 'clean state'? clean state sounds like we want it. If it's missing, let's add it? Line 38: # no gcc warnings at all? are you referring to the post-build step of evaluating gcc warnings? AFAICT that plugin produces garbage and counts pretty much any output as warning. Line 80: combination_filter: '(BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct+trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="femtobts_v2.7") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v2.4") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.0.1pre") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.1") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v5.1") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="v2017.01") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next")' does yaml allow breaking long lines like this up into several lines? Would be good to stay below 120. Ah, like that 'cmd: >' below would be nice. Line 119: ./contrib/jenkins-arm.sh (noting a mix of spaces and tabs, maybe rather avoid that) -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 14 14:48:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 14:48:38 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 4: (2 comments) https://gerrit.osmocom.org/#/c/3911/4/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: Line 246: - branch-compare-type: 'ANT' ANT? that's the web UI's 'Path' value? Line 261: - shell: 'chmod -R +w *; rm -rf *; git checkout .' could also be done by the Git SCM plugin "Clean before checkout" -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 14 14:49:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 14:49:52 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 4: and let's add a jobs/README that describes how these yml files are used to update our jenkins jobs -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 15:25:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 15:25:51 +0000 Subject: libosmo-abis[master]: cosmetic: ipa.c: use msgb_dequeue(), drop local var In-Reply-To: References: Message-ID: Patch Set 2: cosmetic because for all I can tell it does the exact same thing as before, so it's just removing code dup... -- To view, visit https://gerrit.osmocom.org/3942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 15:39:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 14 Sep 2017 15:39:59 +0000 Subject: libosmo-sccp[master]: simple client: prevent overwriting asp settings In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (4 comments) https://gerrit.osmocom.org/#/c/3948/1/src/sccp_user.c File src/sccp_user.c: Line 418: * the default asp name. */ thinking ... if I've added an ASP for a *different* AS but stupidly enough chose the same name, we're now stealing the ASP from the other AS, right? Maybe we need to also check that this other ASP does not belong to a different AS yet. Rather do this in a separate patch I guess. All in all this amount of complexity is what I'd have preferred to avoid altogether. But by now I see that it is convenient for the user to have this magic in place, so it might be worth the trouble after all. Line 423: name); (could stay in one line) Line 434: asp->cfg.local.host = NULL; you really don't like the 'A ? B : C' notation, do you? :) Bloating up two lines to 10, but fine. Line 436: if (default_local_ip) { (could drop the { } braces since it's just one line, and could not break the assignment across two lines; we decided for 120 chars line width some weeks ago) -- To view, visit https://gerrit.osmocom.org/3948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53d73059f804c3bbea6cb43dc73ad49a753b3b15 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 14 16:14:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 16:14:13 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#4). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Requires libosmocore with I72528bc1e376134c5a7b6e7a50c48e38c3f48b0a change. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 3 files changed, 22 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/4 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index c16a954..4cbcf8c 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -65,6 +65,8 @@ uint8_t block_payload; }; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index a3a9670..3b33d22 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -81,18 +81,19 @@ /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } +} - return buf; +void ts_print(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); } static bool test_and_set_bit(uint32_t *bits, size_t elem) @@ -584,11 +585,8 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_print(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ @@ -848,12 +846,10 @@ } if (tbf->direction == GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, dl_slots, 'D'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); + "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); /* assign downlink */ if (dl_slots == 0) { @@ -886,12 +882,10 @@ ul_slots = 1 << ts; usf[ts] = free_usf; + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, ul_slots, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); + "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n",slot_info, single ? ", single" : ""); slotcount++; first_ts = ts; @@ -936,12 +930,8 @@ ms_->set_reserved_slots(trx, reserved_ul_slots, reserved_dl_slots); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); + ts_print(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); } tbf_->trx = trx; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 602e35b..9016eb1 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6549,7 +6549,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 14 16:22:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 16:22:41 +0000 Subject: [PATCH] osmo-mgw[master]: Add TODO-RELEASE file Message-ID: Review at https://gerrit.osmocom.org/3949 Add TODO-RELEASE file Let's track the API/ABI changes in libosmo*mgcp the same way we do it in other libosmo* libraries. Change-Id: Id0b8d55ea58bdb3d72b4c131ac983d8895b55ef8 --- A TODO-RELEASE 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/49/3949/1 diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line -- To view, visit https://gerrit.osmocom.org/3949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0b8d55ea58bdb3d72b4c131ac983d8895b55ef8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 14 16:27:00 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 14 Sep 2017 16:27:00 +0000 Subject: osmo-mgw[master]: Add TODO-RELEASE file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 > Build Successful > > http://jenkins.osmocom.org/jenkins/job/osmo-mgw-gerrit/27/ : > SUCCESS' --verified 1 --code-review 0 -- To view, visit https://gerrit.osmocom.org/3949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id0b8d55ea58bdb3d72b4c131ac983d8895b55ef8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 16:52:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 16:52:02 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-mgw=5Bmaster=5D=3A_Bump_version=3A_1=2E0=2E1_=E2=86=92_1=2E0=2E2?= Message-ID: Review at https://gerrit.osmocom.org/3950 Bump version: 1.0.1 ? 1.0.2 Catch-up with release tagging and .deb changelog: the requirements in OsmoMSC were updated. Change-Id: I2c37b56e81df13007738f340c3fb48f0996a95f3 --- M debian/changelog M src/libosmo-mgcp-client/Makefile.am 2 files changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/3950/1 diff --git a/debian/changelog b/debian/changelog index 21e4bbd..274f7c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-mgw (1.0.2) unstable; urgency=low + + * First release after major rename. + + -- Max Suraev Thu, 14 Sep 2017 18:41:05 +0200 + + osmo-mgw (0.1.0) unstable; urgency=low * Initial release. diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index dbbd303..0416081 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -22,7 +22,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool # documentation before making any modification -MGCP_CLIENT_LIBVERSION=1:0:0 +MGCP_CLIENT_LIBVERSION=1:0:1 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/3950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c37b56e81df13007738f340c3fb48f0996a95f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 14 17:03:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 14 Sep 2017 17:03:23 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Replicate resources based on times attr before combine time In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3907 to look at the new patch set (#4). Replicate resources based on times attr before combine time As suite.conf and scenarios need to match 1-to-1 in lists, it's important to extend the dictionaries by replicating the objects with a 'times' values higher than 1 in order to match the objects correctly. Since dictionanries are expanded at combine time, there's no need to expand them during reserve() time because they are already expanded. As a result, this commit reworks the kind of schema applied in each place (and takes the change to start validating scenario files, which were neglected previously). Two unit tests are added as a show case. Unfortunately output showing scenario dictionaries needs to be ignored while verifying because it was encountered that different versions of python print dictionary elements in different order. Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 --- M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/suite.conf M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 8 files changed, 211 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/3907/4 diff --git a/selftest/resource_test.py b/selftest/resource_test.py index a0ec490..d72eb72 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -80,7 +80,7 @@ origin = log.Origin(None, 'testowner') -resources = pool.reserve(origin, want) +resources = pool.reserve(origin, config.replicate_times(want)) print('~~~ currently reserved:') with open(rrfile, 'r') as f: diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 049f7b4..365fcaa 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -16,6 +16,7 @@ resources: bts: - times: '1' + - times: '2' ip_address: - times: '1' modem: @@ -30,14 +31,30 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 6) +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] +tst test_suite: Reserving 3 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 @@ -140,5 +157,151 @@ skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected +- test with half empty scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py +- test with scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e + addr: 10.42.42.52 + band: GSM-1800 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + trx_list: + - nominal_power: '10' + - nominal_power: '12' + type: osmo-bts-trx +- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index dcda3b6..49bd9eb 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,3 +1,4 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] \([0-9.]+ sec\) (N.N sec) +{combining_scenarios='resources', scenario='foo'}:.* {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 86c4c25..12bd5e7 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -42,5 +42,21 @@ output = report.suite_to_text(s) print(output) +print('- test with half empty scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + +print('- test with scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/test_suite/suite.conf index 376f6cd..890f66a 100644 --- a/selftest/suite_test/test_suite/suite.conf +++ b/selftest/suite_test/test_suite/suite.conf @@ -3,6 +3,7 @@ - times: 1 bts: - times: 1 + - times: 2 modem: - times: 2 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 1d52073..27ce428 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -274,7 +274,13 @@ return src def replicate_times(d): - 'replicate items that have a "times" > 1' + ''' + replicate items that have a "times" > 1 + + 'd' is a dict matching WANT_SCHEMA, which is the same as + the RESOURCES_SCHEMA, except each entity that can be reserved has a 'times' + field added, to indicate how many of those should be reserved. + ''' d = copy.deepcopy(d) for key, item_list in d.items(): idx = 0 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 5315f18..edd61fd 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -73,6 +73,10 @@ dict([('%s[].times' % r, schema.TIMES) for r in R_ALL]), RESOURCES_SCHEMA) +CONF_SCHEMA = util.dict_add( + { 'defaults.timeout': schema.STR }, + dict([('resources.%s' % key, val) for key, val in WANT_SCHEMA.items()])) + KNOWN_BTS_TYPES = { 'osmo-bts-sysmo': bts_sysmo.SysmoBts, 'osmo-bts-trx': bts_osmotrx.OsmoBtsTrx, @@ -107,11 +111,9 @@ 'origin' should be an Origin() instance. - 'want' is a dict matching WANT_SCHEMA, which is the same as - the RESOURCES_SCHEMA, except each entity that can be reserved has a 'times' - field added, to indicate how many of those should be reserved. + 'want' is a dict matching RESOURCES_SCHEMA. - If an entry has only a 'times' set, any of the resources may be + If an entry has no attribute set, any of the resources may be reserved without further limitations. ResourcesPool may also be selected with narrowed down constraints. @@ -119,24 +121,13 @@ sysmo and one of type trx, plus 2 ARFCNs in the 1800 band: { - 'ip_address': [ { 'times': 1 } ], - 'bts': [ { 'type': 'sysmo', 'times': 1 }, { 'type': 'trx', 'times': 1 } ], - 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], - 'modem': [ { 'times': 2 } ], - } - - A times=1 value is implicit, so the above is equivalent to: - - { 'ip_address': [ {} ], 'bts': [ { 'type': 'sysmo' }, { 'type': 'trx' } ], - 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], - 'modem': [ { 'times': 2 } ], + 'arfcn': [ { 'band': 'GSM-1800' }, { 'band': 'GSM-1800' } ], + 'modem': [ {}, {} ], } ''' - schema.validate(want, WANT_SCHEMA) - - want = config.replicate_times(want) + schema.validate(want, RESOURCES_SCHEMA) origin_id = origin.origin_id() @@ -271,10 +262,10 @@ Pass a dict of resource requirements, e.g.: want = { 'bts': [ {'type': 'osmo-bts-sysmo',}, {} ], - 'modem': [ {'times': 3} ] + 'modem': [ {}, {}, {} ] } This function tries to find a combination from the available resources that - matches these requiremens. The returnvalue is a dict (wrapped in a Resources class) + matches these requirements. The return value is a dict (wrapped in a Resources class) that contains the matching resources in the order of 'want' dict: in above example, the returned dict would have a 'bts' list with the first item being a sysmoBTS, the second item being any other available BTS. @@ -290,6 +281,10 @@ If raise_if_missing is False, this will return an empty item for any resource that had no match, instead of immediately raising an exception. + + This function expects input dictionaries whose contents have already + been replicated based on its the 'times' attributes. See + config.replicate_times() for more details. ''' matches = {} for key, want_list in sorted(want.items()): # sorted for deterministic test results @@ -314,7 +309,7 @@ my_item = my_list[i] if skip_if_marked and my_item.get(skip_if_marked): continue - if item_matches(my_item, want_item, ignore_keys=('times',)): + if item_matches(my_item, want_item): item_match_list.append(i) if not item_match_list: if raise_if_missing: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 9b975fd..28bdd69 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -40,14 +40,6 @@ CONF_FILENAME = 'suite.conf' - CONF_SCHEMA = util.dict_add( - { - 'defaults.timeout': schema.STR, - }, - dict([('resources.%s' % k, t) for k,t in resource.WANT_SCHEMA.items()]) - ) - - def __init__(self, suite_dir): self.suite_dir = suite_dir super().__init__(log.C_CNF, os.path.basename(self.suite_dir)) @@ -59,7 +51,7 @@ raise RuntimeError('No such directory: %r' % self.suite_dir) self.conf = config.read(os.path.join(self.suite_dir, SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) + resource.CONF_SCHEMA) self.load_test_basenames() def load_test_basenames(self): @@ -209,11 +201,11 @@ def combined(self, conf_name): log.dbg(combining=conf_name) log.ctx(combining_scenarios=conf_name) - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + combination = config.replicate_times(self.definition.conf.get(conf_name, {})) log.dbg(definition_conf=combination) for scenario in self.scenarios: log.ctx(combining_scenarios=conf_name, scenario=scenario.name()) - c = scenario.get(conf_name) + c = config.replicate_times(scenario.get(conf_name, {})) log.dbg(scenario=scenario.name(), conf=c) if c is None: continue @@ -447,7 +439,7 @@ def load_suite_scenario_str(suite_scenario_str): suite_name, scenario_names = parse_suite_scenario_str(suite_scenario_str) suite = load(suite_name) - scenarios = [config.get_scenario(scenario_name) for scenario_name in scenario_names] + scenarios = [config.get_scenario(scenario_name, resource.CONF_SCHEMA) for scenario_name in scenario_names] return (suite_scenario_str, suite, scenarios) def bts_obj(suite_run, conf): -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 14 17:03:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 14 Sep 2017 17:03:24 +0000 Subject: [PATCH] osmo-gsm-tester[master]: nominal_power and max_power_red attrs can now be set per res... Message-ID: Review at https://gerrit.osmocom.org/3951 nominal_power and max_power_red attrs can now be set per resource Before this commit, only max_power_red was specified and it could only be used as a defaults and could not be set per object. Together with nominal_power, it can be useful to be able to set them to different values for different objects, as for example different osmo-bts-trx objects can require different values. Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd --- M example/defaults.conf M selftest/suite_test.ok M selftest/suite_test/resources.conf M selftest/template_test.ok M selftest/template_test.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 8 files changed, 43 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/51/3951/1 diff --git a/example/defaults.conf b/example/defaults.conf index 082f159..f6ecedd 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -33,7 +33,8 @@ stream_id: 255 osmobsc_bts_type: sysmobts trx_list: - - max_power_red: 0 + - nominal_power: 23 + max_power_red: 0 arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..049f7b4 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -31,7 +31,7 @@ tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 3) +tst test_suite: Reserving 1 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..001d286 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -28,6 +28,36 @@ trx_list: - hw_addr: 00:02:95:00:41:b3 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.52 + band: GSM-1800 + launch_trx: true + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + arfcn: - arfcn: 512 band: GSM-1800 diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 5af4b6a..5bd32a4 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -54,7 +54,7 @@ trx 0 rf_locked 0 arfcn val_trx_arfcn_trx0 - nominal power 23 + nominal power val_trx_nominal_power_trx0 max_power_red val_trx_max_power_red_trx0 rsl e1 tei 0 timeslot 0 @@ -68,7 +68,7 @@ trx 1 rf_locked 0 arfcn val_trx_arfcn_trx1 - nominal power 23 + nominal power val_trx_nominal_power_trx1 max_power_red val_trx_max_power_red_trx1 rsl e1 tei 0 timeslot 0 @@ -98,7 +98,7 @@ trx 0 rf_locked 0 arfcn val_trx_arfcn_trx0 - nominal power 23 + nominal power val_trx_nominal_power_trx0 max_power_red val_trx_max_power_red_trx0 rsl e1 tei 0 timeslot 0 @@ -112,7 +112,7 @@ trx 1 rf_locked 0 arfcn val_trx_arfcn_trx1 - nominal power 23 + nominal power val_trx_nominal_power_trx1 max_power_red val_trx_max_power_red_trx1 rsl e1 tei 0 timeslot 0 diff --git a/selftest/template_test.py b/selftest/template_test.py index f8c32a5..769df49 100755 --- a/selftest/template_test.py +++ b/selftest/template_test.py @@ -27,9 +27,11 @@ 'stream_id': 'val_bts.stream_id', 'trx_list': ( dict(arfcn='val_trx_arfcn_trx0', + nominal_power='val_trx_nominal_power_trx0', max_power_red='val_trx_max_power_red_trx0', timeslot_list=mock_timeslot_list), dict(arfcn='val_trx_arfcn_trx1', + nominal_power='val_trx_nominal_power_trx1', max_power_red='val_trx_max_power_red_trx1', timeslot_list=mock_timeslot_list), ) diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8f34bdb..5315f18 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -58,6 +58,8 @@ 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, + 'bts[].trx_list[].nominal_power': schema.INT, + 'bts[].trx_list[].max_power_red': schema.INT, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 57ab8a3..14aa62d 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -61,7 +61,7 @@ trx ${loop.index} rf_locked 0 arfcn ${trx.arfcn} - nominal power 23 + nominal power ${trx.nominal_power} max_power_red ${trx.max_power_red} rsl e1 tei 0 % for ts in trx.timeslot_list: diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index d2927f9..fbafc8e 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -54,7 +54,7 @@ trx ${loop.index} rf_locked 0 arfcn ${trx.arfcn} - nominal power 23 + nominal power ${trx.nominal_power} max_power_red ${trx.max_power_red} rsl e1 tei 0 % for ts in trx.timeslot_list: -- To view, visit https://gerrit.osmocom.org/3951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 14 17:03:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 14 Sep 2017 17:03:24 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource: Handle lists correctly in item_matches Message-ID: Review at https://gerrit.osmocom.org/3952 resource: Handle lists correctly in item_matches We want to handle lists in the same way as we handle them in combine(). Without this commit, reserve()->find() failed to match objects containing dictionaries inside lists correctly (such as trx configs). A few attributes are added to trx_list of some resources in suite_test/resources.conf to show a case in which resource reservation would fail without this patch. It failed because before this patch, dictionaries inside lists are compared to be equal instead of being compared element by element to see if one dictionary is a subset of the other one (for each element in the lists). Change-Id: I8588d5b788b9f74a9cc84b8bdcb049921788bb48 --- M selftest/resource_test.ok M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test/resources.conf M src/osmo_gsm_tester/resource.py 5 files changed, 57 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/52/3952/1 diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index d366cf9..416e477 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -243,3 +243,9 @@ ~~~ end: currently reserved +- item_matches: +1st subset matches correctly, pass +2nd subset matches correctly, pass +3rd subset should not match, pass +3rd subset should not match, pass +4th subset should not match, pass diff --git a/selftest/resource_test.py b/selftest/resource_test.py index d72eb72..ca723af 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -94,4 +94,27 @@ print(f.read()) print('~~~ end: currently reserved\n') +print('- item_matches:') +superset = { 'hello': 'world', 'foo': 'bar', 'ordered_list': [{'xkey': 'xvalue'},{'ykey': 'yvalue'}], 'unordered_list_set': [1, 2, 3]} + +subset = { 'foo': 'bar', 'ordered_list': [{'xkey': 'xvalue'},{'ykey': 'yvalue'}], 'unordered_list_set': [2, 1] } +if resource.item_matches(superset, subset): + print('1st subset matches correctly, pass') + +subset = { 'ordered_list': [{},{'ykey': 'yvalue'}], 'unordered_list_set': [] } +if resource.item_matches(superset, subset): + print('2nd subset matches correctly, pass') + +subset = { 'ordered_list': [{'ykey': 'yvalue'}, {'xkey': 'xvalue'}] } +if not resource.item_matches(superset, subset): + print('3rd subset should not match, pass') + +subset = { 'ordered_list': [{'xkey': 'xvalue'}, {'ykey': 'yvalue'}, {'zkey': 'zvalue'}] } +if not resource.item_matches(superset, subset): + print('3rd subset should not match, pass') + +subset = { 'unordered_list_set': [4] } +if not resource.item_matches(superset, subset): + print('4th subset should not match, pass') + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 365fcaa..9c73588 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -240,24 +240,27 @@ tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] -tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e +tst test_suite: DBG: Picked - _hash: 89e45aaea42027162cc33f4389f055077338c82b addr: 10.42.42.52 band: GSM-1800 ipa_unit_id: '6' label: Ettus B200 launch_trx: 'True' trx_list: - - nominal_power: '10' + - max_power_red: '2' + nominal_power: '10' - nominal_power: '12' type: osmo-bts-trx -- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc +- _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 addr: 10.42.42.53 band: GSM-1800 ipa_unit_id: '7' label: sysmoCell 5000 trx_list: - - nominal_power: '10' - - nominal_power: '12' + - max_power_red: '3' + nominal_power: '10' + - max_power_red: '0' + nominal_power: '12' trx_remote_ip: 10.42.42.112 type: osmo-bts-trx - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 001d286..440e55c 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -36,6 +36,7 @@ launch_trx: true trx_list: - nominal_power: 10 + max_power_red: 2 - nominal_power: 12 - label: sysmoCell 5000 @@ -46,7 +47,9 @@ trx_remote_ip: 10.42.42.112 trx_list: - nominal_power: 10 + max_power_red: 3 - nominal_power: 12 + max_power_red: 0 - label: sysmoCell 5000 type: osmo-bts-trx @@ -57,6 +60,7 @@ trx_list: - nominal_power: 10 - nominal_power: 12 + max_power_red: 1 arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index edd61fd..cf82408 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -431,10 +431,22 @@ if is_list(wanted_item): if not is_list(item): return False - # multiple possible values - for val in wanted_item: - if val not in item: - return False + # Validate that all elements in both lists are of the same type: + t = util.list_validate_same_elem_type(wanted_item + item) + if t is None: + return True # both lists are empty, return + # For lists of complex objects, we expect them to be sorted lists: + if t in (dict, list, tuple): + for i in range(max(len(wanted_item), len(item))): + log.ctx(idx=i) + subitem = item[i] if i < len(item) else util.empty_instance_type(t) + wanted_subitem = wanted_item[i] if i < len(wanted_item) else util.empty_instance_type(t) + if not item_matches(subitem, wanted_subitem, ignore_keys=ignore_keys): + return False + else: # for lists of basic elements, we handle them as unsorted sets: + for val in wanted_item: + if val not in item: + return False return True return item == wanted_item -- To view, visit https://gerrit.osmocom.org/3952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8588d5b788b9f74a9cc84b8bdcb049921788bb48 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 14 17:03:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 14 Sep 2017 17:03:24 +0000 Subject: [PATCH] osmo-gsm-tester[master]: suite_test: Update tests to check new feature fixes Message-ID: Review at https://gerrit.osmocom.org/3953 suite_test: Update tests to check new feature fixes Now that combination and matching of lists works properly, update the suite test to check a more complex scenario. Change-Id: Ib0b82dc0c2a7f27cd6b2ffc32eed5f1287692ddc --- M selftest/suite_test.ok M selftest/suite_test.py M selftest/suite_test/test_suite/suite.conf 3 files changed, 70 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/3953/1 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 9c73588..cd5a9e7 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -15,8 +15,10 @@ timeout: 60s resources: bts: + - label: sysmoCell 5000 + times: '2' - times: '1' - - times: '2' + type: sysmo ip_address: - times: '1' modem: @@ -31,30 +33,37 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'label': 'sysmoCell 5000'}, {'label': 'sysmoCell 5000'}, {'type': 'sysmo'}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 3 x bts (candidates: 6) -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - max_power_red: '3' + nominal_power: '10' + - max_power_red: '0' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 9eaa928b04ce04b19dbae972f9bfc3eea6f5e249 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - max_power_red: '1' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 - addr: 10.42.42.115 - band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct -- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 - addr: 10.42.42.190 - band: GSM-1900 - ipa_unit_id: '1902' - label: nanoBTS 1900 - trx_list: - - hw_addr: 00:02:95:00:41:b3 - type: nanobts tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 @@ -166,31 +175,38 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'label': 'sysmoCell 5000'}, {'label': 'sysmoCell 5000'}, {'type': 'sysmo'}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - max_power_red: '3' + nominal_power: '10' + - max_power_red: '0' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 9eaa928b04ce04b19dbae972f9bfc3eea6f5e249 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - max_power_red: '1' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 - addr: 10.42.42.115 - band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct -- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 - addr: 10.42.42.190 - band: GSM-1900 - ipa_unit_id: '1902' - label: nanoBTS 1900 - trx_list: - - hw_addr: 00:02:95:00:41:b3 - type: nanobts [resource.py:[LINENR]] tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 @@ -237,21 +253,10 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'label': 'sysmoCell 5000'}, {'label': 'sysmoCell 5000'}, {'type': 'sysmo'}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] -tst test_suite: DBG: Picked - _hash: 89e45aaea42027162cc33f4389f055077338c82b - addr: 10.42.42.52 - band: GSM-1800 - ipa_unit_id: '6' - label: Ettus B200 - launch_trx: 'True' - trx_list: - - max_power_red: '2' - nominal_power: '10' - - nominal_power: '12' - type: osmo-bts-trx -- _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 +tst test_suite: DBG: Picked - _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 addr: 10.42.42.53 band: GSM-1800 ipa_unit_id: '7' @@ -263,6 +268,17 @@ nominal_power: '12' trx_remote_ip: 10.42.42.112 type: osmo-bts-trx +- _hash: 9eaa928b04ce04b19dbae972f9bfc3eea6f5e249 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - max_power_red: '1' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 12bd5e7..a8b0f37 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -45,7 +45,7 @@ print('- test with half empty scenario') trial = log.Origin(log.C_TST, 'trial') scenario = config.Scenario('foo', 'bar') -scenario['resources'] = { 'bts': [{'type': 'sysmo'}] } +scenario['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] } s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/test_suite/suite.conf index 890f66a..925dedb 100644 --- a/selftest/suite_test/test_suite/suite.conf +++ b/selftest/suite_test/test_suite/suite.conf @@ -2,8 +2,10 @@ ip_address: - times: 1 bts: - - times: 1 - times: 2 + label: sysmoCell 5000 + - times: 1 + type: sysmo modem: - times: 2 -- To view, visit https://gerrit.osmocom.org/3953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0b82dc0c2a7f27cd6b2ffc32eed5f1287692ddc Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 14 17:03:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 14 Sep 2017 17:03:24 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource: Allow passing keyword args to NoResourceExn Message-ID: Review at https://gerrit.osmocom.org/3954 resource: Allow passing keyword args to NoResourceExn Same code is already being used by log.Error exception. This way we can use: raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) And get: osmo_gsm_tester.resource.NoResourceExn: No free arfcns in any of bands {bands=['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900']} Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 --- M src/osmo_gsm_tester/resource.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/3954/1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index a7abc99..37c5a7e 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -209,7 +209,8 @@ class NoResourceExn(Exception): - pass + def __init__(self, *messages, **named_items): + super().__init__(log.compose_message(messages, named_items)) class Resources(dict): -- To view, visit https://gerrit.osmocom.org/3954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 14 17:17:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 14 Sep 2017 17:17:56 +0000 Subject: [PATCH] osmo-bsc[master]: SI13: drop PBCCH-related bits Message-ID: Review at https://gerrit.osmocom.org/3955 SI13: drop PBCCH-related bits According to 3GPP TS 44.018 ?1.8 the "network shall never enable PBCCH and PCCCH". Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Related: OS#2400 --- M include/osmocom/bsc/rest_octets.h M src/libbsc/rest_octets.c M src/libbsc/system_information.c 3 files changed, 20 insertions(+), 69 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/55/3955/1 diff --git a/include/osmocom/bsc/rest_octets.h b/include/osmocom/bsc/rest_octets.h index 374b1ba..e6e5303 100644 --- a/include/osmocom/bsc/rest_octets.h +++ b/include/osmocom/bsc/rest_octets.h @@ -63,12 +63,6 @@ /* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - /* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ enum gprs_nmo { GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ @@ -113,25 +107,10 @@ struct gprs_power_ctrl_pars pwr_ctrl_pars; uint8_t bcch_change_mark; uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; + uint8_t rac; + uint8_t spgc_ccch_sup; + uint8_t net_ctrl_ord; + uint8_t prio_acc_thr; }; /* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index ae04225..866734b 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -816,39 +816,16 @@ bitvec_set_uint(&bv, si13->bcch_change_mark, 2); append_gprs_mobile_alloc(&bv); } - if (!si13->pbcch_present) { - /* PBCCH not present in cell */ - bitvec_set_bit(&bv, 0); - bitvec_set_uint(&bv, si13->no_pbcch.rac, 8); - bitvec_set_bit(&bv, si13->no_pbcch.spgc_ccch_sup); - bitvec_set_uint(&bv, si13->no_pbcch.prio_acc_thr, 3); - bitvec_set_uint(&bv, si13->no_pbcch.net_ctrl_ord, 2); - append_gprs_cell_opt(&bv, &si13->cell_opts); - append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); - } else { - /* PBCCH present in cell */ - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.psi1_rep_per, 4); - /* PBCCH Descripiton */ - bitvec_set_uint(&bv, si13->pbcch.pb, 4); - bitvec_set_uint(&bv, si13->pbcch.tsc, 3); - bitvec_set_uint(&bv, si13->pbcch.tn, 3); - switch (si13->pbcch.carrier_type) { - case PBCCH_BCCH: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 0); - break; - case PBCCH_ARFCN: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.arfcn, 10); - break; - case PBCCH_MAIO: - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.maio, 6); - break; - } - } + /* PBCCH not present in cell: + it shall never be indicated according to 3GPP TS 44.018 Table 10.5.2.37b.1 */ + bitvec_set_bit(&bv, 0); + bitvec_set_uint(&bv, si13->rac, 8); + bitvec_set_bit(&bv, si13->spgc_ccch_sup); + bitvec_set_uint(&bv, si13->prio_acc_thr, 3); + bitvec_set_uint(&bv, si13->net_ctrl_ord, 2); + append_gprs_cell_opt(&bv, &si13->cell_opts); + append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); + /* 3GPP TS 44.018 Release 6 / 10.5.2.37b */ bitvec_set_bit(&bv, H); /* added Release 99 */ /* claim our SGSN is compatible with Release 99, as EDGE and EGPRS diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index c0df8bb..c9da4b2 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -1081,15 +1081,10 @@ }, .bcch_change_mark = 1, .si_change_field = 0, - .pbcch_present = 0, - { - .no_pbcch = { - .rac = 0, /* needs to be patched */ - .spgc_ccch_sup = 0, - .net_ctrl_ord = 0, - .prio_acc_thr = 6, - }, - }, + .rac = 0, /* needs to be patched */ + .spgc_ccch_sup = 0, + .net_ctrl_ord = 0, + .prio_acc_thr = 6, }; static int generate_si13(enum osmo_sysinfo_type t, struct gsm_bts *bts) @@ -1104,8 +1099,8 @@ si13->header.skip_indicator = 0; si13->header.system_information = GSM48_MT_RR_SYSINFO_13; - si13_default.no_pbcch.rac = bts->gprs.rac; - si13_default.no_pbcch.net_ctrl_ord = bts->gprs.net_ctrl_ord; + si13_default.rac = bts->gprs.rac; + si13_default.net_ctrl_ord = bts->gprs.net_ctrl_ord; si13_default.cell_opts.ctrl_ack_type_use_block = bts->gprs.ctrl_ack_type_use_block; -- To view, visit https://gerrit.osmocom.org/3955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 14 17:18:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 14 Sep 2017 17:18:28 +0000 Subject: osmo-gsm-tester[master]: Replicate resources based on times attr before combine time In-Reply-To: References: Message-ID: Patch Set 3: (3 comments) https://gerrit.osmocom.org/#/c/3907/3/selftest/suite_test/test_suite/suite.conf File selftest/suite_test/test_suite/suite.conf: Line 6: - times: 2 > it would serve to see which one of them got duplicated :) This is left like this in the new version of the patch because actually other bugs (fixed in next commits) prevent from tests passing if there are other keys in this dictionary. A extra commit is added after the commits that fix bugs in order to improve the test. https://gerrit.osmocom.org/#/c/3907/3/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 61: 'bts[].trx_list[].nominal_power': schema.INT, > hw_addr and net_device will, IIRC, be useful for octphy. I finally moved this to a new commit before this one, fixing usage of max_red_power too. https://gerrit.osmocom.org/#/c/3907/3/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 212: combination = config.replicate_times(self.definition.conf.get(conf_name, {})) > Good point. I'll have a look and do some tests and I'll come with an answer This has been removed in the new version of the commit, because indeed it's not needed. A bit of extra stuff is done in the new version too to accommodate schema requirements after the change. -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 14 18:05:25 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 14 Sep 2017 18:05:25 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: > > That could work, right? OK this will give you a random available extension: SELECT t.extension+1, t2.extension AS ext FROM subscriber AS t LEFT OUTER JOIN subscriber AS t2 ON t.extension+1 = t2.extension WHERE t2.extension IS NULL ORDER BY RANDOM() LIMIT 1; -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 14 18:16:47 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 14 Sep 2017 18:16:47 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: > > > > That could work, right? > > OK this will give you a random available extension: > > SELECT t.extension+1, t2.extension AS ext > FROM subscriber AS t > LEFT OUTER JOIN subscriber AS t2 ON > t.extension+1 = t2.extension > WHERE t2.extension IS NULL > ORDER BY RANDOM() LIMIT 1; Actually something other than +1 (maybe something random here) would avoid sequential numbers if desired. By somehow "seeding" the db, then adding limits to stay within the constraints of GSM_MAX_EXTEN and GSM_MIN_EXTEN it could be good to go. I wonder if sqlite is more efficient at doing this than we would be. I'm getting more or less CPU Time: user 0.220000 sys 0.016000 on a database with ~ 21000 subscriber entries. I will write up and push the patch and see what folks think.. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:18:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:18:37 +0000 Subject: openbsc[master]: libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29270652957f58093be8bf7f2e898b0b4933bd93 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:19:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:19:40 +0000 Subject: osmo-bsc[master]: SI13: drop PBCCH-related bits In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:19:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:19:43 +0000 Subject: [MERGED] osmo-bsc[master]: SI13: drop PBCCH-related bits In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SI13: drop PBCCH-related bits ...................................................................... SI13: drop PBCCH-related bits According to 3GPP TS 44.018 ?1.8 the "network shall never enable PBCCH and PCCCH". Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Related: OS#2400 --- M include/osmocom/bsc/rest_octets.h M src/libbsc/rest_octets.c M src/libbsc/system_information.c 3 files changed, 20 insertions(+), 69 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/rest_octets.h b/include/osmocom/bsc/rest_octets.h index 374b1ba..e6e5303 100644 --- a/include/osmocom/bsc/rest_octets.h +++ b/include/osmocom/bsc/rest_octets.h @@ -63,12 +63,6 @@ /* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - /* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ enum gprs_nmo { GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ @@ -113,25 +107,10 @@ struct gprs_power_ctrl_pars pwr_ctrl_pars; uint8_t bcch_change_mark; uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; + uint8_t rac; + uint8_t spgc_ccch_sup; + uint8_t net_ctrl_ord; + uint8_t prio_acc_thr; }; /* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index ae04225..866734b 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -816,39 +816,16 @@ bitvec_set_uint(&bv, si13->bcch_change_mark, 2); append_gprs_mobile_alloc(&bv); } - if (!si13->pbcch_present) { - /* PBCCH not present in cell */ - bitvec_set_bit(&bv, 0); - bitvec_set_uint(&bv, si13->no_pbcch.rac, 8); - bitvec_set_bit(&bv, si13->no_pbcch.spgc_ccch_sup); - bitvec_set_uint(&bv, si13->no_pbcch.prio_acc_thr, 3); - bitvec_set_uint(&bv, si13->no_pbcch.net_ctrl_ord, 2); - append_gprs_cell_opt(&bv, &si13->cell_opts); - append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); - } else { - /* PBCCH present in cell */ - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.psi1_rep_per, 4); - /* PBCCH Descripiton */ - bitvec_set_uint(&bv, si13->pbcch.pb, 4); - bitvec_set_uint(&bv, si13->pbcch.tsc, 3); - bitvec_set_uint(&bv, si13->pbcch.tn, 3); - switch (si13->pbcch.carrier_type) { - case PBCCH_BCCH: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 0); - break; - case PBCCH_ARFCN: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.arfcn, 10); - break; - case PBCCH_MAIO: - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.maio, 6); - break; - } - } + /* PBCCH not present in cell: + it shall never be indicated according to 3GPP TS 44.018 Table 10.5.2.37b.1 */ + bitvec_set_bit(&bv, 0); + bitvec_set_uint(&bv, si13->rac, 8); + bitvec_set_bit(&bv, si13->spgc_ccch_sup); + bitvec_set_uint(&bv, si13->prio_acc_thr, 3); + bitvec_set_uint(&bv, si13->net_ctrl_ord, 2); + append_gprs_cell_opt(&bv, &si13->cell_opts); + append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); + /* 3GPP TS 44.018 Release 6 / 10.5.2.37b */ bitvec_set_bit(&bv, H); /* added Release 99 */ /* claim our SGSN is compatible with Release 99, as EDGE and EGPRS diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index c0df8bb..c9da4b2 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -1081,15 +1081,10 @@ }, .bcch_change_mark = 1, .si_change_field = 0, - .pbcch_present = 0, - { - .no_pbcch = { - .rac = 0, /* needs to be patched */ - .spgc_ccch_sup = 0, - .net_ctrl_ord = 0, - .prio_acc_thr = 6, - }, - }, + .rac = 0, /* needs to be patched */ + .spgc_ccch_sup = 0, + .net_ctrl_ord = 0, + .prio_acc_thr = 6, }; static int generate_si13(enum osmo_sysinfo_type t, struct gsm_bts *bts) @@ -1104,8 +1099,8 @@ si13->header.skip_indicator = 0; si13->header.system_information = GSM48_MT_RR_SYSINFO_13; - si13_default.no_pbcch.rac = bts->gprs.rac; - si13_default.no_pbcch.net_ctrl_ord = bts->gprs.net_ctrl_ord; + si13_default.rac = bts->gprs.rac; + si13_default.net_ctrl_ord = bts->gprs.net_ctrl_ord; si13_default.cell_opts.ctrl_ack_type_use_block = bts->gprs.ctrl_ack_type_use_block; -- To view, visit https://gerrit.osmocom.org/3955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:19:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:19:57 +0000 Subject: =?UTF-8?Q?osmo-mgw=5Bmaster=5D=3A_Bump_version=3A_1=2E0=2E1_=E2=86=92_1=2E0=2E2?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c37b56e81df13007738f340c3fb48f0996a95f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:20:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:20:01 +0000 Subject: osmo-mgw[master]: Add TODO-RELEASE file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id0b8d55ea58bdb3d72b4c131ac983d8895b55ef8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:20:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:20:18 +0000 Subject: [MERGED] osmo-mgw[master]: Add TODO-RELEASE file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add TODO-RELEASE file ...................................................................... Add TODO-RELEASE file Let's track the API/ABI changes in libosmo*mgcp the same way we do it in other libosmo* libraries. Change-Id: Id0b8d55ea58bdb3d72b4c131ac983d8895b55ef8 --- A TODO-RELEASE 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line -- To view, visit https://gerrit.osmocom.org/3949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id0b8d55ea58bdb3d72b4c131ac983d8895b55ef8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:20:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:20:19 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_osmo-mgw=5Bmaster=5D=3A_Bump_version=3A_1=2E0=2E1_=E2=86=92_1=2E0=2E2?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 1.0.1 ? 1.0.2 ...................................................................... Bump version: 1.0.1 ? 1.0.2 Catch-up with release tagging and .deb changelog: the requirements in OsmoMSC were updated. Change-Id: I2c37b56e81df13007738f340c3fb48f0996a95f3 --- M debian/changelog M src/libosmo-mgcp-client/Makefile.am 2 files changed, 8 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 21e4bbd..274f7c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-mgw (1.0.2) unstable; urgency=low + + * First release after major rename. + + -- Max Suraev Thu, 14 Sep 2017 18:41:05 +0200 + + osmo-mgw (0.1.0) unstable; urgency=low * Initial release. diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index dbbd303..0416081 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -22,7 +22,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool # documentation before making any modification -MGCP_CLIENT_LIBVERSION=1:0:0 +MGCP_CLIENT_LIBVERSION=1:0:1 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/3950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2c37b56e81df13007738f340c3fb48f0996a95f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:23:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:23:03 +0000 Subject: libosmo-abis[master]: cosmetic: ipa.c: use msgb_dequeue(), drop local var In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:29:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:29:42 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:30:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:30:08 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: use defines for constant In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 01:58:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 01:58:05 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 02:01:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 02:01:04 +0000 Subject: libosmocore[master]: VTY: allow comments in the same line as vty commands In-Reply-To: References: Message-ID: Patch Set 3: I would be conservative here, i.e. not merge the patch. Comments are of severely limited use anyway, as they are all deleted when you write back the running configuration to the file anyway. And having them on separate lines has worked so far, nobody has ever raised an issue about it. -- To view, visit https://gerrit.osmocom.org/3882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iccd9cc8604494379910c534b35ce7e74e329d863 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 02:02:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 02:02:28 +0000 Subject: osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 02:02:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 15 Sep 2017 02:02:30 +0000 Subject: [MERGED] osmo-bsc[master]: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg ...................................................................... doc/examples: tweak osmo-bsc.cfg, add osmo-bsc_custom-sccp.cfg Now osmo-bsc.cfg's SCCP addresses work by internal defaults, while osmo-bsc_custom-sccp.cfg shows how to use custom STP IP address and SCCP point codes. Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd --- M doc/examples/osmo-bsc/osmo-bsc.cfg A doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg M osmoappdesc.py 3 files changed, 129 insertions(+), 29 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index 7c10e9d..efa27ec 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -1,11 +1,5 @@ -! -! OsmoBSC (0.9.14+gitr1+3d331c0062bb0c9694dbd4d1eab7adc58138c3ae) configuration saved from vty -!! -password foo -! -! -line vty - no login +! osmo-bsc default configuration +! (assumes STP to run on 127.0.0.1 and uses default point codes) ! e1_input e1_line 0 driver ipa @@ -15,12 +9,14 @@ short name OsmoBSC long name OsmoBSC auth policy closed + authorized-regexp .* location updating reject cause 13 encryption a5 0 - neci 1 + authentication optional + neci 0 paging any use tch 0 rrlp mode none - mm info 1 + mm info 0 handover 0 handover window rxlev averaging 10 handover window rxqual averaging 1 @@ -28,21 +24,25 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 bts 0 - type nanobts + type sysmobts band DCS1800 cell_identity 0 location_area_code 1 - training_sequence_code 7 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 rxlev access min 0 + radio-link-timeout 32 channel allocator ascending rach tx integer 9 rach max transmission 7 - dtx uplink force - dtx downlink + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden ip.access unit_id 0 0 oml ip.access stream_id 255 line 0 neighbor-list mode manual-si5 @@ -50,11 +50,14 @@ neighbor-list add arfcn 200 si5 neighbor-list add arfcn 10 si5 neighbor-list add arfcn 20 + codec-support fr gprs mode none + no force-combined-si trx 0 rf_locked 0 arfcn 871 nominal power 23 + ! to use full TRX power, set max_power_red 0 max_power_red 20 rsl e1 tei 0 timeslot 0 @@ -81,21 +84,24 @@ timeslot 7 phys_chan_config TCH/F hopping enabled 0 -cs7 instance 1 - point-code 3.0.0 - sccp-address bsc_local - point-code 3.0.0 - sccp-address msc_remote - point-code 1.0.0 -msc - bsc-addr bsc_local - msc-addr msc_remote +msc 0 ip.access rtp-base 4000 timeout-ping 20 timeout-pong 5 - dest 192.168.100.11 6666 0 - access-list-name msc-list - no access-list-name + no timeout-ping advanced + no bsc-welcome-text + no bsc-msc-lost-text + no bsc-grace-text + type normal + allow-emergency allow + amr-config 12_2k forbidden + amr-config 10_2k forbidden + amr-config 7_95k forbidden + amr-config 7_40k forbidden + amr-config 6_70k forbidden + amr-config 5_90k allowed + amr-config 5_15k forbidden + amr-config 4_75k forbidden bsc - no access-list-name - access-list-name bsc-list + mid-call-timeout 0 + no missing-msc-text diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg new file mode 100644 index 0000000..59e7090 --- /dev/null +++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg @@ -0,0 +1,93 @@ +! osmo-bsc configuration example for custom SCCP addresses +! +e1_input + e1_line 0 driver ipa +network + network country code 1 + mobile network code 1 + short name OsmoBSC + long name OsmoBSC + auth policy closed + authorized-regexp .* + location updating reject cause 13 + encryption a5 0 + authentication optional + neci 0 + paging any use tch 0 + rrlp mode none + mm info 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + dyn_ts_allow_tch_f 0 + periodic location update 30 + bts 0 + type sysmobts + band DCS1800 + cell_identity 0 + location_area_code 1 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 0 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode none + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + ! to use full TRX power, set max_power_red 0 + max_power_red 20 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 +cs7 instance 0 + point-code 0.42.1 + !asp asp-clnt-OsmoBSC 2905 0 m3ua + ! remote-ip 10.23.24.1 ! where to reach the STP + sccp-address msc_remote + point-code 0.23.1 +msc 0 + msc-addr msc_remote diff --git a/osmoappdesc.py b/osmoappdesc.py index 36eb1a7..338239c 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -15,7 +15,8 @@ # along with this program. If not, see app_configs = { - "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg"], + "osmo-bsc": ["doc/examples/osmo-bsc/osmo-bsc.cfg", + "doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg"], "nat": ["doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg"], } -- To view, visit https://gerrit.osmocom.org/3832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb41d5adc24b2ee5613be691a201df8f3566e5dd Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 07:43:44 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Fri, 15 Sep 2017 07:43:44 +0000 Subject: [MERGED] openbsc[master]: libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp... In-Reply-To: References: Message-ID: Keith Whyte has submitted this change and it was merged. Change subject: libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp_ack ...................................................................... libmsc: Log Rx DELIVER-SM RESP before calling gsm411_send_rp_ack This patch just makes the log match chronologically what is happening. We receive the deliver_sm_resp before we send the RP ACK to the MS. Change-Id: I29270652957f58093be8bf7f2e898b0b4933bd93 --- M openbsc/src/libmsc/smpp_smsc.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 04afc49..83c29f6 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -688,14 +688,14 @@ return -1; } + LOGP(DSMPP, LOGL_INFO, "[%s] Rx DELIVER-SM RESP (%s)\n", + esme->system_id, get_value_string(smpp_status_strs, + deliver_r.command_status)); + if (deliver_r.command_status == ESME_ROK) smpp_cmd_ack(cmd); else smpp_cmd_err(cmd, deliver_r.command_status); - - LOGP(DSMPP, LOGL_INFO, "[%s] Rx DELIVER-SM RESP (%s)\n", - esme->system_id, get_value_string(smpp_status_strs, - deliver_r.command_status)); return 0; } -- To view, visit https://gerrit.osmocom.org/3909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I29270652957f58093be8bf7f2e898b0b4933bd93 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Sep 15 08:54:20 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 15 Sep 2017 08:54:20 +0000 Subject: [PATCH] osmo-msc[master]: a_iface: remove obsolete include Message-ID: Review at https://gerrit.osmocom.org/3956 a_iface: remove obsolete include msc_ifaces.c still includes legacy_mgcp/mgcp.h, since the mgcp client is now completely separated, mgcp_client.h contains all the necessary includes so including mgcp.h as well results in duplicate declarations remove mgcp.h from the include section Change-Id: Ic6d32769819ecfcb585c61360d3df97824a2ef03 --- M src/libmsc/msc_ifaces.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/56/3956/1 diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index f54426e..16696d2 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic6d32769819ecfcb585c61360d3df97824a2ef03 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Sep 15 09:31:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 09:31:26 +0000 Subject: [PATCH] osmo-msc[master]: Remove rest_octets.h Message-ID: Review at https://gerrit.osmocom.org/3957 Remove rest_octets.h The MSC should not fiddle with low-level SI details like rest octets anyway. Unfortunately simply removing the header is impossible as it causes massive fallout due to missing includes. Fixed it as well. The only other parameter which required removal is cell_ro_sel_par which is not referenced anywhere in the code anyway. Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/a_iface.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M include/osmocom/msc/msc_ifaces.h D include/osmocom/msc/rest_octets.h M src/libcommon-cs/common_cs.c M src/libcommon/gsm_subscriber_base.c M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/mncc_sock.c M src/libmsc/msc_ifaces.c M src/libmsc/osmo_msc.c M src/libmsc/ussd.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M tests/msc_vlr/msc_vlr_tests.c 18 files changed, 21 insertions(+), 145 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/57/3957/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 6e7aa38..03896b5 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -52,7 +52,6 @@ bsc_msc_data.h \ osmux.h \ paging.h \ - rest_octets.h \ rrlp.h \ rs232.h \ rtp_proxy.h \ diff --git a/include/osmocom/msc/a_iface.h b/include/osmocom/msc/a_iface.h index 32003eb..40ad9c8 100644 --- a/include/osmocom/msc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -21,6 +21,7 @@ #pragma once #include +#include /* A struct to keep a context information about the BSCs we are associated with */ struct bsc_context { diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 5d3d5ca..1a3fa01 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -10,12 +10,11 @@ #include #include #include - +#include #include #include #include -#include #include #include diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 5028a26..4f47786 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -17,7 +17,7 @@ #include #include #include - +#include #include #ifndef ROLE_BSC @@ -860,7 +860,6 @@ struct gsm48_rach_control rach_control; uint8_t ncc_permitted; struct gsm48_cell_sel_par cell_sel_par; - struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ struct gsm48_cell_options cell_options; struct gsm48_control_channel_descr chan_desc; struct bitvec neigh_list; diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h index d46dfe9..0592c07 100644 --- a/include/osmocom/msc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -2,6 +2,7 @@ #include #include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/osmocom/msc/rest_octets.h b/include/osmocom/msc/rest_octets.h deleted file mode 100644 index 49857b7..0000000 --- a/include/osmocom/msc/rest_octets.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef _REST_OCTETS_H -#define _REST_OCTETS_H - -#include -#include -#include - -/* generate SI1 rest octets */ -int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); -int rest_octets_si2quater(uint8_t *data, struct gsm_bts *bts); -int rest_octets_si6(uint8_t *data, bool is1800_net); - -struct gsm48_si_selection_params { - uint16_t penalty_time:5, - temp_offs:3, - cell_resel_off:6, - cbq:1, - present:1; -}; - -struct gsm48_si_power_offset { - uint8_t power_offset:2, - present:1; -}; - -struct gsm48_si3_gprs_ind { - uint8_t si13_position:1, - ra_colour:3, - present:1; -}; - -struct gsm48_lsa_params { - uint32_t prio_thr:3, - lsa_offset:3, - mcc:12, - mnc:12; - unsigned int present; -}; - -struct gsm48_si_ro_info { - struct gsm48_si_selection_params selection_params; - struct gsm48_si_power_offset power_offset; - uint8_t si2ter_indicator; - uint8_t early_cm_ctrl; - struct { - uint8_t where:3, - present:1; - } scheduling; - struct gsm48_si3_gprs_ind gprs_ind; - /* SI 3 specific */ - uint8_t si2quater_indicator; - /* SI 4 specific */ - struct gsm48_lsa_params lsa_params; - uint16_t cell_id; - uint8_t break_ind; /* do we have SI7 + SI8 ? */ -}; - - -/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ -int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3); - -/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ -int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); - -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - -/* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ -enum gprs_nmo { - GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ - GPRS_NMO_II = 1, /* all paging on CCCH */ - GPRS_NMO_III = 2, /* no paging coordination */ -}; - -/* TS 04.60 12.24 */ -struct gprs_cell_options { - enum gprs_nmo nmo; - /* T3168: wait for packet uplink assignment message */ - uint32_t t3168; /* in milliseconds */ - /* T3192: wait for release of the TBF after reception of the final block */ - uint32_t t3192; /* in milliseconds */ - uint32_t drx_timer_max;/* in seconds */ - uint32_t bs_cv_max; - uint8_t supports_egprs_11bit_rach; - bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */ - - uint8_t ext_info_present; - struct { - uint8_t egprs_supported; - uint8_t use_egprs_p_ch_req; - uint8_t bep_period; - uint8_t pfc_supported; - uint8_t dtm_supported; - uint8_t bss_paging_coordination; - } ext_info; -}; - -/* TS 04.60 Table 12.9.2 */ -struct gprs_power_ctrl_pars { - uint8_t alpha; - uint8_t t_avg_w; - uint8_t t_avg_t; - uint8_t pc_meas_chan; - uint8_t n_avg_i; -}; - -struct gsm48_si13_info { - struct gprs_cell_options cell_opts; - struct gprs_power_ctrl_pars pwr_ctrl_pars; - uint8_t bcch_change_mark; - uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; -}; - -/* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ -int rest_octets_si13(uint8_t *data, const struct gsm48_si13_info *si13); - -#endif /* _REST_OCTETS_H */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 8a28b72..bad8262 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -29,6 +29,7 @@ #include #include #include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index 58a6ff0..20147a3 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 3e86494..4892fb8 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -40,6 +40,8 @@ #include #include +#include + /* A pointer to the GSM network we work with. By the current paradigm, * there can only be one gsm_network per MSC. The pointer is set once * when calling a_init() */ diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 3d5755a..922dca9 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,9 @@ #include #include #include +#include + +#include #define IP_V4_ADDR_LEN 4 diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 05c9439..b6b1bc9 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -38,6 +38,7 @@ #include #include #include +#include struct mncc_sock_state { struct gsm_network *net; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index f54426e..1c8e5ef 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "../../bscconfig.h" diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index db24757..f807f2a 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -29,7 +29,7 @@ #include #include #include - +#include #include #include "../../bscconfig.h" diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index e3263d2..7b450a2 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -34,6 +34,7 @@ #include #include #include +#include /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a9aacbd..6094c9c 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 9d9e4c1..41620b9 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index c9223f8..ea7529e 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index d05aa29..a6e0f29 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -33,6 +33,7 @@ #include #include #include +#include #if BUILD_IU #include -- To view, visit https://gerrit.osmocom.org/3957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 15 09:49:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 09:49:16 +0000 Subject: [PATCH] osmo-msc[master]: Remove SI-related code Message-ID: Review at https://gerrit.osmocom.org/3958 Remove SI-related code Get rid of unused data structures and functions related to SI handling. Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e --- M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M src/libcommon/gsm_data.c 3 files changed, 1 insertion(+), 89 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/58/3958/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1a3fa01..c2533a5 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -682,9 +682,6 @@ int bts_depend_check(struct gsm_bts *bts); int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts); -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value); - bool classmark_is_r99(struct gsm_classmark *cm); #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 4f47786..b764735 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -855,30 +855,7 @@ int chan_alloc_reverse; enum neigh_list_manual_mode neigh_list_manual_mode; - /* parameters from which we build SYSTEM INFORMATION */ - struct { - struct gsm48_rach_control rach_control; - uint8_t ncc_permitted; - struct gsm48_cell_sel_par cell_sel_par; - struct gsm48_cell_options cell_options; - struct gsm48_control_channel_descr chan_desc; - struct bitvec neigh_list; - struct bitvec cell_alloc; - struct bitvec si5_neigh_list; - struct osmo_earfcn_si2q si2quater_neigh_list; - size_t uarfcn_length; /* index for uarfcn and scramble lists */ - struct { - /* bitmask large enough for all possible ARFCN's */ - uint8_t neigh_list[1024/8]; - uint8_t cell_alloc[1024/8]; - /* If the user wants a different neighbor list in SI5 than in SI2 */ - uint8_t si5_neigh_list[1024/8]; - uint8_t meas_bw_list[MAX_EARFCN_LIST]; - uint16_t earfcn_list[MAX_EARFCN_LIST]; - uint16_t uarfcn_list[MAX_EARFCN_LIST]; - uint16_t scramble_list[MAX_EARFCN_LIST]; - } data; - } si_common; + bool early_classmark_allowed; /* for testing only: Have an infinitely long radio link timeout */ bool infinite_radio_link_timeout; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index f4f6e5d..b8840c3 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -268,31 +268,6 @@ bts->dtxd = false; bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ bts->neigh_list_manual_mode = 0; - bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ - bts->si_common.cell_sel_par.rxlev_acc_min = 0; - bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; - bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; - bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; - bts->si_common.si2quater_neigh_list.thresh_hi = 0; - osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); - bts->si_common.neigh_list.data = bts->si_common.data.neigh_list; - bts->si_common.neigh_list.data_len = - sizeof(bts->si_common.data.neigh_list); - bts->si_common.si5_neigh_list.data = bts->si_common.data.si5_neigh_list; - bts->si_common.si5_neigh_list.data_len = - sizeof(bts->si_common.data.si5_neigh_list); - bts->si_common.cell_alloc.data = bts->si_common.data.cell_alloc; - bts->si_common.cell_alloc.data_len = - sizeof(bts->si_common.data.cell_alloc); - bts->si_common.rach_control.re = 1; /* no re-establishment */ - bts->si_common.rach_control.tx_integer = 9; /* 12 slots spread - 217/115 slots delay */ - bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */ - bts->si_common.rach_control.t2 = 4; /* no emergency calls */ - bts->si_common.chan_desc.att = 1; /* attachment required */ - bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ - bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ - gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); @@ -402,43 +377,6 @@ return 0; } return 1; -} - -/* get the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) -{ - const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (bts->infinite_radio_link_timeout) - return -1; - else { - /* Encoding as per Table 10.5.21 of TS 04.08 */ - return (cell_options->radio_link_timeout + 1) << 2; - } -} - -/* set the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 Section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) -{ - struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (value < 0) - bts->infinite_radio_link_timeout = true; - else { - bts->infinite_radio_link_timeout = false; - /* Encoding as per Table 10.5.21 of TS 04.08 */ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; - } } bool classmark_is_r99(struct gsm_classmark *cm) -- To view, visit https://gerrit.osmocom.org/3958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 15 09:58:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 09:58:57 +0000 Subject: osmo-gsm-tester[master]: contrib: Build octphy osmo-bts variant and make it generic In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 09:59:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 09:59:00 +0000 Subject: [MERGED] osmo-gsm-tester[master]: contrib: Build octphy osmo-bts variant and make it generic In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: contrib: Build octphy osmo-bts variant and make it generic ...................................................................... contrib: Build octphy osmo-bts variant and make it generic This is a first step to add support for osmo-bts-octpy to osmo-gsm-tester. There's no point in building separate insts for different osmo-bts variants which run on the main unit and which come from the same git repository, this we make the osmo-bts-trx one generic to handle all variants which fall into the description above. Tested locally on my laptop that it builds susccessfully. Once this patch is applied, jenkins jobs need to be adjusted: - RnD: osmo-gsm-tester_manual-build-all - Prod: osmo-gsm-tester_build-osmo-bts-trx (and rename it) Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 --- R contrib/jenkins-build-osmo-bts.sh M src/osmo_gsm_tester/bts_osmotrx.py 2 files changed, 5 insertions(+), 4 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts.sh similarity index 61% rename from contrib/jenkins-build-osmo-bts-trx.sh rename to contrib/jenkins-build-osmo-bts.sh index 6188be1..7349ce5 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts.sh @@ -1,14 +1,15 @@ #!/bin/sh set -e -x base="$PWD" -name="osmo-bts-trx" +name="osmo-bts" . "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +have_repo octphy-2g-headers build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include --enable-octphy --with-octsdr-2g=$base/octphy-2g-headers -create_bin_tgz osmo-bts-trx +create_bin_tgz osmo-bts-trx osmo-bts-octphy diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 6130ca9..f53b8a3 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -84,7 +84,7 @@ self.log('Waiting for osmo-trx to start up...') event_loop.wait(self, self.trx.trx_ready) - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-bts'))) lib = self.inst.child('lib') if not os.path.isdir(lib): raise RuntimeError('No lib/ in %r' % self.inst) -- To view, visit https://gerrit.osmocom.org/3928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8814e4ce49596b586990f20d7d625a719852e90 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Sep 15 10:01:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 10:01:41 +0000 Subject: [PATCH] osmo-sgsn[master]: Remove rest_octets.h Message-ID: Review at https://gerrit.osmocom.org/3959 Remove rest_octets.h This header is unused anyway. Change-Id: Ic34f7d3e8f813e020d43be312df940c933bc52b7 --- M debian/copyright M include/osmocom/sgsn/Makefile.am D include/osmocom/sgsn/rest_octets.h 3 files changed, 0 insertions(+), 141 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/59/3959/1 diff --git a/debian/copyright b/debian/copyright index 1f7f6fd..ad911c0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -89,7 +89,6 @@ include/osmocom/sgsn/gprs_sgsn.h include/osmocom/sgsn/gprs_sndcp.h include/osmocom/sgsn/gprs_subscriber.h - include/osmocom/sgsn/rest_octets.h include/osmocom/sgsn/sgsn.h include/osmocom/sgsn/vty.h m4/README diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 1502129..3f63b9f 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -18,7 +18,6 @@ gsup_client.h \ gtphub.h \ oap_client.h \ - rest_octets.h \ sgsn.h \ signal.h \ slhc.h \ diff --git a/include/osmocom/sgsn/rest_octets.h b/include/osmocom/sgsn/rest_octets.h deleted file mode 100644 index 0dbe7ae..0000000 --- a/include/osmocom/sgsn/rest_octets.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef _REST_OCTETS_H -#define _REST_OCTETS_H - -#include -#include -#include - -/* generate SI1 rest octets */ -int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); -int rest_octets_si2quater(uint8_t *data, struct gsm_bts *bts); -int rest_octets_si6(uint8_t *data, bool is1800_net); - -struct gsm48_si_selection_params { - uint16_t penalty_time:5, - temp_offs:3, - cell_resel_off:6, - cbq:1, - present:1; -}; - -struct gsm48_si_power_offset { - uint8_t power_offset:2, - present:1; -}; - -struct gsm48_si3_gprs_ind { - uint8_t si13_position:1, - ra_colour:3, - present:1; -}; - -struct gsm48_lsa_params { - uint32_t prio_thr:3, - lsa_offset:3, - mcc:12, - mnc:12; - unsigned int present; -}; - -struct gsm48_si_ro_info { - struct gsm48_si_selection_params selection_params; - struct gsm48_si_power_offset power_offset; - uint8_t si2ter_indicator; - uint8_t early_cm_ctrl; - struct { - uint8_t where:3, - present:1; - } scheduling; - struct gsm48_si3_gprs_ind gprs_ind; - /* SI 3 specific */ - uint8_t si2quater_indicator; - /* SI 4 specific */ - struct gsm48_lsa_params lsa_params; - uint16_t cell_id; - uint8_t break_ind; /* do we have SI7 + SI8 ? */ -}; - - -/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ -int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3); - -/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ -int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); - -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - -/* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ -enum gprs_nmo { - GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ - GPRS_NMO_II = 1, /* all paging on CCCH */ - GPRS_NMO_III = 2, /* no paging coordination */ -}; - -/* TS 04.60 12.24 */ -struct gprs_cell_options { - enum gprs_nmo nmo; - /* T3168: wait for packet uplink assignment message */ - uint32_t t3168; /* in milliseconds */ - /* T3192: wait for release of the TBF after reception of the final block */ - uint32_t t3192; /* in milliseconds */ - uint32_t drx_timer_max;/* in seconds */ - uint32_t bs_cv_max; - uint8_t supports_egprs_11bit_rach; - bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */ - - uint8_t ext_info_present; - struct { - uint8_t egprs_supported; - uint8_t use_egprs_p_ch_req; - uint8_t bep_period; - uint8_t pfc_supported; - uint8_t dtm_supported; - uint8_t bss_paging_coordination; - } ext_info; -}; - -/* TS 04.60 Table 12.9.2 */ -struct gprs_power_ctrl_pars { - uint8_t alpha; - uint8_t t_avg_w; - uint8_t t_avg_t; - uint8_t pc_meas_chan; - uint8_t n_avg_i; -}; - -struct gsm48_si13_info { - struct gprs_cell_options cell_opts; - struct gprs_power_ctrl_pars pwr_ctrl_pars; - uint8_t bcch_change_mark; - uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; -}; - -/* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ -int rest_octets_si13(uint8_t *data, const struct gsm48_si13_info *si13); - -#endif /* _REST_OCTETS_H */ -- To view, visit https://gerrit.osmocom.org/3959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic34f7d3e8f813e020d43be312df940c933bc52b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 15 10:21:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 10:21:37 +0000 Subject: [PATCH] osmo-ggsn[master]: Fix leftovers after rename Message-ID: Review at https://gerrit.osmocom.org/3960 Fix leftovers after rename * Use proper name in jenkins test * Fix naming in systemd service * Fix git-review config Change-Id: I934f897002215d7d4e610cbd312383181bbe97c9 --- M .gitreview M contrib/jenkins.sh R contrib/osmo-ggsn.service 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/60/3960/1 diff --git a/.gitreview b/.gitreview index cc02ff2..98937c1 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openggsn +project=osmo-ggsn diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f319acb..3bfb3f5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -28,7 +28,7 @@ echo echo echo -echo " =============================== openggsn ===============================" +echo " =============================== OsmoGGSN ===============================" echo set -x diff --git a/contrib/openggsn.service b/contrib/osmo-ggsn.service similarity index 64% rename from contrib/openggsn.service rename to contrib/osmo-ggsn.service index a34f374..a8d123a 100644 --- a/contrib/openggsn.service +++ b/contrib/osmo-ggsn.service @@ -1,11 +1,11 @@ [Unit] -Description=OpenGGSN +Description=OsmoGGSN After=networking.service [Service] Type=simple Restart=always -ExecStart=/usr/bin/ggsn -c /etc/ggsn.conf -f +ExecStart=/usr/bin/osmo-ggsn -c /etc/osmocom/osmo-ggsn.conf -f RestartSec=2 RestartPreventExitStatus=1 -- To view, visit https://gerrit.osmocom.org/3960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I934f897002215d7d4e610cbd312383181bbe97c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 15 10:45:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 10:45:22 +0000 Subject: [PATCH] osmo-ggsn[master]: Move PDP logging macro to header Message-ID: Review at https://gerrit.osmocom.org/3961 Move PDP logging macro to header It might be useful for any user of libgtp who uses libosmocore so let's make it available as part of installable header. Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Related: SYS#3610 --- M TODO-RELEASE M ggsn/ggsn.c M gtp/pdp.h 3 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/3961/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..c1190d2 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libgtp API change add LOGPDP() helper to public API. diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 46850a6..19b2a8d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -83,9 +83,6 @@ #define LOGPGGSN(level, ggsn, fmt, args...) \ LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) -#define LOGPPDP(level, pdp, fmt, args...) \ - LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) - static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); diff --git a/gtp/pdp.h b/gtp/pdp.h index cb98920..f27d0ab 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -15,6 +15,9 @@ struct gsn_t; +#define LOGPPDP(level, pdp, fmt, args...) \ + LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 15 12:05:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 12:05:58 +0000 Subject: [PATCH] osmo-msc[master]: Remove SI-related code In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3958 to look at the new patch set (#2). Remove SI-related code Get rid of unused data structures and functions related to SI handling. Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e --- M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M src/libcommon/gsm_data.c 3 files changed, 1 insertion(+), 112 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/58/3958/2 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1a3fa01..c2533a5 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -682,9 +682,6 @@ int bts_depend_check(struct gsm_bts *bts); int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts); -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value); - bool classmark_is_r99(struct gsm_classmark *cm); #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 4f47786..194cacd 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -26,13 +26,6 @@ #include -/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: - 4-bit index is used (2#1111 = 10#15) */ -#define SI2Q_MAX_NUM 16 -/* length in bits (for single SI2quater message) */ -#define SI2Q_MAX_LEN 160 -#define SI2Q_MIN_LEN 18 - struct osmo_bsc_data; struct osmo_bsc_sccp_con; @@ -502,11 +495,6 @@ struct gsm_bts_trx_ts ts[TRX_NR_TS]; }; -#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i]) -#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) -#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0]) -#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) - enum gsm_bts_type { GSM_BTS_TYPE_UNKNOWN, GSM_BTS_TYPE_BS11, @@ -744,17 +732,6 @@ struct gsm_abis_mo mo; } site_mgr; - /* bitmask of all SI that are present/valid in si_buf */ - uint32_t si_valid; - /* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */ - uint8_t si2q_index; /* distinguish individual SI2quater messages */ - uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */ - /* buffers where we put the pre-computed SI */ - sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; - /* offsets used while generating SI2quater */ - size_t e_offset; - size_t u_offset; - /* ip.accesss Unit ID's have Site/BTS/TRX layout */ union { struct { @@ -855,30 +832,7 @@ int chan_alloc_reverse; enum neigh_list_manual_mode neigh_list_manual_mode; - /* parameters from which we build SYSTEM INFORMATION */ - struct { - struct gsm48_rach_control rach_control; - uint8_t ncc_permitted; - struct gsm48_cell_sel_par cell_sel_par; - struct gsm48_cell_options cell_options; - struct gsm48_control_channel_descr chan_desc; - struct bitvec neigh_list; - struct bitvec cell_alloc; - struct bitvec si5_neigh_list; - struct osmo_earfcn_si2q si2quater_neigh_list; - size_t uarfcn_length; /* index for uarfcn and scramble lists */ - struct { - /* bitmask large enough for all possible ARFCN's */ - uint8_t neigh_list[1024/8]; - uint8_t cell_alloc[1024/8]; - /* If the user wants a different neighbor list in SI5 than in SI2 */ - uint8_t si5_neigh_list[1024/8]; - uint8_t meas_bw_list[MAX_EARFCN_LIST]; - uint16_t earfcn_list[MAX_EARFCN_LIST]; - uint16_t uarfcn_list[MAX_EARFCN_LIST]; - uint16_t scramble_list[MAX_EARFCN_LIST]; - } data; - } si_common; + bool early_classmark_allowed; /* for testing only: Have an infinitely long radio link timeout */ bool infinite_radio_link_timeout; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index f4f6e5d..b8840c3 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -268,31 +268,6 @@ bts->dtxd = false; bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ bts->neigh_list_manual_mode = 0; - bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ - bts->si_common.cell_sel_par.rxlev_acc_min = 0; - bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; - bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; - bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; - bts->si_common.si2quater_neigh_list.thresh_hi = 0; - osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); - bts->si_common.neigh_list.data = bts->si_common.data.neigh_list; - bts->si_common.neigh_list.data_len = - sizeof(bts->si_common.data.neigh_list); - bts->si_common.si5_neigh_list.data = bts->si_common.data.si5_neigh_list; - bts->si_common.si5_neigh_list.data_len = - sizeof(bts->si_common.data.si5_neigh_list); - bts->si_common.cell_alloc.data = bts->si_common.data.cell_alloc; - bts->si_common.cell_alloc.data_len = - sizeof(bts->si_common.data.cell_alloc); - bts->si_common.rach_control.re = 1; /* no re-establishment */ - bts->si_common.rach_control.tx_integer = 9; /* 12 slots spread - 217/115 slots delay */ - bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */ - bts->si_common.rach_control.t2 = 4; /* no emergency calls */ - bts->si_common.chan_desc.att = 1; /* attachment required */ - bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ - bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ - gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); @@ -402,43 +377,6 @@ return 0; } return 1; -} - -/* get the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) -{ - const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (bts->infinite_radio_link_timeout) - return -1; - else { - /* Encoding as per Table 10.5.21 of TS 04.08 */ - return (cell_options->radio_link_timeout + 1) << 2; - } -} - -/* set the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 Section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) -{ - struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (value < 0) - bts->infinite_radio_link_timeout = true; - else { - bts->infinite_radio_link_timeout = false; - /* Encoding as per Table 10.5.21 of TS 04.08 */ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; - } } bool classmark_is_r99(struct gsm_classmark *cm) -- To view, visit https://gerrit.osmocom.org/3958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 12:05:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 12:05:59 +0000 Subject: [PATCH] osmo-msc[master]: Remove BTS-specific attributes Message-ID: Review at https://gerrit.osmocom.org/3962 Remove BTS-specific attributes Remove *bts_model_* functions as they are only useful to BSC. Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/bss.h D include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M src/libcommon/gsm_data.c 6 files changed, 2 insertions(+), 323 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/3962/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 03896b5..80a6d0e 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -10,7 +10,6 @@ bsc_msg_filter.h \ bsc_rll.h \ bss.h \ - bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ common.h \ common_bsc.h \ diff --git a/include/osmocom/msc/bss.h b/include/osmocom/msc/bss.h index 0904334..4e1db7a 100644 --- a/include/osmocom/msc/bss.h +++ b/include/osmocom/msc/bss.h @@ -10,11 +10,4 @@ extern int bsc_network_configure(const char *cfg_file); extern int bsc_shutdown_net(struct gsm_network *net); -/* register all supported BTS */ -extern int bts_init(void); -extern int bts_model_bs11_init(void); -extern int bts_model_rbs2k_init(void); -extern int bts_model_nanobts_init(void); -extern int bts_model_nokia_site_init(void); -extern int bts_model_sysmobts_init(void); #endif diff --git a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h deleted file mode 100644 index bc7860b..0000000 --- a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h +++ /dev/null @@ -1,32 +0,0 @@ -/* OML attribute table generator for ipaccess nanobts */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, - struct gsm_bts_trx *trx); diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index c2533a5..4d493cb 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -559,8 +559,6 @@ extern void talloc_ctx_init(void *ctx_root); -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); - enum gsm_bts_type parse_btstype(const char *arg); const char *btstype2str(enum gsm_bts_type type); struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, @@ -568,68 +566,6 @@ extern void *tall_bsc_ctx; extern int ipacc_rtp_direct; - -/* this actaully refers to the IPA transport, not the BTS model */ -static inline int is_ipaccess_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_sysmobts_v2(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_siemens_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_nokia_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_e1_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} enum gsm_auth_policy gsm_auth_policy_parse(const char *arg); const char *gsm_auth_policy_name(enum gsm_auth_policy policy); @@ -639,13 +575,9 @@ enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid); const char *bts_gprs_mode_name(enum bts_gprs_mode mode); -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode); int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); -int gsm_bts_model_register(struct gsm_bts_model *model); struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan); void bsc_subscr_con_free(struct gsm_subscriber_connection *conn); @@ -653,15 +585,11 @@ struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, - enum gsm_bts_type type, - uint8_t bsic); - void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); + struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); int gsm_bts_set_system_infos(struct gsm_bts *bts); @@ -675,12 +603,6 @@ /* control interface handling */ int bsc_base_ctrl_cmds_install(void); int msc_ctrl_cmds_install(struct gsm_network *net); - -/* dependency handling */ -void bts_depend_mark(struct gsm_bts *bts, int dep); -void bts_depend_clear(struct gsm_bts *bts, int dep); -int bts_depend_check(struct gsm_bts *bts); -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); bool classmark_is_r99(struct gsm_classmark *cm); diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 194cacd..63f4d33 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -523,30 +523,6 @@ struct vty; -struct gsm_bts_model { - struct llist_head list; - - enum gsm_bts_type type; - enum gsm_bts_type_variant variant; - const char *name; - - bool started; - int (*start)(struct gsm_network *net); - int (*oml_rcvmsg)(struct msgb *msg); - - void (*e1line_bind_ops)(struct e1inp_line *line); - - void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); - void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); - void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); - - struct tlv_definition nm_att_tlvdef; - - /* features of a given BTS model set via gsm_bts_model_register() locally */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; -}; - /* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility with BTS compiled against earlier version of this header */ enum gsm_bts_features { @@ -690,7 +666,7 @@ /* type of BTS */ enum gsm_bts_type type; enum gsm_bts_type_variant variant; - struct gsm_bts_model *model; + enum gsm_band band; char version[MAX_VERSION_LENGTH]; char sub_model[MAX_VERSION_LENGTH]; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index b8840c3..4ab8a20 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -49,28 +49,6 @@ ts->e1_link.e1_ts_ss = e1_ts_ss; } -static struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - llist_for_each_entry(model, &bts_models, list) { - if (model->type == type) - return model; - } - - return NULL; -} - -int gsm_bts_model_register(struct gsm_bts_model *model) -{ - if (bts_model_find(model->type)) - return -EEXIST; - - tlv_def_patch(&model->nm_att_tlvdef, &abis_nm_att_tlvdef); - llist_add_tail(&model->list, &bts_models); - return 0; -} - const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, @@ -177,107 +155,6 @@ return get_value_string(bts_gprs_mode_names, mode); } -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) -{ - if (mode != BTS_GPRS_NONE && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) { - return 0; - } - if (mode == BTS_GPRS_EGPRS && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) { - return 0; - } - - return 1; -} - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&model->features, feat, 1); -} - -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&model->features, feat); -} - -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - model = bts_model_find(type); - if (!model) - return -EINVAL; - - bts->type = type; - bts->model = model; - - if (model->start && !model->started) { - int ret = model->start(bts->network); - if (ret < 0) - return ret; - - model->started = true; - } - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - /* Set the default OML Stream ID to 0xff */ - bts->oml_tei = 0xff; - bts->c0->nominal_power = 23; - break; - case GSM_BTS_TYPE_RBS2000: - INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups); - INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_UNKNOWN: - case GSM_BTS_TYPE_NOKIA_SITE: - /* Set default BTS reset timer */ - bts->nokia.bts_reset_timer_cnf = 15; - case _NUM_GSM_BTS_TYPE: - break; - } - - return 0; -} - -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, - uint8_t bsic) -{ - struct gsm_bts_model *model = bts_model_find(type); - struct gsm_bts *bts; - - if (!model && type != GSM_BTS_TYPE_UNKNOWN) - return NULL; - - bts = gsm_bts_alloc(net, net->num_bts); - if (!bts) - return NULL; - - net->num_bts++; - - bts->network = net; - bts->type = type; - bts->model = model; - bts->bsic = bsic; - bts->dtxu = GSM48_DTX_SHALL_NOT_BE_USED; - bts->dtxd = false; - bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ - bts->neigh_list_manual_mode = 0; - - llist_add_tail(&bts->list, &net->bts_list); - - INIT_LLIST_HEAD(&bts->abis_queue); - - INIT_LLIST_HEAD(&bts->loc_list); - - return bts; -} - void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) { raid->mcc = bts->network->country_code; @@ -322,62 +199,6 @@ /* Assume there are only 256 possible bts */ osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); -static void depends_calc_index_bit(int bts_nr, int *idx, int *bit) -{ - *idx = bts_nr / (8 * 4); - *bit = bts_nr % (8 * 4); -} - -void bts_depend_mark(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] |= 1 << bit; -} - -void bts_depend_clear(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] &= ~(1 << bit); -} - -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) -{ - int idx, bit; - depends_calc_index_bit(other->nr, &idx, &bit); - - /* Check if there is a depends bit */ - return (base->depends_on[idx] & (1 << bit)) > 0; -} - -static int bts_is_online(struct gsm_bts *bts) -{ - /* TODO: support E1 BTS too */ - if (!is_ipaccess_bts(bts)) - return 1; - - if (!bts->oml_link) - return 0; - - return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - -int bts_depend_check(struct gsm_bts *bts) -{ - struct gsm_bts *other_bts; - - llist_for_each_entry(other_bts, &bts->network->bts_list, list) { - if (!bts_depend_is_depedency(bts, other_bts)) - continue; - if (bts_is_online(other_bts)) - continue; - return 0; - } - return 1; -} bool classmark_is_r99(struct gsm_classmark *cm) { -- To view, visit https://gerrit.osmocom.org/3962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 15 12:16:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 12:16:06 +0000 Subject: [PATCH] osmo-msc[master]: Remove BTS-specific attributes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3962 to look at the new patch set (#2). Remove BTS-specific attributes Remove *bts_model_* functions as they are only useful to BSC. Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/bss.h D include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M src/libcommon/gsm_data.c M src/osmo-msc/msc_main.c 7 files changed, 2 insertions(+), 338 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/3962/2 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 03896b5..07b2e2f 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -9,8 +9,6 @@ bsc_msc.h \ bsc_msg_filter.h \ bsc_rll.h \ - bss.h \ - bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ common.h \ common_bsc.h \ diff --git a/include/osmocom/msc/bss.h b/include/osmocom/msc/bss.h deleted file mode 100644 index 0904334..0000000 --- a/include/osmocom/msc/bss.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _BSS_H_ -#define _BSS_H_ - -#include - -struct msgb; - -/* start and stop network */ -extern int bsc_network_alloc(mncc_recv_cb_t mncc_recv); -extern int bsc_network_configure(const char *cfg_file); -extern int bsc_shutdown_net(struct gsm_network *net); - -/* register all supported BTS */ -extern int bts_init(void); -extern int bts_model_bs11_init(void); -extern int bts_model_rbs2k_init(void); -extern int bts_model_nanobts_init(void); -extern int bts_model_nokia_site_init(void); -extern int bts_model_sysmobts_init(void); -#endif diff --git a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h deleted file mode 100644 index bc7860b..0000000 --- a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h +++ /dev/null @@ -1,32 +0,0 @@ -/* OML attribute table generator for ipaccess nanobts */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, - struct gsm_bts_trx *trx); diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index c2533a5..4d493cb 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -559,8 +559,6 @@ extern void talloc_ctx_init(void *ctx_root); -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); - enum gsm_bts_type parse_btstype(const char *arg); const char *btstype2str(enum gsm_bts_type type); struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, @@ -568,68 +566,6 @@ extern void *tall_bsc_ctx; extern int ipacc_rtp_direct; - -/* this actaully refers to the IPA transport, not the BTS model */ -static inline int is_ipaccess_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_sysmobts_v2(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_siemens_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_nokia_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_e1_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} enum gsm_auth_policy gsm_auth_policy_parse(const char *arg); const char *gsm_auth_policy_name(enum gsm_auth_policy policy); @@ -639,13 +575,9 @@ enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid); const char *bts_gprs_mode_name(enum bts_gprs_mode mode); -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode); int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); -int gsm_bts_model_register(struct gsm_bts_model *model); struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan); void bsc_subscr_con_free(struct gsm_subscriber_connection *conn); @@ -653,15 +585,11 @@ struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, - enum gsm_bts_type type, - uint8_t bsic); - void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); + struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); int gsm_bts_set_system_infos(struct gsm_bts *bts); @@ -675,12 +603,6 @@ /* control interface handling */ int bsc_base_ctrl_cmds_install(void); int msc_ctrl_cmds_install(struct gsm_network *net); - -/* dependency handling */ -void bts_depend_mark(struct gsm_bts *bts, int dep); -void bts_depend_clear(struct gsm_bts *bts, int dep); -int bts_depend_check(struct gsm_bts *bts); -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); bool classmark_is_r99(struct gsm_classmark *cm); diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 194cacd..63f4d33 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -523,30 +523,6 @@ struct vty; -struct gsm_bts_model { - struct llist_head list; - - enum gsm_bts_type type; - enum gsm_bts_type_variant variant; - const char *name; - - bool started; - int (*start)(struct gsm_network *net); - int (*oml_rcvmsg)(struct msgb *msg); - - void (*e1line_bind_ops)(struct e1inp_line *line); - - void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); - void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); - void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); - - struct tlv_definition nm_att_tlvdef; - - /* features of a given BTS model set via gsm_bts_model_register() locally */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; -}; - /* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility with BTS compiled against earlier version of this header */ enum gsm_bts_features { @@ -690,7 +666,7 @@ /* type of BTS */ enum gsm_bts_type type; enum gsm_bts_type_variant variant; - struct gsm_bts_model *model; + enum gsm_band band; char version[MAX_VERSION_LENGTH]; char sub_model[MAX_VERSION_LENGTH]; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index b8840c3..4ab8a20 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -49,28 +49,6 @@ ts->e1_link.e1_ts_ss = e1_ts_ss; } -static struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - llist_for_each_entry(model, &bts_models, list) { - if (model->type == type) - return model; - } - - return NULL; -} - -int gsm_bts_model_register(struct gsm_bts_model *model) -{ - if (bts_model_find(model->type)) - return -EEXIST; - - tlv_def_patch(&model->nm_att_tlvdef, &abis_nm_att_tlvdef); - llist_add_tail(&model->list, &bts_models); - return 0; -} - const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, @@ -177,107 +155,6 @@ return get_value_string(bts_gprs_mode_names, mode); } -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) -{ - if (mode != BTS_GPRS_NONE && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) { - return 0; - } - if (mode == BTS_GPRS_EGPRS && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) { - return 0; - } - - return 1; -} - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&model->features, feat, 1); -} - -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&model->features, feat); -} - -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - model = bts_model_find(type); - if (!model) - return -EINVAL; - - bts->type = type; - bts->model = model; - - if (model->start && !model->started) { - int ret = model->start(bts->network); - if (ret < 0) - return ret; - - model->started = true; - } - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - /* Set the default OML Stream ID to 0xff */ - bts->oml_tei = 0xff; - bts->c0->nominal_power = 23; - break; - case GSM_BTS_TYPE_RBS2000: - INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups); - INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_UNKNOWN: - case GSM_BTS_TYPE_NOKIA_SITE: - /* Set default BTS reset timer */ - bts->nokia.bts_reset_timer_cnf = 15; - case _NUM_GSM_BTS_TYPE: - break; - } - - return 0; -} - -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, - uint8_t bsic) -{ - struct gsm_bts_model *model = bts_model_find(type); - struct gsm_bts *bts; - - if (!model && type != GSM_BTS_TYPE_UNKNOWN) - return NULL; - - bts = gsm_bts_alloc(net, net->num_bts); - if (!bts) - return NULL; - - net->num_bts++; - - bts->network = net; - bts->type = type; - bts->model = model; - bts->bsic = bsic; - bts->dtxu = GSM48_DTX_SHALL_NOT_BE_USED; - bts->dtxd = false; - bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ - bts->neigh_list_manual_mode = 0; - - llist_add_tail(&bts->list, &net->bts_list); - - INIT_LLIST_HEAD(&bts->abis_queue); - - INIT_LLIST_HEAD(&bts->loc_list); - - return bts; -} - void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) { raid->mcc = bts->network->country_code; @@ -322,62 +199,6 @@ /* Assume there are only 256 possible bts */ osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); -static void depends_calc_index_bit(int bts_nr, int *idx, int *bit) -{ - *idx = bts_nr / (8 * 4); - *bit = bts_nr % (8 * 4); -} - -void bts_depend_mark(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] |= 1 << bit; -} - -void bts_depend_clear(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] &= ~(1 << bit); -} - -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) -{ - int idx, bit; - depends_calc_index_bit(other->nr, &idx, &bit); - - /* Check if there is a depends bit */ - return (base->depends_on[idx] & (1 << bit)) > 0; -} - -static int bts_is_online(struct gsm_bts *bts) -{ - /* TODO: support E1 BTS too */ - if (!is_ipaccess_bts(bts)) - return 1; - - if (!bts->oml_link) - return 0; - - return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - -int bts_depend_check(struct gsm_bts *bts) -{ - struct gsm_bts *other_bts; - - llist_for_each_entry(other_bts, &bts->network->bts_list, list) { - if (!bts_depend_is_depedency(bts, other_bts)) - continue; - if (bts_is_online(other_bts)) - continue; - return 0; - } - return 1; -} bool classmark_is_r99(struct gsm_classmark *cm) { diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 75ba19c..64def78 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 15 12:19:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 12:19:02 +0000 Subject: [PATCH] osmo-msc[master]: Remove unused osmo_bsc_rf.h header Message-ID: Review at https://gerrit.osmocom.org/3963 Remove unused osmo_bsc_rf.h header Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/osmo_bsc_rf.h M src/osmo-msc/msc_main.c 3 files changed, 0 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/63/3963/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 07b2e2f..4099c9e 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -44,7 +44,6 @@ osmo_bsc.h \ osmo_bsc_grace.h \ a_reset.h \ - osmo_bsc_rf.h \ osmo_msc.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/msc/osmo_bsc_rf.h b/include/osmocom/msc/osmo_bsc_rf.h deleted file mode 100644 index a81ebd7..0000000 --- a/include/osmocom/msc/osmo_bsc_rf.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef OSMO_BSC_RF -#define OSMO_BSC_RF - -#include -#include -#include - -enum osmo_bsc_rf_opstate { - OSMO_BSC_RF_OPSTATE_INOPERATIONAL, - OSMO_BSC_RF_OPSTATE_OPERATIONAL, -}; - -enum osmo_bsc_rf_adminstate { - OSMO_BSC_RF_ADMINSTATE_UNLOCKED, - OSMO_BSC_RF_ADMINSTATE_LOCKED, -}; - -enum osmo_bsc_rf_policy { - OSMO_BSC_RF_POLICY_OFF, - OSMO_BSC_RF_POLICY_ON, - OSMO_BSC_RF_POLICY_GRACE, - OSMO_BSC_RF_POLICY_UNKNOWN, -}; - - -struct gsm_network; - -struct osmo_bsc_rf { - /* the value of signal.h */ - int policy; - struct osmo_fd listen; - struct gsm_network *gsm_network; - - const char *last_state_command; - - char *last_rf_lock_ctrl_command; - - /* delay the command */ - char last_request; - struct osmo_timer_list delay_cmd; - - /* verify that RF is up as it should be */ - struct osmo_timer_list rf_check; - - /* some handling for the automatic grace switch */ - struct osmo_timer_list grace_timeout; - - /* auto RF switch-off due lack of MSC connection */ - struct osmo_timer_list auto_off_timer; -}; - -struct osmo_bsc_rf_conn { - struct osmo_wqueue queue; - struct osmo_bsc_rf *rf; -}; - -const char *osmo_bsc_rf_get_opstate_name(enum osmo_bsc_rf_opstate opstate); -const char *osmo_bsc_rf_get_adminstate_name(enum osmo_bsc_rf_adminstate adminstate); -const char *osmo_bsc_rf_get_policy_name(enum osmo_bsc_rf_policy policy); -enum osmo_bsc_rf_opstate osmo_bsc_rf_get_opstate_by_bts(struct gsm_bts *bts); -enum osmo_bsc_rf_adminstate osmo_bsc_rf_get_adminstate_by_bts(struct gsm_bts *bts); -enum osmo_bsc_rf_policy osmo_bsc_rf_get_policy_by_bts(struct gsm_bts *bts); -struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net); -void osmo_bsc_rf_schedule_lock(struct osmo_bsc_rf *rf, char cmd); - -#endif diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 64def78..bbf35b8 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:11:13 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Fri, 15 Sep 2017 13:11:13 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 4: (9 comments) Thanks for the review, all comments/changes will be applied. Let's submit/merge afterwards! >> and let's add a jobs/README that describes how these yml >> files are used to update our jenkins jobs Good idea, will be done. I also would like to move lynxis osmo-nitb.yaml file to jobs/ ? https://gerrit.osmocom.org/#/c/3911/4/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: Line 3: # following default values can be overridden by each repo > by repo you mean the individual projects listed below in this file? (and no Yes, the repositories/projects (line 21 to 185) Line 8: slave_axis: !!python/tuple [linux_amd64_debian8] > wondering about the '!!python/tuple', is that really needed? A normal list I totally agree, it would be less cumbersome without the !!python/tuple, but I didn't manage to move it to the job-template. The JJB example [1] does the same, so I guess it's the way it is. [1] https://docs.openstack.org/infra/jenkins-job-builder/definition.html#variable-references Line 25: > (whitespace) ooops, will be removed. Line 26: # no 'clean state'? > clean state sounds like we want it. If it's missing, let's add it? Sure, the template actually adds it for all jobs, but I simply wanted to point out the difference. Line 38: # no gcc warnings at all? > are you referring to the post-build step of evaluating gcc warnings? AFAICT Yes, it's about the post-build step. Cannot say anything about the value of its output. Line 80: combination_filter: '(BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "oct+trx" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="master") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="femtobts_v2.7") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v2.4") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.0.1pre") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v3.1") || (BTS_MODEL == "sysmo" && FIRMWARE_VERSION=="superfemto_v5.1") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="v2017.01") || (BTS_MODEL == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next")' > does yaml allow breaking long lines like this up into several lines? Would Yes, will try to keep in the 120 char rule. Maybe expression can be shortened by using '!'. Line 119: ./contrib/jenkins-arm.sh > (noting a mix of spaces and tabs, maybe rather avoid that) Good point, would personally like to stay with tabs, but YAML needs blanks afaik, so no tabs it is! Line 246: - branch-compare-type: 'ANT' > ANT? that's the web UI's 'Path' value? Yes, confused me too. :) Jenkins terms: Plain, Path, RegExp jjb terms: PLAIN, ANT, REG_EXP https://docs.openstack.org/infra/jenkins-job-builder/triggers.html Line 261: - shell: 'chmod -R +w *; rm -rf *; git checkout .' > could also be done by the Git SCM plugin "Clean before checkout" Good point, will (try) to put it there. -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:22:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:22:57 +0000 Subject: osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3763/7/src/osmo_gsm_tester/schema.py File src/osmo_gsm_tester/schema.py: Line 85: if val in ('sms', 'gprs', 'voicecall', 'ussd'): (I'd prefer just "voice"... can change later.) -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:25:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:25:19 +0000 Subject: osmo-gsm-tester[master]: Replicate resources based on times attr before combine time In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:25:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:25:39 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 10 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:27:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:27:04 +0000 Subject: osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 8 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:30:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:30:41 +0000 Subject: osmo-gsm-tester[master]: resource: Allow passing keyword args to NoResourceExn In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3954/2/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 213: super().__init__(log.compose_message(messages, named_items)) (rather inherit from log.Error? class NoResourceExn(log.Error): pass ) -- To view, visit https://gerrit.osmocom.org/3954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:34:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:34:37 +0000 Subject: osmo-gsm-tester[master]: nominal_power and max_power_red attrs can now be set per res... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3951/2/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 61: 'bts[].trx_list[].nominal_power': schema.INT, rather UINT or positive integer? (like TIMES, though TIMES is a name that doesn't really match here; maybe rename TIMES too?) -- To view, visit https://gerrit.osmocom.org/3951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:38:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:38:16 +0000 Subject: osmo-gsm-tester[master]: resource: Handle lists correctly in item_matches In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8588d5b788b9f74a9cc84b8bdcb049921788bb48 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:40:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:40:12 +0000 Subject: osmo-gsm-tester[master]: suite_test: Update tests to check new feature fixes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib0b82dc0c2a7f27cd6b2ffc32eed5f1287692ddc Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:40:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 13:40:54 +0000 Subject: osmo-gsm-tester[master]: nominal_power and max_power_red attrs can now be set per res... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3951/2/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 61: 'bts[].trx_list[].nominal_power': schema.INT, > rather UINT or positive integer? (like TIMES, though TIMES is a name that d I think nominal_power can be 0, so UINT. I tried finding a good name for "natural numbers greater than zero" but couldn't find any naming for that group. -- To view, visit https://gerrit.osmocom.org/3951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:41:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:41:04 +0000 Subject: osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:43:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 13:43:14 +0000 Subject: osmo-gsm-tester[master]: nominal_power and max_power_red attrs can now be set per res... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:53:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 13:53:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource: Allow passing keyword args to NoResourceExn In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3954 to look at the new patch set (#3). resource: Allow passing keyword args to NoResourceExn Same code is already being used by log.Error exception. This way we can use: raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) And get: osmo_gsm_tester.resource.NoResourceExn: No free arfcns in any of bands {bands=['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900']} Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 --- M src/osmo_gsm_tester/resource.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/3954/3 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index f1697ea..7e55129 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -208,7 +208,7 @@ return next_msisdn -class NoResourceExn(Exception): +class NoResourceExn(log.Error): pass class Resources(dict): -- To view, visit https://gerrit.osmocom.org/3954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 13:53:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 13:53:15 +0000 Subject: [PATCH] osmo-gsm-tester[master]: nominal_power and max_power_red attrs can now be set per res... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3951 to look at the new patch set (#3). nominal_power and max_power_red attrs can now be set per resource Before this commit, only max_power_red was specified and it could only be used as a defaults and could not be set per object. Together with nominal_power, it can be useful to be able to set them to different values for different objects, as for example different osmo-bts-trx objects can require different values. Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd --- M example/defaults.conf M selftest/suite_test.ok M selftest/suite_test/resources.conf M selftest/template_test.ok M selftest/template_test.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 8 files changed, 43 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/51/3951/3 diff --git a/example/defaults.conf b/example/defaults.conf index 082f159..f6ecedd 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -33,7 +33,8 @@ stream_id: 255 osmobsc_bts_type: sysmobts trx_list: - - max_power_red: 0 + - nominal_power: 23 + max_power_red: 0 arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..049f7b4 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -31,7 +31,7 @@ tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 3) +tst test_suite: Reserving 1 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..001d286 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -28,6 +28,36 @@ trx_list: - hw_addr: 00:02:95:00:41:b3 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.52 + band: GSM-1800 + launch_trx: true + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + arfcn: - arfcn: 512 band: GSM-1800 diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 5af4b6a..5bd32a4 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -54,7 +54,7 @@ trx 0 rf_locked 0 arfcn val_trx_arfcn_trx0 - nominal power 23 + nominal power val_trx_nominal_power_trx0 max_power_red val_trx_max_power_red_trx0 rsl e1 tei 0 timeslot 0 @@ -68,7 +68,7 @@ trx 1 rf_locked 0 arfcn val_trx_arfcn_trx1 - nominal power 23 + nominal power val_trx_nominal_power_trx1 max_power_red val_trx_max_power_red_trx1 rsl e1 tei 0 timeslot 0 @@ -98,7 +98,7 @@ trx 0 rf_locked 0 arfcn val_trx_arfcn_trx0 - nominal power 23 + nominal power val_trx_nominal_power_trx0 max_power_red val_trx_max_power_red_trx0 rsl e1 tei 0 timeslot 0 @@ -112,7 +112,7 @@ trx 1 rf_locked 0 arfcn val_trx_arfcn_trx1 - nominal power 23 + nominal power val_trx_nominal_power_trx1 max_power_red val_trx_max_power_red_trx1 rsl e1 tei 0 timeslot 0 diff --git a/selftest/template_test.py b/selftest/template_test.py index f8c32a5..769df49 100755 --- a/selftest/template_test.py +++ b/selftest/template_test.py @@ -27,9 +27,11 @@ 'stream_id': 'val_bts.stream_id', 'trx_list': ( dict(arfcn='val_trx_arfcn_trx0', + nominal_power='val_trx_nominal_power_trx0', max_power_red='val_trx_max_power_red_trx0', timeslot_list=mock_timeslot_list), dict(arfcn='val_trx_arfcn_trx1', + nominal_power='val_trx_nominal_power_trx1', max_power_red='val_trx_max_power_red_trx1', timeslot_list=mock_timeslot_list), ) diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8f34bdb..7ba6e72 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -58,6 +58,8 @@ 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, + 'bts[].trx_list[].nominal_power': schema.UINT, + 'bts[].trx_list[].max_power_red': schema.UINT, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 57ab8a3..14aa62d 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -61,7 +61,7 @@ trx ${loop.index} rf_locked 0 arfcn ${trx.arfcn} - nominal power 23 + nominal power ${trx.nominal_power} max_power_red ${trx.max_power_red} rsl e1 tei 0 % for ts in trx.timeslot_list: diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index d2927f9..fbafc8e 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -54,7 +54,7 @@ trx ${loop.index} rf_locked 0 arfcn ${trx.arfcn} - nominal power 23 + nominal power ${trx.nominal_power} max_power_red ${trx.max_power_red} rsl e1 tei 0 % for ts in trx.timeslot_list: -- To view, visit https://gerrit.osmocom.org/3951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:11:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 14:11:55 +0000 Subject: osmo-gsm-tester[master]: nominal_power and max_power_red attrs can now be set per res... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:12:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 14:12:37 +0000 Subject: osmo-gsm-tester[master]: resource: Allow passing keyword args to NoResourceExn In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:54:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 14:54:42 +0000 Subject: osmo-msc[master]: Remove unused osmo_bsc_rf.h header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:56:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 14:56:18 +0000 Subject: osmo-msc[master]: Remove BTS-specific attributes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (could not add those two blank lines) -- To view, visit https://gerrit.osmocom.org/3962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:57:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 14:57:12 +0000 Subject: osmo-msc[master]: Remove SI-related code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:58:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 14:58:03 +0000 Subject: osmo-msc[master]: Remove rest_octets.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:58:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 14:58:14 +0000 Subject: [MERGED] osmo-msc[master]: Remove rest_octets.h In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove rest_octets.h ...................................................................... Remove rest_octets.h The MSC should not fiddle with low-level SI details like rest octets anyway. Unfortunately simply removing the header is impossible as it causes massive fallout due to missing includes. Fixed it as well. The only other parameter which required removal is cell_ro_sel_par which is not referenced anywhere in the code anyway. Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/a_iface.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M include/osmocom/msc/msc_ifaces.h D include/osmocom/msc/rest_octets.h M src/libcommon-cs/common_cs.c M src/libcommon/gsm_subscriber_base.c M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/mncc_sock.c M src/libmsc/msc_ifaces.c M src/libmsc/osmo_msc.c M src/libmsc/ussd.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M tests/msc_vlr/msc_vlr_tests.c 18 files changed, 21 insertions(+), 145 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 6e7aa38..03896b5 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -52,7 +52,6 @@ bsc_msc_data.h \ osmux.h \ paging.h \ - rest_octets.h \ rrlp.h \ rs232.h \ rtp_proxy.h \ diff --git a/include/osmocom/msc/a_iface.h b/include/osmocom/msc/a_iface.h index 32003eb..40ad9c8 100644 --- a/include/osmocom/msc/a_iface.h +++ b/include/osmocom/msc/a_iface.h @@ -21,6 +21,7 @@ #pragma once #include +#include /* A struct to keep a context information about the BSCs we are associated with */ struct bsc_context { diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 5d3d5ca..1a3fa01 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -10,12 +10,11 @@ #include #include #include - +#include #include #include #include -#include #include #include diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 5028a26..4f47786 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -17,7 +17,7 @@ #include #include #include - +#include #include #ifndef ROLE_BSC @@ -860,7 +860,6 @@ struct gsm48_rach_control rach_control; uint8_t ncc_permitted; struct gsm48_cell_sel_par cell_sel_par; - struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ struct gsm48_cell_options cell_options; struct gsm48_control_channel_descr chan_desc; struct bitvec neigh_list; diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h index d46dfe9..0592c07 100644 --- a/include/osmocom/msc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -2,6 +2,7 @@ #include #include +#include /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, * i.e. in the direction towards the mobile device (MS aka UE). diff --git a/include/osmocom/msc/rest_octets.h b/include/osmocom/msc/rest_octets.h deleted file mode 100644 index 49857b7..0000000 --- a/include/osmocom/msc/rest_octets.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef _REST_OCTETS_H -#define _REST_OCTETS_H - -#include -#include -#include - -/* generate SI1 rest octets */ -int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); -int rest_octets_si2quater(uint8_t *data, struct gsm_bts *bts); -int rest_octets_si6(uint8_t *data, bool is1800_net); - -struct gsm48_si_selection_params { - uint16_t penalty_time:5, - temp_offs:3, - cell_resel_off:6, - cbq:1, - present:1; -}; - -struct gsm48_si_power_offset { - uint8_t power_offset:2, - present:1; -}; - -struct gsm48_si3_gprs_ind { - uint8_t si13_position:1, - ra_colour:3, - present:1; -}; - -struct gsm48_lsa_params { - uint32_t prio_thr:3, - lsa_offset:3, - mcc:12, - mnc:12; - unsigned int present; -}; - -struct gsm48_si_ro_info { - struct gsm48_si_selection_params selection_params; - struct gsm48_si_power_offset power_offset; - uint8_t si2ter_indicator; - uint8_t early_cm_ctrl; - struct { - uint8_t where:3, - present:1; - } scheduling; - struct gsm48_si3_gprs_ind gprs_ind; - /* SI 3 specific */ - uint8_t si2quater_indicator; - /* SI 4 specific */ - struct gsm48_lsa_params lsa_params; - uint16_t cell_id; - uint8_t break_ind; /* do we have SI7 + SI8 ? */ -}; - - -/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ -int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3); - -/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ -int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); - -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - -/* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ -enum gprs_nmo { - GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ - GPRS_NMO_II = 1, /* all paging on CCCH */ - GPRS_NMO_III = 2, /* no paging coordination */ -}; - -/* TS 04.60 12.24 */ -struct gprs_cell_options { - enum gprs_nmo nmo; - /* T3168: wait for packet uplink assignment message */ - uint32_t t3168; /* in milliseconds */ - /* T3192: wait for release of the TBF after reception of the final block */ - uint32_t t3192; /* in milliseconds */ - uint32_t drx_timer_max;/* in seconds */ - uint32_t bs_cv_max; - uint8_t supports_egprs_11bit_rach; - bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */ - - uint8_t ext_info_present; - struct { - uint8_t egprs_supported; - uint8_t use_egprs_p_ch_req; - uint8_t bep_period; - uint8_t pfc_supported; - uint8_t dtm_supported; - uint8_t bss_paging_coordination; - } ext_info; -}; - -/* TS 04.60 Table 12.9.2 */ -struct gprs_power_ctrl_pars { - uint8_t alpha; - uint8_t t_avg_w; - uint8_t t_avg_t; - uint8_t pc_meas_chan; - uint8_t n_avg_i; -}; - -struct gsm48_si13_info { - struct gprs_cell_options cell_opts; - struct gprs_power_ctrl_pars pwr_ctrl_pars; - uint8_t bcch_change_mark; - uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; -}; - -/* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ -int rest_octets_si13(uint8_t *data, const struct gsm48_si13_info *si13); - -#endif /* _REST_OCTETS_H */ diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 8a28b72..bad8262 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -29,6 +29,7 @@ #include #include #include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c index 58a6ff0..20147a3 100644 --- a/src/libcommon/gsm_subscriber_base.c +++ b/src/libcommon/gsm_subscriber_base.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 3e86494..4892fb8 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -40,6 +40,8 @@ #include #include +#include + /* A pointer to the GSM network we work with. By the current paradigm, * there can only be one gsm_network per MSC. The pointer is set once * when calling a_init() */ diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 3d5755a..922dca9 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,9 @@ #include #include #include +#include + +#include #define IP_V4_ADDR_LEN 4 diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 05c9439..b6b1bc9 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -38,6 +38,7 @@ #include #include #include +#include struct mncc_sock_state { struct gsm_network *net; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index f54426e..1c8e5ef 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "../../bscconfig.h" diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index db24757..f807f2a 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -29,7 +29,7 @@ #include #include #include - +#include #include #include "../../bscconfig.h" diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index e3263d2..7b450a2 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -34,6 +34,7 @@ #include #include #include +#include /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a9aacbd..6094c9c 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include #include "vlr_core.h" #include "vlr_auth_fsm.h" diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 9d9e4c1..41620b9 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index c9223f8..ea7529e 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index d05aa29..a6e0f29 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -33,6 +33,7 @@ #include #include #include +#include #if BUILD_IU #include -- To view, visit https://gerrit.osmocom.org/3957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:58:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 14:58:14 +0000 Subject: [MERGED] osmo-msc[master]: Remove SI-related code In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove SI-related code ...................................................................... Remove SI-related code Get rid of unused data structures and functions related to SI handling. Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e --- M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M src/libcommon/gsm_data.c 3 files changed, 1 insertion(+), 112 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1a3fa01..c2533a5 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -682,9 +682,6 @@ int bts_depend_check(struct gsm_bts *bts); int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts); -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value); - bool classmark_is_r99(struct gsm_classmark *cm); #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 4f47786..194cacd 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -26,13 +26,6 @@ #include -/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: - 4-bit index is used (2#1111 = 10#15) */ -#define SI2Q_MAX_NUM 16 -/* length in bits (for single SI2quater message) */ -#define SI2Q_MAX_LEN 160 -#define SI2Q_MIN_LEN 18 - struct osmo_bsc_data; struct osmo_bsc_sccp_con; @@ -502,11 +495,6 @@ struct gsm_bts_trx_ts ts[TRX_NR_TS]; }; -#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i]) -#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) -#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0]) -#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) - enum gsm_bts_type { GSM_BTS_TYPE_UNKNOWN, GSM_BTS_TYPE_BS11, @@ -744,17 +732,6 @@ struct gsm_abis_mo mo; } site_mgr; - /* bitmask of all SI that are present/valid in si_buf */ - uint32_t si_valid; - /* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */ - uint8_t si2q_index; /* distinguish individual SI2quater messages */ - uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */ - /* buffers where we put the pre-computed SI */ - sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; - /* offsets used while generating SI2quater */ - size_t e_offset; - size_t u_offset; - /* ip.accesss Unit ID's have Site/BTS/TRX layout */ union { struct { @@ -855,30 +832,7 @@ int chan_alloc_reverse; enum neigh_list_manual_mode neigh_list_manual_mode; - /* parameters from which we build SYSTEM INFORMATION */ - struct { - struct gsm48_rach_control rach_control; - uint8_t ncc_permitted; - struct gsm48_cell_sel_par cell_sel_par; - struct gsm48_cell_options cell_options; - struct gsm48_control_channel_descr chan_desc; - struct bitvec neigh_list; - struct bitvec cell_alloc; - struct bitvec si5_neigh_list; - struct osmo_earfcn_si2q si2quater_neigh_list; - size_t uarfcn_length; /* index for uarfcn and scramble lists */ - struct { - /* bitmask large enough for all possible ARFCN's */ - uint8_t neigh_list[1024/8]; - uint8_t cell_alloc[1024/8]; - /* If the user wants a different neighbor list in SI5 than in SI2 */ - uint8_t si5_neigh_list[1024/8]; - uint8_t meas_bw_list[MAX_EARFCN_LIST]; - uint16_t earfcn_list[MAX_EARFCN_LIST]; - uint16_t uarfcn_list[MAX_EARFCN_LIST]; - uint16_t scramble_list[MAX_EARFCN_LIST]; - } data; - } si_common; + bool early_classmark_allowed; /* for testing only: Have an infinitely long radio link timeout */ bool infinite_radio_link_timeout; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index f4f6e5d..b8840c3 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -268,31 +268,6 @@ bts->dtxd = false; bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ bts->neigh_list_manual_mode = 0; - bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ - bts->si_common.cell_sel_par.rxlev_acc_min = 0; - bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; - bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; - bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; - bts->si_common.si2quater_neigh_list.thresh_hi = 0; - osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); - bts->si_common.neigh_list.data = bts->si_common.data.neigh_list; - bts->si_common.neigh_list.data_len = - sizeof(bts->si_common.data.neigh_list); - bts->si_common.si5_neigh_list.data = bts->si_common.data.si5_neigh_list; - bts->si_common.si5_neigh_list.data_len = - sizeof(bts->si_common.data.si5_neigh_list); - bts->si_common.cell_alloc.data = bts->si_common.data.cell_alloc; - bts->si_common.cell_alloc.data_len = - sizeof(bts->si_common.data.cell_alloc); - bts->si_common.rach_control.re = 1; /* no re-establishment */ - bts->si_common.rach_control.tx_integer = 9; /* 12 slots spread - 217/115 slots delay */ - bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */ - bts->si_common.rach_control.t2 = 4; /* no emergency calls */ - bts->si_common.chan_desc.att = 1; /* attachment required */ - bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ - bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ - gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); @@ -402,43 +377,6 @@ return 0; } return 1; -} - -/* get the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) -{ - const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (bts->infinite_radio_link_timeout) - return -1; - else { - /* Encoding as per Table 10.5.21 of TS 04.08 */ - return (cell_options->radio_link_timeout + 1) << 2; - } -} - -/* set the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 Section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) -{ - struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (value < 0) - bts->infinite_radio_link_timeout = true; - else { - bts->infinite_radio_link_timeout = false; - /* Encoding as per Table 10.5.21 of TS 04.08 */ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; - } } bool classmark_is_r99(struct gsm_classmark *cm) -- To view, visit https://gerrit.osmocom.org/3958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:58:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 14:58:14 +0000 Subject: [MERGED] osmo-msc[master]: Remove BTS-specific attributes In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove BTS-specific attributes ...................................................................... Remove BTS-specific attributes Remove *bts_model_* functions as they are only useful to BSC. Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/bss.h D include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M src/libcommon/gsm_data.c M src/osmo-msc/msc_main.c 7 files changed, 2 insertions(+), 338 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 03896b5..07b2e2f 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -9,8 +9,6 @@ bsc_msc.h \ bsc_msg_filter.h \ bsc_rll.h \ - bss.h \ - bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ common.h \ common_bsc.h \ diff --git a/include/osmocom/msc/bss.h b/include/osmocom/msc/bss.h deleted file mode 100644 index 0904334..0000000 --- a/include/osmocom/msc/bss.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _BSS_H_ -#define _BSS_H_ - -#include - -struct msgb; - -/* start and stop network */ -extern int bsc_network_alloc(mncc_recv_cb_t mncc_recv); -extern int bsc_network_configure(const char *cfg_file); -extern int bsc_shutdown_net(struct gsm_network *net); - -/* register all supported BTS */ -extern int bts_init(void); -extern int bts_model_bs11_init(void); -extern int bts_model_rbs2k_init(void); -extern int bts_model_nanobts_init(void); -extern int bts_model_nokia_site_init(void); -extern int bts_model_sysmobts_init(void); -#endif diff --git a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h b/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h deleted file mode 100644 index bc7860b..0000000 --- a/include/osmocom/msc/bts_ipaccess_nanobts_omlattr.h +++ /dev/null @@ -1,32 +0,0 @@ -/* OML attribute table generator for ipaccess nanobts */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include -#include - -struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts); -struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, - struct gsm_bts_trx *trx); diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index c2533a5..4d493cb 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -559,8 +559,6 @@ extern void talloc_ctx_init(void *ctx_root); -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); - enum gsm_bts_type parse_btstype(const char *arg); const char *btstype2str(enum gsm_bts_type type); struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, @@ -568,68 +566,6 @@ extern void *tall_bsc_ctx; extern int ipacc_rtp_direct; - -/* this actaully refers to the IPA transport, not the BTS model */ -static inline int is_ipaccess_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_sysmobts_v2(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_OSMOBTS: - return 1; - default: - break; - } - return 0; -} - -static inline int is_siemens_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_nokia_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} - -static inline int is_e1_bts(struct gsm_bts *bts) -{ - switch (bts->type) { - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - return 1; - default: - break; - } - - return 0; -} enum gsm_auth_policy gsm_auth_policy_parse(const char *arg); const char *gsm_auth_policy_name(enum gsm_auth_policy policy); @@ -639,13 +575,9 @@ enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid); const char *bts_gprs_mode_name(enum bts_gprs_mode mode); -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode); int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); -int gsm_bts_model_register(struct gsm_bts_model *model); struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan); void bsc_subscr_con_free(struct gsm_subscriber_connection *conn); @@ -653,15 +585,11 @@ struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, - enum gsm_bts_type type, - uint8_t bsic); - void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); + struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); int gsm_bts_set_system_infos(struct gsm_bts *bts); @@ -675,12 +603,6 @@ /* control interface handling */ int bsc_base_ctrl_cmds_install(void); int msc_ctrl_cmds_install(struct gsm_network *net); - -/* dependency handling */ -void bts_depend_mark(struct gsm_bts *bts, int dep); -void bts_depend_clear(struct gsm_bts *bts, int dep); -int bts_depend_check(struct gsm_bts *bts); -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); bool classmark_is_r99(struct gsm_classmark *cm); diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 194cacd..63f4d33 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -523,30 +523,6 @@ struct vty; -struct gsm_bts_model { - struct llist_head list; - - enum gsm_bts_type type; - enum gsm_bts_type_variant variant; - const char *name; - - bool started; - int (*start)(struct gsm_network *net); - int (*oml_rcvmsg)(struct msgb *msg); - - void (*e1line_bind_ops)(struct e1inp_line *line); - - void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts); - void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx); - void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts); - - struct tlv_definition nm_att_tlvdef; - - /* features of a given BTS model set via gsm_bts_model_register() locally */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; -}; - /* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility with BTS compiled against earlier version of this header */ enum gsm_bts_features { @@ -690,7 +666,7 @@ /* type of BTS */ enum gsm_bts_type type; enum gsm_bts_type_variant variant; - struct gsm_bts_model *model; + enum gsm_band band; char version[MAX_VERSION_LENGTH]; char sub_model[MAX_VERSION_LENGTH]; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index b8840c3..4ab8a20 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -49,28 +49,6 @@ ts->e1_link.e1_ts_ss = e1_ts_ss; } -static struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - llist_for_each_entry(model, &bts_models, list) { - if (model->type == type) - return model; - } - - return NULL; -} - -int gsm_bts_model_register(struct gsm_bts_model *model) -{ - if (bts_model_find(model->type)) - return -EEXIST; - - tlv_def_patch(&model->nm_att_tlvdef, &abis_nm_att_tlvdef); - llist_add_tail(&model->list, &bts_models); - return 0; -} - const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, @@ -177,107 +155,6 @@ return get_value_string(bts_gprs_mode_names, mode); } -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) -{ - if (mode != BTS_GPRS_NONE && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) { - return 0; - } - if (mode == BTS_GPRS_EGPRS && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) { - return 0; - } - - return 1; -} - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&model->features, feat, 1); -} - -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&model->features, feat); -} - -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - model = bts_model_find(type); - if (!model) - return -EINVAL; - - bts->type = type; - bts->model = model; - - if (model->start && !model->started) { - int ret = model->start(bts->network); - if (ret < 0) - return ret; - - model->started = true; - } - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - /* Set the default OML Stream ID to 0xff */ - bts->oml_tei = 0xff; - bts->c0->nominal_power = 23; - break; - case GSM_BTS_TYPE_RBS2000: - INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups); - INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_UNKNOWN: - case GSM_BTS_TYPE_NOKIA_SITE: - /* Set default BTS reset timer */ - bts->nokia.bts_reset_timer_cnf = 15; - case _NUM_GSM_BTS_TYPE: - break; - } - - return 0; -} - -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, - uint8_t bsic) -{ - struct gsm_bts_model *model = bts_model_find(type); - struct gsm_bts *bts; - - if (!model && type != GSM_BTS_TYPE_UNKNOWN) - return NULL; - - bts = gsm_bts_alloc(net, net->num_bts); - if (!bts) - return NULL; - - net->num_bts++; - - bts->network = net; - bts->type = type; - bts->model = model; - bts->bsic = bsic; - bts->dtxu = GSM48_DTX_SHALL_NOT_BE_USED; - bts->dtxd = false; - bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ - bts->neigh_list_manual_mode = 0; - - llist_add_tail(&bts->list, &net->bts_list); - - INIT_LLIST_HEAD(&bts->abis_queue); - - INIT_LLIST_HEAD(&bts->loc_list); - - return bts; -} - void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) { raid->mcc = bts->network->country_code; @@ -322,62 +199,6 @@ /* Assume there are only 256 possible bts */ osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); -static void depends_calc_index_bit(int bts_nr, int *idx, int *bit) -{ - *idx = bts_nr / (8 * 4); - *bit = bts_nr % (8 * 4); -} - -void bts_depend_mark(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] |= 1 << bit; -} - -void bts_depend_clear(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] &= ~(1 << bit); -} - -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) -{ - int idx, bit; - depends_calc_index_bit(other->nr, &idx, &bit); - - /* Check if there is a depends bit */ - return (base->depends_on[idx] & (1 << bit)) > 0; -} - -static int bts_is_online(struct gsm_bts *bts) -{ - /* TODO: support E1 BTS too */ - if (!is_ipaccess_bts(bts)) - return 1; - - if (!bts->oml_link) - return 0; - - return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - -int bts_depend_check(struct gsm_bts *bts) -{ - struct gsm_bts *other_bts; - - llist_for_each_entry(other_bts, &bts->network->bts_list, list) { - if (!bts_depend_is_depedency(bts, other_bts)) - continue; - if (bts_is_online(other_bts)) - continue; - return 0; - } - return 1; -} bool classmark_is_r99(struct gsm_classmark *cm) { diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 75ba19c..64def78 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 14:58:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 14:58:29 +0000 Subject: [MERGED] osmo-msc[master]: Remove unused osmo_bsc_rf.h header In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove unused osmo_bsc_rf.h header ...................................................................... Remove unused osmo_bsc_rf.h header Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/osmo_bsc_rf.h M src/osmo-msc/msc_main.c 3 files changed, 0 insertions(+), 68 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 07b2e2f..4099c9e 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -44,7 +44,6 @@ osmo_bsc.h \ osmo_bsc_grace.h \ a_reset.h \ - osmo_bsc_rf.h \ osmo_msc.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ diff --git a/include/osmocom/msc/osmo_bsc_rf.h b/include/osmocom/msc/osmo_bsc_rf.h deleted file mode 100644 index a81ebd7..0000000 --- a/include/osmocom/msc/osmo_bsc_rf.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef OSMO_BSC_RF -#define OSMO_BSC_RF - -#include -#include -#include - -enum osmo_bsc_rf_opstate { - OSMO_BSC_RF_OPSTATE_INOPERATIONAL, - OSMO_BSC_RF_OPSTATE_OPERATIONAL, -}; - -enum osmo_bsc_rf_adminstate { - OSMO_BSC_RF_ADMINSTATE_UNLOCKED, - OSMO_BSC_RF_ADMINSTATE_LOCKED, -}; - -enum osmo_bsc_rf_policy { - OSMO_BSC_RF_POLICY_OFF, - OSMO_BSC_RF_POLICY_ON, - OSMO_BSC_RF_POLICY_GRACE, - OSMO_BSC_RF_POLICY_UNKNOWN, -}; - - -struct gsm_network; - -struct osmo_bsc_rf { - /* the value of signal.h */ - int policy; - struct osmo_fd listen; - struct gsm_network *gsm_network; - - const char *last_state_command; - - char *last_rf_lock_ctrl_command; - - /* delay the command */ - char last_request; - struct osmo_timer_list delay_cmd; - - /* verify that RF is up as it should be */ - struct osmo_timer_list rf_check; - - /* some handling for the automatic grace switch */ - struct osmo_timer_list grace_timeout; - - /* auto RF switch-off due lack of MSC connection */ - struct osmo_timer_list auto_off_timer; -}; - -struct osmo_bsc_rf_conn { - struct osmo_wqueue queue; - struct osmo_bsc_rf *rf; -}; - -const char *osmo_bsc_rf_get_opstate_name(enum osmo_bsc_rf_opstate opstate); -const char *osmo_bsc_rf_get_adminstate_name(enum osmo_bsc_rf_adminstate adminstate); -const char *osmo_bsc_rf_get_policy_name(enum osmo_bsc_rf_policy policy); -enum osmo_bsc_rf_opstate osmo_bsc_rf_get_opstate_by_bts(struct gsm_bts *bts); -enum osmo_bsc_rf_adminstate osmo_bsc_rf_get_adminstate_by_bts(struct gsm_bts *bts); -enum osmo_bsc_rf_policy osmo_bsc_rf_get_policy_by_bts(struct gsm_bts *bts); -struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net); -void osmo_bsc_rf_schedule_lock(struct osmo_bsc_rf *rf, char cmd); - -#endif diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 64def78..bbf35b8 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 15:00:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 15:00:38 +0000 Subject: osmo-ggsn[master]: Fix leftovers after rename In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I934f897002215d7d4e610cbd312383181bbe97c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 15:00:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 15:00:53 +0000 Subject: osmo-ggsn[master]: Move PDP logging macro to header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 15:01:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 15:01:05 +0000 Subject: osmo-sgsn[master]: Remove rest_octets.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic34f7d3e8f813e020d43be312df940c933bc52b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 15:01:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 15:01:44 +0000 Subject: [MERGED] osmo-ggsn[master]: Fix leftovers after rename In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix leftovers after rename ...................................................................... Fix leftovers after rename * Use proper name in jenkins test * Fix naming in systemd service * Fix git-review config Change-Id: I934f897002215d7d4e610cbd312383181bbe97c9 --- M .gitreview M contrib/jenkins.sh R contrib/osmo-ggsn.service 3 files changed, 4 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitreview b/.gitreview index cc02ff2..98937c1 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openggsn +project=osmo-ggsn diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f319acb..3bfb3f5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -28,7 +28,7 @@ echo echo echo -echo " =============================== openggsn ===============================" +echo " =============================== OsmoGGSN ===============================" echo set -x diff --git a/contrib/openggsn.service b/contrib/osmo-ggsn.service similarity index 64% rename from contrib/openggsn.service rename to contrib/osmo-ggsn.service index a34f374..a8d123a 100644 --- a/contrib/openggsn.service +++ b/contrib/osmo-ggsn.service @@ -1,11 +1,11 @@ [Unit] -Description=OpenGGSN +Description=OsmoGGSN After=networking.service [Service] Type=simple Restart=always -ExecStart=/usr/bin/ggsn -c /etc/ggsn.conf -f +ExecStart=/usr/bin/osmo-ggsn -c /etc/osmocom/osmo-ggsn.conf -f RestartSec=2 RestartPreventExitStatus=1 -- To view, visit https://gerrit.osmocom.org/3960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I934f897002215d7d4e610cbd312383181bbe97c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Sep 15 15:02:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 15:02:10 +0000 Subject: [MERGED] osmo-sgsn[master]: Remove rest_octets.h In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove rest_octets.h ...................................................................... Remove rest_octets.h This header is unused anyway. Change-Id: Ic34f7d3e8f813e020d43be312df940c933bc52b7 --- M debian/copyright M include/osmocom/sgsn/Makefile.am D include/osmocom/sgsn/rest_octets.h 3 files changed, 0 insertions(+), 141 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/copyright b/debian/copyright index 1f7f6fd..ad911c0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -89,7 +89,6 @@ include/osmocom/sgsn/gprs_sgsn.h include/osmocom/sgsn/gprs_sndcp.h include/osmocom/sgsn/gprs_subscriber.h - include/osmocom/sgsn/rest_octets.h include/osmocom/sgsn/sgsn.h include/osmocom/sgsn/vty.h m4/README diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 1502129..3f63b9f 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -18,7 +18,6 @@ gsup_client.h \ gtphub.h \ oap_client.h \ - rest_octets.h \ sgsn.h \ signal.h \ slhc.h \ diff --git a/include/osmocom/sgsn/rest_octets.h b/include/osmocom/sgsn/rest_octets.h deleted file mode 100644 index 0dbe7ae..0000000 --- a/include/osmocom/sgsn/rest_octets.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef _REST_OCTETS_H -#define _REST_OCTETS_H - -#include -#include -#include - -/* generate SI1 rest octets */ -int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); -int rest_octets_si2quater(uint8_t *data, struct gsm_bts *bts); -int rest_octets_si6(uint8_t *data, bool is1800_net); - -struct gsm48_si_selection_params { - uint16_t penalty_time:5, - temp_offs:3, - cell_resel_off:6, - cbq:1, - present:1; -}; - -struct gsm48_si_power_offset { - uint8_t power_offset:2, - present:1; -}; - -struct gsm48_si3_gprs_ind { - uint8_t si13_position:1, - ra_colour:3, - present:1; -}; - -struct gsm48_lsa_params { - uint32_t prio_thr:3, - lsa_offset:3, - mcc:12, - mnc:12; - unsigned int present; -}; - -struct gsm48_si_ro_info { - struct gsm48_si_selection_params selection_params; - struct gsm48_si_power_offset power_offset; - uint8_t si2ter_indicator; - uint8_t early_cm_ctrl; - struct { - uint8_t where:3, - present:1; - } scheduling; - struct gsm48_si3_gprs_ind gprs_ind; - /* SI 3 specific */ - uint8_t si2quater_indicator; - /* SI 4 specific */ - struct gsm48_lsa_params lsa_params; - uint16_t cell_id; - uint8_t break_ind; /* do we have SI7 + SI8 ? */ -}; - - -/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ -int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3); - -/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ -int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); - -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - -/* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ -enum gprs_nmo { - GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ - GPRS_NMO_II = 1, /* all paging on CCCH */ - GPRS_NMO_III = 2, /* no paging coordination */ -}; - -/* TS 04.60 12.24 */ -struct gprs_cell_options { - enum gprs_nmo nmo; - /* T3168: wait for packet uplink assignment message */ - uint32_t t3168; /* in milliseconds */ - /* T3192: wait for release of the TBF after reception of the final block */ - uint32_t t3192; /* in milliseconds */ - uint32_t drx_timer_max;/* in seconds */ - uint32_t bs_cv_max; - uint8_t supports_egprs_11bit_rach; - bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */ - - uint8_t ext_info_present; - struct { - uint8_t egprs_supported; - uint8_t use_egprs_p_ch_req; - uint8_t bep_period; - uint8_t pfc_supported; - uint8_t dtm_supported; - uint8_t bss_paging_coordination; - } ext_info; -}; - -/* TS 04.60 Table 12.9.2 */ -struct gprs_power_ctrl_pars { - uint8_t alpha; - uint8_t t_avg_w; - uint8_t t_avg_t; - uint8_t pc_meas_chan; - uint8_t n_avg_i; -}; - -struct gsm48_si13_info { - struct gprs_cell_options cell_opts; - struct gprs_power_ctrl_pars pwr_ctrl_pars; - uint8_t bcch_change_mark; - uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; -}; - -/* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ -int rest_octets_si13(uint8_t *data, const struct gsm48_si13_info *si13); - -#endif /* _REST_OCTETS_H */ -- To view, visit https://gerrit.osmocom.org/3959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic34f7d3e8f813e020d43be312df940c933bc52b7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 15 15:03:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 15 Sep 2017 15:03:23 +0000 Subject: libosmocore[master]: Make release helper more robust In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ide04d4c1ba20426bdf9531e25b462eda9418858a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 15 15:04:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 15 Sep 2017 15:04:21 +0000 Subject: [MERGED] libosmocore[master]: Make release helper more robust In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Make release helper more robust ...................................................................... Make release helper more robust * check for bumpversion and error out if missing * drop bumpversion dependency from .deb Change-Id: Ide04d4c1ba20426bdf9531e25b462eda9418858a Related: OS#1861 --- M debian/control M osmo-release.mk 2 files changed, 5 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index e266173..b19448e 100644 --- a/debian/control +++ b/debian/control @@ -281,7 +281,6 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, - bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk index 03eb3cb..40eb121 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,6 +2,7 @@ REL := patch endif +BUMPVER := $(shell bumpversion) NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) @@ -9,6 +10,10 @@ release: +ifeq ($(BUMPVER),) + @$(error Unable to find 'bumpversion' command.) +endif + ifeq ($(NEW_VER),) @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) endif -- To view, visit https://gerrit.osmocom.org/3817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ide04d4c1ba20426bdf9531e25b462eda9418858a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Sep 15 18:24:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 18:24:39 +0000 Subject: [PATCH] libsmpp34[master]: smpp34_dumpBuf.c: remove unused variable Message-ID: Review at https://gerrit.osmocom.org/3964 smpp34_dumpBuf.c: remove unused variable Fixes compilation warning below: smpp34_dumpBuf.c:52:9: warning: variable ?lefterror? set but not used [-Wunused-but-set-variable] int lefterror = 0; Change-Id: Iea8ff80d3e4d16aaca6e37d64593b50fa27c8cfb --- M src/smpp34_dumpBuf.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/64/3964/1 diff --git a/src/smpp34_dumpBuf.c b/src/smpp34_dumpBuf.c index 77dfdba..dd0bad4 100644 --- a/src/smpp34_dumpBuf.c +++ b/src/smpp34_dumpBuf.c @@ -49,14 +49,12 @@ int size; uint8_t ind = 3; uint8_t *buffer = NULL; - int lefterror = 0; size = srcL; buffer = src; memset(smpp34_strerror, 0, sizeof(smpp34_strerror)); ptrerror = smpp34_strerror; - lefterror = sizeof(smpp34_strerror); /* dump buffer character by character until size is reached */ for(i = 0; i < size; i++){ -- To view, visit https://gerrit.osmocom.org/3964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea8ff80d3e4d16aaca6e37d64593b50fa27c8cfb Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 15 18:24:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 18:24:40 +0000 Subject: [PATCH] libsmpp34[master]: smpp34_structs.h: Fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/3965 smpp34_structs.h: Fix trailing whitespace Change-Id: I5838e216fe16b4789bb1a0ce40ce496f46a3c328 --- M src/smpp34_structs.h 1 file changed, 39 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/65/3965/1 diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index 025109d..6b9f41e 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -5,19 +5,19 @@ * * This file is part of libsmpp34 (c-open-smpp3.4 library). * - * The libsmpp34 library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of the + * The libsmpp34 library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the * License, or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _STB_H_ @@ -37,35 +37,35 @@ extern char smpp34_strerror[2048]; /* Define structures **********************************************************/ -typedef struct tlv_t tlv_t; -typedef struct dad_t dad_t; -typedef struct udad_t udad_t; -typedef struct bind_transmitter_t bind_transmitter_t; -typedef struct bind_transmitter_resp_t bind_transmitter_resp_t; -typedef struct bind_receiver_t bind_receiver_t; -typedef struct bind_receiver_resp_t bind_receiver_resp_t; -typedef struct bind_transceiver_t bind_transceiver_t; -typedef struct bind_transceiver_resp_t bind_transceiver_resp_t; -typedef struct outbind_t outbind_t; -typedef struct unbind_t unbind_t; -typedef struct unbind_resp_t unbind_resp_t; -typedef struct generic_nack_t generic_nack_t; -typedef struct submit_sm_t submit_sm_t; -typedef struct submit_sm_resp_t submit_sm_resp_t; -typedef struct submit_multi_t submit_multi_t; -typedef struct submit_multi_resp_t submit_multi_resp_t; -typedef struct deliver_sm_t deliver_sm_t; -typedef struct deliver_sm_resp_t deliver_sm_resp_t; -typedef struct data_sm_t data_sm_t; -typedef struct data_sm_resp_t data_sm_resp_t; -typedef struct query_sm_t query_sm_t; -typedef struct query_sm_resp_t query_sm_resp_t; -typedef struct cancel_sm_t cancel_sm_t; -typedef struct cancel_sm_resp_t cancel_sm_resp_t; -typedef struct replace_sm_t replace_sm_t; -typedef struct replace_sm_resp_t replace_sm_resp_t; -typedef struct enquire_link_t enquire_link_t; -typedef struct alert_notification_t alert_notification_t; +typedef struct tlv_t tlv_t; +typedef struct dad_t dad_t; +typedef struct udad_t udad_t; +typedef struct bind_transmitter_t bind_transmitter_t; +typedef struct bind_transmitter_resp_t bind_transmitter_resp_t; +typedef struct bind_receiver_t bind_receiver_t; +typedef struct bind_receiver_resp_t bind_receiver_resp_t; +typedef struct bind_transceiver_t bind_transceiver_t; +typedef struct bind_transceiver_resp_t bind_transceiver_resp_t; +typedef struct outbind_t outbind_t; +typedef struct unbind_t unbind_t; +typedef struct unbind_resp_t unbind_resp_t; +typedef struct generic_nack_t generic_nack_t; +typedef struct submit_sm_t submit_sm_t; +typedef struct submit_sm_resp_t submit_sm_resp_t; +typedef struct submit_multi_t submit_multi_t; +typedef struct submit_multi_resp_t submit_multi_resp_t; +typedef struct deliver_sm_t deliver_sm_t; +typedef struct deliver_sm_resp_t deliver_sm_resp_t; +typedef struct data_sm_t data_sm_t; +typedef struct data_sm_resp_t data_sm_resp_t; +typedef struct query_sm_t query_sm_t; +typedef struct query_sm_resp_t query_sm_resp_t; +typedef struct cancel_sm_t cancel_sm_t; +typedef struct cancel_sm_resp_t cancel_sm_resp_t; +typedef struct replace_sm_t replace_sm_t; +typedef struct replace_sm_resp_t replace_sm_resp_t; +typedef struct enquire_link_t enquire_link_t; +typedef struct alert_notification_t alert_notification_t; /* TYPEDEFs structs ***********************************************************/ #define instancia 0 @@ -232,7 +232,7 @@ #include "def_frame/header.frame" }; -typedef struct enquire_link_resp_t enquire_link_resp_t; +typedef struct enquire_link_resp_t enquire_link_resp_t; struct enquire_link_resp_t { #include "def_frame/header.frame" }; -- To view, visit https://gerrit.osmocom.org/3965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5838e216fe16b4789bb1a0ce40ce496f46a3c328 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 15 18:24:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 18:24:40 +0000 Subject: [PATCH] libsmpp34[master]: smpp34_structs.h: Fix truncated output in str_tlv_id Message-ID: Review at https://gerrit.osmocom.org/3966 smpp34_structs.h: Fix truncated output in str_tlv_id Fixes compilation warning below: %s? directive output may be truncated writing between 8 and 33 bytes into a regio n of size 30 [-Wformat-truncation=] snprintf(buff, SMALL_BUFF, "%s", ^~ /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_params.c:136:5: note: ? snprintf? output between 9 and 34 bytes into a destination of size 30 snprintf(buff, SMALL_BUFF, "%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #define OPERACION( p_tlv_id ) (tlv_id == p_tlv_id)?#p_tlv_id: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include "def_list/tlv_id.list" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Reserved" ~~~~~~~~~~ #undef OPERACION ~~~~~~~~~~~~~~~~ ); Change-Id: Ie2ba6182eb0cdd98cadb8317aef49141244aa92d --- M src/smpp34_structs.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/66/3966/1 diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index 6b9f41e..71d22cd 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -23,7 +23,7 @@ #ifndef _STB_H_ #define _STB_H_ -#define SMALL_BUFF 30 +#define SMALL_BUFF 34 /* Identify PDUs ident ********************************************************/ #define MAX_TLV_SIZE 1024 #define MAX_DAD_SIZE 21 -- To view, visit https://gerrit.osmocom.org/3966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2ba6182eb0cdd98cadb8317aef49141244aa92d Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 15 18:24:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 18:24:40 +0000 Subject: [PATCH] libsmpp34[master]: smpp34_unpack.c: remove unused variable Message-ID: Review at https://gerrit.osmocom.org/3967 smpp34_unpack.c: remove unused variable Fixes compilation warning below: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c: In function ?smpp34_unpack?: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c:232:18: warning: variable ?l? set but not used [ -Wunused-but-set-variable] uint32_t l; Change-Id: I75baa65b575deec1cc040490f2e76ebb54e46ca7 --- M src/smpp34_unpack.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/67/3967/1 diff --git a/src/smpp34_unpack.c b/src/smpp34_unpack.c index f498d01..3d8b0f8 100644 --- a/src/smpp34_unpack.c +++ b/src/smpp34_unpack.c @@ -229,9 +229,7 @@ { /* Hace algunas Verificaciones **************************************/ uint32_t len_orig; - uint32_t l; memcpy(&len_orig, tt, sizeof(uint32_t)); - l = ntohl( len_orig ); if( len_orig != (aux - ini) ){ PUTLOG("[%s:(Error in PDU length %d!=%d)]",PDU,len_orig,(uint32_t)(aux-ini)); return( -1 ); -- To view, visit https://gerrit.osmocom.org/3967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75baa65b575deec1cc040490f2e76ebb54e46ca7 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 15 18:24:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 18:24:40 +0000 Subject: [PATCH] libsmpp34[master]: bind_receiver_resp_test.c: Fix compilation warning Message-ID: Review at https://gerrit.osmocom.org/3968 bind_receiver_resp_test.c: Fix compilation warning /home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c: In function ?main?: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c:55:58: warning: ?snprintf? output truncated before the last format character [-Wformat-truncation=] snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456"); ^ /home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c:55:5: note: ?snprintf? output 17 bytes into a destination of size 16 snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456"); Change-Id: I4ec682a5e2ee4d02008a9c86a0a5507792667d0e --- M test_pdu/bind_receiver_resp_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/68/3968/1 diff --git a/test_pdu/bind_receiver_resp_test.c b/test_pdu/bind_receiver_resp_test.c index 610effd..e1817e8 100644 --- a/test_pdu/bind_receiver_resp_test.c +++ b/test_pdu/bind_receiver_resp_test.c @@ -52,7 +52,7 @@ b.command_id = BIND_RECEIVER_RESP; b.command_status = ESME_ROK; b.sequence_number = 1; - snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456"); + snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "123456789012345"); tlv.tag = TLVID_sc_interface_version; tlv.length = sizeof(uint8_t); -- To view, visit https://gerrit.osmocom.org/3968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ec682a5e2ee4d02008a9c86a0a5507792667d0e Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 15 18:24:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 15 Sep 2017 18:24:41 +0000 Subject: [PATCH] libsmpp34[master]: Fix Out of bounds compilation warning in OCTET8 Message-ID: Review at https://gerrit.osmocom.org/3969 Fix Out of bounds compilation warning in OCTET8 The code in OCTET8 implementation assumes the len is placed inside the byte preceding the memory buffer, which is true for the defined cases. However, it creates a compilation warning. Better pass the value directly from the struct field rather than playing addr games. this way we also assert we require to explicitly pass the len. Fixes lots of warning like the one below: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c: In function ?smpp34_u npack?: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c:147:14: warning: array subscript is above array bounds [-Warray-bounds] lenval = *((inst par) - 1);\ ^~~~~~~~~~~~~~~~~ /home/pespin/dev/sysmocom/bin/../git/libsmpp34/def_frame/submit_sm.frame:18:2: note: in e xpansion of macro ?OCTET8? OCTET8( instancia, short_message, 254 ); ^~~~~~ Change-Id: Id110f4e977c3becdb44cf5492c372e530ea51551 --- M def_frame/deliver_sm.frame M def_frame/replace_sm.frame M def_frame/submit_multi.frame M def_frame/submit_sm.frame M src/smpp34_dumpPdu.c M src/smpp34_pack.c M src/smpp34_structs.h M src/smpp34_unpack.c 8 files changed, 8 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/69/3969/1 diff --git a/def_frame/deliver_sm.frame b/def_frame/deliver_sm.frame index 2306f19..6cbd90d 100644 --- a/def_frame/deliver_sm.frame +++ b/def_frame/deliver_sm.frame @@ -15,5 +15,5 @@ U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_deliver_sm ); diff --git a/def_frame/replace_sm.frame b/def_frame/replace_sm.frame index a35187d..641207e 100644 --- a/def_frame/replace_sm.frame +++ b/def_frame/replace_sm.frame @@ -7,4 +7,4 @@ U08( instancia, registered_delivery, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); diff --git a/def_frame/submit_multi.frame b/def_frame/submit_multi.frame index 0c5fb31..e58fd36 100644 --- a/def_frame/submit_multi.frame +++ b/def_frame/submit_multi.frame @@ -14,5 +14,5 @@ U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_submit_multi ); diff --git a/def_frame/submit_sm.frame b/def_frame/submit_sm.frame index 0a54421..bf8e560 100644 --- a/def_frame/submit_sm.frame +++ b/def_frame/submit_sm.frame @@ -15,5 +15,5 @@ U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_submit_sm ); diff --git a/src/smpp34_dumpPdu.c b/src/smpp34_dumpPdu.c index 89d6e53..688f4ea 100644 --- a/src/smpp34_dumpPdu.c +++ b/src/smpp34_dumpPdu.c @@ -136,11 +136,10 @@ _op(inst, par, size )\ } -#define OCTET8( inst, par, size ){\ +#define OCTET8( inst, par, size, lenval ){\ int i = 0;\ uint8_t *p = l_dest;\ int dummy = 0;\ - lenval = *((inst par) - 1);\ if( (lenval + 33) >= left ){\ PUTLOG("[%s:%s(%s)]", par, inst par, \ "Value length exceed buffer length");\ diff --git a/src/smpp34_pack.c b/src/smpp34_pack.c index b36e7a4..ef1c599 100644 --- a/src/smpp34_pack.c +++ b/src/smpp34_pack.c @@ -139,8 +139,7 @@ }\ }; -#define OCTET8( inst, par, sizeval ){\ - lenval = *((inst par) - 1);\ +#define OCTET8( inst, par, sizeval, lenval ){\ if( lenval >= left ){\ PUTLOG("[leng %s:%d(%s)]", par, lenval,\ "Value length exceed buffer length");\ diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index 71d22cd..7c83df8 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -75,7 +75,7 @@ #define O_C_OCTET( inst, par, size ) uint8_t par[ size ]; #define C_OCTET( inst, par, size ) uint8_t par[ size ]; -#define OCTET8( inst, par, size ) uint8_t par[ size ]; +#define OCTET8( inst, par, size, lenval ) uint8_t par[ size ]; #define OCTET16( inst, par, size ) uint8_t par[ size ]; #define TLV( inst, par, do_tlv ) tlv_t *par; diff --git a/src/smpp34_unpack.c b/src/smpp34_unpack.c index 3d8b0f8..749a037 100644 --- a/src/smpp34_unpack.c +++ b/src/smpp34_unpack.c @@ -143,8 +143,7 @@ };\ } -#define OCTET8( inst, par, size ){\ - lenval = *((inst par) - 1);\ +#define OCTET8( inst, par, size, lenval ){\ if( lenval > left ){\ PUTLOG("[leng %s:%d(%s)]", par, lenval,\ "Value length exceed buffer length");\ -- To view, visit https://gerrit.osmocom.org/3969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id110f4e977c3becdb44cf5492c372e530ea51551 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Sep 16 00:12:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 16 Sep 2017 00:12:35 +0000 Subject: libsmpp34[master]: Fix Out of bounds compilation warning in OCTET8 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id110f4e977c3becdb44cf5492c372e530ea51551 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 00:13:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 16 Sep 2017 00:13:05 +0000 Subject: libsmpp34[master]: bind_receiver_resp_test.c: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4ec682a5e2ee4d02008a9c86a0a5507792667d0e Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 00:13:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 16 Sep 2017 00:13:35 +0000 Subject: libsmpp34[master]: smpp34_unpack.c: remove unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75baa65b575deec1cc040490f2e76ebb54e46ca7 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 00:13:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 16 Sep 2017 00:13:50 +0000 Subject: libsmpp34[master]: smpp34_structs.h: Fix truncated output in str_tlv_id In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie2ba6182eb0cdd98cadb8317aef49141244aa92d Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 00:14:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 16 Sep 2017 00:14:08 +0000 Subject: libsmpp34[master]: smpp34_structs.h: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5838e216fe16b4789bb1a0ce40ce496f46a3c328 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 00:14:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 16 Sep 2017 00:14:20 +0000 Subject: libsmpp34[master]: smpp34_dumpBuf.c: remove unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iea8ff80d3e4d16aaca6e37d64593b50fa27c8cfb Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 00:14:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 16 Sep 2017 00:14:50 +0000 Subject: osmo-msc[master]: a_iface: remove obsolete include In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic6d32769819ecfcb585c61360d3df97824a2ef03 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:34 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resource: Handle lists correctly in item_matches In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: resource: Handle lists correctly in item_matches ...................................................................... resource: Handle lists correctly in item_matches We want to handle lists in the same way as we handle them in combine(). Without this commit, reserve()->find() failed to match objects containing dictionaries inside lists correctly (such as trx configs). A few attributes are added to trx_list of some resources in suite_test/resources.conf to show a case in which resource reservation would fail without this patch. It failed because before this patch, dictionaries inside lists are compared to be equal instead of being compared element by element to see if one dictionary is a subset of the other one (for each element in the lists). Change-Id: I8588d5b788b9f74a9cc84b8bdcb049921788bb48 --- M selftest/resource_test.ok M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test/resources.conf M src/osmo_gsm_tester/resource.py 5 files changed, 57 insertions(+), 9 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index d366cf9..416e477 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -243,3 +243,9 @@ ~~~ end: currently reserved +- item_matches: +1st subset matches correctly, pass +2nd subset matches correctly, pass +3rd subset should not match, pass +3rd subset should not match, pass +4th subset should not match, pass diff --git a/selftest/resource_test.py b/selftest/resource_test.py index d72eb72..ca723af 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -94,4 +94,27 @@ print(f.read()) print('~~~ end: currently reserved\n') +print('- item_matches:') +superset = { 'hello': 'world', 'foo': 'bar', 'ordered_list': [{'xkey': 'xvalue'},{'ykey': 'yvalue'}], 'unordered_list_set': [1, 2, 3]} + +subset = { 'foo': 'bar', 'ordered_list': [{'xkey': 'xvalue'},{'ykey': 'yvalue'}], 'unordered_list_set': [2, 1] } +if resource.item_matches(superset, subset): + print('1st subset matches correctly, pass') + +subset = { 'ordered_list': [{},{'ykey': 'yvalue'}], 'unordered_list_set': [] } +if resource.item_matches(superset, subset): + print('2nd subset matches correctly, pass') + +subset = { 'ordered_list': [{'ykey': 'yvalue'}, {'xkey': 'xvalue'}] } +if not resource.item_matches(superset, subset): + print('3rd subset should not match, pass') + +subset = { 'ordered_list': [{'xkey': 'xvalue'}, {'ykey': 'yvalue'}, {'zkey': 'zvalue'}] } +if not resource.item_matches(superset, subset): + print('3rd subset should not match, pass') + +subset = { 'unordered_list_set': [4] } +if not resource.item_matches(superset, subset): + print('4th subset should not match, pass') + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 365fcaa..9c73588 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -240,24 +240,27 @@ tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] -tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e +tst test_suite: DBG: Picked - _hash: 89e45aaea42027162cc33f4389f055077338c82b addr: 10.42.42.52 band: GSM-1800 ipa_unit_id: '6' label: Ettus B200 launch_trx: 'True' trx_list: - - nominal_power: '10' + - max_power_red: '2' + nominal_power: '10' - nominal_power: '12' type: osmo-bts-trx -- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc +- _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 addr: 10.42.42.53 band: GSM-1800 ipa_unit_id: '7' label: sysmoCell 5000 trx_list: - - nominal_power: '10' - - nominal_power: '12' + - max_power_red: '3' + nominal_power: '10' + - max_power_red: '0' + nominal_power: '12' trx_remote_ip: 10.42.42.112 type: osmo-bts-trx - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 001d286..440e55c 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -36,6 +36,7 @@ launch_trx: true trx_list: - nominal_power: 10 + max_power_red: 2 - nominal_power: 12 - label: sysmoCell 5000 @@ -46,7 +47,9 @@ trx_remote_ip: 10.42.42.112 trx_list: - nominal_power: 10 + max_power_red: 3 - nominal_power: 12 + max_power_red: 0 - label: sysmoCell 5000 type: osmo-bts-trx @@ -57,6 +60,7 @@ trx_list: - nominal_power: 10 - nominal_power: 12 + max_power_red: 1 arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8206767..150e28b 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -431,10 +431,22 @@ if is_list(wanted_item): if not is_list(item): return False - # multiple possible values - for val in wanted_item: - if val not in item: - return False + # Validate that all elements in both lists are of the same type: + t = util.list_validate_same_elem_type(wanted_item + item) + if t is None: + return True # both lists are empty, return + # For lists of complex objects, we expect them to be sorted lists: + if t in (dict, list, tuple): + for i in range(max(len(wanted_item), len(item))): + log.ctx(idx=i) + subitem = item[i] if i < len(item) else util.empty_instance_type(t) + wanted_subitem = wanted_item[i] if i < len(wanted_item) else util.empty_instance_type(t) + if not item_matches(subitem, wanted_subitem, ignore_keys=ignore_keys): + return False + else: # for lists of basic elements, we handle them as unsorted sets: + for val in wanted_item: + if val not in item: + return False return True return item == wanted_item -- To view, visit https://gerrit.osmocom.org/3952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8588d5b788b9f74a9cc84b8bdcb049921788bb48 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:34 +0000 Subject: [MERGED] osmo-gsm-tester[master]: nominal_power and max_power_red attrs can now be set per res... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: nominal_power and max_power_red attrs can now be set per resource ...................................................................... nominal_power and max_power_red attrs can now be set per resource Before this commit, only max_power_red was specified and it could only be used as a defaults and could not be set per object. Together with nominal_power, it can be useful to be able to set them to different values for different objects, as for example different osmo-bts-trx objects can require different values. Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd --- M example/defaults.conf M selftest/suite_test.ok M selftest/suite_test/resources.conf M selftest/template_test.ok M selftest/template_test.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 8 files changed, 43 insertions(+), 8 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/defaults.conf b/example/defaults.conf index 082f159..f6ecedd 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -33,7 +33,8 @@ stream_id: 255 osmobsc_bts_type: sysmobts trx_list: - - max_power_red: 0 + - nominal_power: 23 + max_power_red: 0 arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..049f7b4 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -31,7 +31,7 @@ tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 3) +tst test_suite: Reserving 1 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..001d286 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -28,6 +28,36 @@ trx_list: - hw_addr: 00:02:95:00:41:b3 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.52 + band: GSM-1800 + launch_trx: true + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.53 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + trx_list: + - nominal_power: 10 + - nominal_power: 12 + arfcn: - arfcn: 512 band: GSM-1800 diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 5af4b6a..5bd32a4 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -54,7 +54,7 @@ trx 0 rf_locked 0 arfcn val_trx_arfcn_trx0 - nominal power 23 + nominal power val_trx_nominal_power_trx0 max_power_red val_trx_max_power_red_trx0 rsl e1 tei 0 timeslot 0 @@ -68,7 +68,7 @@ trx 1 rf_locked 0 arfcn val_trx_arfcn_trx1 - nominal power 23 + nominal power val_trx_nominal_power_trx1 max_power_red val_trx_max_power_red_trx1 rsl e1 tei 0 timeslot 0 @@ -98,7 +98,7 @@ trx 0 rf_locked 0 arfcn val_trx_arfcn_trx0 - nominal power 23 + nominal power val_trx_nominal_power_trx0 max_power_red val_trx_max_power_red_trx0 rsl e1 tei 0 timeslot 0 @@ -112,7 +112,7 @@ trx 1 rf_locked 0 arfcn val_trx_arfcn_trx1 - nominal power 23 + nominal power val_trx_nominal_power_trx1 max_power_red val_trx_max_power_red_trx1 rsl e1 tei 0 timeslot 0 diff --git a/selftest/template_test.py b/selftest/template_test.py index f8c32a5..769df49 100755 --- a/selftest/template_test.py +++ b/selftest/template_test.py @@ -27,9 +27,11 @@ 'stream_id': 'val_bts.stream_id', 'trx_list': ( dict(arfcn='val_trx_arfcn_trx0', + nominal_power='val_trx_nominal_power_trx0', max_power_red='val_trx_max_power_red_trx0', timeslot_list=mock_timeslot_list), dict(arfcn='val_trx_arfcn_trx1', + nominal_power='val_trx_nominal_power_trx1', max_power_red='val_trx_max_power_red_trx1', timeslot_list=mock_timeslot_list), ) diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8f34bdb..7ba6e72 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -58,6 +58,8 @@ 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, + 'bts[].trx_list[].nominal_power': schema.UINT, + 'bts[].trx_list[].max_power_red': schema.UINT, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 57ab8a3..14aa62d 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -61,7 +61,7 @@ trx ${loop.index} rf_locked 0 arfcn ${trx.arfcn} - nominal power 23 + nominal power ${trx.nominal_power} max_power_red ${trx.max_power_red} rsl e1 tei 0 % for ts in trx.timeslot_list: diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index d2927f9..fbafc8e 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -54,7 +54,7 @@ trx ${loop.index} rf_locked 0 arfcn ${trx.arfcn} - nominal power 23 + nominal power ${trx.nominal_power} max_power_red ${trx.max_power_red} rsl e1 tei 0 % for ts in trx.timeslot_list: -- To view, visit https://gerrit.osmocom.org/3951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I472742e98052cc39686d38c945be76d7f50eeebd Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:34 +0000 Subject: [MERGED] osmo-gsm-tester[master]: config: Fix combination of lists In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: config: Fix combination of lists ...................................................................... config: Fix combination of lists This commit fixes combination of resources containing lists. For lists containing complex types, it has been decided to handle them as sorted list, where position in list matters. In this case, combine is called recursively for each element in dest and src sharing position in the list, and assumes that if one list is shorter than the other, then it has to be combined against empty set for that tye. For instance this is useful when defining trx_list properties, where a BTS can have a different amount of TRX but we may be interested in restricting the first TRX and don't care about extra TRX. For lists containing simple types (eg. integers or strings), we just want to merge both lists and we only need to check if the value is already there, ie. handle them as unsortered sets. This case won't work if we call combine for each element of the list because for a simple case it will just end up checking if a[i] == b[i]. This kind of operation for simple types is needed in later commits where cipher attribute is introduced. Without this patch, having following 2 scenarios and trying them to use together "-s foosuite:cipher-a50+ciphera51" will fail: cipher_a50.conf: bts: - ciphers: - 'a5 0' cipher_a51.conf bts: - ciphers: - 'a5 1' ValueError: cannot combine dicts, conflicting items (values 'a5 0' and 'a5 1') Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 --- M selftest/config_test.ok M selftest/config_test.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/util.py 4 files changed, 158 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 80b5a06..e1fb87d 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -93,3 +93,20 @@ Validation: Error --- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error +- Combine dicts: +- Combine dicts 2: +- Combine lists: +- Combine lists 2: +- Combine lists 3: +ValueError expected +- Combine lists 4: +ValueError expected +- Combine lists 5: +ValueError expected +- Combine lists 6: +- Combine lists 7: +- Combine lists 8: +- Combine lists 9: +- Combine lists 10: +- Combine lists 13: +- Combine lists 14: diff --git a/selftest/config_test.py b/selftest/config_test.py index 61ec73a..fa86adc 100755 --- a/selftest/config_test.py +++ b/selftest/config_test.py @@ -112,4 +112,105 @@ c['imsi'][2] = None val(c) +print('- Combine dicts:') +a = {'times': '2'} +b = {'type': 'osmo-bts-trx'} +res = {'times': '2', 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine dicts 2:') +a = {'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +b = {'type': 'osmo-bts-trx'} +res = {'times': '1', 'label': 'foo', 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists:') +a = { 'a_list': ['x', 'y', 'z'] } +b = { 'a_list': ['y'] } +res = {'a_list': ['x', 'y', 'z']} +config.combine(a, b) +assert a == res + +print('- Combine lists 2:') +a = { 'a_list': ['x'] } +b = { 'a_list': ['w', 'u', 'x', 'y', 'z'] } +res = {'a_list': ['x', 'w', 'u', 'y', 'z']} +config.combine(a, b) +assert a == res + +print('- Combine lists 3:') +a = { 'a_list': ['x', 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 4:') +a = { 'a_list': [2, 3] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 5:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': ['y', 'z'] } +try: + config.combine(a, b) +except ValueError: + print("ValueError expected") + +print('- Combine lists 6:') +a = { 'a_list': [{}, {}] } +b = { 'a_list': [{}] } +res = {'a_list': [{}, {}]} +config.combine(a, b) +assert a == res + +print('- Combine lists 7:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 8:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 9:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 10:') +a = { 'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 13:') +a = { 'times': '1', 'label': 'foo', 'trx': [{}, {'nominal power': '12'}] } +b = { 'type': 'osmo-bts-trx', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}] } +res = {'times': '1', 'label': 'foo', 'trx': [{'nominal power': '10'}, {'nominal power': '12'}], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + +print('- Combine lists 14:') +a = { 'times': '1', 'label': 'foo', 'trx': [] } +b = { 'type': 'osmo-bts-trx', 'trx': [] } +res = {'times': '1', 'label': 'foo', 'trx': [], 'type': 'osmo-bts-trx'} +config.combine(a, b) +assert a == res + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 27ce428..0721c30 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -245,9 +245,23 @@ if is_list(dest): if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) - for i in range(len(src)): - log.ctx(idx=i) - combine(dest[i], src[i]) + # Validate that all elements in both lists are of the same type: + t = util.list_validate_same_elem_type(src + dest) + if t is None: + return # both lists are empty, return + # For lists of complex objects, we expect them to be sorted lists: + if t in (dict, list, tuple): + for i in range(len(dest)): + log.ctx(idx=i) + src_it = src[i] if i < len(src) else util.empty_instance_type(t) + combine(dest[i], src_it) + for i in range(len(dest), len(src)): + log.ctx(idx=i) + dest.append(src[i]) + else: # for lists of basic elements, we handle them as unsorted sets: + for elem in src: + if elem not in dest: + dest.append(elem) return if dest == src: return diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 197dc97..bb4c524 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -314,4 +314,27 @@ return True raise ValueError('Invalid BOOL field: %r' % val) +def list_validate_same_elem_type(li): + ''' + Checks that all elements in the list are of the same type and returns that type. + If the list is empty, returns None + If one of the elements is not of the same type, it throws a ValueError exception. + ''' + if len(li) == 0: + return None + t = type(li[0]) + for elem in li: + if type(elem) != t: + raise ValueError('List contains elements of different types: %r vs %r' % (t, type(elem))) + return t + +def empty_instance_type(t): + if t == dict: + return {} + elif t == list: + return [] + elif t == tuple: + return () + raise ValueError('type %r not supported!' % t) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 10 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:35 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Replicate resources based on times attr before combine time In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Replicate resources based on times attr before combine time ...................................................................... Replicate resources based on times attr before combine time As suite.conf and scenarios need to match 1-to-1 in lists, it's important to extend the dictionaries by replicating the objects with a 'times' values higher than 1 in order to match the objects correctly. Since dictionanries are expanded at combine time, there's no need to expand them during reserve() time because they are already expanded. As a result, this commit reworks the kind of schema applied in each place (and takes the change to start validating scenario files, which were neglected previously). Two unit tests are added as a show case. Unfortunately output showing scenario dictionaries needs to be ignored while verifying because it was encountered that different versions of python print dictionary elements in different order. Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 --- M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/suite.conf M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 8 files changed, 211 insertions(+), 37 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/resource_test.py b/selftest/resource_test.py index a0ec490..d72eb72 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -80,7 +80,7 @@ origin = log.Origin(None, 'testowner') -resources = pool.reserve(origin, want) +resources = pool.reserve(origin, config.replicate_times(want)) print('~~~ currently reserved:') with open(rrfile, 'r') as f: diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 049f7b4..365fcaa 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -16,6 +16,7 @@ resources: bts: - times: '1' + - times: '2' ip_address: - times: '1' modem: @@ -30,14 +31,30 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] -tst test_suite: Reserving 1 x bts (candidates: 6) +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] +tst test_suite: Reserving 3 x bts (candidates: 6) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 @@ -140,5 +157,151 @@ skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected +- test with half empty scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo +- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + addr: 10.42.42.115 + band: GSM-1800 + ipa_unit_id: '5' + label: octBTS 3000 + trx_list: + - hw_addr: 00:0c:90:32:b5:8a + type: oct +- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 + addr: 10.42.42.190 + band: GSM-1900 + ipa_unit_id: '1902' + label: nanoBTS 1900 + trx_list: + - hw_addr: 00:02:95:00:41:b3 + type: nanobts + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py +- test with scenario +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test [config.py:[LINENR]] +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir [config.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- +tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] +tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] +tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: f1cab48db5b9004986e2030cb71730a5c55e823e + addr: 10.42.42.52 + band: GSM-1800 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + trx_list: + - nominal_power: '10' + - nominal_power: '12' + type: osmo-bts-trx +- _hash: 1d00bd0d6643db5590cdbefff3152e70500abefc + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 + addr: 10.42.42.114 + band: GSM-1800 + ipa_unit_id: '1' + label: sysmoBTS 1002 + type: sysmo + [resource.py:[LINENR]] +tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 + addr: 10.42.42.1 + [resource.py:[LINENR]] +tst test_suite: Reserving 2 x modem (candidates: 16) [resource.py:[LINENR]] +tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f + imsi: '901700000007801' + ki: D620F48487B1B782DA55DF6717F08FF9 + label: m7801 + path: /wavecom_0 +- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + imsi: '901700000007802' + ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 + label: m7802 + path: /wavecom_1 + [resource.py:[LINENR]] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- +tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] [hello_world.py:[LINENR]] +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index dcda3b6..49bd9eb 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,3 +1,4 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] \([0-9.]+ sec\) (N.N sec) +{combining_scenarios='resources', scenario='foo'}:.* {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 86c4c25..12bd5e7 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -42,5 +42,21 @@ output = report.suite_to_text(s) print(output) +print('- test with half empty scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + +print('- test with scenario') +trial = log.Origin(log.C_TST, 'trial') +scenario = config.Scenario('foo', 'bar') +scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +results = s.run_tests('hello_world.py') +print(report.suite_to_text(s)) + print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/test_suite/suite.conf index 376f6cd..890f66a 100644 --- a/selftest/suite_test/test_suite/suite.conf +++ b/selftest/suite_test/test_suite/suite.conf @@ -3,6 +3,7 @@ - times: 1 bts: - times: 1 + - times: 2 modem: - times: 2 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 1d52073..27ce428 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -274,7 +274,13 @@ return src def replicate_times(d): - 'replicate items that have a "times" > 1' + ''' + replicate items that have a "times" > 1 + + 'd' is a dict matching WANT_SCHEMA, which is the same as + the RESOURCES_SCHEMA, except each entity that can be reserved has a 'times' + field added, to indicate how many of those should be reserved. + ''' d = copy.deepcopy(d) for key, item_list in d.items(): idx = 0 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 7ba6e72..8206767 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -73,6 +73,10 @@ dict([('%s[].times' % r, schema.TIMES) for r in R_ALL]), RESOURCES_SCHEMA) +CONF_SCHEMA = util.dict_add( + { 'defaults.timeout': schema.STR }, + dict([('resources.%s' % key, val) for key, val in WANT_SCHEMA.items()])) + KNOWN_BTS_TYPES = { 'osmo-bts-sysmo': bts_sysmo.SysmoBts, 'osmo-bts-trx': bts_osmotrx.OsmoBtsTrx, @@ -107,11 +111,9 @@ 'origin' should be an Origin() instance. - 'want' is a dict matching WANT_SCHEMA, which is the same as - the RESOURCES_SCHEMA, except each entity that can be reserved has a 'times' - field added, to indicate how many of those should be reserved. + 'want' is a dict matching RESOURCES_SCHEMA. - If an entry has only a 'times' set, any of the resources may be + If an entry has no attribute set, any of the resources may be reserved without further limitations. ResourcesPool may also be selected with narrowed down constraints. @@ -119,24 +121,13 @@ sysmo and one of type trx, plus 2 ARFCNs in the 1800 band: { - 'ip_address': [ { 'times': 1 } ], - 'bts': [ { 'type': 'sysmo', 'times': 1 }, { 'type': 'trx', 'times': 1 } ], - 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], - 'modem': [ { 'times': 2 } ], - } - - A times=1 value is implicit, so the above is equivalent to: - - { 'ip_address': [ {} ], 'bts': [ { 'type': 'sysmo' }, { 'type': 'trx' } ], - 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], - 'modem': [ { 'times': 2 } ], + 'arfcn': [ { 'band': 'GSM-1800' }, { 'band': 'GSM-1800' } ], + 'modem': [ {}, {} ], } ''' - schema.validate(want, WANT_SCHEMA) - - want = config.replicate_times(want) + schema.validate(want, RESOURCES_SCHEMA) origin_id = origin.origin_id() @@ -271,10 +262,10 @@ Pass a dict of resource requirements, e.g.: want = { 'bts': [ {'type': 'osmo-bts-sysmo',}, {} ], - 'modem': [ {'times': 3} ] + 'modem': [ {}, {}, {} ] } This function tries to find a combination from the available resources that - matches these requiremens. The returnvalue is a dict (wrapped in a Resources class) + matches these requirements. The return value is a dict (wrapped in a Resources class) that contains the matching resources in the order of 'want' dict: in above example, the returned dict would have a 'bts' list with the first item being a sysmoBTS, the second item being any other available BTS. @@ -290,6 +281,10 @@ If raise_if_missing is False, this will return an empty item for any resource that had no match, instead of immediately raising an exception. + + This function expects input dictionaries whose contents have already + been replicated based on its the 'times' attributes. See + config.replicate_times() for more details. ''' matches = {} for key, want_list in sorted(want.items()): # sorted for deterministic test results @@ -314,7 +309,7 @@ my_item = my_list[i] if skip_if_marked and my_item.get(skip_if_marked): continue - if item_matches(my_item, want_item, ignore_keys=('times',)): + if item_matches(my_item, want_item): item_match_list.append(i) if not item_match_list: if raise_if_missing: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 9b975fd..28bdd69 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -40,14 +40,6 @@ CONF_FILENAME = 'suite.conf' - CONF_SCHEMA = util.dict_add( - { - 'defaults.timeout': schema.STR, - }, - dict([('resources.%s' % k, t) for k,t in resource.WANT_SCHEMA.items()]) - ) - - def __init__(self, suite_dir): self.suite_dir = suite_dir super().__init__(log.C_CNF, os.path.basename(self.suite_dir)) @@ -59,7 +51,7 @@ raise RuntimeError('No such directory: %r' % self.suite_dir) self.conf = config.read(os.path.join(self.suite_dir, SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) + resource.CONF_SCHEMA) self.load_test_basenames() def load_test_basenames(self): @@ -209,11 +201,11 @@ def combined(self, conf_name): log.dbg(combining=conf_name) log.ctx(combining_scenarios=conf_name) - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + combination = config.replicate_times(self.definition.conf.get(conf_name, {})) log.dbg(definition_conf=combination) for scenario in self.scenarios: log.ctx(combining_scenarios=conf_name, scenario=scenario.name()) - c = scenario.get(conf_name) + c = config.replicate_times(scenario.get(conf_name, {})) log.dbg(scenario=scenario.name(), conf=c) if c is None: continue @@ -447,7 +439,7 @@ def load_suite_scenario_str(suite_scenario_str): suite_name, scenario_names = parse_suite_scenario_str(suite_scenario_str) suite = load(suite_name) - scenarios = [config.get_scenario(scenario_name) for scenario_name in scenario_names] + scenarios = [config.get_scenario(scenario_name, resource.CONF_SCHEMA) for scenario_name in scenario_names] return (suite_scenario_str, suite, scenarios) def bts_obj(suite_run, conf): -- To view, visit https://gerrit.osmocom.org/3907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I25eb639c7e3cf3b4c67a205422808bffbdd791e6 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:35 +0000 Subject: [MERGED] osmo-gsm-tester[master]: config: Fix variable reference before assigment In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: config: Fix variable reference before assigment ...................................................................... config: Fix variable reference before assigment Change-Id: I1a1acd7b3e5ff96b09a9a8e2825fb864ead9e54b --- M src/osmo_gsm_tester/config.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 4e7f504..1d52073 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -268,7 +268,7 @@ if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) for i in range(len(src)): - log.ctx(key=key) + log.ctx(idx=i) dest[i] = overlay(dest[i], src[i]) return dest return src -- To view, visit https://gerrit.osmocom.org/3730 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a1acd7b3e5ff96b09a9a8e2825fb864ead9e54b Gerrit-PatchSet: 10 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:35 +0000 Subject: [MERGED] osmo-gsm-tester[master]: config: replicate_times: insert replicates in place In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: config: replicate_times: insert replicates in place ...................................................................... config: replicate_times: insert replicates in place In the following suite.conf, position matters when matching against scenarios: [suite.conf] resources: bts: - type: sysmo times: 2 - type: osmo-bts-trx times: 1 [scenario] resources: bts: - - ip_addr: 1.2.3.4 In this case, for instance, we make it clear that we want the second sysmo bts which has IP 1.2.3.4. With old behaviour, the replicated sysmo would have been created at the end (3rd position), and the ip_addr would match against the osmo-bts-trx BTS. Change-Id: Id78e2326db964d5efb6648854b57d8addce4deb0 --- M src/osmo_gsm_tester/config.py 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index a0fe969..4e7f504 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -277,13 +277,13 @@ 'replicate items that have a "times" > 1' d = copy.deepcopy(d) for key, item_list in d.items(): - more_items = [] - for item in item_list: - times = int(item.pop('times')) - if times and times > 1: - for i in range(times - 1): - more_items.append(copy.deepcopy(item)) - item_list.extend(more_items) + idx = 0 + while idx < len(item_list): + item = item_list[idx] + times = int(item.pop('times', 1)) + for j in range(1, times): + item_list.insert(idx + j, copy.deepcopy(item)) + idx += times return d # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id78e2326db964d5efb6648854b57d8addce4deb0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:36 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Move code to replicate dicts based on times attr to its own ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Move code to replicate dicts based on times attr to its own function ...................................................................... Move code to replicate dicts based on times attr to its own function Change-Id: I26ddae2124813bfb63a7c97c466e056cd2ef991a --- M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py 2 files changed, 16 insertions(+), 10 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index f6e81ac..a0fe969 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -52,6 +52,7 @@ import yaml import os +import copy from . import log, schema, util from .util import is_dict, is_list, Dir, get_tempdir @@ -271,4 +272,18 @@ dest[i] = overlay(dest[i], src[i]) return dest return src + +def replicate_times(d): + 'replicate items that have a "times" > 1' + d = copy.deepcopy(d) + for key, item_list in d.items(): + more_items = [] + for item in item_list: + times = int(item.pop('times')) + if times and times > 1: + for i in range(times - 1): + more_items.append(copy.deepcopy(item)) + item_list.extend(more_items) + return d + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index d8efe2f..8f34bdb 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -134,16 +134,7 @@ ''' schema.validate(want, WANT_SCHEMA) - # replicate items that have a 'times' > 1 - want = copy.deepcopy(want) - for key, item_list in want.items(): - more_items = [] - for item in item_list: - times = int(item.pop('times')) - if times and times > 1: - for i in range(times - 1): - more_items.append(copy.deepcopy(item)) - item_list.extend(more_items) + want = config.replicate_times(want) origin_id = origin.origin_id() -- To view, visit https://gerrit.osmocom.org/3918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I26ddae2124813bfb63a7c97c466e056cd2ef991a Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:36 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resource: times is expected to be a non-zero positive integer In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: resource: times is expected to be a non-zero positive integer ...................................................................... resource: times is expected to be a non-zero positive integer Change-Id: Ie9e313727053a411cec2f698c3bd654d27e8013f --- M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 2 files changed, 8 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index f8acb9e..d8efe2f 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -68,7 +68,7 @@ } WANT_SCHEMA = util.dict_add( - dict([('%s[].times' % r, schema.INT) for r in R_ALL]), + dict([('%s[].times' % r, schema.TIMES) for r in R_ALL]), RESOURCES_SCHEMA) KNOWN_BTS_TYPES = { diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index b904960..dcdfdb1 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -71,6 +71,11 @@ if n < 0: raise ValueError('Positive value expected instead of %d' % n) +def times(val): + n = int(val) + if n < 1: + raise ValueError('Positive value >0 expected instead of %d' % n) + INT = 'int' STR = 'str' UINT = 'uint' @@ -82,6 +87,7 @@ KI = 'ki' MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' +TIMES='times' SCHEMA_TYPES = { INT: int, STR: str, @@ -94,6 +100,7 @@ KI: ki, MSISDN: msisdn, AUTH_ALGO: auth_algo, + TIMES: times, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie9e313727053a411cec2f698c3bd654d27e8013f Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 16 19:51:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 19:51:36 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resource: ipa_unit_id is expected to be a positive integer In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: resource: ipa_unit_id is expected to be a positive integer ...................................................................... resource: ipa_unit_id is expected to be a positive integer Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb --- M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 2 files changed, 8 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index da543f7..f8acb9e 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -51,7 +51,7 @@ 'ip_address[].addr': schema.IPV4, 'bts[].label': schema.STR, 'bts[].type': schema.STR, - 'bts[].ipa_unit_id': schema.INT, + 'bts[].ipa_unit_id': schema.UINT, 'bts[].addr': schema.IPV4, 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 2da80cd..b904960 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -66,8 +66,14 @@ return raise ValueError('Unknown Authentication Algorithm: %r' % val) +def uint(val): + n = int(val) + if n < 0: + raise ValueError('Positive value expected instead of %d' % n) + INT = 'int' STR = 'str' +UINT = 'uint' BOOL_STR = 'bool_str' BAND = 'band' IPV4 = 'ipv4' @@ -79,6 +85,7 @@ SCHEMA_TYPES = { INT: int, STR: str, + UINT: uint, BOOL_STR: str2bool, BAND: band, IPV4: ipv4, -- To view, visit https://gerrit.osmocom.org/3916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I26d7a4351089b73716d193496d7161bf3d9988bb Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 16 20:01:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 20:01:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix crash in overlay() Message-ID: Review at https://gerrit.osmocom.org/3970 config: Fix crash in overlay() if len(src) > len(dest), then we hit an out-of-bounds crash accessing dest[i]. It is totally valid to have src and dest with different lens, as you may want to override only part of the list. Change-Id: I01f50c84f40018269815b03faac63c2f746e1462 --- M src/osmo_gsm_tester/config.py 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/70/3970/1 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 0721c30..7f1e52f 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -281,9 +281,12 @@ if is_list(dest): if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) - for i in range(len(src)): + copy_len = min(len(src),len(dest)) + for i in range(copy_len): log.ctx(idx=i) dest[i] = overlay(dest[i], src[i]) + for i in range(copy_len, len(src)): + dest.append(src[i]) return dest return src -- To view, visit https://gerrit.osmocom.org/3970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01f50c84f40018269815b03faac63c2f746e1462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Sep 16 20:04:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 20:04:48 +0000 Subject: osmo-gsm-tester[master]: config: Fix crash in overlay() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01f50c84f40018269815b03faac63c2f746e1462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 16 20:30:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 16 Sep 2017 20:30:58 +0000 Subject: [PATCH] osmo-msc[master]: fix deb: drop obsolete mgcp header Message-ID: Review at https://gerrit.osmocom.org/3971 fix deb: drop obsolete mgcp header This fixes the debian builds since osmo-msc depends on libosmo-mgcp-client, while it includes a libosmo-legacy-mgcp header not included in libosmo-mgcp-client. When installing from source, both get installed, so this was only noticed from the OBS builds that include only the libosmo-mgcp-client dependency. Change-Id: I6b9454698976bdba3b1e0498a81bad9855eee45e --- M src/libmsc/msc_ifaces.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/71/3971/1 diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 1c8e5ef..e29fe0e 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b9454698976bdba3b1e0498a81bad9855eee45e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 17 14:54:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 14:54:10 +0000 Subject: osmo-gsm-tester[master]: config: Fix crash in overlay() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I didn't test this patch properly yet, that's why it was still waiting in my pespin/oct branch. If you feel confident it is the good fix or if you already hit this issue then let's merge it, otherwise let's wait to merge it with the pespin/oct branch. -- To view, visit https://gerrit.osmocom.org/3970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01f50c84f40018269815b03faac63c2f746e1462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 17 14:59:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 14:59:44 +0000 Subject: [MERGED] libsmpp34[master]: smpp34_dumpBuf.c: remove unused variable In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: smpp34_dumpBuf.c: remove unused variable ...................................................................... smpp34_dumpBuf.c: remove unused variable Fixes compilation warning below: smpp34_dumpBuf.c:52:9: warning: variable ?lefterror? set but not used [-Wunused-but-set-variable] int lefterror = 0; Change-Id: Iea8ff80d3e4d16aaca6e37d64593b50fa27c8cfb --- M src/smpp34_dumpBuf.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/smpp34_dumpBuf.c b/src/smpp34_dumpBuf.c index 77dfdba..dd0bad4 100644 --- a/src/smpp34_dumpBuf.c +++ b/src/smpp34_dumpBuf.c @@ -49,14 +49,12 @@ int size; uint8_t ind = 3; uint8_t *buffer = NULL; - int lefterror = 0; size = srcL; buffer = src; memset(smpp34_strerror, 0, sizeof(smpp34_strerror)); ptrerror = smpp34_strerror; - lefterror = sizeof(smpp34_strerror); /* dump buffer character by character until size is reached */ for(i = 0; i < size; i++){ -- To view, visit https://gerrit.osmocom.org/3964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea8ff80d3e4d16aaca6e37d64593b50fa27c8cfb Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 17 14:59:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 14:59:44 +0000 Subject: [MERGED] libsmpp34[master]: smpp34_structs.h: Fix trailing whitespace In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: smpp34_structs.h: Fix trailing whitespace ...................................................................... smpp34_structs.h: Fix trailing whitespace Change-Id: I5838e216fe16b4789bb1a0ce40ce496f46a3c328 --- M src/smpp34_structs.h 1 file changed, 39 insertions(+), 39 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index 025109d..6b9f41e 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -5,19 +5,19 @@ * * This file is part of libsmpp34 (c-open-smpp3.4 library). * - * The libsmpp34 library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of the + * The libsmpp34 library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the * License, or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _STB_H_ @@ -37,35 +37,35 @@ extern char smpp34_strerror[2048]; /* Define structures **********************************************************/ -typedef struct tlv_t tlv_t; -typedef struct dad_t dad_t; -typedef struct udad_t udad_t; -typedef struct bind_transmitter_t bind_transmitter_t; -typedef struct bind_transmitter_resp_t bind_transmitter_resp_t; -typedef struct bind_receiver_t bind_receiver_t; -typedef struct bind_receiver_resp_t bind_receiver_resp_t; -typedef struct bind_transceiver_t bind_transceiver_t; -typedef struct bind_transceiver_resp_t bind_transceiver_resp_t; -typedef struct outbind_t outbind_t; -typedef struct unbind_t unbind_t; -typedef struct unbind_resp_t unbind_resp_t; -typedef struct generic_nack_t generic_nack_t; -typedef struct submit_sm_t submit_sm_t; -typedef struct submit_sm_resp_t submit_sm_resp_t; -typedef struct submit_multi_t submit_multi_t; -typedef struct submit_multi_resp_t submit_multi_resp_t; -typedef struct deliver_sm_t deliver_sm_t; -typedef struct deliver_sm_resp_t deliver_sm_resp_t; -typedef struct data_sm_t data_sm_t; -typedef struct data_sm_resp_t data_sm_resp_t; -typedef struct query_sm_t query_sm_t; -typedef struct query_sm_resp_t query_sm_resp_t; -typedef struct cancel_sm_t cancel_sm_t; -typedef struct cancel_sm_resp_t cancel_sm_resp_t; -typedef struct replace_sm_t replace_sm_t; -typedef struct replace_sm_resp_t replace_sm_resp_t; -typedef struct enquire_link_t enquire_link_t; -typedef struct alert_notification_t alert_notification_t; +typedef struct tlv_t tlv_t; +typedef struct dad_t dad_t; +typedef struct udad_t udad_t; +typedef struct bind_transmitter_t bind_transmitter_t; +typedef struct bind_transmitter_resp_t bind_transmitter_resp_t; +typedef struct bind_receiver_t bind_receiver_t; +typedef struct bind_receiver_resp_t bind_receiver_resp_t; +typedef struct bind_transceiver_t bind_transceiver_t; +typedef struct bind_transceiver_resp_t bind_transceiver_resp_t; +typedef struct outbind_t outbind_t; +typedef struct unbind_t unbind_t; +typedef struct unbind_resp_t unbind_resp_t; +typedef struct generic_nack_t generic_nack_t; +typedef struct submit_sm_t submit_sm_t; +typedef struct submit_sm_resp_t submit_sm_resp_t; +typedef struct submit_multi_t submit_multi_t; +typedef struct submit_multi_resp_t submit_multi_resp_t; +typedef struct deliver_sm_t deliver_sm_t; +typedef struct deliver_sm_resp_t deliver_sm_resp_t; +typedef struct data_sm_t data_sm_t; +typedef struct data_sm_resp_t data_sm_resp_t; +typedef struct query_sm_t query_sm_t; +typedef struct query_sm_resp_t query_sm_resp_t; +typedef struct cancel_sm_t cancel_sm_t; +typedef struct cancel_sm_resp_t cancel_sm_resp_t; +typedef struct replace_sm_t replace_sm_t; +typedef struct replace_sm_resp_t replace_sm_resp_t; +typedef struct enquire_link_t enquire_link_t; +typedef struct alert_notification_t alert_notification_t; /* TYPEDEFs structs ***********************************************************/ #define instancia 0 @@ -232,7 +232,7 @@ #include "def_frame/header.frame" }; -typedef struct enquire_link_resp_t enquire_link_resp_t; +typedef struct enquire_link_resp_t enquire_link_resp_t; struct enquire_link_resp_t { #include "def_frame/header.frame" }; -- To view, visit https://gerrit.osmocom.org/3965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5838e216fe16b4789bb1a0ce40ce496f46a3c328 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 17 14:59:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 14:59:44 +0000 Subject: [MERGED] libsmpp34[master]: smpp34_structs.h: Fix truncated output in str_tlv_id In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: smpp34_structs.h: Fix truncated output in str_tlv_id ...................................................................... smpp34_structs.h: Fix truncated output in str_tlv_id Fixes compilation warning below: %s? directive output may be truncated writing between 8 and 33 bytes into a regio n of size 30 [-Wformat-truncation=] snprintf(buff, SMALL_BUFF, "%s", ^~ /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_params.c:136:5: note: ? snprintf? output between 9 and 34 bytes into a destination of size 30 snprintf(buff, SMALL_BUFF, "%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #define OPERACION( p_tlv_id ) (tlv_id == p_tlv_id)?#p_tlv_id: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include "def_list/tlv_id.list" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Reserved" ~~~~~~~~~~ #undef OPERACION ~~~~~~~~~~~~~~~~ ); Change-Id: Ie2ba6182eb0cdd98cadb8317aef49141244aa92d --- M src/smpp34_structs.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index 6b9f41e..71d22cd 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -23,7 +23,7 @@ #ifndef _STB_H_ #define _STB_H_ -#define SMALL_BUFF 30 +#define SMALL_BUFF 34 /* Identify PDUs ident ********************************************************/ #define MAX_TLV_SIZE 1024 #define MAX_DAD_SIZE 21 -- To view, visit https://gerrit.osmocom.org/3966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2ba6182eb0cdd98cadb8317aef49141244aa92d Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 17 14:59:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 14:59:44 +0000 Subject: [MERGED] libsmpp34[master]: smpp34_unpack.c: remove unused variable In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: smpp34_unpack.c: remove unused variable ...................................................................... smpp34_unpack.c: remove unused variable Fixes compilation warning below: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c: In function ?smpp34_unpack?: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c:232:18: warning: variable ?l? set but not used [ -Wunused-but-set-variable] uint32_t l; Change-Id: I75baa65b575deec1cc040490f2e76ebb54e46ca7 --- M src/smpp34_unpack.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/smpp34_unpack.c b/src/smpp34_unpack.c index f498d01..3d8b0f8 100644 --- a/src/smpp34_unpack.c +++ b/src/smpp34_unpack.c @@ -229,9 +229,7 @@ { /* Hace algunas Verificaciones **************************************/ uint32_t len_orig; - uint32_t l; memcpy(&len_orig, tt, sizeof(uint32_t)); - l = ntohl( len_orig ); if( len_orig != (aux - ini) ){ PUTLOG("[%s:(Error in PDU length %d!=%d)]",PDU,len_orig,(uint32_t)(aux-ini)); return( -1 ); -- To view, visit https://gerrit.osmocom.org/3967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I75baa65b575deec1cc040490f2e76ebb54e46ca7 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 17 14:59:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 14:59:45 +0000 Subject: [MERGED] libsmpp34[master]: bind_receiver_resp_test.c: Fix compilation warning In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: bind_receiver_resp_test.c: Fix compilation warning ...................................................................... bind_receiver_resp_test.c: Fix compilation warning /home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c: In function ?main?: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c:55:58: warning: ?snprintf? output truncated before the last format character [-Wformat-truncation=] snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456"); ^ /home/pespin/dev/sysmocom/bin/../git/libsmpp34/test_pdu/bind_receiver_resp_test.c:55:5: note: ?snprintf? output 17 bytes into a destination of size 16 snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456"); Change-Id: I4ec682a5e2ee4d02008a9c86a0a5507792667d0e --- M test_pdu/bind_receiver_resp_test.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/test_pdu/bind_receiver_resp_test.c b/test_pdu/bind_receiver_resp_test.c index 610effd..e1817e8 100644 --- a/test_pdu/bind_receiver_resp_test.c +++ b/test_pdu/bind_receiver_resp_test.c @@ -52,7 +52,7 @@ b.command_id = BIND_RECEIVER_RESP; b.command_status = ESME_ROK; b.sequence_number = 1; - snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456"); + snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "123456789012345"); tlv.tag = TLVID_sc_interface_version; tlv.length = sizeof(uint8_t); -- To view, visit https://gerrit.osmocom.org/3968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ec682a5e2ee4d02008a9c86a0a5507792667d0e Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 17 14:59:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 14:59:45 +0000 Subject: [MERGED] libsmpp34[master]: Fix Out of bounds compilation warning in OCTET8 In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Fix Out of bounds compilation warning in OCTET8 ...................................................................... Fix Out of bounds compilation warning in OCTET8 The code in OCTET8 implementation assumes the len is placed inside the byte preceding the memory buffer, which is true for the defined cases. However, it creates a compilation warning. Better pass the value directly from the struct field rather than playing addr games. this way we also assert we require to explicitly pass the len. Fixes lots of warning like the one below: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c: In function ?smpp34_u npack?: /home/pespin/dev/sysmocom/bin/../git/libsmpp34/src/smpp34_unpack.c:147:14: warning: array subscript is above array bounds [-Warray-bounds] lenval = *((inst par) - 1);\ ^~~~~~~~~~~~~~~~~ /home/pespin/dev/sysmocom/bin/../git/libsmpp34/def_frame/submit_sm.frame:18:2: note: in e xpansion of macro ?OCTET8? OCTET8( instancia, short_message, 254 ); ^~~~~~ Change-Id: Id110f4e977c3becdb44cf5492c372e530ea51551 --- M def_frame/deliver_sm.frame M def_frame/replace_sm.frame M def_frame/submit_multi.frame M def_frame/submit_sm.frame M src/smpp34_dumpPdu.c M src/smpp34_pack.c M src/smpp34_structs.h M src/smpp34_unpack.c 8 files changed, 8 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/def_frame/deliver_sm.frame b/def_frame/deliver_sm.frame index 2306f19..6cbd90d 100644 --- a/def_frame/deliver_sm.frame +++ b/def_frame/deliver_sm.frame @@ -15,5 +15,5 @@ U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_deliver_sm ); diff --git a/def_frame/replace_sm.frame b/def_frame/replace_sm.frame index a35187d..641207e 100644 --- a/def_frame/replace_sm.frame +++ b/def_frame/replace_sm.frame @@ -7,4 +7,4 @@ U08( instancia, registered_delivery, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); diff --git a/def_frame/submit_multi.frame b/def_frame/submit_multi.frame index 0c5fb31..e58fd36 100644 --- a/def_frame/submit_multi.frame +++ b/def_frame/submit_multi.frame @@ -14,5 +14,5 @@ U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_submit_multi ); diff --git a/def_frame/submit_sm.frame b/def_frame/submit_sm.frame index 0a54421..bf8e560 100644 --- a/def_frame/submit_sm.frame +++ b/def_frame/submit_sm.frame @@ -15,5 +15,5 @@ U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_submit_sm ); diff --git a/src/smpp34_dumpPdu.c b/src/smpp34_dumpPdu.c index 89d6e53..688f4ea 100644 --- a/src/smpp34_dumpPdu.c +++ b/src/smpp34_dumpPdu.c @@ -136,11 +136,10 @@ _op(inst, par, size )\ } -#define OCTET8( inst, par, size ){\ +#define OCTET8( inst, par, size, lenval ){\ int i = 0;\ uint8_t *p = l_dest;\ int dummy = 0;\ - lenval = *((inst par) - 1);\ if( (lenval + 33) >= left ){\ PUTLOG("[%s:%s(%s)]", par, inst par, \ "Value length exceed buffer length");\ diff --git a/src/smpp34_pack.c b/src/smpp34_pack.c index b36e7a4..ef1c599 100644 --- a/src/smpp34_pack.c +++ b/src/smpp34_pack.c @@ -139,8 +139,7 @@ }\ }; -#define OCTET8( inst, par, sizeval ){\ - lenval = *((inst par) - 1);\ +#define OCTET8( inst, par, sizeval, lenval ){\ if( lenval >= left ){\ PUTLOG("[leng %s:%d(%s)]", par, lenval,\ "Value length exceed buffer length");\ diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index 71d22cd..7c83df8 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -75,7 +75,7 @@ #define O_C_OCTET( inst, par, size ) uint8_t par[ size ]; #define C_OCTET( inst, par, size ) uint8_t par[ size ]; -#define OCTET8( inst, par, size ) uint8_t par[ size ]; +#define OCTET8( inst, par, size, lenval ) uint8_t par[ size ]; #define OCTET16( inst, par, size ) uint8_t par[ size ]; #define TLV( inst, par, do_tlv ) tlv_t *par; diff --git a/src/smpp34_unpack.c b/src/smpp34_unpack.c index 3d8b0f8..749a037 100644 --- a/src/smpp34_unpack.c +++ b/src/smpp34_unpack.c @@ -143,8 +143,7 @@ };\ } -#define OCTET8( inst, par, size ){\ - lenval = *((inst par) - 1);\ +#define OCTET8( inst, par, size, lenval ){\ if( lenval > left ){\ PUTLOG("[leng %s:%d(%s)]", par, lenval,\ "Value length exceed buffer length");\ -- To view, visit https://gerrit.osmocom.org/3969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id110f4e977c3becdb44cf5492c372e530ea51551 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Sep 17 15:06:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 17 Sep 2017 15:06:26 +0000 Subject: [PATCH] libsmpp34[master]: contrib: Enable -Werror by default Message-ID: Review at https://gerrit.osmocom.org/3972 contrib: Enable -Werror by default Change-Id: I2a88cdcbf76ea28a30e82836030f894c2152d5ed --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/72/3972/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7a388c2..79d101e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -4,6 +4,6 @@ autoreconf --install --force ./configure -$MAKE +$MAKE CFLAGS="-Werror" CPPFLAGS="-Werror" # currently broken $MAKE $PARALLEL_MAKE # currently broken $MAKE distcheck -- To view, visit https://gerrit.osmocom.org/3972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a88cdcbf76ea28a30e82836030f894c2152d5ed Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 18 12:42:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 18 Sep 2017 12:42:15 +0000 Subject: [PATCH] libosmocore[master]: Remove bogus error message Message-ID: Review at https://gerrit.osmocom.org/3973 Remove bogus error message * mark 'release' target as virtual (not tight to a presence of a certain file) * silence bumpversion test warning outside of release target Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Related: OS#1861 --- M Makefile.am M osmo-release.mk 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/3973/1 diff --git a/Makefile.am b/Makefile.am index 8b35856..9dfcdba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,8 @@ @RELMAKE@ +.PHONY: release + relengdir = $(includedir) releng_DATA = osmo-release.mk diff --git a/osmo-release.mk b/osmo-release.mk index 40eb121..ea36f23 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,8 +2,8 @@ REL := patch endif -BUMPVER := $(shell bumpversion) -NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +BUMPVER := $(shell which bumpversion 2>/dev/null) +NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty 2>/dev/null | awk -F '=' '{ print $$2 }') LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) ISODATE := $(shell date -I) -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 18 12:55:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 18 Sep 2017 12:55:13 +0000 Subject: libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3973/1//COMMIT_MSG Commit Message: Line 9: * mark 'release' target as virtual (not tight to a presence of a certain tied -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 18 12:55:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 18 Sep 2017 12:55:34 +0000 Subject: libosmocore[master]: Expand bit pretty-printer In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72528bc1e376134c5a7b6e7a50c48e38c3f48b0a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 12:55:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 18 Sep 2017 12:55:52 +0000 Subject: libsmpp34[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2a88cdcbf76ea28a30e82836030f894c2152d5ed Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 12:56:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 18 Sep 2017 12:56:36 +0000 Subject: osmo-msc[master]: fix deb: drop obsolete mgcp header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6b9454698976bdba3b1e0498a81bad9855eee45e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 12:57:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 18 Sep 2017 12:57:13 +0000 Subject: [PATCH] libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3973 to look at the new patch set (#2). Remove bogus error message * mark 'release' target as virtual (not tied to a presence of a certain file) * silence bumpversion test warning outside of release target Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Related: OS#1861 --- M Makefile.am M osmo-release.mk 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/3973/2 diff --git a/Makefile.am b/Makefile.am index 8b35856..9dfcdba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,8 @@ @RELMAKE@ +.PHONY: release + relengdir = $(includedir) releng_DATA = osmo-release.mk diff --git a/osmo-release.mk b/osmo-release.mk index 40eb121..ea36f23 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,8 +2,8 @@ REL := patch endif -BUMPVER := $(shell bumpversion) -NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +BUMPVER := $(shell which bumpversion 2>/dev/null) +NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty 2>/dev/null | awk -F '=' '{ print $$2 }') LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) ISODATE := $(shell date -I) -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 18 12:57:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 18 Sep 2017 12:57:39 +0000 Subject: [MERGED] libosmocore[master]: Expand bit pretty-printer In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Expand bit pretty-printer ...................................................................... Expand bit pretty-printer Add OSMO_BIT_PRINT_EX() which is like OSMO_BIT_PRINT() but allows to specify character to be printed for set bits. It's useful to print bytes used as mask where set bit has particular semantics - for example TS mask in OsmoPCU. Change-Id: I72528bc1e376134c5a7b6e7a50c48e38c3f48b0a Related: OS#2282 --- M include/osmocom/core/bits.h 1 file changed, 11 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 17fe1c6..c6a142f 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -69,15 +69,17 @@ (byte & 0x01 ? 1 : 0) #define OSMO_BIT_SPEC "%c%c%c%c%c%c%c%c" -#define OSMO_BIT_PRINT(byte) \ - (byte & 0x80 ? '1' : '.'), \ - (byte & 0x40 ? '1' : '.'), \ - (byte & 0x20 ? '1' : '.'), \ - (byte & 0x10 ? '1' : '.'), \ - (byte & 0x08 ? '1' : '.'), \ - (byte & 0x04 ? '1' : '.'), \ - (byte & 0x02 ? '1' : '.'), \ - (byte & 0x01 ? '1' : '.') +#define OSMO_BIT_PRINT_EX(byte, ch) \ + (byte & 0x80 ? ch : '.'), \ + (byte & 0x40 ? ch : '.'), \ + (byte & 0x20 ? ch : '.'), \ + (byte & 0x10 ? ch : '.'), \ + (byte & 0x08 ? ch : '.'), \ + (byte & 0x04 ? ch : '.'), \ + (byte & 0x02 ? ch : '.'), \ + (byte & 0x01 ? ch : '.') + +#define OSMO_BIT_PRINT(byte) OSMO_BIT_PRINT_EX(byte, '1') /* BIT REVERSAL */ -- To view, visit https://gerrit.osmocom.org/3915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72528bc1e376134c5a7b6e7a50c48e38c3f48b0a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 14:05:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 14:05:23 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmodumpdoc: fix finding cfg when not calling from source tree Message-ID: Review at https://gerrit.osmocom.org/3974 osmodumpdoc: fix finding cfg when not calling from source tree When the binary has not been built in the source tree, it was impossible to call osmodumpdoc.py despite the -p option. Look for config files in that config-path. Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c --- M osmopy/osmodumpdoc.py 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/74/3974/1 diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index 0ff1f6b..247fb84 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -28,7 +28,7 @@ Returns the number of apps configs could not be dumped for.""" -def dump_configs(apps, configs): +def dump_configs(apps, configs, confpath): failures = 0 successes = 0 @@ -41,7 +41,7 @@ appname = app[3] print "Starting app for %s" % appname proc = None - cmd = [app[1], "-c", configs[appname][0]] + cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) except OSError: # Probably a missing binary @@ -84,7 +84,7 @@ os.chdir(workdir) num_fails, num_sucs = dump_configs( - osmoappdesc.apps, osmoappdesc.app_configs) + osmoappdesc.apps, osmoappdesc.app_configs, confpath) if num_fails > 0: print >> sys.stderr, "Warning: Skipped %s apps" % num_fails if 0 == num_sucs: -- To view, visit https://gerrit.osmocom.org/3974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 14:05:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 14:05:24 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmodumpdoc: print called commands and OSError messages Message-ID: Review at https://gerrit.osmocom.org/3975 osmodumpdoc: print called commands and OSError messages Change-Id: Ib044cbb8a1b8e02cbe6852f785c75b5c7aae6174 --- M osmopy/osmodumpdoc.py 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/75/3975/1 diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index 247fb84..4841bcc 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -42,9 +42,11 @@ print "Starting app for %s" % appname proc = None cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] + print 'cd', os.path.abspath(os.path.curdir), ';', ' '.join(cmd) try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) - except OSError: # Probably a missing binary + except OSError as e: # Probably a missing binary + print >> sys.stderr, e print >> sys.stderr, "Skipping app %s" % appname failures += 1 else: -- To view, visit https://gerrit.osmocom.org/3975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib044cbb8a1b8e02cbe6852f785c75b5c7aae6174 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 14:05:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 14:05:24 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmodumpdoc: print generated path Message-ID: Review at https://gerrit.osmocom.org/3976 osmodumpdoc: print generated path Change-Id: Ie39316f0b51ee518b9dce8d5f98b53f748db573b --- M osmopy/osmodumpdoc.py 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/76/3976/1 diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index 4841bcc..da039e0 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -21,6 +21,7 @@ out = open(filename, 'w') out.write(xml) out.close() + print 'generated %r' % filename """Dump the config of all the apps. -- To view, visit https://gerrit.osmocom.org/3976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie39316f0b51ee518b9dce8d5f98b53f748db573b Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 14:12:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 18 Sep 2017 14:12:40 +0000 Subject: [PATCH] osmo-sgsn[master]: gbproxy: check peer allocation result Message-ID: Review at https://gerrit.osmocom.org/3977 gbproxy: check peer allocation result gbproxy_peer_alloc() could return NULL which wasn't checked. Fix it and add corresponding error log. While at it, also format log messages consistently. Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 --- M src/gprs/gb_proxy.c 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/77/3977/1 diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index eb2bbcc..c64dc8c 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1018,9 +1018,14 @@ if (!from_peer) { /* if a PTP-BVC is reset, and we don't know that * PTP-BVCI yet, we should allocate a new peer */ - LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for " - "BVCI=%u via NSEI=%u\n", bvci, nsei); + LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for BVCI=%u via NSEI=%u\n", bvci, nsei); from_peer = gbproxy_peer_alloc(cfg, bvci); + if (!from_peer) { + LOGP(DGPRS, LOGL_ERROR, "Failed to allocate new peer for BVCI=%u via NSEI=%u\n", + bvci, nsei); + + return -ENOMEM; + } from_peer->nsei = nsei; } -- To view, visit https://gerrit.osmocom.org/3977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 18 15:29:05 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 15:29:05 +0000 Subject: osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Patch Set 9: Code-Review-1 Looks like a lot of churn in this iteration. Especially as we have trx->bts in many places. For moving UL/DL TBF into the trx. What corner cases do you expect? How do you solve them? Is there a high level approach for this branch? E.g. how to make sure that UL and DL are allocated on the same TRX only? How is it balanced? What is your plan for USF? Does it need to be unique per BTS or TRX? -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 15:39:59 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 15:39:59 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) What tests are adjusted? https://gerrit.osmocom.org/#/c/3912/2/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 305: static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) Did we remove the 80 chars limit? -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 18 15:40:44 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 15:40:44 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: use defines for constant In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 15:44:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 18 Sep 2017 15:44:48 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Patch Set 2: > Did we remove the 80 chars limit? For several months already - see https://lists.osmocom.org/pipermail/openbsc/2017-April/thread.html#10522 -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 15:46:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 15:46:11 +0000 Subject: [PATCH] libosmocore[master]: vty: use internal node id for xml ids Message-ID: Review at https://gerrit.osmocom.org/3978 vty: use internal node id for xml ids The 'show online-help' produces XML output with ids. We reference those from the osmo-gsm-manuals, but until now, these ids fall out of sync when the amount of VTY nodes changes. Change these ids to use the internal node ID constant (as in enum bsc_vty_node) instead of a simple counter. If this is merged, we need to adjust the references in osmo-gsm-manuals.git. Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 --- M src/vty/command.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/3978/1 diff --git a/src/vty/command.c b/src/vty/command.c index 52c7191..8512ec8 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -579,7 +579,7 @@ if (!cnode) continue; - vty_out(vty, " %s", i, VTY_NEWLINE); + vty_out(vty, " %s", cnode->node, VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- To view, visit https://gerrit.osmocom.org/3978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 15:46:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 15:46:12 +0000 Subject: [PATCH] libosmocore[master]: vty: derive node name from prompt, use as XML ids Message-ID: Review at https://gerrit.osmocom.org/3979 vty: derive node name from prompt, use as XML ids The 'show online-help' produces XML output with ids. We reference those from the osmo-gsm-manuals. Instead of numeric IDs coming from internal code, rather use a human-readable node ID. In order to obtain such while remaining backwards compatible, derive such a name from the command node's prompt by stripping non-alnum characters. If this is merged, we need to adjust the references in osmo-gsm-manuals.git. Change-Id: I8fa555570268b231c5e01727c661da92fad265de --- M include/osmocom/vty/command.h M src/vty/command.c 2 files changed, 49 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/3979/1 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0fa5175..580c58e 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -123,6 +123,11 @@ /*! Vector of this node's command list. */ vector cmd_vector; + + /*! Human-readable ID of this node. Should only contain alphanumeric + * plus '-' and '_' characters (is used as XML ID for 'show + * online-help'). If left NUL, this is derived from the prompt.*/ + char name[64]; }; enum { diff --git a/src/vty/command.c b/src/vty/command.c index 8512ec8..76b6851 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -123,12 +123,40 @@ return str; } +/* For the lack of a better defined way to derive a node name from user input, + * mangle the provided prompt to make a node name that consists of only alnum, + * '-' and '_'. For example used for XML IDs in 'show online-help'. */ +static const char *node_name_from_prompt(const char *prompt, char *name_buf, size_t name_buf_size) +{ + const char *pos; + int dest = 0; + + if (!prompt || !*prompt) + return ""; + + for (pos = prompt; *pos && dest < (name_buf_size-1); pos++) { + if (pos[0] == '%' && pos[1]) { + /* skip "%s"; loop pos++ does the second one. */ + pos++; + continue; + } + if (!(isalnum(pos[0]) || pos[0] == '-' || pos[0] == '_')) + continue; + name_buf[dest] = pos[0]; + dest++; + } + name_buf[dest] = '\0'; + return name_buf; +} + /*! Install top node of command vector. */ void install_node(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); + if (!node->name || !*node->name) + node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); } /* Compare two command's string. Used in sort_node (). */ @@ -570,6 +598,7 @@ static int vty_dump_nodes(struct vty *vty) { int i, j; + int same_name_count; vty_out(vty, "%s", VTY_NEWLINE); @@ -579,7 +608,21 @@ if (!cnode) continue; - vty_out(vty, " %s", cnode->node, VTY_NEWLINE); + /* How many times has this same prompt been used before? */ + same_name_count = 1; + for (j = 0; j < i; ++j) { + struct cmd_node *cnode2; + cnode2 = vector_slot(cmdvec, j); + if (!cnode2) + continue; + if (strcmp(cnode->name, cnode2->name) == 0) + same_name_count ++; + } + + vty_out(vty, " %s", VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 16:08:41 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 16:08:41 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: improve readability In-Reply-To: References: Message-ID: Patch Set 15: (5 comments) I have mixed feelings about the change. It seems churn and I don't see the development path of this branch yet. https://gerrit.osmocom.org/#/c/3760/15/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 706 How does this debugging code hurt you? As someone that needed to understand it. Wasn't it helpful to follow Jacob's line of thinking? Line 251: LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); Old and new code doesn't fit on my macbook air 13" screen. So I don't think it is a general improvement. I see the merit of having the log in a single line but this makes me scroll on review. Line 382: if (trx) { What is the reason to move this here? Line 799: ul_slots = ms->reserved_ul_slots(); So this is to avoid the reassignment? Line 806: LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); This is the part of the change I don't like. You remove the TRX check and now we will get "Failed to allocate a TFI" when we haven't even tried to allocate one as the precondition failed? -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 15 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 18 16:12:03 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 16:12:03 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 Where is the recursion? * snprintf in call sites is not really an improvement * Method is called print while it is a format * newer libosmocore without bumping minimum version in configure.ac What would it take to just fix the bug? -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 16:13:04 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 16:13:04 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 Depends on "ts_print" which doesn't print.. so I stop review here for now. -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 16:15:26 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 16:15:26 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: cosmetic, use proper formatting In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-2 Yes it is sad that coding style was violated.. but stuff like this breaks git blame and such. In other projects such cleanups are not done for having a working history. We can do parts of the change. -- To view, visit https://gerrit.osmocom.org/3914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 16:17:08 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 18 Sep 2017 16:17:08 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: split USF/UL allocation In-Reply-To: References: Message-ID: Patch Set 3: Looks okay. -- To view, visit https://gerrit.osmocom.org/3930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 16:55:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 16:55:05 +0000 Subject: libosmocore[master]: vty: use internal node id for xml ids In-Reply-To: References: Message-ID: Patch Set 2: note that this is extended further by https://gerrit.osmocom.org/3979 ... technically, if we merge that, this one is not necessary. Just adding this one as a leaner alternative. -- To view, visit https://gerrit.osmocom.org/3978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 18 16:56:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 16:56:52 +0000 Subject: [PATCH] libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3979 to look at the new patch set (#3). vty: derive node name from prompt, use as XML ids The 'show online-help' produces XML output with ids. We reference those from the osmo-gsm-manuals. Instead of numeric IDs coming from internal code, rather use a human-readable node ID. In order to obtain such while remaining backwards compatible, derive such a name from the command node's prompt by stripping non-alnum characters. If this is merged, we need to adjust the references in osmo-gsm-manuals.git. Change-Id: I8fa555570268b231c5e01727c661da92fad265de --- M include/osmocom/vty/command.h M src/vty/command.c 2 files changed, 49 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/3979/3 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0fa5175..580c58e 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -123,6 +123,11 @@ /*! Vector of this node's command list. */ vector cmd_vector; + + /*! Human-readable ID of this node. Should only contain alphanumeric + * plus '-' and '_' characters (is used as XML ID for 'show + * online-help'). If left NUL, this is derived from the prompt.*/ + char name[64]; }; enum { diff --git a/src/vty/command.c b/src/vty/command.c index 8512ec8..1857cff 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -123,12 +123,40 @@ return str; } +/* For the lack of a better defined way to derive a node name from caller input, + * mangle the provided prompt to make a node name that consists of only alnum, + * '-' and '_'. For example used for XML IDs in 'show online-help'. */ +static const char *node_name_from_prompt(const char *prompt, char *name_buf, size_t name_buf_size) +{ + const char *pos; + int dest = 0; + + if (!prompt || !*prompt) + return ""; + + for (pos = prompt; *pos && dest < (name_buf_size-1); pos++) { + if (pos[0] == '%' && pos[1]) { + /* skip "%s"; loop pos++ does the second one. */ + pos++; + continue; + } + if (!(isalnum(pos[0]) || pos[0] == '-' || pos[0] == '_')) + continue; + name_buf[dest] = pos[0]; + dest++; + } + name_buf[dest] = '\0'; + return name_buf; +} + /*! Install top node of command vector. */ void install_node(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); + if (!*node->name) + node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); } /* Compare two command's string. Used in sort_node (). */ @@ -570,6 +598,7 @@ static int vty_dump_nodes(struct vty *vty) { int i, j; + int same_name_count; vty_out(vty, "%s", VTY_NEWLINE); @@ -579,7 +608,21 @@ if (!cnode) continue; - vty_out(vty, " %s", cnode->node, VTY_NEWLINE); + /* How many times has this same prompt been used before? */ + same_name_count = 1; + for (j = 0; j < i; ++j) { + struct cmd_node *cnode2; + cnode2 = vector_slot(cmdvec, j); + if (!cnode2) + continue; + if (strcmp(cnode->name, cnode2->name) == 0) + same_name_count ++; + } + + vty_out(vty, " %s", VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 18 18:01:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 18 Sep 2017 18:01:10 +0000 Subject: [MERGED] libosmo-netif[master]: src: _snprintf() helper functions nul-terminate buffers, if ... In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: src: _snprintf() helper functions nul-terminate buffers, if possible ...................................................................... src: _snprintf() helper functions nul-terminate buffers, if possible This patch inconditionally initializes the buffer we get to nul-terminate it, whenever possible. It's a very simple solution to catch three overly corner cases: 1) snprintf() returns -1, very much unlikely in practise. 2) msg->len == 0: In such case, I would expect this function is never called with an empty message, but let's be safe in this case too. 3) If your buffer is empty, it doesn't nul-terminate the buffer. Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 --- M src/osmux.c M src/rtp.c 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmux.c b/src/osmux.c index b18246f..7290d99 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -902,6 +902,9 @@ int msg_len = msg->len; int ret; + if (size) + buf[0] = '\0'; + while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { LOGP(DLMIB, LOGL_ERROR, diff --git a/src/rtp.c b/src/rtp.c index 56fc37c..48cb9b0 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -200,6 +200,9 @@ uint8_t *payload; int ret, i; + if (size) + buf[0] = '\0'; + rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) return -1; -- To view, visit https://gerrit.osmocom.org/3830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 18 21:51:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 21:51:22 +0000 Subject: [PATCH] osmo-msc[master]: main: remove cmdline args no longer available for osmo-msc Message-ID: Review at https://gerrit.osmocom.org/3980 main: remove cmdline args no longer available for osmo-msc Change-Id: I3009d2b3dd89eacdf6bc3d9c19744e9fdf4be6c3 --- M src/osmo-msc/msc_main.c 1 file changed, 1 insertion(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/3980/1 diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index bbf35b8..5c192e8 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -115,19 +115,6 @@ static struct osmo_timer_list db_sync_timer; -static void create_pcap_file(char *file) -{ - mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; - int fd = open(file, O_WRONLY|O_TRUNC|O_CREAT, mode); - - if (fd < 0) { - perror("Failed to open file for pcap"); - return; - } - - e1_set_pcap_fd(fd); -} - static void print_usage() { printf("Usage: osmo-nitb\n"); @@ -144,13 +131,10 @@ printf(" -l --database db-name The database to use.\n"); printf(" -T --timestamp Prefix every log line with a timestamp.\n"); printf(" -V --version Print the version of OpenBSC.\n"); - printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC.\n"); printf(" -e --log-level number Set a global loglevel.\n"); printf(" -M --mncc-sock-path PATH Disable built-in MNCC handler and offer socket.\n"); printf(" -m --mncc-sock Same as `-M /tmp/bsc_mncc' (deprecated).\n"); printf(" -C --no-dbcounter Disable regular syncing of counters to database.\n"); - printf(" -r --rf-ctl PATH A unix domain socket to listen for cmds.\n"); - printf(" -p --pcap PATH Write abis communication to pcap trace file.\n"); } static void handle_options(int argc, char **argv) @@ -164,10 +148,8 @@ {"config-file", 1, 0, 'c'}, {"disable-color", 0, 0, 's'}, {"database", 1, 0, 'l'}, - {"pcap", 1, 0, 'p'}, {"timestamp", 0, 0, 'T'}, {"version", 0, 0, 'V' }, - {"rtp-proxy", 0, 0, 'P'}, {"log-level", 1, 0, 'e'}, {"mncc-sock", 0, 0, 'm'}, {"mncc-sock-path", 1, 0, 'M'}, @@ -175,7 +157,7 @@ {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hd:Dsl:ap:TPVc:e:mCM:", + c = getopt_long(argc, argv, "hd:Dsl:TVc:e:mCM:", long_options, &option_index); if (c == -1) break; @@ -200,17 +182,9 @@ case 'c': msc_cmdline_config.config_file = optarg; break; - case 'p': - create_pcap_file(optarg); - break; case 'T': log_set_print_timestamp(osmo_stderr_target, 1); break; -#if BEFORE_MSCSPLIT - case 'P': - ipacc_rtp_direct = 0; - break; -#endif case 'e': log_set_log_level(osmo_stderr_target, atoi(optarg)); break; -- To view, visit https://gerrit.osmocom.org/3980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3009d2b3dd89eacdf6bc3d9c19744e9fdf4be6c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:16:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:16:21 +0000 Subject: [PATCH] osmo-msc[master]: vty: fix: missing default cmds at hlr node Message-ID: Review at https://gerrit.osmocom.org/3981 vty: fix: missing default cmds at hlr node Without this, it is impossible to exit the 'hlr' node. Change-Id: I53e572194af39a431c54f83cd07e4c41c6fdf7f8 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/81/3981/1 diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index 484e9d5..b6e3ded 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -971,6 +971,7 @@ install_element(CONFIG_NODE, &cfg_hlr_cmd); install_node(&hlr_node, config_write_hlr); + vty_install_default(HLR_NODE); install_element(HLR_NODE, &cfg_hlr_remote_ip_cmd); install_element(HLR_NODE, &cfg_hlr_remote_port_cmd); -- To view, visit https://gerrit.osmocom.org/3981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53e572194af39a431c54f83cd07e4c41c6fdf7f8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:29:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:29:57 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: resource_test: update to check list features (ciphers) ...................................................................... resource_test: update to check list features (ciphers) Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c --- M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/resource_test.py 3 files changed, 182 insertions(+), 237 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index 2005590..b186737 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -1,32 +1,41 @@ # all hardware and interfaces available to this osmo-gsm-tester ip_address: -- addr: 10.42.42.1 - addr: 10.42.42.2 - addr: 10.42.42.3 +- addr: 10.42.42.4 +- addr: 10.42.42.5 +- addr: 10.42.42.6 bts: - label: sysmoBTS 1002 - type: sysmo + type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - 'a5_0' + - 'a5_1' -- label: octBTS 3000 - type: oct - ipa_unit_id: 5 - addr: 10.42.42.115 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.50 band: GSM-1800 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a + launch_trx: true + ciphers: + - 'a5_0' + - 'a5_1' -- label: nanoBTS 1900 - type: nanobts - ipa_unit_id: 1902 - addr: 10.42.42.190 - band: GSM-1900 - trx_list: - - hw_addr: 00:02:95:00:41:b3 +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.51 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + ciphers: + - 'a5_0' + - 'a5_1' arfcn: - arfcn: 512 @@ -39,7 +48,6 @@ band: GSM-1800 - arfcn: 520 band: GSM-1800 - - arfcn: 540 band: GSM-1900 - arfcn: 542 @@ -52,82 +60,38 @@ band: GSM-1900 modem: -- label: m7801 - path: '/wavecom_0' - imsi: 901700000007801 - ki: D620F48487B1B782DA55DF6717F08FF9 +- label: sierra_1 + path: '/sierra_1' + imsi: '901700000009031' + ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' -- label: m7802 - path: '/wavecom_1' - imsi: 901700000007802 - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 +- label: sierra_2 + path: '/sierra_2' + imsi: '901700000009029' + ki: '00969E283349D354A8239E877F2E0866' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' -- label: m7803 - path: '/wavecom_2' - imsi: 901700000007803 - ki: ABBED4C91417DF710F60675B6EE2C8D2 +- label: gobi_0 + path: '/gobi_0' + imsi: '901700000009030' + ki: 'BB70807226393CDBAC8DD3439FF54252' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' -- label: m7804 - path: '/wavecom_3' - imsi: 901700000007804 - ki: 8BA541179156F2BF0918CA3CFF9351B0 - -- label: m7805 - path: '/wavecom_4' - imsi: 901700000007805 - ki: 82BEC24B5B50C9FAA69D17DEC0883A23 - -- label: m7806 - path: '/wavecom_5' - imsi: 901700000007806 - ki: DAF6BD6A188F7A4F09866030BF0F723D - -- label: m7807 - path: '/wavecom_6' - imsi: 901700000007807 - ki: AEB411CFE39681A6352A1EAE4DDC9DBA - -- label: m7808 - path: '/wavecom_7' - imsi: 901700000007808 - ki: F5DEF8692B305D7A65C677CA9EEE09C4 - -- label: m7809 - path: '/wavecom_8' - imsi: 901700000007809 - ki: A644F4503E812FD75329B1C8D625DA44 - -- label: m7810 - path: '/wavecom_9' - imsi: 901700000007810 - ki: EF663BDF3477DCD18D3D2293A2BAED67 - -- label: m7811 - path: '/wavecom_10' - imsi: 901700000007811 - ki: E88F37F048A86A9BC4D652539228C039 - -- label: m7812 - path: '/wavecom_11' - imsi: 901700000007812 - ki: E8D940DD66FCF6F1CD2C0F8F8C45633D - -- label: m7813 - path: '/wavecom_12' - imsi: 901700000007813 - ki: DBF534700C10141C49F699B0419107E3 - -- label: m7814 - path: '/wavecom_13' - imsi: 901700000007814 - ki: B36021DEB90C4EA607E408A92F3B024D - -- label: m7815 - path: '/wavecom_14' - imsi: 901700000007815 - ki: 1E209F6F839F9195778C4F96BE281A24 - -- label: m7816 - path: '/wavecom_15' - imsi: 901700000007816 - ki: BF827D219E739DD189F6F59E60D6455C +- label: gobi_3 + path: '/gobi_3' + imsi: '901700000009032' + ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' + auth_algo: 'xor' + ciphers: + - 'a5_0' + - 'a5_1' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index 416e477..09c276a 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,112 +46,67 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': '07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9', + 'bts': [{'_hash': '377ac78d5404b826d40c84efd04b4a9fd4e62b7e', 'addr': '10.42.42.114', 'band': 'GSM-1800', + 'ciphers': ['a5_0', 'a5_1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', - 'type': 'sysmo'}, - {'_hash': '76c8d2f459113cd6c99ed62d1a94bbe9a291ba94', - 'addr': '10.42.42.115', + 'type': 'osmo-bts-sysmo'}, + {'_hash': '6a9c9fbd364e1563a5b9f0826030a7888fd19575', + 'addr': '10.42.42.50', 'band': 'GSM-1800', - 'ipa_unit_id': '5', - 'label': 'octBTS 3000', - 'trx_list': [{'hw_addr': '00:0c:90:32:b5:8a'}], - 'type': 'oct'}, - {'_hash': '0b7fabd512b36aec43d7d496abd00af4e193b0f8', - 'addr': '10.42.42.190', - 'band': 'GSM-1900', - 'ipa_unit_id': '1902', - 'label': 'nanoBTS 1900', - 'trx_list': [{'hw_addr': '00:02:95:00:41:b3'}], - 'type': 'nanobts'}], - 'ip_address': [{'_hash': 'cde1debf28f07f94f92c761b4b7c6bf35785ced4', - 'addr': '10.42.42.1'}, - {'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c', + 'ciphers': ['a5_0', 'a5_1'], + 'ipa_unit_id': '6', + 'label': 'Ettus B200', + 'launch_trx': 'True', + 'type': 'osmo-bts-trx'}, + {'_hash': 'e50fd38e3bfe8039ac13bc315bc84f46110b7443', + 'addr': '10.42.42.51', + 'band': 'GSM-1800', + 'ciphers': ['a5_0', 'a5_1'], + 'ipa_unit_id': '7', + 'label': 'sysmoCell 5000', + 'trx_remote_ip': '10.42.42.112', + 'type': 'osmo-bts-trx'}], + 'ip_address': [{'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c', 'addr': '10.42.42.2'}, {'_hash': '1c614d6210c551d142aadca8f25e1534ebb2a70f', - 'addr': '10.42.42.3'}], - 'modem': [{'_hash': '19c69e45aa090fb511446bd00797690aa82ff52f', - 'imsi': '901700000007801', - 'ki': 'D620F48487B1B782DA55DF6717F08FF9', - 'label': 'm7801', - 'path': '/wavecom_0'}, - {'_hash': 'e1a46516a1fb493b2617ab14fc1693a9a45ec254', - 'imsi': '901700000007802', - 'ki': '47FDB2D55CE6A10A85ABDAD034A5B7B3', - 'label': 'm7802', - 'path': '/wavecom_1'}, - {'_hash': '4fe91500a309782bb0fd8ac6fc827834089f8b00', - 'imsi': '901700000007803', - 'ki': 'ABBED4C91417DF710F60675B6EE2C8D2', - 'label': 'm7803', - 'path': '/wavecom_2'}, - {'_hash': 'c895badf0c2faaa4a997cd9f2313b5ebda7486e4', - 'imsi': '901700000007804', - 'ki': '8BA541179156F2BF0918CA3CFF9351B0', - 'label': 'm7804', - 'path': '/wavecom_3'}, - {'_hash': '60f182abed05adb530e3d06d88cc47703b65d7d8', - 'imsi': '901700000007805', - 'ki': '82BEC24B5B50C9FAA69D17DEC0883A23', - 'label': 'm7805', - 'path': '/wavecom_4'}, - {'_hash': 'd1f0fbf089a4bf32dd566af956d23b89e3d60821', - 'imsi': '901700000007806', - 'ki': 'DAF6BD6A188F7A4F09866030BF0F723D', - 'label': 'm7806', - 'path': '/wavecom_5'}, - {'_hash': '2445e3b5949d15f4351c0db1d3f3f593f9d73aa5', - 'imsi': '901700000007807', - 'ki': 'AEB411CFE39681A6352A1EAE4DDC9DBA', - 'label': 'm7807', - 'path': '/wavecom_6'}, - {'_hash': '80247388b2ca382382c4aec678102355b7922965', - 'imsi': '901700000007808', - 'ki': 'F5DEF8692B305D7A65C677CA9EEE09C4', - 'label': 'm7808', - 'path': '/wavecom_7'}, - {'_hash': '5b9e4e117a8889430542d22a9693e7b999362856', - 'imsi': '901700000007809', - 'ki': 'A644F4503E812FD75329B1C8D625DA44', - 'label': 'm7809', - 'path': '/wavecom_8'}, - {'_hash': '219a7abb057050eef3ce4b99c487f32bbaae9a41', - 'imsi': '901700000007810', - 'ki': 'EF663BDF3477DCD18D3D2293A2BAED67', - 'label': 'm7810', - 'path': '/wavecom_9'}, - {'_hash': '75d45c2d975b893da34c7cae827c25a2039cecd2', - 'imsi': '901700000007811', - 'ki': 'E88F37F048A86A9BC4D652539228C039', - 'label': 'm7811', - 'path': '/wavecom_10'}, - {'_hash': '1777362f556b249a5c1d6a83110704dbd037bc20', - 'imsi': '901700000007812', - 'ki': 'E8D940DD66FCF6F1CD2C0F8F8C45633D', - 'label': 'm7812', - 'path': '/wavecom_11'}, - {'_hash': '21d7eb4b0c782e004821a9f7f778891c93956924', - 'imsi': '901700000007813', - 'ki': 'DBF534700C10141C49F699B0419107E3', - 'label': 'm7813', - 'path': '/wavecom_12'}, - {'_hash': 'f53e4e79bdbc63eb2845de671007d4f733f28409', - 'imsi': '901700000007814', - 'ki': 'B36021DEB90C4EA607E408A92F3B024D', - 'label': 'm7814', - 'path': '/wavecom_13'}, - {'_hash': 'df1abec7704ebc89b2c062a69bd299cf3663ed9e', - 'imsi': '901700000007815', - 'ki': '1E209F6F839F9195778C4F96BE281A24', - 'label': 'm7815', - 'path': '/wavecom_14'}, - {'_hash': '11df1e4c7708157e5b89020c757763f58d6e610b', - 'imsi': '901700000007816', - 'ki': 'BF827D219E739DD189F6F59E60D6455C', - 'label': 'm7816', - 'path': '/wavecom_15'}]} + 'addr': '10.42.42.3'}, + {'_hash': '862b529c701adf302477bc126a8032cfc2ec4753', + 'addr': '10.42.42.4'}, + {'_hash': '05feb6e1e24ca4235889eb28d0a8d5cedac6e5d1', + 'addr': '10.42.42.5'}, + {'_hash': 'e780ac7581ad29f8f46e637b61d0c38898c4c52c', + 'addr': '10.42.42.6'}], + 'modem': [{'_hash': 'f392ed391f9d39abb6ae01431b26b4f44079a447', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009031', + 'ki': '80A37E6FDEA931EAC92FFA5F671EFEAD', + 'label': 'sierra_1', + 'path': '/sierra_1'}, + {'_hash': '1b3cf2a04bde791a84fcc462c29f73391b1f7313', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009029', + 'ki': '00969E283349D354A8239E877F2E0866', + 'label': 'sierra_2', + 'path': '/sierra_2'}, + {'_hash': '83f7b4a07c355487d31db6f068146e48bb1ed118', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009030', + 'ki': 'BB70807226393CDBAC8DD3439FF54252', + 'label': 'gobi_0', + 'path': '/gobi_0'}, + {'_hash': 'a5f8f08a24df0eca067c5b51d55c3c4fd8721908', + 'auth_algo': 'xor', + 'ciphers': ['a5_0', 'a5_1'], + 'imsi': '901700000009032', + 'ki': '2F70DCA43C45ACB97E947FDD0C7CA30A', + 'label': 'gobi_3', + 'path': '/gobi_3'}]} *** end: all resources - request some resources @@ -163,34 +118,47 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +--- testowner: DBG: Picked - _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e addr: 10.42.42.114 band: GSM-1800 + ciphers: + - a5_0 + - a5_1 ipa_unit_id: '1' label: sysmoBTS 1002 - type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 - addr: 10.42.42.115 + type: osmo-bts-sysmo +- _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 + addr: 10.42.42.50 band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct ---- testowner: Reserving 1 x ip_address (candidates: 3) ---- testowner: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 - addr: 10.42.42.1 ---- testowner: Reserving 2 x modem (candidates: 16) ---- testowner: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f - imsi: '901700000007801' - ki: D620F48487B1B782DA55DF6717F08FF9 - label: m7801 - path: /wavecom_0 -- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 - imsi: '901700000007802' - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 - label: m7802 - path: /wavecom_1 + ciphers: + - a5_0 + - a5_1 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + type: osmo-bts-trx +--- testowner: Reserving 1 x ip_address (candidates: 5) +--- testowner: DBG: Picked - _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c + addr: 10.42.42.2 +--- testowner: Reserving 2 x modem (candidates: 4) +--- testowner: DBG: Picked - _hash: f392ed391f9d39abb6ae01431b26b4f44079a447 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009031' + ki: 80A37E6FDEA931EAC92FFA5F671EFEAD + label: sierra_1 + path: /sierra_1 +- _hash: 1b3cf2a04bde791a84fcc462c29f73391b1f7313 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009029' + ki: 00969E283349D354A8239E877F2E0866 + label: sierra_2 + path: /sierra_2 ~~~ currently reserved: arfcn: - _hash: e620569450f8259b3f0212ec19c285dd07df063c @@ -202,39 +170,52 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +- _hash: 377ac78d5404b826d40c84efd04b4a9fd4e62b7e _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - a5_0 + - a5_1 ipa_unit_id: '1' label: sysmoBTS 1002 - type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + type: osmo-bts-sysmo +- _hash: 6a9c9fbd364e1563a5b9f0826030a7888fd19575 _reserved_by: testowner-123-1490837279 - addr: 10.42.42.115 + addr: 10.42.42.50 band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct + ciphers: + - a5_0 + - a5_1 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + type: osmo-bts-trx ip_address: -- _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 +- _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c _reserved_by: testowner-123-1490837279 - addr: 10.42.42.1 + addr: 10.42.42.2 modem: -- _hash: 19c69e45aa090fb511446bd00797690aa82ff52f +- _hash: f392ed391f9d39abb6ae01431b26b4f44079a447 _reserved_by: testowner-123-1490837279 - imsi: '901700000007801' - ki: D620F48487B1B782DA55DF6717F08FF9 - label: m7801 - path: /wavecom_0 -- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009031' + ki: 80A37E6FDEA931EAC92FFA5F671EFEAD + label: sierra_1 + path: /sierra_1 +- _hash: 1b3cf2a04bde791a84fcc462c29f73391b1f7313 _reserved_by: testowner-123-1490837279 - imsi: '901700000007802' - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 - label: m7802 - path: /wavecom_1 + auth_algo: xor + ciphers: + - a5_0 + - a5_1 + imsi: '901700000009029' + ki: 00969E283349D354A8239E877F2E0866 + label: sierra_2 + path: /sierra_2 ~~~ end: currently reserved diff --git a/selftest/resource_test.py b/selftest/resource_test.py index ca723af..e4324f6 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -73,9 +73,9 @@ print('- request some resources') want = { 'ip_address': [ { 'times': 1 } ], - 'bts': [ { 'type': 'sysmo', 'times': 1 }, { 'type': 'oct', 'times': 1 } ], + 'bts': [ { 'type': 'osmo-bts-sysmo', 'times': 1 , 'ciphers': ['a5_1']}, { 'type': 'osmo-bts-trx', 'times': 1 } ], 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], - 'modem': [ { 'times': 2 } ], + 'modem': [ { 'times': 2 , 'ciphers': ['a5_0', 'a5_1']} ], } origin = log.Origin(None, 'testowner') -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 12 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:29:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:29:57 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resource_test: Fix trailing whitespace In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: resource_test: Fix trailing whitespace ...................................................................... resource_test: Fix trailing whitespace Change-Id: I654484b21ca2e950ff3019ee20133e9cb50296bb --- M selftest/resource_test.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/resource_test.py b/selftest/resource_test.py index e4324f6..52d8e47 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -37,7 +37,7 @@ try: resource.solve([ [0, 2], [2], - [0, 2] ]) + [0, 2] ]) assert False except resource.NotSolvable as e: print(e) -- To view, visit https://gerrit.osmocom.org/3816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I654484b21ca2e950ff3019ee20133e9cb50296bb Gerrit-PatchSet: 9 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:29:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:29:58 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Add cipher cfg param for modem and bts ...................................................................... Add cipher cfg param for modem and bts This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e --- M example/default-suites.conf M example/resources.conf A example/scenarios/cipher-a50.conf A example/scenarios/cipher-a51.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 31 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..1e8d47a 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption +- aoip_encryption:cipher-a50+cipher-a51 diff --git a/example/resources.conf b/example/resources.conf index f190c2f..95cb8cf 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -13,6 +13,7 @@ ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: [a5_0, a5_1, a5_3] - label: Ettus B200 type: osmo-bts-trx @@ -20,6 +21,7 @@ addr: 10.42.42.50 band: GSM-1800 launch_trx: true + ciphers: [a5_0, a5_1] - label: sysmoCell 5000 type: osmo-bts-trx @@ -27,6 +29,7 @@ addr: 10.42.42.51 band: GSM-1800 trx_remote_ip: 10.42.42.112 + ciphers: [a5_0, a5_1] arfcn: - arfcn: 512 @@ -56,21 +59,25 @@ imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' + ciphers: [a5_0, a5_1] - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' + ciphers: [a5_0, a5_1] diff --git a/example/scenarios/cipher-a50.conf b/example/scenarios/cipher-a50.conf new file mode 100644 index 0000000..107172b --- /dev/null +++ b/example/scenarios/cipher-a50.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - a5_0 + modem: + - ciphers: + - a5_0 diff --git a/example/scenarios/cipher-a51.conf b/example/scenarios/cipher-a51.conf new file mode 100644 index 0000000..8539867 --- /dev/null +++ b/example/scenarios/cipher-a51.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - a5_1 + modem: + - ciphers: + - a5_1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 150e28b..dab3453 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -56,6 +56,7 @@ 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, + 'bts[].ciphers[]': schema.CIPHER, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'bts[].trx_list[].nominal_power': schema.UINT, @@ -67,6 +68,7 @@ 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, + 'modem[].ciphers[]': schema.CIPHER, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index dcdfdb1..9a0906c 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -76,6 +76,11 @@ if n < 1: raise ValueError('Positive value >0 expected instead of %d' % n) +def cipher(val): + if val in ('a5_0', 'a5_1', 'a5_2', 'a5_3', 'a5_4', 'a5_5', 'a5_6', 'a5_7'): + return + raise ValueError('Unknown Cipher value: %r' % val) + INT = 'int' STR = 'str' UINT = 'uint' @@ -88,6 +93,7 @@ MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' TIMES='times' +CIPHER = 'cipher' SCHEMA_TYPES = { INT: int, STR: str, @@ -101,6 +107,7 @@ MSISDN: msisdn, AUTH_ALGO: auth_algo, TIMES: times, + CIPHER: cipher, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 12 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:29:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:29:59 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Add features attribute to modems In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Add features attribute to modems ...................................................................... Add features attribute to modems The idea behind this attribute is similar to the Features one in ofono: To provide an easy-to-use list of features that a modem supports. In osmo-gsm-tester this feature list can be used to create scenarios to act as a filter for modems. For instance, if an sms related feature must be tested, then a modem supporting sms features is required. This way only modems supporting that feature are going to be selected for that test when that scenario is used. We provide our own list instead of dynamically using it for two reasons: - Accessing the list from ofono means powering on + online the modem, which requires using the modem before resource resolution is done. - ofono may state that it has support for feature X, but it still doesn't have all features required by osmo-gsm-tester or there is a bug in some part of the feature which prevents it from being used for a specific test. Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 --- M example/resources.conf A example/scenarios/mfeature-gprs.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 4 files changed, 17 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/resources.conf b/example/resources.conf index 95cb8cf..3daf677 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -60,6 +60,7 @@ ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: sierra_2 path: '/sierra_2' @@ -67,6 +68,7 @@ ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: gobi_0 path: '/gobi_0' @@ -74,6 +76,7 @@ ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['sms'] - label: gobi_3 path: '/gobi_3' @@ -81,3 +84,4 @@ ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' ciphers: [a5_0, a5_1] + features: ['gprs'] diff --git a/example/scenarios/mfeature-gprs.conf b/example/scenarios/mfeature-gprs.conf new file mode 100644 index 0000000..c520a90 --- /dev/null +++ b/example/scenarios/mfeature-gprs.conf @@ -0,0 +1,4 @@ +resources: + modem: + - features: + - 'gprs' diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index dab3453..f1697ea 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -69,6 +69,7 @@ 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, 'modem[].ciphers[]': schema.CIPHER, + 'modem[].features[]': schema.MODEM_FEATURE, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 9a0906c..6d5f7ad 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -81,6 +81,11 @@ return raise ValueError('Unknown Cipher value: %r' % val) +def modem_feature(val): + if val in ('sms', 'gprs', 'voicecall', 'ussd'): + return + raise ValueError('Unknown Modem Feature: %r' % val) + INT = 'int' STR = 'str' UINT = 'uint' @@ -94,6 +99,8 @@ AUTH_ALGO = 'auth_algo' TIMES='times' CIPHER = 'cipher' +MODEM_FEATURE = 'modem_feature' + SCHEMA_TYPES = { INT: int, STR: str, @@ -108,6 +115,7 @@ AUTH_ALGO: auth_algo, TIMES: times, CIPHER: cipher, + MODEM_FEATURE: modem_feature, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1634049f01859ae0310174892a96e204bb670bc1 Gerrit-PatchSet: 9 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:29:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:29:59 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Use own format to specify encryption algorithm In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Use own format to specify encryption algorithm ...................................................................... Use own format to specify encryption algorithm ... instead of using the one from from osmo vty directly. This way we avoid having multiple word attribute value and we can skip using quotes in the conf files. Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d --- M example/defaults.conf M selftest/template_test/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/util.py M suites/aoip_encryption/register_a5_0_authopt.py M suites/aoip_encryption/register_a5_0_authreq.py M suites/aoip_encryption/register_a5_1_authreq.py 9 files changed, 26 insertions(+), 13 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/defaults.conf b/example/defaults.conf index f6ecedd..e2921a4 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -5,7 +5,7 @@ short_name: osmo-gsm-tester-nitb long_name: osmo-gsm-tester-nitb auth_policy: closed - encryption: a5 0 + encryption: a5_0 bsc: net: @@ -14,7 +14,7 @@ short_name: osmo-gsm-tester-msc long_name: osmo-gsm-tester-msc auth_policy: closed - encryption: a5 0 + encryption: a5_0 authentication: optional msc: @@ -24,7 +24,7 @@ short_name: osmo-gsm-tester-msc long_name: osmo-gsm-tester-msc auth_policy: closed - encryption: a5 0 + encryption: a5_0 authentication: optional bsc_bts: diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 200dfdc..2559b14 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -24,7 +24,7 @@ long name ${net_name_long} auth policy ${net_auth_policy} location updating reject cause 13 - encryption a5 ${encryption} + encryption ${encryption} neci 1 rrlp mode none mm info 1 diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index f9eb858..5fbeea6 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -81,7 +81,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(bsc=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['bsc']['net']['encryption']) + config.overlay(values, dict(bsc=dict(net=dict(encryption=encryption_vty)))) self.dbg('BSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index f023b29..67234e3 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -81,7 +81,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['msc']['net']['encryption']) + config.overlay(values, dict(msc=dict(net=dict(encryption=encryption_vty)))) if self.authentication is not None: config.overlay(values, dict(msc=dict(net=dict(authentication=self.authentication)))) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 8f91bbd..b0a706d 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -82,7 +82,10 @@ # runtime parameters: if self.encryption is not None: - config.overlay(values, dict(nitb=dict(net=dict(encryption=self.encryption)))) + encryption_vty = util.encryption2osmovty(self.encryption) + else: + encryption_vty = util.encryption2osmovty(values['nitb']['net']['encryption']) + config.overlay(values, dict(nitb=dict(net=dict(encryption=encryption_vty)))) self.config = values diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index bb4c524..c07bcf2 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -337,4 +337,8 @@ return () raise ValueError('type %r not supported!' % t) +def encryption2osmovty(val): + assert val[:3] == 'a5_' + return 'a5 ' + val[3:] + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py index ff93cb8..0224ee0 100755 --- a/suites/aoip_encryption/register_a5_0_authopt.py +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(False) -msc.set_encryption('a5 0') -bsc.set_encryption('a5 0') +msc.set_encryption('a5_0') +bsc.set_encryption('a5_0') hlr.start() stp.start() msc.start() diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index 051f5e2..114c628 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(True) -msc.set_encryption('a5 0') -bsc.set_encryption('a5 0') +msc.set_encryption('a5_0') +bsc.set_encryption('a5_0') hlr.start() stp.start() msc.start() diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index 11ee006..a84fa3a 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -11,8 +11,8 @@ print('start network...') msc.set_authentication(True) -msc.set_encryption('a5 1') -bsc.set_encryption('a5 1') +msc.set_encryption('a5_1') +bsc.set_encryption('a5_1') hlr.start() stp.start() msc.start() -- To view, visit https://gerrit.osmocom.org/3815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5265cc9990dd5e99dba1f6262b3a8c597a3e958d Gerrit-PatchSet: 9 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:30:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:30:00 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resource: Allow passing keyword args to NoResourceExn In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: resource: Allow passing keyword args to NoResourceExn ...................................................................... resource: Allow passing keyword args to NoResourceExn Same code is already being used by log.Error exception. This way we can use: raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) And get: osmo_gsm_tester.resource.NoResourceExn: No free arfcns in any of bands {bands=['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900']} Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 --- M src/osmo_gsm_tester/resource.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index f1697ea..7e55129 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -208,7 +208,7 @@ return next_msisdn -class NoResourceExn(Exception): +class NoResourceExn(log.Error): pass class Resources(dict): -- To view, visit https://gerrit.osmocom.org/3954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic960ae8db5372b0a4640356f0b4820ed42477b46 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:30:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:30:00 +0000 Subject: [MERGED] osmo-gsm-tester[master]: suite_test: Update tests to check new feature fixes In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: suite_test: Update tests to check new feature fixes ...................................................................... suite_test: Update tests to check new feature fixes Now that combination and matching of lists works properly, update the suite test to check a more complex scenario. Change-Id: Ib0b82dc0c2a7f27cd6b2ffc32eed5f1287692ddc --- M selftest/suite_test.ok M selftest/suite_test.py M selftest/suite_test/test_suite/suite.conf 3 files changed, 70 insertions(+), 52 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 9c73588..cd5a9e7 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -15,8 +15,10 @@ timeout: 60s resources: bts: + - label: sysmoCell 5000 + times: '2' - times: '1' - - times: '2' + type: sysmo ip_address: - times: '1' modem: @@ -31,30 +33,37 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'label': 'sysmoCell 5000'}, {'label': 'sysmoCell 5000'}, {'type': 'sysmo'}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 3 x bts (candidates: 6) -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - max_power_red: '3' + nominal_power: '10' + - max_power_red: '0' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 9eaa928b04ce04b19dbae972f9bfc3eea6f5e249 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - max_power_red: '1' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 - addr: 10.42.42.115 - band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct -- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 - addr: 10.42.42.190 - band: GSM-1900 - ipa_unit_id: '1902' - label: nanoBTS 1900 - trx_list: - - hw_addr: 00:02:95:00:41:b3 - type: nanobts tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 @@ -166,31 +175,38 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'label': 'sysmoCell 5000'}, {'label': 'sysmoCell 5000'}, {'type': 'sysmo'}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - max_power_red: '3' + nominal_power: '10' + - max_power_red: '0' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 9eaa928b04ce04b19dbae972f9bfc3eea6f5e249 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - max_power_red: '1' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx +- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 - addr: 10.42.42.115 - band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct -- _hash: 0b7fabd512b36aec43d7d496abd00af4e193b0f8 - addr: 10.42.42.190 - band: GSM-1900 - ipa_unit_id: '1902' - label: nanoBTS 1900 - trx_list: - - hw_addr: 00:02:95:00:41:b3 - type: nanobts [resource.py:[LINENR]] tst test_suite: Reserving 1 x ip_address (candidates: 3) [resource.py:[LINENR]] tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 @@ -237,21 +253,10 @@ --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... [suite.py:[LINENR]] tst test_suite: DBG: {combining='resources'} [suite.py:[LINENR]] -tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{}, {}, {}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'label': 'sysmoCell 5000'}, {'label': 'sysmoCell 5000'}, {'type': 'sysmo'}], ip_address=[{}], modem=[{}, {}]}} [test_suite?{combining_scenarios='resources'}] [suite.py:[LINENR]] tst {combining_scenarios='resources', scenario='foo'}: [RESOURCE_DICT] tst test_suite: Reserving 3 x bts (candidates: 6) [resource.py:[LINENR]] -tst test_suite: DBG: Picked - _hash: 89e45aaea42027162cc33f4389f055077338c82b - addr: 10.42.42.52 - band: GSM-1800 - ipa_unit_id: '6' - label: Ettus B200 - launch_trx: 'True' - trx_list: - - max_power_red: '2' - nominal_power: '10' - - nominal_power: '12' - type: osmo-bts-trx -- _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 +tst test_suite: DBG: Picked - _hash: 076ff06a4b719e61779492d3fb99f42a6635bb72 addr: 10.42.42.53 band: GSM-1800 ipa_unit_id: '7' @@ -263,6 +268,17 @@ nominal_power: '12' trx_remote_ip: 10.42.42.112 type: osmo-bts-trx +- _hash: 9eaa928b04ce04b19dbae972f9bfc3eea6f5e249 + addr: 10.42.42.53 + band: GSM-1800 + ipa_unit_id: '7' + label: sysmoCell 5000 + trx_list: + - nominal_power: '10' + - max_power_red: '1' + nominal_power: '12' + trx_remote_ip: 10.42.42.112 + type: osmo-bts-trx - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 12bd5e7..a8b0f37 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -45,7 +45,7 @@ print('- test with half empty scenario') trial = log.Origin(log.C_TST, 'trial') scenario = config.Scenario('foo', 'bar') -scenario['resources'] = { 'bts': [{'type': 'sysmo'}] } +scenario['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] } s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) diff --git a/selftest/suite_test/test_suite/suite.conf b/selftest/suite_test/test_suite/suite.conf index 890f66a..925dedb 100644 --- a/selftest/suite_test/test_suite/suite.conf +++ b/selftest/suite_test/test_suite/suite.conf @@ -2,8 +2,10 @@ ip_address: - times: 1 bts: - - times: 1 - times: 2 + label: sysmoCell 5000 + - times: 1 + type: sysmo modem: - times: 2 -- To view, visit https://gerrit.osmocom.org/3953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib0b82dc0c2a7f27cd6b2ffc32eed5f1287692ddc Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:31:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:31:16 +0000 Subject: [MERGED] libosmo-abis[master]: cosmetic: ipa.c: use msgb_dequeue(), drop local var In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: ipa.c: use msgb_dequeue(), drop local var ...................................................................... cosmetic: ipa.c: use msgb_dequeue(), drop local var Make ipa_server_conn_write() a lot simpler and shorter by using msgb_dequeue() and avoiding local pointer that was used only once. Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 --- M src/input/ipa.c 1 file changed, 3 insertions(+), 7 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/input/ipa.c b/src/input/ipa.c index ce155ce..fbed038 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -358,20 +358,16 @@ static void ipa_server_conn_write(struct ipa_server_conn *conn) { - struct osmo_fd *ofd = &conn->ofd; struct msgb *msg; - struct llist_head *lh; int ret; LOGP(DLINP, LOGL_DEBUG, "sending data\n"); + msg = msgb_dequeue(&conn->tx_queue); - if (llist_empty(&conn->tx_queue)) { - ofd->when &= ~BSC_FD_WRITE; + if (!msg) { + conn->ofd.when &= ~BSC_FD_WRITE; return; } - lh = conn->tx_queue.next; - llist_del(lh); - msg = llist_entry(lh, struct msgb, list); ret = send(conn->ofd.fd, msg->data, msg->len, 0); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/3942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:33:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:33:24 +0000 Subject: [ABANDON] osmo-msc[master]: fix deb: drop obsolete mgcp header In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: fix deb: drop obsolete mgcp header ...................................................................... Abandoned this is a bit more complex. This may work when the next batch of osmo-mgw patches are merged, which create an libosmo-mgcp alongside the libosmo-legacy-mgcp. I could spend considerable time on applying that now, but I'd rather wait until we've clarified a last patch by pmaier and can merge those patches, then clean this up from there. Unfortunately, the osmo-msc deb package will not work until this is through. -- To view, visit https://gerrit.osmocom.org/3971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6b9454698976bdba3b1e0498a81bad9855eee45e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 18 22:38:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 18 Sep 2017 22:38:06 +0000 Subject: [PATCH] osmo-msc[master]: ctrl: remove unimplemented cmds subscriber-{modify, delete} Message-ID: Review at https://gerrit.osmocom.org/3982 ctrl: remove unimplemented cmds subscriber-{modify,delete} Change-Id: I754de5d08c053fea5f1ca2673b0ac4d26a85778a --- M src/libmsc/ctrl_commands.c 1 file changed, 0 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/82/3982/1 diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index 4767ddd..c6236ed 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -31,26 +31,6 @@ static struct gsm_network *msc_ctrl_net = NULL; -static int verify_subscriber_modify(struct ctrl_cmd *cmd, const char *value, void *d) -{ - return 0; -} - -static int set_subscriber_modify(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "Command moved to osmo-hlr, no longer available here"; - return CTRL_CMD_ERROR; -} - -CTRL_CMD_DEFINE_WO(subscriber_modify, "subscriber-modify-v1"); - -static int set_subscriber_delete(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "Command moved to osmo-hlr, no longer available here"; - return CTRL_CMD_ERROR; -} -CTRL_CMD_DEFINE_WO_NOVRF(subscriber_delete, "subscriber-delete-v1"); - static int get_subscriber_list(struct ctrl_cmd *cmd, void *d) { struct vlr_subscr *vsub; @@ -84,8 +64,6 @@ int rc = 0; msc_ctrl_net = net; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_subscriber_modify); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_subscriber_delete); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_subscriber_list); return rc; } -- To view, visit https://gerrit.osmocom.org/3982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I754de5d08c053fea5f1ca2673b0ac4d26a85778a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 18 23:26:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 18 Sep 2017 23:26:06 +0000 Subject: [MERGED] libsmpp34[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: contrib: Enable -Werror by default ...................................................................... contrib: Enable -Werror by default Change-Id: I2a88cdcbf76ea28a30e82836030f894c2152d5ed --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7a388c2..79d101e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -4,6 +4,6 @@ autoreconf --install --force ./configure -$MAKE +$MAKE CFLAGS="-Werror" CPPFLAGS="-Werror" # currently broken $MAKE $PARALLEL_MAKE # currently broken $MAKE distcheck -- To view, visit https://gerrit.osmocom.org/3972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a88cdcbf76ea28a30e82836030f894c2152d5ed Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 18 23:34:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 18 Sep 2017 23:34:15 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: https://gerrit.osmocom.org/#/c/3830/ has been merged, so some changes in this patch can be re-submitted again on top it: - documentation for the function. - Add the "osmuxh->ft == OSMUX_FT_VOICE_AMR &&" check. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 00:45:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 00:45:09 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: INSTALL.txt: add missing dep and vty ref howto Message-ID: Review at https://gerrit.osmocom.org/3983 INSTALL.txt: add missing dep and vty ref howto Change-Id: I1068d665b91faf1faa1b295503fcdc33f4ac500a --- M INSTALL.txt 1 file changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/83/3983/1 diff --git a/INSTALL.txt b/INSTALL.txt index 39653d3..2669c0c 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -7,9 +7,31 @@ dblatex \ mscgen \ graphviz \ - python-pychart + python-pychart \ + python-nwdiag Build PDFs, run: make or for a parallel build using more CPU cores: make -j 5 + +To update the VTY reference for a given program, use osmodumpdoc.py, available +from git.osmocom.org/python/osmo-python-tests -- for example, for osmo-msc: + + cd ~/osmo-python-tests + ./setup.py install + + cd ~/osmo-msc + mkdir build + cd build + ../configure --enable-smpp + make + osmodumpdoc.py -p ~/osmo-msc + + cp doc/msc_vty_reference.xml ~/osmo-gsm-manuals/OsmoMSC/vty/ + cd ~/osmo-gsm-manuals/OsmoMSC + git status + git diff + make + git commit -a -m "OsmoMSC: update VTY reference" + git push origin HEAD:refs/for/master/msc_vty -- To view, visit https://gerrit.osmocom.org/3983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1068d665b91faf1faa1b295503fcdc33f4ac500a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 00:45:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 00:45:09 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: fix make deps: join hint_to_remove_draft_mode to build step Message-ID: Review at https://gerrit.osmocom.org/3984 fix make deps: join hint_to_remove_draft_mode to build step Change-Id: Iecf8e18ce2f1dac61bf55019e1fec601b33abb95 --- M build/Makefile.asciidoc.inc 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/84/3984/1 diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index 660d72a..e088624 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -29,14 +29,11 @@ all: $(ASCIIDOCPDFS) -.PHONY: hint_to_remove_draft_mode -hint_to_remove_draft_mode: +$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ || true - -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc hint_to_remove_draft_mode a2x $(A2X_OPTS) $< || asciidoc -v $(ASCIIDOC_OPTS) $< check: $(ASCIIDOC_CHECKS) -- To view, visit https://gerrit.osmocom.org/3984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecf8e18ce2f1dac61bf55019e1fec601b33abb95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 00:45:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 00:45:10 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: fix make deps: don't use the FORCE Message-ID: Review at https://gerrit.osmocom.org/3985 fix make deps: don't use the FORCE With the FORCE dependency in place, every 'make' invocation builds all from scratch all the time. Remove that to have intelligent re-build on edits. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoMGCP/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.inc 9 files changed, 19 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/3985/1 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..97b87ba 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,9 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals - -EXTRA_DEPS = gen-bsc-vty-docbook - topdir = . bsc_reference = $(topdir)/osmobsc-vty-reference.xml manuals = $(bsc_reference) @@ -20,7 +17,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmobsc-usermanual.pdf: chapters/*.adoc +osmobsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml osmux-reference.pdf: osmux-reference.adoc aoip-mgw-options.pdf: aoip-mgw-options.adoc @@ -37,7 +34,7 @@ -rm osmux-reference__*.png -rm osmux-reference__*.check -gen-bsc-vty-docbook: FORCE +generated/docbook_vty.xml: osmobsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/bsc_vty_reference.xml, \ diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..58b8250 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-bts-vty-docbook - topdir = . bts_reference = $(topdir)/osmobts-vty-reference.xml manuals = $(bts_reference) @@ -19,7 +17,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmobts-abis.pdf: abis/*.adoc abis/*.msc +osmobts-abis.pdf: abis/*.adoc abis/*.msc generated/docbook_vty.xml osmobts-usermanual.pdf: chapters/*.adoc clean: @@ -33,7 +31,7 @@ -rm osmobts-abis*.check -rm osmobts-usermanual*.check -gen-bts-vty-docbook: FORCE +generated/docbook_vty.xml: osmobts-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/bts_vty_reference.xml, \ diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..9602f55 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-ggsn-vty-docbook - topdir = . ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml manuals = $(ggsn_reference) @@ -19,14 +17,14 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +osmoggsn-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png -rm osmoggsn-usermanual.check -gen-ggsn-vty-docbook: FORCE +generated/docbook_vty.xml: osmoggsn-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..8848af8 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,7 +1,7 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-mgcp-vty-docbook +EXTRA_DEPS = generated/docbook_vty.xml topdir = . mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml @@ -18,7 +18,7 @@ clean: -rm -rf $(cleanfiles) -gen-mgcp-vty-docbook: FORCE +generated/docbook_vty.xml: osmomgcp-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fe7ed1a 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,7 +1,7 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-nat-vty-docbook +EXTRA_DEPS = generated/docbook_vty.xml topdir = . nat_reference = $(topdir)/osmonat-vty-reference.xml @@ -18,7 +18,7 @@ clean: -rm -rf $(cleanfiles) -gen-nat-vty-docbook: FORCE +generated/docbook_vty.xml: osmonat-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/nat_vty_reference.xml, \ diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..5b73459 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -19,7 +19,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +osmonitb-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) @@ -27,7 +27,7 @@ -rm osmonitb-usermanual__*.png -rm osmonitb-usermanual.check -gen-nitb-vty-docbook: FORCE +generated/docbook_vty.xml: osmonitb-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/nitb_vty_reference.xml, \ diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..5be9700 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-vty-docbook - topdir = . pcu_reference = $(topdir)/osmopcu-vty-reference.xml manuals = $(bts_manual) $(pcu_reference) @@ -19,8 +17,8 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmopcu-gb.pdf: gb/*.adoc gb/*.msc -osmopcu-usermanual.pdf: chapters/*.adoc +osmopcu-gb.pdf: gb/*.adoc gb/*.msc generated/docbook_vty.xml +osmopcu-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) @@ -29,7 +27,7 @@ -rm osmopcu-usermanual__*.svg -rm osmopcu-usermanual.check -gen-vty-docbook: FORCE +generated/docbook_vty.xml: osmopcu-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..1c01af7 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-sgsn-vty-docbook - topdir = . sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml manuals = $(sgsn_reference) @@ -19,14 +17,14 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +osmosgsn-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png -rm osmosgsn-usermanual.check -gen-sgsn-vty-docbook: FORCE +generated/docbook_vty.xml: osmosgsn-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ diff --git a/build/Makefile.inc b/build/Makefile.inc index 3905cb0..9c17176 100644 --- a/build/Makefile.inc +++ b/build/Makefile.inc @@ -27,21 +27,16 @@ all: $(types) -$(types): FORCE - - pdf: $(pdfs) $(manuals) # Lint the file -%.xml-lint: %.xml FORCE +%.xml-lint: %.xml $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) # Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE +%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) upload: $(pdfs) $(ASCIIDOCPDFS) rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 00:45:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 00:45:33 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoNITB: update vty reference Message-ID: Review at https://gerrit.osmocom.org/3986 OsmoNITB: update vty reference Change node IDs to use the names derived from the node prompt. Related: I8fa555570268b231c5e01727c661da92fad265de (libosmocore) Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 --- M OsmoNITB/vty/nitb_vty_additions.xml M OsmoNITB/vty/nitb_vty_reference.xml 2 files changed, 761 insertions(+), 118 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/86/3986/1 diff --git a/OsmoNITB/vty/nitb_vty_additions.xml b/OsmoNITB/vty/nitb_vty_additions.xml index 0d473bd..7ea60dc 100644 --- a/OsmoNITB/vty/nitb_vty_additions.xml +++ b/OsmoNITB/vty/nitb_vty_additions.xml @@ -1,20 +1,20 @@ - - + + MNCC Internal Configuration This node allows to configure the default codecs for the internal call control handling. - - + + SMPP Configuration This node allows to configure the SMPP interface for interfacing with external SMS applications. This section contains generic/common SMPP related configuration, and no per-ESME specific parameters. - - + + ESME Configuration This node allows to configure one particular SMPP ESME, which is an External SMS Entity such as a SMS based diff --git a/OsmoNITB/vty/nitb_vty_reference.xml b/OsmoNITB/vty/nitb_vty_reference.xml index 5f49b09..2e30dd6 100644 --- a/OsmoNITB/vty/nitb_vty_reference.xml +++ b/OsmoNITB/vty/nitb_vty_reference.xml @@ -1,7 +1,7 @@ - + - + @@ -202,7 +202,7 @@ - + @@ -233,6 +233,7 @@ + @@ -243,6 +244,13 @@ + + + + + + + @@ -307,6 +315,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -423,6 +459,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -454,10 +521,17 @@ + + + + + + + - + - + @@ -719,7 +793,7 @@ - + @@ -750,6 +824,7 @@ + @@ -760,6 +835,13 @@ + + + + + + + @@ -820,6 +902,13 @@ + + + + + + + @@ -833,6 +922,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -840,6 +963,14 @@ + + + + + + + + @@ -936,6 +1067,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1052,6 +1211,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1092,6 +1282,17 @@ + + + + + + + + + + + @@ -1209,8 +1410,15 @@ + + + + + + + - + @@ -1372,6 +1580,11 @@ + + + + + @@ -1488,11 +1701,6 @@ - - - - - @@ -1513,8 +1721,13 @@ + + + + + - + @@ -1607,7 +1820,7 @@ - + @@ -1638,6 +1851,7 @@ + @@ -1648,6 +1862,13 @@ + + + + + + + @@ -1678,7 +1899,7 @@ - + @@ -1795,7 +2016,7 @@ - + @@ -1863,7 +2084,7 @@ - + @@ -1913,7 +2134,7 @@ - + @@ -1922,6 +2143,7 @@ + @@ -1930,6 +2152,14 @@ + + + + + + + + @@ -1973,7 +2203,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1981,7 +2260,7 @@ - + @@ -2096,13 +2375,6 @@ - - - - - - - @@ -2119,6 +2391,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2182,88 +2502,100 @@ - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + @@ -2271,13 +2603,6 @@ - - - - - - - @@ -2297,7 +2622,7 @@ - + @@ -2360,7 +2685,7 @@ - + @@ -2440,33 +2765,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2725,6 +3023,12 @@ + + + + + + @@ -2926,6 +3230,13 @@ + + + + + + + @@ -2954,16 +3265,23 @@ - + - + - + + + + + + + + @@ -3442,6 +3760,12 @@ + + + + + + @@ -3450,12 +3774,19 @@ - + + + + + + + + @@ -3464,8 +3795,14 @@ + + + + + + - + @@ -3523,7 +3860,7 @@ - + @@ -3584,7 +3921,7 @@ - + @@ -3717,7 +4054,7 @@ - + @@ -3782,7 +4119,7 @@ - + @@ -3889,7 +4226,7 @@ - + @@ -3962,7 +4299,7 @@ - + @@ -4045,7 +4382,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4078,4 +4464,261 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 00:52:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 00:52:32 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: fix make deps: don't use the FORCE In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3985 to look at the new patch set (#2). fix make deps: don't use the FORCE With the FORCE dependency in place, every 'make' invocation builds all from scratch all the time. Remove that to have intelligent re-build on edits. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 --- M OsmoBSC/Makefile M OsmoBTS/Makefile M OsmoGGSN/Makefile M OsmoMGCP/Makefile M OsmoNAT/Makefile M OsmoNITB/Makefile M OsmoPCU/Makefile M OsmoSGSN/Makefile M build/Makefile.inc 9 files changed, 19 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/3985/2 diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index 35f50da..97b87ba 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -1,9 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals - -EXTRA_DEPS = gen-bsc-vty-docbook - topdir = . bsc_reference = $(topdir)/osmobsc-vty-reference.xml manuals = $(bsc_reference) @@ -20,7 +17,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmobsc-usermanual.pdf: chapters/*.adoc +osmobsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml osmux-reference.pdf: osmux-reference.adoc aoip-mgw-options.pdf: aoip-mgw-options.adoc @@ -37,7 +34,7 @@ -rm osmux-reference__*.png -rm osmux-reference__*.check -gen-bsc-vty-docbook: FORCE +generated/docbook_vty.xml: osmobsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/bsc_vty_reference.xml, \ diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 58df0e3..58b8250 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-bts-vty-docbook - topdir = . bts_reference = $(topdir)/osmobts-vty-reference.xml manuals = $(bts_reference) @@ -19,7 +17,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmobts-abis.pdf: abis/*.adoc abis/*.msc +osmobts-abis.pdf: abis/*.adoc abis/*.msc generated/docbook_vty.xml osmobts-usermanual.pdf: chapters/*.adoc clean: @@ -33,7 +31,7 @@ -rm osmobts-abis*.check -rm osmobts-usermanual*.check -gen-bts-vty-docbook: FORCE +generated/docbook_vty.xml: osmobts-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/bts_vty_reference.xml, \ diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile index 2dfedb2..9602f55 100644 --- a/OsmoGGSN/Makefile +++ b/OsmoGGSN/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-ggsn-vty-docbook - topdir = . ggsn_reference = $(topdir)/osmoggsn-vty-reference.xml manuals = $(ggsn_reference) @@ -19,14 +17,14 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmoggsn-usermanual.pdf: chapters/*.adoc +osmoggsn-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) -rm osmoggsn-usermanual__*.svg osmoggsn-usermanual__*.png -rm osmoggsn-usermanual.check -gen-ggsn-vty-docbook: FORCE +generated/docbook_vty.xml: osmoggsn-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/ggsn_vty_reference.xml, \ diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile index 9aff12b..8848af8 100644 --- a/OsmoMGCP/Makefile +++ b/OsmoMGCP/Makefile @@ -1,7 +1,7 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-mgcp-vty-docbook +EXTRA_DEPS = generated/docbook_vty.xml topdir = . mgcp_reference = $(topdir)/osmomgcp-vty-reference.xml @@ -18,7 +18,7 @@ clean: -rm -rf $(cleanfiles) -gen-mgcp-vty-docbook: FORCE +generated/docbook_vty.xml: osmomgcp-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/mgcp_vty_reference.xml, \ diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile index d7302e6..fe7ed1a 100644 --- a/OsmoNAT/Makefile +++ b/OsmoNAT/Makefile @@ -1,7 +1,7 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-nat-vty-docbook +EXTRA_DEPS = generated/docbook_vty.xml topdir = . nat_reference = $(topdir)/osmonat-vty-reference.xml @@ -18,7 +18,7 @@ clean: -rm -rf $(cleanfiles) -gen-nat-vty-docbook: FORCE +generated/docbook_vty.xml: osmonat-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/nat_vty_reference.xml, \ diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index 99cd317..3812e5b 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-nitb-vty-docbook - topdir = . nitb_reference = $(topdir)/osmonitb-vty-reference.xml manuals = $(nitb_reference) @@ -19,7 +17,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmonitb-usermanual.pdf: chapters/*.adoc +osmonitb-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) @@ -27,7 +25,7 @@ -rm osmonitb-usermanual__*.png -rm osmonitb-usermanual.check -gen-nitb-vty-docbook: FORCE +generated/docbook_vty.xml: osmonitb-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/nitb_vty_reference.xml, \ diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index a83b909..5be9700 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-vty-docbook - topdir = . pcu_reference = $(topdir)/osmopcu-vty-reference.xml manuals = $(bts_manual) $(pcu_reference) @@ -19,8 +17,8 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmopcu-gb.pdf: gb/*.adoc gb/*.msc -osmopcu-usermanual.pdf: chapters/*.adoc +osmopcu-gb.pdf: gb/*.adoc gb/*.msc generated/docbook_vty.xml +osmopcu-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) @@ -29,7 +27,7 @@ -rm osmopcu-usermanual__*.svg -rm osmopcu-usermanual.check -gen-vty-docbook: FORCE +generated/docbook_vty.xml: osmopcu-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/osmo-pcu_vty_reference.xml, \ diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 6f7d28d..1c01af7 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -1,8 +1,6 @@ # XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ # Makefile from BitBake/OpenEmbedded manuals -EXTRA_DEPS = gen-sgsn-vty-docbook - topdir = . sgsn_reference = $(topdir)/osmosgsn-vty-reference.xml manuals = $(sgsn_reference) @@ -19,14 +17,14 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc -osmosgsn-usermanual.pdf: chapters/*.adoc +osmosgsn-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml clean: -rm -rf $(cleanfiles) -rm osmosgsn-usermanual__*.svg osmosgsn-usermanual__*.png -rm osmosgsn-usermanual.check -gen-sgsn-vty-docbook: FORCE +generated/docbook_vty.xml: osmosgsn-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl $(call command,xsltproc -o generated/combined1.xml \ --stringparam with $(PWD)/../common/vty_additions.xml \ $(MERGE_DOC) vty/sgsn_vty_reference.xml, \ diff --git a/build/Makefile.inc b/build/Makefile.inc index 3905cb0..9c17176 100644 --- a/build/Makefile.inc +++ b/build/Makefile.inc @@ -27,21 +27,16 @@ all: $(types) -$(types): FORCE - - pdf: $(pdfs) $(manuals) # Lint the file -%.xml-lint: %.xml FORCE +%.xml-lint: %.xml $(call command,xmllint --xinclude --postvalid --noout $<,XMLLINT,$<) # Create a PDF file and lint it before -%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) FORCE +%.pdf: %.xml %.xml-lint $(EXTRA_DEPS) $(call command,dblatex $(dblatex_quiet) -P draft.mode=no $<,DBLATEX,$<) upload: $(pdfs) $(ASCIIDOCPDFS) rsync -avz $(pdfs) $(ASCIIDOCPDFS) $(UPLOAD_PATH)/ - -FORCE: -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 19 00:52:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 00:52:48 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoNITB: update vty reference In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3986 to look at the new patch set (#2). OsmoNITB: update vty reference Change node IDs to use the names derived from the node prompt, in the process fix the node references to not place the vty_additions in the wrong places. Related: I8fa555570268b231c5e01727c661da92fad265de (libosmocore) Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 --- M OsmoNITB/vty/nitb_vty_additions.xml M OsmoNITB/vty/nitb_vty_reference.xml 2 files changed, 761 insertions(+), 118 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/86/3986/2 diff --git a/OsmoNITB/vty/nitb_vty_additions.xml b/OsmoNITB/vty/nitb_vty_additions.xml index 0d473bd..7ea60dc 100644 --- a/OsmoNITB/vty/nitb_vty_additions.xml +++ b/OsmoNITB/vty/nitb_vty_additions.xml @@ -1,20 +1,20 @@ - - + + MNCC Internal Configuration This node allows to configure the default codecs for the internal call control handling. - - + + SMPP Configuration This node allows to configure the SMPP interface for interfacing with external SMS applications. This section contains generic/common SMPP related configuration, and no per-ESME specific parameters. - - + + ESME Configuration This node allows to configure one particular SMPP ESME, which is an External SMS Entity such as a SMS based diff --git a/OsmoNITB/vty/nitb_vty_reference.xml b/OsmoNITB/vty/nitb_vty_reference.xml index 5f49b09..2e30dd6 100644 --- a/OsmoNITB/vty/nitb_vty_reference.xml +++ b/OsmoNITB/vty/nitb_vty_reference.xml @@ -1,7 +1,7 @@ - + - + @@ -202,7 +202,7 @@ - + @@ -233,6 +233,7 @@ + @@ -243,6 +244,13 @@ + + + + + + + @@ -307,6 +315,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -423,6 +459,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -454,10 +521,17 @@ + + + + + + + - + - + @@ -719,7 +793,7 @@ - + @@ -750,6 +824,7 @@ + @@ -760,6 +835,13 @@ + + + + + + + @@ -820,6 +902,13 @@ + + + + + + + @@ -833,6 +922,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -840,6 +963,14 @@ + + + + + + + + @@ -936,6 +1067,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1052,6 +1211,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1092,6 +1282,17 @@ + + + + + + + + + + + @@ -1209,8 +1410,15 @@ + + + + + + + - + @@ -1372,6 +1580,11 @@ + + + + + @@ -1488,11 +1701,6 @@ - - - - - @@ -1513,8 +1721,13 @@ + + + + + - + @@ -1607,7 +1820,7 @@ - + @@ -1638,6 +1851,7 @@ + @@ -1648,6 +1862,13 @@ + + + + + + + @@ -1678,7 +1899,7 @@ - + @@ -1795,7 +2016,7 @@ - + @@ -1863,7 +2084,7 @@ - + @@ -1913,7 +2134,7 @@ - + @@ -1922,6 +2143,7 @@ + @@ -1930,6 +2152,14 @@ + + + + + + + + @@ -1973,7 +2203,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1981,7 +2260,7 @@ - + @@ -2096,13 +2375,6 @@ - - - - - - - @@ -2119,6 +2391,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2182,88 +2502,100 @@ - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + - + - - + + + @@ -2271,13 +2603,6 @@ - - - - - - - @@ -2297,7 +2622,7 @@ - + @@ -2360,7 +2685,7 @@ - + @@ -2440,33 +2765,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2725,6 +3023,12 @@ + + + + + + @@ -2926,6 +3230,13 @@ + + + + + + + @@ -2954,16 +3265,23 @@ - + - + - + + + + + + + + @@ -3442,6 +3760,12 @@ + + + + + + @@ -3450,12 +3774,19 @@ - + + + + + + + + @@ -3464,8 +3795,14 @@ + + + + + + - + @@ -3523,7 +3860,7 @@ - + @@ -3584,7 +3921,7 @@ - + @@ -3717,7 +4054,7 @@ - + @@ -3782,7 +4119,7 @@ - + @@ -3889,7 +4226,7 @@ - + @@ -3962,7 +4299,7 @@ - + @@ -4045,7 +4382,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4078,4 +4464,261 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:08:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:08:22 +0000 Subject: osmo-msc[master]: main: remove cmdline args no longer available for osmo-msc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3009d2b3dd89eacdf6bc3d9c19744e9fdf4be6c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:08:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:08:26 +0000 Subject: [MERGED] osmo-msc[master]: main: remove cmdline args no longer available for osmo-msc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: main: remove cmdline args no longer available for osmo-msc ...................................................................... main: remove cmdline args no longer available for osmo-msc Change-Id: I3009d2b3dd89eacdf6bc3d9c19744e9fdf4be6c3 --- M src/osmo-msc/msc_main.c 1 file changed, 1 insertion(+), 27 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index bbf35b8..5c192e8 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -115,19 +115,6 @@ static struct osmo_timer_list db_sync_timer; -static void create_pcap_file(char *file) -{ - mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; - int fd = open(file, O_WRONLY|O_TRUNC|O_CREAT, mode); - - if (fd < 0) { - perror("Failed to open file for pcap"); - return; - } - - e1_set_pcap_fd(fd); -} - static void print_usage() { printf("Usage: osmo-nitb\n"); @@ -144,13 +131,10 @@ printf(" -l --database db-name The database to use.\n"); printf(" -T --timestamp Prefix every log line with a timestamp.\n"); printf(" -V --version Print the version of OpenBSC.\n"); - printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC.\n"); printf(" -e --log-level number Set a global loglevel.\n"); printf(" -M --mncc-sock-path PATH Disable built-in MNCC handler and offer socket.\n"); printf(" -m --mncc-sock Same as `-M /tmp/bsc_mncc' (deprecated).\n"); printf(" -C --no-dbcounter Disable regular syncing of counters to database.\n"); - printf(" -r --rf-ctl PATH A unix domain socket to listen for cmds.\n"); - printf(" -p --pcap PATH Write abis communication to pcap trace file.\n"); } static void handle_options(int argc, char **argv) @@ -164,10 +148,8 @@ {"config-file", 1, 0, 'c'}, {"disable-color", 0, 0, 's'}, {"database", 1, 0, 'l'}, - {"pcap", 1, 0, 'p'}, {"timestamp", 0, 0, 'T'}, {"version", 0, 0, 'V' }, - {"rtp-proxy", 0, 0, 'P'}, {"log-level", 1, 0, 'e'}, {"mncc-sock", 0, 0, 'm'}, {"mncc-sock-path", 1, 0, 'M'}, @@ -175,7 +157,7 @@ {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hd:Dsl:ap:TPVc:e:mCM:", + c = getopt_long(argc, argv, "hd:Dsl:TVc:e:mCM:", long_options, &option_index); if (c == -1) break; @@ -200,17 +182,9 @@ case 'c': msc_cmdline_config.config_file = optarg; break; - case 'p': - create_pcap_file(optarg); - break; case 'T': log_set_print_timestamp(osmo_stderr_target, 1); break; -#if BEFORE_MSCSPLIT - case 'P': - ipacc_rtp_direct = 0; - break; -#endif case 'e': log_set_log_level(osmo_stderr_target, atoi(optarg)); break; -- To view, visit https://gerrit.osmocom.org/3980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3009d2b3dd89eacdf6bc3d9c19744e9fdf4be6c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:08:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:08:43 +0000 Subject: osmo-msc[master]: vty: fix: missing default cmds at hlr node In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53e572194af39a431c54f83cd07e4c41c6fdf7f8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:08:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:08:45 +0000 Subject: [MERGED] osmo-msc[master]: vty: fix: missing default cmds at hlr node In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: fix: missing default cmds at hlr node ...................................................................... vty: fix: missing default cmds at hlr node Without this, it is impossible to exit the 'hlr' node. Change-Id: I53e572194af39a431c54f83cd07e4c41c6fdf7f8 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index 484e9d5..b6e3ded 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -971,6 +971,7 @@ install_element(CONFIG_NODE, &cfg_hlr_cmd); install_node(&hlr_node, config_write_hlr); + vty_install_default(HLR_NODE); install_element(HLR_NODE, &cfg_hlr_remote_ip_cmd); install_element(HLR_NODE, &cfg_hlr_remote_port_cmd); -- To view, visit https://gerrit.osmocom.org/3981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53e572194af39a431c54f83cd07e4c41c6fdf7f8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:09:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:09:02 +0000 Subject: osmo-msc[master]: ctrl: remove unimplemented cmds subscriber-{modify, delete} In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I754de5d08c053fea5f1ca2673b0ac4d26a85778a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:09:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:09:04 +0000 Subject: [MERGED] osmo-msc[master]: ctrl: remove unimplemented cmds subscriber-{modify, delete} In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ctrl: remove unimplemented cmds subscriber-{modify,delete} ...................................................................... ctrl: remove unimplemented cmds subscriber-{modify,delete} Change-Id: I754de5d08c053fea5f1ca2673b0ac4d26a85778a --- M src/libmsc/ctrl_commands.c 1 file changed, 0 insertions(+), 22 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index 4767ddd..c6236ed 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -31,26 +31,6 @@ static struct gsm_network *msc_ctrl_net = NULL; -static int verify_subscriber_modify(struct ctrl_cmd *cmd, const char *value, void *d) -{ - return 0; -} - -static int set_subscriber_modify(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "Command moved to osmo-hlr, no longer available here"; - return CTRL_CMD_ERROR; -} - -CTRL_CMD_DEFINE_WO(subscriber_modify, "subscriber-modify-v1"); - -static int set_subscriber_delete(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "Command moved to osmo-hlr, no longer available here"; - return CTRL_CMD_ERROR; -} -CTRL_CMD_DEFINE_WO_NOVRF(subscriber_delete, "subscriber-delete-v1"); - static int get_subscriber_list(struct ctrl_cmd *cmd, void *d) { struct vlr_subscr *vsub; @@ -84,8 +64,6 @@ int rc = 0; msc_ctrl_net = net; - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_subscriber_modify); - rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_subscriber_delete); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_subscriber_list); return rc; } -- To view, visit https://gerrit.osmocom.org/3982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I754de5d08c053fea5f1ca2673b0ac4d26a85778a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:12:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:12:06 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 4: before merging this, we should make sure that all VTY nodes have the default commands installed, like in https://gerrit.osmocom.org/3981 -- otherwise we are creating VTY nodes from which it is impossible to exit. Before this patch, a node that forgot to have default commands would hit the parent node's 'exit' or 'end' commands, now these are required to exist in each child node. -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:29:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:29:23 +0000 Subject: [PATCH] osmo-bts[master]: vty: mgr: sysmobts, lc15: install default commands for ACT_N... Message-ID: Review at https://gerrit.osmocom.org/3987 vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE Change-Id: Ia1b3d5e010c5b6ea8e655b79d9b36b08cd1ef4c4 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/3987/1 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index e7e33e5..189a7e2 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -1056,6 +1056,7 @@ install_node(&act_norm_node, config_write_dummy); install_element(MGR_NODE, &cfg_action_normal_cmd); register_normal_action(ACT_NORM_NODE); + vty_install_default(ACT_NORM_NODE); /* install the warning and critical node */ install_node(&act_warn_node, config_write_dummy); diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c index b49f282..cba4fbb 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c @@ -507,6 +507,7 @@ install_node(&act_norm_node, config_write_dummy); install_element(MGR_NODE, &cfg_action_normal_cmd); register_normal_action(ACT_NORM_NODE); + vty_install_default(ACT_NORM_NODE); /* install the warning and critical node */ install_node(&act_warn_node, config_write_dummy); -- To view, visit https://gerrit.osmocom.org/3987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1b3d5e010c5b6ea8e655b79d9b36b08cd1ef4c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:30:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:30:18 +0000 Subject: [PATCH] osmo-sip-connector[master]: vty: install default commands for SIP, MNCC, APP_NODE Message-ID: Review at https://gerrit.osmocom.org/3988 vty: install default commands for SIP,MNCC,APP_NODE Change-Id: Iee51881cc07d56209647fb4f505f8f6be6b885f0 --- M src/vty.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/88/3988/1 diff --git a/src/vty.c b/src/vty.c index f3d9467..83e250d 100644 --- a/src/vty.c +++ b/src/vty.c @@ -300,15 +300,18 @@ install_element(CONFIG_NODE, &cfg_sip_cmd); install_node(&sip_node, config_write_sip); + vty_install_default(SIP_NODE); install_element(SIP_NODE, &cfg_sip_local_addr_cmd); install_element(SIP_NODE, &cfg_sip_remote_addr_cmd); install_element(CONFIG_NODE, &cfg_mncc_cmd); install_node(&mncc_node, config_write_mncc); + vty_install_default(MNCC_NODE); install_element(MNCC_NODE, &cfg_mncc_path_cmd); install_element(CONFIG_NODE, &cfg_app_cmd); install_node(&app_node, config_write_app); + vty_install_default(APP_NODE); install_element(APP_NODE, &cfg_use_imsi_cmd); install_element(APP_NODE, &cfg_no_use_imsi_cmd); -- To view, visit https://gerrit.osmocom.org/3988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee51881cc07d56209647fb4f505f8f6be6b885f0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:34:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:34:19 +0000 Subject: libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Patch Set 4: see https://gerrit.osmocom.org/3987 https://gerrit.osmocom.org/3988 ... those are all that I found. Good think I looked, but this patch does not actually affect those. The patch that made those nodes un-exitable islands has already been merged, i.e. the one for the interactive VTY. This one is for config file parsing and on top provides an implicit way to go to the parent node, so not related. Sorry for the noise. -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:35:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:35:30 +0000 Subject: [MERGED] libosmocore[master]: VTY: implicit node exit by de-indenting, not parent lookup In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: VTY: implicit node exit by de-indenting, not parent lookup ...................................................................... VTY: implicit node exit by de-indenting, not parent lookup Note: This will break users' config files if they do not use consistent indenting. (see below for a definition of "consistent".) When reading VTY commands from a file, use indenting as means to implicitly exit child nodes. Do not look for commands in the parent node implicitly. The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the current node, but succeeds on the parent node. That is the mechanism by which our VTY config files do not need 'exit' at the end of each child node. We've hit problems with this in the following scenarios, which will show improved user experience after this patch: *) When both a parent and its child node have commands with identical names: cs7 instace 0 point-code 1.2.3 sccp-address osmo-msc point-code 0.0.1 If I put the parent's command below the child, it is still interpreted in the context of the child node: cs7 instace 0 sccp-address osmo-msc point-code 0.0.1 point-code 1.2.3 Though the indenting lets me assume I am setting the cs7 instance's global PC to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the 0.0.1. *) When a software change moves a VTY command from a child to a parent. Say 'timezone' moved from 'bts' to 'network' level: network timezone 1 2 Say a user still has an old config file with 'timezone' on the child level: network bts 0 timezone 1 2 trx 0 The user would expect an error message that 'timezone' is invalid on the 'bts' level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts' to the 'network' level, and instead says that the 'trx' command does not exist. Format: Consistent means that two adjacent indenting lines have the exact same indenting characters for the common length: Weird mix if you ask me, but correct and consistent: ROOT PARENT CHILD GRANDCHILD GRANDCHILD2 SIBLING Inconsistent: ROOT PARENT CHILD GRANDCHILD GRANDCHILD2 SIBLING Also, when going back to a parent level, the exact same indenting must be used as before in that node: Incorrect: ROOT PARENT CHILD SIBLING As not really intended side effect, it is also permitted to indent the entire file starting from the root level. We could guard against it but there's no harm: Correct and consistent: ROOT PARENT CHILD SIBLING Implementation: Track parent nodes state: whenever a command enters a child node, push a parent node onto an llist to remember the exact indentation characters used for that level. As soon as the first line on a child node is parsed, remember this new indentation (which must have a longer strlen() than its parent level) to apply to all remaining child siblings and grandchildren. If the amount of spaces that indent a following VTY command are less than this expected indentation, call vty_go_parent() until it matches up. At any level, if the common length of indentation characters mismatch, abort parsing in error. Transitions to child node are spread across VTY implementations and are hard to change. But transitions to the parent node are all handled by vty_go_parent(). By popping a parent from the list of parents in vty_go_parent(), we can also detect that a command has changed the node without changing the parent, hence it must have stepped into a child node, and we can push a parent frame. The behavior on the interactive telnet VTY remains unchanged. Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 --- M include/osmocom/vty/command.h M include/osmocom/vty/vty.h M src/vty/command.c M src/vty/vty.c M tests/Makefile.am M tests/testsuite.at A tests/vty/fail_not_de-indented.cfg A tests/vty/fail_tabs_and_spaces.cfg A tests/vty/fail_too_much_indent.cfg A tests/vty/ok.cfg A tests/vty/ok_ignore_blank.cfg A tests/vty/ok_ignore_comment.cfg A tests/vty/ok_indented_root.cfg A tests/vty/ok_more_spaces.cfg A tests/vty/ok_tabs.cfg A tests/vty/ok_tabs_and_spaces.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 18 files changed, 321 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0fa5175..cb2edaa 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -161,6 +161,7 @@ #define CMD_COMPLETE_MATCH 8 #define CMD_COMPLETE_LIST_MATCH 9 #define CMD_SUCCESS_DAEMON 10 +#define CMD_ERR_INVALID_INDENT 11 /* Argc max counts. */ #define CMD_ARGC_MAX 256 @@ -368,6 +369,7 @@ char *argv_concat(const char **argv, int argc, int shift); vector cmd_make_strvec(const char *); +int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p); void cmd_free_strvec(vector); vector cmd_describe_command(); char **cmd_complete_command(); diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index 544e1fa..02ba03e 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -3,6 +3,8 @@ #include #include +#include + /*! \defgroup vty VTY (Virtual TTY) interface * @{ * \file vty.h */ @@ -43,6 +45,20 @@ VTY_FILE, VTY_SHELL, VTY_SHELL_SERV +}; + +struct vty_parent_node { + struct llist_head entry; + + /*! private data, specified by creator */ + void *priv; + + /*! Node status of this vty */ + int node; + + /*! When reading from a config file, these are the indenting characters expected for children of + * this VTY node. */ + char *indent; }; /*! Internal representation of a single VTY */ @@ -134,6 +150,13 @@ /*! In configure mode. */ int config; + + /*! List of parent nodes, last item is the outermost parent. */ + struct llist_head parent_nodes; + + /*! When reading from a config file, these are the indenting characters expected for children of + * the current VTY node. */ + char *indent; }; /* Small macro to determine newline is newline only or linefeed needed. */ diff --git a/src/vty/command.c b/src/vty/command.c index 52c7191..a65b4de 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -190,31 +190,56 @@ } } -/*! Breaking up string into each command piece. I assume given - character is separated by a space character. Return value is a - vector which includes char ** data element. */ -vector cmd_make_strvec(const char *string) +/*! Break up string in command tokens. Return leading indents. + * \param[in] string String to split. + * \param[out] indent If not NULL, return a talloc_strdup of indent characters. + * \param[out] strvec_p Returns vector of split tokens, must not be NULL. + * \returns CMD_SUCCESS or CMD_ERR_INVALID_INDENT + * + * If \a indent is passed non-NULL, only simple space ' ' indents are allowed, + * so that \a indent can simply return the count of leading spaces. + * Otherwise any isspace() characters are allowed for indenting (backwards compat). + */ +int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p) { const char *cp, *start; char *token; int strlen; vector strvec; + *strvec_p = NULL; + if (indent) + *indent = 0; + if (string == NULL) - return NULL; + return CMD_SUCCESS; cp = string; /* Skip white spaces. */ - while (isspace((int)*cp) && *cp != '\0') + while (isspace((int)*cp) && *cp != '\0') { + /* if we're counting indents, we need to be strict about them */ + if (indent && (*cp != ' ') && (*cp != '\t')) { + /* Ignore blank lines, they appear as leading whitespace with line breaks. */ + if (*cp == '\n' || *cp == '\r') { + cp++; + string = cp; + continue; + } + return CMD_ERR_INVALID_INDENT; + } cp++; + } + + if (indent) + *indent = talloc_strndup(tall_vty_cmd_ctx, string, cp - string); /* Return if there is only white spaces */ if (*cp == '\0') - return NULL; + return CMD_SUCCESS; if (*cp == '!' || *cp == '#') - return NULL; + return CMD_SUCCESS; /* Prepare return vector. */ strvec = vector_init(VECTOR_MIN_SIZE); @@ -236,8 +261,21 @@ cp++; if (*cp == '\0') - return strvec; + break; } + + *strvec_p = strvec; + return CMD_SUCCESS; +} + +/*! Breaking up string into each command piece. I assume given + character is separated by a space character. Return value is a + vector which includes char ** data element. */ +vector cmd_make_strvec(const char *string) +{ + vector strvec; + cmd_make_strvec2(string, NULL, &strvec); + return strvec; } /*! Free allocated string vector. */ @@ -1947,6 +1985,33 @@ return cmd_complete_command_real(vline, vty, status); } +static struct vty_parent_node *vty_parent(struct vty *vty) +{ + return llist_first_entry_or_null(&vty->parent_nodes, + struct vty_parent_node, + entry); +} + +static bool vty_pop_parent(struct vty *vty) +{ + struct vty_parent_node *parent = vty_parent(vty); + if (!parent) + return false; + llist_del(&parent->entry); + vty->node = parent->node; + vty->priv = parent->priv; + if (vty->indent) + talloc_free(vty->indent); + vty->indent = parent->indent; + talloc_free(parent); + return true; +} + +static void vty_clear_parents(struct vty *vty) +{ + while (vty_pop_parent(vty)); +} + /* return parent node */ /* * This function MUST eventually converge on a node when called repeatedly, @@ -1969,24 +2034,33 @@ case VIEW_NODE: case ENABLE_NODE: case CONFIG_NODE: + vty_clear_parents(vty); break; case AUTH_ENABLE_NODE: vty->node = VIEW_NODE; + vty_clear_parents(vty); break; case CFG_LOG_NODE: case VTY_NODE: vty->node = CONFIG_NODE; + vty_clear_parents(vty); break; default: - if (host.app_info->go_parent_cb) + if (host.app_info->go_parent_cb) { host.app_info->go_parent_cb(vty); - else if (is_config_child(vty)) + vty_pop_parent(vty); + } + else if (is_config_child(vty)) { vty->node = CONFIG_NODE; - else + vty_clear_parents(vty); + } + else { vty->node = VIEW_NODE; + vty_clear_parents(vty); + } break; } @@ -2252,36 +2326,130 @@ return (*matched_element->func) (matched_element, vty, argc, argv); } +static inline size_t len(const char *str) +{ + return str? strlen(str) : 0; +} + +static int indent_cmp(const char *a, const char *b) +{ + size_t al, bl; + al = len(a); + bl = len(b); + if (al > bl) { + if (bl && strncmp(a, b, bl) != 0) + return EINVAL; + return 1; + } + /* al <= bl */ + if (al && strncmp(a, b, al) != 0) + return EINVAL; + return (al < bl)? -1 : 0; +} + /* Configration make from file. */ int config_from_file(struct vty *vty, FILE * fp) { int ret; vector vline; + char *indent; + int cmp; + struct vty_parent_node this_node; + struct vty_parent_node *parent; while (fgets(vty->buf, VTY_BUFSIZ, fp)) { - vline = cmd_make_strvec(vty->buf); + indent = NULL; + vline = NULL; + ret = cmd_make_strvec2(vty->buf, &indent, &vline); - /* In case of comment line */ - if (vline == NULL) + if (ret != CMD_SUCCESS) + goto return_invalid_indent; + + /* In case of comment or empty line */ + if (vline == NULL) { + if (indent) { + talloc_free(indent); + indent = NULL; + } continue; - /* Execute configuration command : this is strict match */ - ret = cmd_execute_command_strict(vline, vty, NULL); - - /* Try again with setting node to CONFIG_NODE */ - while (ret != CMD_SUCCESS && ret != CMD_WARNING - && ret != CMD_ERR_NOTHING_TODO - && is_config_child(vty)) { - vty_go_parent(vty); - ret = cmd_execute_command_strict(vline, vty, NULL); } + /* We have a nonempty line. This might be the first on a deeper indenting level, so let's + * remember this indent if we don't have one yet. */ + if (!vty->indent) + vty->indent = talloc_strdup(vty, indent); + + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + + /* Less indent: go up the parent nodes to find matching amount of less indent. When this + * loop exits, we want to have found an exact match, i.e. cmp == 0. */ + while (cmp < 0) { + vty_go_parent(vty); + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + } + + /* More indent without having entered a child node level? Either the parent node's indent + * wasn't hit exactly (e.g. there's a space more than the parent level had further above) + * or the indentation increased even though the vty command didn't enter a child. */ + if (cmp > 0) + goto return_invalid_indent; + + /* Remember the current node before the command possibly changes it. */ + this_node = (struct vty_parent_node){ + .node = vty->node, + .priv = vty->priv, + .indent = vty->indent, + }; + + parent = vty_parent(vty); + ret = cmd_execute_command_strict(vline, vty, NULL); cmd_free_strvec(vline); if (ret != CMD_SUCCESS && ret != CMD_WARNING - && ret != CMD_ERR_NOTHING_TODO) + && ret != CMD_ERR_NOTHING_TODO) { + if (indent) { + talloc_free(indent); + indent = NULL; + } return ret; + } + + /* If we have stepped down into a child node, push a parent frame. + * The causality is such: we don't expect every single node entry implementation to push + * a parent node entry onto vty->parent_nodes. Instead we expect vty_go_parent() to *pop* + * a parent node. Hence if the node changed without the parent node changing, we must + * have stepped into a child node (and now expect a deeper indent). */ + if (vty->node != this_node.node && parent == vty_parent(vty)) { + /* Push the parent node. */ + parent = talloc_zero(vty, struct vty_parent_node); + *parent = this_node; + llist_add(&parent->entry, &vty->parent_nodes); + + /* The current talloc'ed vty->indent string will now be owned by this parent + * struct. Indicate that we don't know what deeper indent characters the user + * will choose. */ + vty->indent = NULL; + } + + if (indent) { + talloc_free(indent); + indent = NULL; + } } return CMD_SUCCESS; + +return_invalid_indent: + if (vline) + cmd_free_strvec(vline); + if (indent) { + talloc_free(indent); + indent = NULL; + } + return CMD_ERR_INVALID_INDENT; } /* Configration from terminal */ diff --git a/src/vty/vty.c b/src/vty/vty.c index 113a781..bd0d2c3 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -110,6 +110,8 @@ if (!new) goto out; + INIT_LLIST_HEAD(&new->parent_nodes); + new->obuf = buffer_new(new, 0); /* Use default buffer size. */ if (!new->obuf) goto out_new; @@ -1480,6 +1482,12 @@ case CMD_ERR_NO_MATCH: fprintf(stderr, "There is no such command.\n"); break; + case CMD_ERR_INVALID_INDENT: + fprintf(stderr, + "Inconsistent indentation -- leading whitespace must match adjacent lines, and\n" + "indentation must reflect child node levels. A mix of tabs and spaces is\n" + "allowed, but their sequence must not change within a child block.\n"); + break; } fprintf(stderr, "Error occurred during reading the below " "line:\n%s\n", vty->buf); diff --git a/tests/Makefile.am b/tests/Makefile.am index 37378fb..8935bf7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -217,7 +217,18 @@ logging/logging_test.ok logging/logging_test.err \ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ - vty/vty_test.ok comp128/comp128_test.ok \ + vty/vty_test.ok \ + vty/fail_not_de-indented.cfg \ + vty/fail_tabs_and_spaces.cfg \ + vty/fail_too_much_indent.cfg \ + vty/ok.cfg \ + vty/ok_ignore_blank.cfg \ + vty/ok_ignore_comment.cfg \ + vty/ok_indented_root.cfg \ + vty/ok_more_spaces.cfg \ + vty/ok_tabs_and_spaces.cfg \ + vty/ok_tabs.cfg \ + comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ diff --git a/tests/testsuite.at b/tests/testsuite.at index f148cf5..1954e66 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -174,6 +174,7 @@ AT_SETUP([vty]) AT_KEYWORDS([vty]) cat $abs_srcdir/vty/vty_test.ok > expout +cp $abs_srcdir/vty/*.cfg . AT_CHECK([$abs_top_builddir/tests/vty/vty_test], [0], [expout], [ignore]) AT_CLEANUP diff --git a/tests/vty/fail_not_de-indented.cfg b/tests/vty/fail_not_de-indented.cfg new file mode 100644 index 0000000..5af833d --- /dev/null +++ b/tests/vty/fail_not_de-indented.cfg @@ -0,0 +1,3 @@ +line vty + no login + log stderr diff --git a/tests/vty/fail_tabs_and_spaces.cfg b/tests/vty/fail_tabs_and_spaces.cfg new file mode 100644 index 0000000..fa6ce05 --- /dev/null +++ b/tests/vty/fail_tabs_and_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/fail_too_much_indent.cfg b/tests/vty/fail_too_much_indent.cfg new file mode 100644 index 0000000..bacb3e1 --- /dev/null +++ b/tests/vty/fail_too_much_indent.cfg @@ -0,0 +1,3 @@ +line vty + no login + log stderr diff --git a/tests/vty/ok.cfg b/tests/vty/ok.cfg new file mode 100644 index 0000000..d5ef23e --- /dev/null +++ b/tests/vty/ok.cfg @@ -0,0 +1,3 @@ +line vty + no login +log stderr diff --git a/tests/vty/ok_ignore_blank.cfg b/tests/vty/ok_ignore_blank.cfg new file mode 100644 index 0000000..d16ff64 --- /dev/null +++ b/tests/vty/ok_ignore_blank.cfg @@ -0,0 +1,7 @@ +line vty + + no login + + no login + +log stderr diff --git a/tests/vty/ok_ignore_comment.cfg b/tests/vty/ok_ignore_comment.cfg new file mode 100644 index 0000000..5813fc7 --- /dev/null +++ b/tests/vty/ok_ignore_comment.cfg @@ -0,0 +1,7 @@ +line vty + ! comment + no login +! comment + no login + ! comment +log stderr diff --git a/tests/vty/ok_indented_root.cfg b/tests/vty/ok_indented_root.cfg new file mode 100644 index 0000000..313c674 --- /dev/null +++ b/tests/vty/ok_indented_root.cfg @@ -0,0 +1,3 @@ + line vty + no login + log stderr diff --git a/tests/vty/ok_more_spaces.cfg b/tests/vty/ok_more_spaces.cfg new file mode 100644 index 0000000..b66a9c2 --- /dev/null +++ b/tests/vty/ok_more_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/ok_tabs.cfg b/tests/vty/ok_tabs.cfg new file mode 100644 index 0000000..e94609b --- /dev/null +++ b/tests/vty/ok_tabs.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/ok_tabs_and_spaces.cfg b/tests/vty/ok_tabs_and_spaces.cfg new file mode 100644 index 0000000..2049b73 --- /dev/null +++ b/tests/vty/ok_tabs_and_spaces.cfg @@ -0,0 +1,4 @@ +line vty + no login + no login +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index d84bf41..eba9995 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -288,6 +289,15 @@ destroy_test_vty(&test, vty); } +void test_exit_by_indent(const char *fname, int expect_rc) +{ + int rc; + printf("reading file %s, expecting rc=%d\n", fname, expect_rc); + rc = vty_read_config_file(fname, NULL); + printf("got rc=%d\n", rc); + OSMO_ASSERT(rc == expect_rc); +} + int main(int argc, char **argv) { struct vty_app_info vty_info = { @@ -322,6 +332,16 @@ test_cmd_string_from_valstr(); test_node_tree_structure(); test_stats_vty(); + test_exit_by_indent("ok.cfg", 0); + test_exit_by_indent("ok_more_spaces.cfg", 0); + test_exit_by_indent("ok_tabs.cfg", 0); + test_exit_by_indent("ok_tabs_and_spaces.cfg", 0); + test_exit_by_indent("ok_ignore_comment.cfg", 0); + test_exit_by_indent("ok_ignore_blank.cfg", 0); + test_exit_by_indent("fail_not_de-indented.cfg", -EINVAL); + test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); + test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); + test_exit_by_indent("ok_indented_root.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index 2b6d5a6..b2df1a1 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -108,4 +108,24 @@ Returned: 0, Current node: 4 '%s(config)# ' Going to execute 'no stats reporter statsd' Returned: 0, Current node: 4 '%s(config)# ' +reading file ok.cfg, expecting rc=0 +got rc=0 +reading file ok_more_spaces.cfg, expecting rc=0 +got rc=0 +reading file ok_tabs.cfg, expecting rc=0 +got rc=0 +reading file ok_tabs_and_spaces.cfg, expecting rc=0 +got rc=0 +reading file ok_ignore_comment.cfg, expecting rc=0 +got rc=0 +reading file ok_ignore_blank.cfg, expecting rc=0 +got rc=0 +reading file fail_not_de-indented.cfg, expecting rc=-22 +got rc=-22 +reading file fail_too_much_indent.cfg, expecting rc=-22 +got rc=-22 +reading file fail_tabs_and_spaces.cfg, expecting rc=-22 +got rc=-22 +reading file ok_indented_root.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 01:37:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 01:37:21 +0000 Subject: [PATCH] python/osmo-python-tests[master]: osmodumpdoc: fix finding cfg when not calling from source tree In-Reply-To: References: Message-ID: osmodumpdoc: fix finding cfg when not calling from source tree When the binary has not been built in the source tree, it was impossible to call osmodumpdoc.py despite the -p option. Look for config files in that config-path. Make sure a relative config-path is adjusted when changing to the workdir. Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c --- M osmopy/osmodumpdoc.py 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/74/3974/2 diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index 0ff1f6b..ce9fec4 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -28,7 +28,7 @@ Returns the number of apps configs could not be dumped for.""" -def dump_configs(apps, configs): +def dump_configs(apps, configs, confpath): failures = 0 successes = 0 @@ -41,7 +41,7 @@ appname = app[3] print "Starting app for %s" % appname proc = None - cmd = [app[1], "-c", configs[appname][0]] + cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) except OSError: # Probably a missing binary @@ -82,9 +82,10 @@ osmoappdesc = osmoutil.importappconf_or_quit( confpath, "osmoappdesc", args.p) + confpath = os.path.relpath(confpath, workdir) os.chdir(workdir) num_fails, num_sucs = dump_configs( - osmoappdesc.apps, osmoappdesc.app_configs) + osmoappdesc.apps, osmoappdesc.app_configs, confpath) if num_fails > 0: print >> sys.stderr, "Warning: Skipped %s apps" % num_fails if 0 == num_sucs: -- To view, visit https://gerrit.osmocom.org/3974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 10:18:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 19 Sep 2017 10:18:48 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 3: That sounds good. Split it in two patches I would suggest. Thanks! -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 11:20:22 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 19 Sep 2017 11:20:22 +0000 Subject: [PATCH] osmo-tetra[master]: Introduce contrib/jenkins.sh to align with other projects Message-ID: Review at https://gerrit.osmocom.org/3989 Introduce contrib/jenkins.sh to align with other projects This change will make jenkins' inline scripts obsolete, so build testing and gerrit verification jobs [1][2] simply invoke: $ ./contrib/jenkins.sh [1] https://jenkins.osmocom.org/jenkins/view/OsmoTETRA/job/OsmoTETRA/ [2] https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/job/OsmoTETRA-gerrit/ Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f --- A contrib/jenkins.sh 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/89/3989/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..2555a6e --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +rm -rf deps/install +mkdir deps || true +cd deps +osmo-deps.sh libosmocore + +cd libosmocore +autoreconf --install --force +./configure --prefix=$PWD/../install +$MAKE $PARALLEL_MAKE install + +cd ../../src +make clean || true +PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE -- To view, visit https://gerrit.osmocom.org/3989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg From gerrit-no-reply at lists.osmocom.org Tue Sep 19 11:21:33 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 19 Sep 2017 11:21:33 +0000 Subject: [PATCH] osmo-tetra[master]: Introduce contrib/jenkins.sh to align with other projects In-Reply-To: References: Message-ID: Introduce contrib/jenkins.sh to align with other projects This change will make jenkins' inline scripts obsolete, so build testing and gerrit verification jobs [1][2] simply invoke: $ ./contrib/jenkins.sh [1] https://jenkins.osmocom.org/jenkins/view/OsmoTETRA/job/OsmoTETRA/ [2] https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/job/OsmoTETRA-gerrit/ Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f --- A contrib/jenkins.sh 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/89/3989/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..503b6a0 --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,15 @@ +#!/bin/sh -ex + +rm -rf deps/install +mkdir deps || true +cd deps +osmo-deps.sh libosmocore + +cd libosmocore +autoreconf --install --force +./configure --prefix=$PWD/../install +$MAKE $PARALLEL_MAKE install + +cd ../../src +make clean || true +PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE -- To view, visit https://gerrit.osmocom.org/3989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f Gerrit-PatchSet: 2 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg From gerrit-no-reply at lists.osmocom.org Tue Sep 19 11:41:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 19 Sep 2017 11:41:53 +0000 Subject: osmo-tetra[master]: Introduce contrib/jenkins.sh to align with other projects In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f Gerrit-PatchSet: 2 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 14:28:16 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 19 Sep 2017 14:28:16 +0000 Subject: [PATCH] libosmocore[master]: bitvec: implement write L or H value to vector Message-ID: Review at https://gerrit.osmocom.org/3990 bitvec: implement write L or H value to vector Change-Id: I36a76916a5986f098b6be6b5b779639c470725ef --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 25 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/3990/1 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index d4c7d68..944b391 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -70,6 +70,7 @@ unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer); uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len); int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len); +int bitvec_write_field_lh(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len); int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill); char bit_value_to_char(enum bit_value v); void bitvec_to_string_r(const struct bitvec *bv, char *str); diff --git a/src/bitvec.c b/src/bitvec.c index f07b42c..a294675 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -503,6 +503,30 @@ return 0; } +/*! write L/H value into the vector + * \param[in] bv The boolean vector to work on + * \param[in,out] write_index Where writing supposed to start in the vector + * \param[in] L or H value to be written to the vector + * \param[in] len How many bits to write + * \returns 0 in case of success or negative value on error + */ +int bitvec_write_field_lh(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) +{ + unsigned int i; + int rc; + bv->cur_bit = *write_index; + for (i = 0; i < len; i++) { + int bit = L; + if (val & ((uint64_t)1 << (len - i - 1))) + bit = H; + rc = bitvec_set_bit(bv, bit); + if (rc) + return rc; + } + *write_index += len; + return 0; +} + /*! convert enum to corresponding character * \param v input value (bit) * \return single character, either 0, 1, L or H */ -- To view, visit https://gerrit.osmocom.org/3990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36a76916a5986f098b6be6b5b779639c470725ef Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Sep 19 15:36:32 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 19 Sep 2017 15:36:32 +0000 Subject: [PATCH] osmo-pcu[master]: EDGE: fix wrong encoding of LH bits Message-ID: Review at https://gerrit.osmocom.org/3991 EDGE: fix wrong encoding of LH bits Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 --- M src/encoding.cpp 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/91/3991/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index 6742efd..e14477a 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -85,7 +85,7 @@ return -EINVAL; } // GSM 04.08 10.5.2.16 IA Rest Octets - bitvec_write_field(dest, &wp, 3, 2); // "HH" + bitvec_write_field_lh(dest, &wp, 3, 2); // "HH" bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment bitvec_write_field(dest, &wp,tbf->tlli(),32); // TLLI bitvec_write_field(dest, &wp,0x1,1); // switch TFI : on @@ -115,7 +115,7 @@ if (tbf->is_egprs_enabled()) { /* see GMS 44.018, 10.5.2.16 */ unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32; - bitvec_write_field(dest, &wp, 1, 1); // "H" + bitvec_write_field_lh(dest, &wp, 1, 1); // "H" bitvec_write_field(dest, &wp, ws_enc, 5); // EGPRS Window Size bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present @@ -133,7 +133,7 @@ OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); // GMS 04.08 10.5.2.37b 10.5.2.16 - bitvec_write_field(dest, &wp, 3, 2); // "HH" + bitvec_write_field_lh(dest, &wp, 3, 2); // "HH" bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment if (tbf == NULL) { bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Sep 19 15:47:10 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 19 Sep 2017 15:47:10 +0000 Subject: [PATCH] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3911 to look at the new patch set (#5). Gerrit verification jobs as Jenkins Job Builder YAML [1] file. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- M README.adoc A jobs/README.adoc A jobs/gerrit-verifications.yml R jobs/osmocom-nightly-nitb-split.yml 4 files changed, 284 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/3911/5 diff --git a/README.adoc b/README.adoc index 796d148..aa45b58 100644 --- a/README.adoc +++ b/README.adoc @@ -6,6 +6,9 @@ - a cov-analysis-linux64-8.5.0 in coverity/ (or the like, may need to adjust some scripts to match) +jobs: Jenkins Job Builder YAML files defining jenkins jobs. Read jobs/README.adoc +for more information about deployment. + scripts: used by jenkins jobs. Various osmo*/contrib/jenkins.sh scripts assume osmo-ci to be checked out in the build slave user's home, i.e. using a PATH of $HOME/osmo-ci/scripts. diff --git a/jobs/README.adoc b/jobs/README.adoc new file mode 100644 index 0000000..2fbfd0a --- /dev/null +++ b/jobs/README.adoc @@ -0,0 +1,31 @@ +This "jobs" folder holds +https://docs.openstack.org/infra/jenkins-job-builder/index.html[Jenkins Job Builder] +YAML files, which define jenkins' jobs. + +One can declare a single job per file or create a job-template to declare several jobs of the same kind. +The gerrit-verifications.yaml file for example holds all gerrit verification jobs. + +''' +*WIP:* Furthermore, we're planning to automatically deploy merged changes by having two jobs based on gerrit events: + +pre-merge: + +- test generation of XML + +post-merge: + +- test generation of XML +- deploy jobs + +''' +The XML test generation is done by: + + jenkins-jobs test jobs/ + + +The deployment will be done by: + + jenkins-jobs --conf "$JJB_CONFIGFILE" update jobs/ + +but it is not clear *yet* how we want to store/inject the `"$JJB_CONFIGFILE"` part. + diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..0b1e6d4 --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,250 @@ +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation is default + cmd: ./contrib/jenkins.sh + + repos: + - osmo-iuh + - osmo-gsm-manuals + - osmo-sip-connector + - osmocom-bb + - osmo-tetra + + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - cellmgr-ng: + concurrent: true + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ + -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: > + FIRMWARE_VERSION == "master" || + (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "lc15") + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: > + (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + clean: + before: true + + triggers: + - gerrit: + trigger-on: + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: false + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true diff --git a/scripts/osmocom-nightly-nitb-split.yml b/jobs/osmocom-nightly-nitb-split.yml similarity index 100% rename from scripts/osmocom-nightly-nitb-split.yml rename to jobs/osmocom-nightly-nitb-split.yml -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 5 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 16:05:00 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 19 Sep 2017 16:05:00 +0000 Subject: [PATCH] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3911 to look at the new patch set (#6). Gerrit verification jobs as Jenkins Job Builder YAML [1] file. All jobs are in jobs/ directory and will be automatically verified and deployed in a follow-up commit. Note: osmocom-nightly-nitb-split.yml has been moved to jobs/ dir. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- M README.adoc A jobs/README.adoc A jobs/gerrit-verifications.yml R jobs/osmocom-nightly-nitb-split.yml 4 files changed, 287 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/3911/6 diff --git a/README.adoc b/README.adoc index 796d148..aa45b58 100644 --- a/README.adoc +++ b/README.adoc @@ -6,6 +6,9 @@ - a cov-analysis-linux64-8.5.0 in coverity/ (or the like, may need to adjust some scripts to match) +jobs: Jenkins Job Builder YAML files defining jenkins jobs. Read jobs/README.adoc +for more information about deployment. + scripts: used by jenkins jobs. Various osmo*/contrib/jenkins.sh scripts assume osmo-ci to be checked out in the build slave user's home, i.e. using a PATH of $HOME/osmo-ci/scripts. diff --git a/jobs/README.adoc b/jobs/README.adoc new file mode 100644 index 0000000..b8c8164 --- /dev/null +++ b/jobs/README.adoc @@ -0,0 +1,31 @@ +This "jobs" folder holds +https://docs.openstack.org/infra/jenkins-job-builder/index.html[Jenkins Job Builder] +YAML files, which define jenkins' jobs. + +One can declare a single job per file or create a job-template to declare several jobs of the same kind. +The gerrit-verifications.yaml file for example holds all gerrit verification jobs. + +''' +*WIP:* Furthermore, we're planning to automatically deploy merged changes by having two jobs based on gerrit events: + +pre-merge: + +- test generation of XML + +post-merge: + +- test generation of XML +- deploy jobs + +''' +The XML test generation is done by: + + jenkins-jobs test jobs/ + + +The deployment will be done by: + + jenkins-jobs --conf "$JJB_CONFIGFILE" update jobs/ + +but it is not clear *yet* how we want to store/inject the `"$JJB_CONFIGFILE"` part. + diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..780f2d5 --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,253 @@ +# This file holds all gerrit verifications https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/. +# One cane simply add a gerrit job by adding project's repository to repos list. + +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation + cmd: ./contrib/jenkins.sh + + repos: + - osmo-iuh + - osmo-gsm-manuals + - osmo-sip-connector + - osmocom-bb + - osmo-tetra + + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - cellmgr-ng: + concurrent: true + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ + -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: > + FIRMWARE_VERSION == "master" || + (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "lc15") + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: > + (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + clean: + before: true + + triggers: + - gerrit: + trigger-on: + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: false + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true diff --git a/scripts/osmocom-nightly-nitb-split.yml b/jobs/osmocom-nightly-nitb-split.yml similarity index 100% rename from scripts/osmocom-nightly-nitb-split.yml rename to jobs/osmocom-nightly-nitb-split.yml -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 6 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 16:05:51 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 19 Sep 2017 16:05:51 +0000 Subject: [PATCH] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3911 to look at the new patch set (#7). Gerrit verification jobs as Jenkins Job Builder YAML [1] file. All jobs are in jobs/ directory and will be automatically verified and deployed in a follow-up commit. Note: osmocom-nightly-nitb-split.yml has been moved to jobs/ dir. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- M README.adoc A jobs/README.adoc A jobs/gerrit-verifications.yml R jobs/osmocom-nightly-nitb-split.yml 4 files changed, 287 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/11/3911/7 diff --git a/README.adoc b/README.adoc index 796d148..aa45b58 100644 --- a/README.adoc +++ b/README.adoc @@ -6,6 +6,9 @@ - a cov-analysis-linux64-8.5.0 in coverity/ (or the like, may need to adjust some scripts to match) +jobs: Jenkins Job Builder YAML files defining jenkins jobs. Read jobs/README.adoc +for more information about deployment. + scripts: used by jenkins jobs. Various osmo*/contrib/jenkins.sh scripts assume osmo-ci to be checked out in the build slave user's home, i.e. using a PATH of $HOME/osmo-ci/scripts. diff --git a/jobs/README.adoc b/jobs/README.adoc new file mode 100644 index 0000000..b8c8164 --- /dev/null +++ b/jobs/README.adoc @@ -0,0 +1,31 @@ +This "jobs" folder holds +https://docs.openstack.org/infra/jenkins-job-builder/index.html[Jenkins Job Builder] +YAML files, which define jenkins' jobs. + +One can declare a single job per file or create a job-template to declare several jobs of the same kind. +The gerrit-verifications.yaml file for example holds all gerrit verification jobs. + +''' +*WIP:* Furthermore, we're planning to automatically deploy merged changes by having two jobs based on gerrit events: + +pre-merge: + +- test generation of XML + +post-merge: + +- test generation of XML +- deploy jobs + +''' +The XML test generation is done by: + + jenkins-jobs test jobs/ + + +The deployment will be done by: + + jenkins-jobs --conf "$JJB_CONFIGFILE" update jobs/ + +but it is not clear *yet* how we want to store/inject the `"$JJB_CONFIGFILE"` part. + diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..780f2d5 --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,253 @@ +# This file holds all gerrit verifications https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/. +# One cane simply add a gerrit job by adding project's repository to repos list. + +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation + cmd: ./contrib/jenkins.sh + + repos: + - osmo-iuh + - osmo-gsm-manuals + - osmo-sip-connector + - osmocom-bb + - osmo-tetra + + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - cellmgr-ng: + concurrent: true + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ + -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: > + FIRMWARE_VERSION == "master" || + (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "lc15") + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: > + (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + clean: + before: true + + triggers: + - gerrit: + trigger-on: + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: false + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true diff --git a/scripts/osmocom-nightly-nitb-split.yml b/jobs/osmocom-nightly-nitb-split.yml similarity index 100% rename from scripts/osmocom-nightly-nitb-split.yml rename to jobs/osmocom-nightly-nitb-split.yml -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 7 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 16:10:14 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 19 Sep 2017 16:10:14 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) Sorry for noise by several patchsets because of typos... https://gerrit.osmocom.org/#/c/3911/7/jobs/gerrit-verifications.yml File jobs/gerrit-verifications.yml: PS7, Line 222: clean: : before: true ... instead of "clean state" shell step -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 7 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 19 17:00:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 19 Sep 2017 17:00:07 +0000 Subject: libosmocore[master]: bitvec: implement write L or H value to vector In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36a76916a5986f098b6be6b5b779639c470725ef Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 22:06:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 22:06:07 +0000 Subject: [PATCH] libosmocore[master]: fix vty regression: empty parent node Message-ID: Review at https://gerrit.osmocom.org/3992 fix vty regression: empty parent node The recent exit-by-indent patch breaks a VTY case where a node is entered but directly followed by a sibling or ancestor without listing any child nodes. Regression introduced by I24cbb3f6de111f2d31110c3c484c066f1153aac9. An example is a common usage in osmo-bts, where 'phy N' / 'instance N' is a parent node that is commonly left empty: phy 0 instance 0 bts 0 band 1800 Before this patch, this case produces the error: There is no such command. Error occurred during reading the below line: bts 0 Fix indentation parsing logic in command.c to accomodate this case. Add a unit test for empty parent node. Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_empty_parent.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 37 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/3992/1 diff --git a/src/vty/command.c b/src/vty/command.c index a65b4de..a050884 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2374,10 +2374,37 @@ continue; } - /* We have a nonempty line. This might be the first on a deeper indenting level, so let's - * remember this indent if we don't have one yet. */ - if (!vty->indent) - vty->indent = talloc_strdup(vty, indent); + /* We have a nonempty line. */ + if (!vty->indent) { + /* If We have just entered a node and expecting the first child to come up; but + * we may also skip right back to a parent or ancestor level. */ + parent = vty_parent(vty); + if (parent) { + cmp = indent_cmp(indent, parent->indent); + + if (cmp == EINVAL) + goto return_invalid_indent; + + if (cmp <= 0) { + /* We have gone right back to the parent level or higher, we are + * skipping this child node level entirely. Pop the parent to + * reinstate the vty->indent, and enter below loop to find a + * matching parent indent. */ + vty_go_parent(vty); + /* (The next indent_cmp() below is just a repetition, but would + * make the code complex to skip it.) */ + } + } else { + /* If there is no parent, record any indentation we encounter: */ + cmp = 1; + } + + if (cmp > 0) { + /* The indent is deeper than the just entered parent, record the new + * indentation characters. */ + vty->indent = talloc_strdup(vty, indent); + } + } cmp = indent_cmp(indent, vty->indent); if (cmp == EINVAL) diff --git a/tests/Makefile.am b/tests/Makefile.am index 8935bf7..b138717 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -222,6 +222,7 @@ vty/fail_tabs_and_spaces.cfg \ vty/fail_too_much_indent.cfg \ vty/ok.cfg \ + vty/ok_empty_parent.cfg \ vty/ok_ignore_blank.cfg \ vty/ok_ignore_comment.cfg \ vty/ok_indented_root.cfg \ diff --git a/tests/vty/ok_empty_parent.cfg b/tests/vty/ok_empty_parent.cfg new file mode 100644 index 0000000..fe04fcf --- /dev/null +++ b/tests/vty/ok_empty_parent.cfg @@ -0,0 +1,2 @@ +line vty +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index eba9995..d9af6ae 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -342,6 +342,7 @@ test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); test_exit_by_indent("ok_indented_root.cfg", 0); + test_exit_by_indent("ok_empty_parent.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index b2df1a1..f9fea34 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -128,4 +128,6 @@ got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 got rc=0 +reading file ok_empty_parent.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 22:07:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 22:07:27 +0000 Subject: libosmocore[master]: fix vty regression: empty parent node In-Reply-To: References: Message-ID: Patch Set 1: found by the osmo-gsm-tester :) -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 22:11:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 22:11:10 +0000 Subject: [PATCH] libosmocore[master]: fix vty regression: empty parent node In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3992 to look at the new patch set (#2). fix vty regression: empty parent node The recent exit-by-indent patch breaks a VTY case where a node is entered but directly followed by a sibling or ancestor without listing any child nodes. Regression introduced by I24cbb3f6de111f2d31110c3c484c066f1153aac9. An example is a common usage in osmo-bts, where 'phy N' / 'instance N' is a parent node that is commonly left empty: phy 0 instance 0 bts 0 band 1800 Before this patch, this case produces the error: There is no such command. Error occurred during reading the below line: bts 0 Fix indentation parsing logic in command.c to accomodate this case. Add a unit test for empty parent node. Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_empty_parent.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 37 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/3992/2 diff --git a/src/vty/command.c b/src/vty/command.c index a65b4de..f389928 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2374,10 +2374,37 @@ continue; } - /* We have a nonempty line. This might be the first on a deeper indenting level, so let's - * remember this indent if we don't have one yet. */ - if (!vty->indent) - vty->indent = talloc_strdup(vty, indent); + /* We have a nonempty line. */ + if (!vty->indent) { + /* We have just entered a node and expecting the first child to come up; but we + * may also skip right back to a parent or ancestor level. */ + parent = vty_parent(vty); + if (parent) { + cmp = indent_cmp(indent, parent->indent); + + if (cmp == EINVAL) + goto return_invalid_indent; + + if (cmp <= 0) { + /* We have gone right back to the parent level or higher, we are + * skipping this child node level entirely. Pop the parent to + * reinstate the vty->indent, and enter below loop to find a + * matching parent indent. */ + vty_go_parent(vty); + /* (The next indent_cmp() below is just a repetition, but would + * make the code complex to skip it.) */ + } + } else { + /* If there is no parent, record any indentation we encounter: */ + cmp = 1; + } + + if (cmp > 0) { + /* The indent is deeper than the just entered parent, record the new + * indentation characters. */ + vty->indent = talloc_strdup(vty, indent); + } + } cmp = indent_cmp(indent, vty->indent); if (cmp == EINVAL) diff --git a/tests/Makefile.am b/tests/Makefile.am index 8935bf7..b138717 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -222,6 +222,7 @@ vty/fail_tabs_and_spaces.cfg \ vty/fail_too_much_indent.cfg \ vty/ok.cfg \ + vty/ok_empty_parent.cfg \ vty/ok_ignore_blank.cfg \ vty/ok_ignore_comment.cfg \ vty/ok_indented_root.cfg \ diff --git a/tests/vty/ok_empty_parent.cfg b/tests/vty/ok_empty_parent.cfg new file mode 100644 index 0000000..fe04fcf --- /dev/null +++ b/tests/vty/ok_empty_parent.cfg @@ -0,0 +1,2 @@ +line vty +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index eba9995..d9af6ae 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -342,6 +342,7 @@ test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); test_exit_by_indent("ok_indented_root.cfg", 0); + test_exit_by_indent("ok_empty_parent.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index b2df1a1..f9fea34 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -128,4 +128,6 @@ got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 got rc=0 +reading file ok_empty_parent.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 22:46:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 22:46:24 +0000 Subject: [PATCH] libosmocore[master]: fix vty regression: empty parent node In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3992 to look at the new patch set (#3). fix vty regression: empty parent node The recent exit-by-indent patch breaks a VTY case where a node is entered but directly followed by a sibling or ancestor without listing any child nodes. Regression introduced by I24cbb3f6de111f2d31110c3c484c066f1153aac9. An example is a common usage in osmo-bts, where 'phy N' / 'instance N' is a parent node that is commonly left empty: phy 0 instance 0 bts 0 band 1800 Before this patch, this case produces the error: There is no such command. Error occurred during reading the below line: bts 0 Fix indentation parsing logic in command.c to accomodate this case. Add a unit test for empty parent node. Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_empty_parent.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 33 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/3992/3 diff --git a/src/vty/command.c b/src/vty/command.c index a65b4de..e804959 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2374,10 +2374,33 @@ continue; } - /* We have a nonempty line. This might be the first on a deeper indenting level, so let's - * remember this indent if we don't have one yet. */ - if (!vty->indent) - vty->indent = talloc_strdup(vty, indent); + /* We have a nonempty line. */ + if (!vty->indent) { + /* We have just entered a node and expecting the first child to come up; but we + * may also skip right back to a parent or ancestor level. */ + parent = vty_parent(vty); + + /* If there is no parent, record any indentation we encounter. */ + cmp = parent ? indent_cmp(indent, parent->indent) : 1; + + if (cmp == EINVAL) + goto return_invalid_indent; + + if (cmp <= 0) { + /* We have gone right back to the parent level or higher, we are skipping + * this child node level entirely. Pop the parent to go back to a node + * that was actually there (to reinstate vty->indent) and re-use below + * go-parent while-loop to find an accurate match of indent in the node + * ancestry. */ + vty_go_parent(vty); + /* (The next indent_cmp() below is just a repetition, but would + * make the code complex to skip it.) */ + } else { + /* The indent is deeper than the just entered parent, record the new + * indentation characters. */ + vty->indent = talloc_strdup(vty, indent); + } + } cmp = indent_cmp(indent, vty->indent); if (cmp == EINVAL) diff --git a/tests/Makefile.am b/tests/Makefile.am index 8935bf7..b138717 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -222,6 +222,7 @@ vty/fail_tabs_and_spaces.cfg \ vty/fail_too_much_indent.cfg \ vty/ok.cfg \ + vty/ok_empty_parent.cfg \ vty/ok_ignore_blank.cfg \ vty/ok_ignore_comment.cfg \ vty/ok_indented_root.cfg \ diff --git a/tests/vty/ok_empty_parent.cfg b/tests/vty/ok_empty_parent.cfg new file mode 100644 index 0000000..fe04fcf --- /dev/null +++ b/tests/vty/ok_empty_parent.cfg @@ -0,0 +1,2 @@ +line vty +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index eba9995..d9af6ae 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -342,6 +342,7 @@ test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); test_exit_by_indent("ok_indented_root.cfg", 0); + test_exit_by_indent("ok_empty_parent.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index b2df1a1..f9fea34 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -128,4 +128,6 @@ got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 got rc=0 +reading file ok_empty_parent.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 22:49:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 22:49:43 +0000 Subject: [PATCH] libosmocore[master]: comment: describe indent_cmp() Message-ID: Review at https://gerrit.osmocom.org/3993 comment: describe indent_cmp() Change-Id: Ia58c16d995f6751bdd69defe8a46665aee163f3d --- M src/vty/command.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/3993/1 diff --git a/src/vty/command.c b/src/vty/command.c index e804959..8f11a2c 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2331,6 +2331,10 @@ return str? strlen(str) : 0; } +/*! Make sure the common length of strings a and b is identical, then compare their lengths. I.e., if a + * is longer than b, a must start with exactly b, and vice versa. + * \returns EINVAL on mismatch, -1 for a < b, 0 for a == b, 1 for a > b. + */ static int indent_cmp(const char *a, const char *b) { size_t al, bl; -- To view, visit https://gerrit.osmocom.org/3993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia58c16d995f6751bdd69defe8a46665aee163f3d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 22:56:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 19 Sep 2017 22:56:13 +0000 Subject: libosmocore[master]: comment: describe indent_cmp() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3993/1/src/vty/command.c File src/vty/command.c: Line 2334: /*! Make sure the common length of strings a and b is identical, then compare their lengths. I.e., if a common prefix of a and b is identical? Not that important though. -- To view, visit https://gerrit.osmocom.org/3993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia58c16d995f6751bdd69defe8a46665aee163f3d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 19 22:58:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 22:58:42 +0000 Subject: [PATCH] libosmocore[master]: fix vty regression: empty parent node In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3992 to look at the new patch set (#4). fix vty regression: empty parent node The recent exit-by-indent patch breaks a VTY case where a node is entered but directly followed by a sibling or ancestor without listing any child nodes. Regression introduced by I24cbb3f6de111f2d31110c3c484c066f1153aac9. An example is a common usage in osmo-bts, where 'phy N' / 'instance N' is a parent node that is commonly left empty: phy 0 instance 0 bts 0 band 1800 Before this patch, this case produces the error: There is no such command. Error occurred during reading the below line: bts 0 Fix indentation parsing logic in command.c to accomodate this case. Add a unit test for empty parent node. Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_empty_parent.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 38 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/3992/4 diff --git a/src/vty/command.c b/src/vty/command.c index a65b4de..46c9fa2 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2374,14 +2374,39 @@ continue; } - /* We have a nonempty line. This might be the first on a deeper indenting level, so let's - * remember this indent if we don't have one yet. */ - if (!vty->indent) - vty->indent = talloc_strdup(vty, indent); + /* We have a nonempty line. */ + if (!vty->indent) { + /* We have just entered a node and expecting the first child to come up; but we + * may also skip right back to a parent or ancestor level. */ + parent = vty_parent(vty); - cmp = indent_cmp(indent, vty->indent); - if (cmp == EINVAL) - goto return_invalid_indent; + /* If there is no parent, record any indentation we encounter. */ + cmp = parent ? indent_cmp(indent, parent->indent) : 1; + + if (cmp == EINVAL) + goto return_invalid_indent; + + if (cmp <= 0) { + /* We have gone right back to the parent level or higher, we are skipping + * this child node level entirely. Pop the parent to go back to a node + * that was actually there (to reinstate vty->indent) and re-use below + * go-parent while-loop to find an accurate match of indent in the node + * ancestry. */ + vty_go_parent(vty); + } else { + /* The indent is deeper than the just entered parent, record the new + * indentation characters. */ + vty->indent = talloc_strdup(vty, indent); + /* This *is* the new indentation. */ + cmp = 0; + } + } else { + /* There is a known indentation for this node level, validate and detect node + * exits. */ + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + } /* Less indent: go up the parent nodes to find matching amount of less indent. When this * loop exits, we want to have found an exact match, i.e. cmp == 0. */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 8935bf7..b138717 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -222,6 +222,7 @@ vty/fail_tabs_and_spaces.cfg \ vty/fail_too_much_indent.cfg \ vty/ok.cfg \ + vty/ok_empty_parent.cfg \ vty/ok_ignore_blank.cfg \ vty/ok_ignore_comment.cfg \ vty/ok_indented_root.cfg \ diff --git a/tests/vty/ok_empty_parent.cfg b/tests/vty/ok_empty_parent.cfg new file mode 100644 index 0000000..fe04fcf --- /dev/null +++ b/tests/vty/ok_empty_parent.cfg @@ -0,0 +1,2 @@ +line vty +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index eba9995..d9af6ae 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -342,6 +342,7 @@ test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); test_exit_by_indent("ok_indented_root.cfg", 0); + test_exit_by_indent("ok_empty_parent.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index b2df1a1..f9fea34 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -128,4 +128,6 @@ got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 got rc=0 +reading file ok_empty_parent.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 19 23:05:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 19 Sep 2017 23:05:43 +0000 Subject: libosmocore[master]: fix vty regression: empty parent node In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 23:09:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 23:09:20 +0000 Subject: libosmocore[master]: fix vty regression: empty parent node In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 fast tracking to resolve the regression without more fallout -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 19 23:09:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 19 Sep 2017 23:09:23 +0000 Subject: [MERGED] libosmocore[master]: fix vty regression: empty parent node In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix vty regression: empty parent node ...................................................................... fix vty regression: empty parent node The recent exit-by-indent patch breaks a VTY case where a node is entered but directly followed by a sibling or ancestor without listing any child nodes. Regression introduced by I24cbb3f6de111f2d31110c3c484c066f1153aac9. An example is a common usage in osmo-bts, where 'phy N' / 'instance N' is a parent node that is commonly left empty: phy 0 instance 0 bts 0 band 1800 Before this patch, this case produces the error: There is no such command. Error occurred during reading the below line: bts 0 Fix indentation parsing logic in command.c to accomodate this case. Add a unit test for empty parent node. Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 --- M src/vty/command.c M tests/Makefile.am A tests/vty/ok_empty_parent.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 5 files changed, 38 insertions(+), 7 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/command.c b/src/vty/command.c index a65b4de..46c9fa2 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2374,14 +2374,39 @@ continue; } - /* We have a nonempty line. This might be the first on a deeper indenting level, so let's - * remember this indent if we don't have one yet. */ - if (!vty->indent) - vty->indent = talloc_strdup(vty, indent); + /* We have a nonempty line. */ + if (!vty->indent) { + /* We have just entered a node and expecting the first child to come up; but we + * may also skip right back to a parent or ancestor level. */ + parent = vty_parent(vty); - cmp = indent_cmp(indent, vty->indent); - if (cmp == EINVAL) - goto return_invalid_indent; + /* If there is no parent, record any indentation we encounter. */ + cmp = parent ? indent_cmp(indent, parent->indent) : 1; + + if (cmp == EINVAL) + goto return_invalid_indent; + + if (cmp <= 0) { + /* We have gone right back to the parent level or higher, we are skipping + * this child node level entirely. Pop the parent to go back to a node + * that was actually there (to reinstate vty->indent) and re-use below + * go-parent while-loop to find an accurate match of indent in the node + * ancestry. */ + vty_go_parent(vty); + } else { + /* The indent is deeper than the just entered parent, record the new + * indentation characters. */ + vty->indent = talloc_strdup(vty, indent); + /* This *is* the new indentation. */ + cmp = 0; + } + } else { + /* There is a known indentation for this node level, validate and detect node + * exits. */ + cmp = indent_cmp(indent, vty->indent); + if (cmp == EINVAL) + goto return_invalid_indent; + } /* Less indent: go up the parent nodes to find matching amount of less indent. When this * loop exits, we want to have found an exact match, i.e. cmp == 0. */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 8935bf7..b138717 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -222,6 +222,7 @@ vty/fail_tabs_and_spaces.cfg \ vty/fail_too_much_indent.cfg \ vty/ok.cfg \ + vty/ok_empty_parent.cfg \ vty/ok_ignore_blank.cfg \ vty/ok_ignore_comment.cfg \ vty/ok_indented_root.cfg \ diff --git a/tests/vty/ok_empty_parent.cfg b/tests/vty/ok_empty_parent.cfg new file mode 100644 index 0000000..fe04fcf --- /dev/null +++ b/tests/vty/ok_empty_parent.cfg @@ -0,0 +1,2 @@ +line vty +log stderr diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index eba9995..d9af6ae 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -342,6 +342,7 @@ test_exit_by_indent("fail_too_much_indent.cfg", -EINVAL); test_exit_by_indent("fail_tabs_and_spaces.cfg", -EINVAL); test_exit_by_indent("ok_indented_root.cfg", 0); + test_exit_by_indent("ok_empty_parent.cfg", 0); /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index b2df1a1..f9fea34 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -128,4 +128,6 @@ got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 got rc=0 +reading file ok_empty_parent.cfg, expecting rc=0 +got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia0880a17ae55accb092ae8585cc3a1bec9986891 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 20 01:05:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 01:05:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix osmo-bts-trx config: 'osmotrx' must be indented in 'inst... Message-ID: Review at https://gerrit.osmocom.org/3994 fix osmo-bts-trx config: 'osmotrx' must be indented in 'instance 0' We hit this now because libosmocore has started strictly enforcing correct indenting of child nodes. See I24cbb3f6de111f2d31110c3c484c066f1153aac9. Change-Id: I3a48cda44b932b46f34f027ca88e3703b6f04bad --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/94/3994/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 950c03e..f8c47d9 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -15,10 +15,10 @@ ! phy 0 instance 0 - osmotrx rx-gain 25 - osmotrx tx-attenuation oml - osmotrx ip local ${osmo_bts_trx.trx_local_ip} - osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} + osmotrx rx-gain 25 + osmotrx tx-attenuation oml + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 -- To view, visit https://gerrit.osmocom.org/3994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a48cda44b932b46f34f027ca88e3703b6f04bad Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 01:06:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 01:06:16 +0000 Subject: osmo-gsm-tester[master]: fix osmo-bts-trx config: 'osmotrx' must be indented in 'inst... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a48cda44b932b46f34f027ca88e3703b6f04bad Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 20 01:06:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 01:06:18 +0000 Subject: [MERGED] osmo-gsm-tester[master]: fix osmo-bts-trx config: 'osmotrx' must be indented in 'inst... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix osmo-bts-trx config: 'osmotrx' must be indented in 'instance 0' ...................................................................... fix osmo-bts-trx config: 'osmotrx' must be indented in 'instance 0' We hit this now because libosmocore has started strictly enforcing correct indenting of child nodes. See I24cbb3f6de111f2d31110c3c484c066f1153aac9. Change-Id: I3a48cda44b932b46f34f027ca88e3703b6f04bad --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 950c03e..f8c47d9 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -15,10 +15,10 @@ ! phy 0 instance 0 - osmotrx rx-gain 25 - osmotrx tx-attenuation oml - osmotrx ip local ${osmo_bts_trx.trx_local_ip} - osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} + osmotrx rx-gain 25 + osmotrx tx-attenuation oml + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 -- To view, visit https://gerrit.osmocom.org/3994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3a48cda44b932b46f34f027ca88e3703b6f04bad Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 01:33:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 01:33:30 +0000 Subject: [PATCH] libosmocore[master]: vty_test: add artificial node levels for better testing Message-ID: Review at https://gerrit.osmocom.org/3995 vty_test: add artificial node levels for better testing In vty_test, add three levels of parent nodes (level1, level2, level3) with each having a leaf child (child1, child2, child3). Use these to enhance the vty_test cfg files and test more diverse situations. The current VTY code expects a go_parent_cb() to be present, otherwise it will bump right back to the CONFIG_NODE, which will not work with more than one node level below the CONFIG_NODE. Hence provide a minimal go_parent_cb(). Change-Id: Ib9bcf58b655fbd85e196f363fb7d8305d7dfc997 --- M tests/vty/fail_not_de-indented.cfg M tests/vty/fail_tabs_and_spaces.cfg M tests/vty/fail_too_much_indent.cfg M tests/vty/ok.cfg M tests/vty/ok_empty_parent.cfg M tests/vty/ok_ignore_blank.cfg M tests/vty/ok_ignore_comment.cfg M tests/vty/ok_indented_root.cfg M tests/vty/ok_more_spaces.cfg M tests/vty/ok_tabs.cfg M tests/vty/ok_tabs_and_spaces.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 13 files changed, 440 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/3995/1 diff --git a/tests/vty/fail_not_de-indented.cfg b/tests/vty/fail_not_de-indented.cfg index 5af833d..ca5a3cd 100644 --- a/tests/vty/fail_not_de-indented.cfg +++ b/tests/vty/fail_not_de-indented.cfg @@ -1,3 +1,3 @@ -line vty - no login - log stderr +level1 a + child1 a + level1 b diff --git a/tests/vty/fail_tabs_and_spaces.cfg b/tests/vty/fail_tabs_and_spaces.cfg index fa6ce05..4cb0cf5 100644 --- a/tests/vty/fail_tabs_and_spaces.cfg +++ b/tests/vty/fail_tabs_and_spaces.cfg @@ -1,4 +1,4 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + child1 b +level1 b diff --git a/tests/vty/fail_too_much_indent.cfg b/tests/vty/fail_too_much_indent.cfg index bacb3e1..3446a05 100644 --- a/tests/vty/fail_too_much_indent.cfg +++ b/tests/vty/fail_too_much_indent.cfg @@ -1,3 +1,3 @@ -line vty - no login - log stderr +level1 a + child1 a + level1 b diff --git a/tests/vty/ok.cfg b/tests/vty/ok.cfg index d5ef23e..f562348 100644 --- a/tests/vty/ok.cfg +++ b/tests/vty/ok.cfg @@ -1,3 +1,28 @@ -line vty - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/ok_empty_parent.cfg b/tests/vty/ok_empty_parent.cfg index fe04fcf..40dd372 100644 --- a/tests/vty/ok_empty_parent.cfg +++ b/tests/vty/ok_empty_parent.cfg @@ -1,2 +1,22 @@ -line vty -log stderr +level1 a + level2 a + level3 a +level1 b + level2 b +level1 c +level1 d + level2 e + level2 f + level3 f + level3 g + level2 g + level2 h +level1 h +level1 i +level1 j + level2 j + child1 j +level1 k + level2 k + level3 k + child1 k diff --git a/tests/vty/ok_ignore_blank.cfg b/tests/vty/ok_ignore_blank.cfg index d16ff64..a4a8bcb 100644 --- a/tests/vty/ok_ignore_blank.cfg +++ b/tests/vty/ok_ignore_blank.cfg @@ -1,7 +1,14 @@ -line vty +level1 - no login + level2 - no login + child2 + -log stderr + + level3 + + + child3 + +level1 diff --git a/tests/vty/ok_ignore_comment.cfg b/tests/vty/ok_ignore_comment.cfg index 5813fc7..1d6d87e 100644 --- a/tests/vty/ok_ignore_comment.cfg +++ b/tests/vty/ok_ignore_comment.cfg @@ -1,7 +1,8 @@ -line vty +level1 ! comment - no login + child1 ! comment - no login + level2 ! comment -log stderr + child2 +level1 diff --git a/tests/vty/ok_indented_root.cfg b/tests/vty/ok_indented_root.cfg index 313c674..b7487f6 100644 --- a/tests/vty/ok_indented_root.cfg +++ b/tests/vty/ok_indented_root.cfg @@ -1,3 +1,5 @@ - line vty - no login - log stderr + level1 a + child1 + level2 + child2 + level1 b diff --git a/tests/vty/ok_more_spaces.cfg b/tests/vty/ok_more_spaces.cfg index b66a9c2..263c682 100644 --- a/tests/vty/ok_more_spaces.cfg +++ b/tests/vty/ok_more_spaces.cfg @@ -1,4 +1,28 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/ok_tabs.cfg b/tests/vty/ok_tabs.cfg index e94609b..3f6085d 100644 --- a/tests/vty/ok_tabs.cfg +++ b/tests/vty/ok_tabs.cfg @@ -1,4 +1,28 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/ok_tabs_and_spaces.cfg b/tests/vty/ok_tabs_and_spaces.cfg index 2049b73..1922aad 100644 --- a/tests/vty/ok_tabs_and_spaces.cfg +++ b/tests/vty/ok_tabs_and_spaces.cfg @@ -1,4 +1,28 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index d9af6ae..fe50e4c 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -298,12 +298,128 @@ OSMO_ASSERT(rc == expect_rc); } +enum test_nodes { + LEVEL1_NODE = _LAST_OSMOVTY_NODE + 1, + LEVEL2_NODE, + LEVEL3_NODE, +}; + +struct cmd_node level1_node = { + LEVEL1_NODE, + "%s(config-level1)# ", + 1 +}; + +struct cmd_node level2_node = { + LEVEL2_NODE, + "%s(config-level1-level2)# ", + 1 +}; + +struct cmd_node level3_node = { + LEVEL3_NODE, + "%s(config-level1-level2-level3)# ", + 1 +}; + +DEFUN(cfg_level1, cfg_level1_cmd, + "level1 [MARKER]", + "Level 1 node for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + vty->index = NULL; + vty->node = LEVEL1_NODE; + printf("called level1 node %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level1_child, cfg_level1_child_cmd, + "child1 [MARKER]", + "Level 1 child cmd for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + printf("called level1 child cmd %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level2, cfg_level2_cmd, + "level2 [MARKER]", + "Level 2 node for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + vty->index = NULL; + vty->node = LEVEL2_NODE; + printf("called level2 node %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level2_child, cfg_level2_child_cmd, + "child2 [MARKER]", + "Level 2 child cmd for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + printf("called level2 child cmd %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level3, cfg_level3_cmd, + "level3 [MARKER]", + "Level 3 node for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + vty->index = NULL; + vty->node = LEVEL3_NODE; + printf("called level3 node %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level3_child, cfg_level3_child_cmd, + "child3 [MARKER]", + "Level 3 child cmd for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + printf("called level3 child cmd %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +void test_vty_add_cmds() +{ + install_element(CONFIG_NODE, &cfg_level1_cmd); + install_node(&level1_node, NULL); + vty_install_default(LEVEL1_NODE); + install_element(LEVEL1_NODE, &cfg_level1_child_cmd); + install_element(LEVEL1_NODE, &cfg_level2_cmd); + + install_node(&level2_node, NULL); + vty_install_default(LEVEL2_NODE); + install_element(LEVEL2_NODE, &cfg_level2_child_cmd); + install_element(LEVEL2_NODE, &cfg_level3_cmd); + + install_node(&level3_node, NULL); + vty_install_default(LEVEL3_NODE); + install_element(LEVEL3_NODE, &cfg_level3_child_cmd); +} + +static int go_parent_cb(struct vty *vty) +{ + /* + * - For the interactive VTY tests above, it is expected to bounce back to + * the CONFIG_NODE. Hence do so in go_parent_cb(). + * - In the config file parsing tests, setting vty->node in go_parent_cb() has no + * effect, because we will subsequently pop a parent node from the parent stack + * and override to go to the node that was recorded as the actual parent. + */ + vty->node = CONFIG_NODE; + vty->index = NULL; + return 0; +} + int main(int argc, char **argv) { struct vty_app_info vty_info = { .name = "VtyTest", .version = 0, - .go_parent_cb = NULL, + .go_parent_cb = go_parent_cb, .is_config_node = NULL, }; @@ -329,6 +445,8 @@ logging_vty_add_cmds(); osmo_stats_vty_add_cmds(); + test_vty_add_cmds(); + test_cmd_string_from_valstr(); test_node_tree_structure(); test_stats_vty(); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index f9fea34..bd6c5d6 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -109,25 +109,181 @@ Going to execute 'no stats reporter statsd' Returned: 0, Current node: 4 '%s(config)# ' reading file ok.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_more_spaces.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_tabs.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_tabs_and_spaces.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_ignore_comment.cfg, expecting rc=0 +called level1 node +called level1 child cmd +called level2 node +called level2 child cmd +called level1 node got rc=0 reading file ok_ignore_blank.cfg, expecting rc=0 +called level1 node +called level2 node +called level2 child cmd +called level3 node +called level3 child cmd +called level1 node got rc=0 reading file fail_not_de-indented.cfg, expecting rc=-22 +called level1 node a +called level1 child cmd a got rc=-22 reading file fail_too_much_indent.cfg, expecting rc=-22 +called level1 node a +called level1 child cmd a got rc=-22 reading file fail_tabs_and_spaces.cfg, expecting rc=-22 +called level1 node a +called level1 child cmd a got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 +called level1 node a +called level1 child cmd +called level2 node +called level2 child cmd +called level1 node b got rc=0 reading file ok_empty_parent.cfg, expecting rc=0 +called level1 node a +called level2 node a +called level3 node a +called level1 node b +called level2 node b +called level1 node c +called level1 node d +called level2 node e +called level2 node f +called level3 node f +called level3 node g +called level2 node g +called level2 node h +called level1 node h +called level1 node i +called level1 node j +called level2 node j +called level1 child cmd j +called level1 node k +called level2 node k +called level3 node k +called level1 child cmd k got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9bcf58b655fbd85e196f363fb7d8305d7dfc997 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 01:46:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 01:46:43 +0000 Subject: [PATCH] osmo-gsm-tester[master]: re-fix osmo-bts-trx config: 'osmotrx ip' must *not* be indented Message-ID: Review at https://gerrit.osmocom.org/3996 re-fix osmo-bts-trx config: 'osmotrx ip' must *not* be indented The previous commit wrongly placed all of 'osmotrx' below 'instance 0', put the 'osmotrx ip' ones back in the parent (I3a48cda44b932b46f34f027ca88e3703b6f04bad -- I should have known, the change Id ends in "bad"). The correct structure is: phy 0 osmotrx ip ... instance 0 osmotrx rx-gain ... osmotrx tx-attenuation ... i.e. the 'osmotrx' command name exists on both the 'phy' parent level as well as the 'instance' child level. (Argh, can this be more confusing? I assume we will be seeing a continuous flow of users hitting this now.) Change-Id: I7ef7ab3048266c1b2a4f6f33951f1305ec5f0ad6 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/96/3996/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index f8c47d9..c316e62 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -14,11 +14,11 @@ logging level trx info ! phy 0 + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} instance 0 osmotrx rx-gain 25 osmotrx tx-attenuation oml - osmotrx ip local ${osmo_bts_trx.trx_local_ip} - osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 -- To view, visit https://gerrit.osmocom.org/3996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ef7ab3048266c1b2a4f6f33951f1305ec5f0ad6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 01:47:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 01:47:40 +0000 Subject: osmo-gsm-tester[master]: re-fix osmo-bts-trx config: 'osmotrx ip' must *not* be indented In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7ef7ab3048266c1b2a4f6f33951f1305ec5f0ad6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 20 01:47:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 01:47:41 +0000 Subject: [MERGED] osmo-gsm-tester[master]: re-fix osmo-bts-trx config: 'osmotrx ip' must *not* be indented In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: re-fix osmo-bts-trx config: 'osmotrx ip' must *not* be indented ...................................................................... re-fix osmo-bts-trx config: 'osmotrx ip' must *not* be indented The previous commit wrongly placed all of 'osmotrx' below 'instance 0', put the 'osmotrx ip' ones back in the parent (I3a48cda44b932b46f34f027ca88e3703b6f04bad -- I should have known, the change Id ends in "bad"). The correct structure is: phy 0 osmotrx ip ... instance 0 osmotrx rx-gain ... osmotrx tx-attenuation ... i.e. the 'osmotrx' command name exists on both the 'phy' parent level as well as the 'instance' child level. (Argh, can this be more confusing? I assume we will be seeing a continuous flow of users hitting this now.) Change-Id: I7ef7ab3048266c1b2a4f6f33951f1305ec5f0ad6 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index f8c47d9..c316e62 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -14,11 +14,11 @@ logging level trx info ! phy 0 + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} instance 0 osmotrx rx-gain 25 osmotrx tx-attenuation oml - osmotrx ip local ${osmo_bts_trx.trx_local_ip} - osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 -- To view, visit https://gerrit.osmocom.org/3996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ef7ab3048266c1b2a4f6f33951f1305ec5f0ad6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 03:10:21 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 20 Sep 2017 03:10:21 +0000 Subject: libosmocore[master]: vty: use internal node id for xml ids In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Okay makes sense. But is cnode->node unique it seems to be solely external defined but then it might be more stable? -- To view, visit https://gerrit.osmocom.org/3978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 20 03:15:54 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 20 Sep 2017 03:15:54 +0000 Subject: libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 (2 comments) You don't mention "duplicate" avoidance. I don't think we should derive it from the prompt... https://gerrit.osmocom.org/#/c/3979/3/src/vty/command.c File src/vty/command.c: Line 158: if (!*node->name) use node->name[0]? But why derive it from the prompt? It seems like an interim solution only? Line 612: same_name_count = 1; Why start with 1? For the first node it has not used before? -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 20 12:41:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 12:41:33 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix osmo-stp.cfg: accept-asp-connections must be a child of ... Message-ID: Review at https://gerrit.osmocom.org/3997 fix osmo-stp.cfg: accept-asp-connections must be a child of listen m3ua Change-Id: I266b129788b2caaec0f345f80a2c5eab0172bf97 --- M src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/97/3997/1 diff --git a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl index ab41de9..eb6ac1d 100644 --- a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl @@ -13,4 +13,4 @@ cs7 instance 0 xua rkm routing-key-allocation dynamic-permitted listen m3ua 2905 - accept-asp-connections dynamic-permitted + accept-asp-connections dynamic-permitted -- To view, visit https://gerrit.osmocom.org/3997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I266b129788b2caaec0f345f80a2c5eab0172bf97 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 13:53:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 13:53:21 +0000 Subject: [PATCH] libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes Message-ID: Review at https://gerrit.osmocom.org/3998 vty: install 'exit', 'end',... commands on *all* nodes In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Deprecate both install_default() and vty_install_default() and make them no-ops so that users of the API may still call them without harm. Drop all invocations to the deprecated functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b --- M include/osmocom/vty/command.h M src/ctrl/control_vty.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c M src/vty/command.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/vty.c M tests/vty/vty_test.c 9 files changed, 33 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/3998/1 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index cb2edaa..20bc142 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -27,6 +27,8 @@ #include #include "vector.h" +#include + /*! \defgroup command VTY Command * @{ * \file command.h */ @@ -353,15 +355,12 @@ /* Prototypes. */ void install_node(struct cmd_node *, int (*)(struct vty *)); -void install_default(int node_type); +void install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()"); void install_element(int node_type, struct cmd_element *); void install_element_ve(struct cmd_element *cmd); void sort_node(void); -/* This is similar to install_default() but it also creates - * 'exit' and 'end' commands. - */ -void vty_install_default(int node_type); +void vty_install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()"); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated string with a space between each element (allocated using diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index 97f42de..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -82,7 +82,6 @@ ctrl_vty_ctx = ctx; install_element(CONFIG_NODE, &cfg_ctrl_cmd); install_node(&ctrl_node, config_write_ctrl); - vty_install_default(L_CTRL_NODE); install_element(L_CTRL_NODE, &cfg_ctrl_bind_addr_cmd); return 0; diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index 703d130..2953f88 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -211,7 +211,6 @@ install_element(CONFIG_NODE, &cfg_bssgp_cmd); install_node(&bssgp_node, config_write_bssgp); - install_default(L_BSSGP_NODE); install_element(L_BSSGP_NODE, &libgb_exit_cmd); install_element(L_BSSGP_NODE, &libgb_end_cmd); diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index e320ba2..547c9b8 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_ns_cmd); install_node(&ns_node, config_write_ns); - install_default(L_NS_NODE); install_element(L_NS_NODE, &libgb_exit_cmd); install_element(L_NS_NODE, &libgb_end_cmd); install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); diff --git a/src/vty/command.c b/src/vty/command.c index a19d5db..4769c89 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -123,12 +123,21 @@ return str; } -/*! Install top node of command vector. */ -void install_node(struct cmd_node *node, int (*func) (struct vty *)) +static void install_basic_node_commands(int node); + +/*! Install top node of command vector, without adding basic node commands. */ +static void install_node_bare(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); +} + +/*! Install top node of command vector. */ +void install_node(struct cmd_node *node, int (*func) (struct vty *)) +{ + install_node_bare(node, func); + install_basic_node_commands(node->node); } /* Compare two command's string. Used in sort_node (). */ @@ -3554,7 +3563,22 @@ host.config = talloc_strdup(tall_vty_cmd_ctx, filename); } +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ void install_default(int node) +{ +} + +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ +void vty_install_default(int node) +{ +} + +/*! Install common commands like 'exit' and 'list'. */ +static void install_basic_node_commands(int node) { install_element(node, &config_help_cmd); install_element(node, &config_list_cmd); @@ -3564,11 +3588,6 @@ install_element(node, &config_write_memory_cmd); install_element(node, &config_write_cmd); install_element(node, &show_running_config_cmd); -} - -void vty_install_default(int node) -{ - install_default(node); install_element(node, &config_exit_cmd); @@ -3636,10 +3655,10 @@ host.motdfile = NULL; /* Install top nodes. */ - install_node(&view_node, NULL); + install_node_bare(&view_node, NULL); install_node(&enable_node, NULL); - install_node(&auth_node, NULL); - install_node(&auth_enable_node, NULL); + install_node_bare(&auth_node, NULL); + install_node_bare(&auth_enable_node, NULL); install_node(&config_node, config_write_host); /* Each node's basic commands. */ @@ -3656,7 +3675,6 @@ } if (terminal) { - vty_install_default(ENABLE_NODE); install_element(ENABLE_NODE, &config_disable_cmd); install_element(ENABLE_NODE, &config_terminal_cmd); install_element (ENABLE_NODE, ©_runningconfig_startupconfig_cmd); @@ -3669,8 +3687,6 @@ install_element(ENABLE_NODE, &config_terminal_length_cmd); install_element(ENABLE_NODE, &config_terminal_no_length_cmd); install_element(ENABLE_NODE, &echo_cmd); - - vty_install_default(CONFIG_NODE); } install_element(CONFIG_NODE, &hostname_cmd); diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 01480b1..0ab7686 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -776,7 +776,6 @@ install_element_ve(&show_alarms_cmd); install_node(&cfg_log_node, config_write_log); - vty_install_default(CFG_LOG_NODE); install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 57cdd30..a4c73fa 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_stats_interval_cmd); install_node(&cfg_stats_node, config_write_stats); - vty_install_default(CFG_STATS_NODE); install_element(CFG_STATS_NODE, &cfg_stats_reporter_local_ip_cmd); install_element(CFG_STATS_NODE, &cfg_no_stats_reporter_local_ip_cmd); diff --git a/src/vty/vty.c b/src/vty/vty.c index bd0d2c3..3d76b7a 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1798,7 +1798,6 @@ install_element(ENABLE_NODE, &terminal_monitor_cmd); install_element(ENABLE_NODE, &terminal_no_monitor_cmd); - vty_install_default(VTY_NODE); install_element(VTY_NODE, &vty_login_cmd); install_element(VTY_NODE, &no_vty_login_cmd); install_element(VTY_NODE, &vty_bind_cmd); diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index fe50e4c..2542baf 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -386,17 +386,14 @@ { install_element(CONFIG_NODE, &cfg_level1_cmd); install_node(&level1_node, NULL); - vty_install_default(LEVEL1_NODE); install_element(LEVEL1_NODE, &cfg_level1_child_cmd); install_element(LEVEL1_NODE, &cfg_level2_cmd); install_node(&level2_node, NULL); - vty_install_default(LEVEL2_NODE); install_element(LEVEL2_NODE, &cfg_level2_child_cmd); install_element(LEVEL2_NODE, &cfg_level3_cmd); install_node(&level3_node, NULL); - vty_install_default(LEVEL3_NODE); install_element(LEVEL3_NODE, &cfg_level3_child_cmd); } -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 15:37:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 15:37:29 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3912 to look at the new patch set (#3). Simplify TS alloc: adjust function signatures * document used parameters and return values * use consistent formatting * constify function parameters where appropriate (adjusting parameter types if necessary) Change-Id: I211b10b4da59c73d509b719346774515c761886a Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp 3 files changed, 63 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/3912/3 diff --git a/src/bts.cpp b/src/bts.cpp index 1284f11..0046238 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -439,10 +439,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; diff --git a/src/bts.h b/src/bts.h index f15ca22..b3a8027 100644 --- a/src/bts.h +++ b/src/bts.h @@ -364,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 4ce2fa6..47a892d 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -103,7 +103,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -121,13 +121,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == 0xffffffffUL) return -1; @@ -140,16 +138,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -187,22 +184,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -217,11 +211,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -230,7 +232,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -300,30 +302,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -334,9 +329,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -353,32 +348,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -425,7 +429,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -493,9 +497,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -752,7 +762,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -822,14 +832,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -857,7 +866,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -868,7 +877,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -1057,7 +1066,7 @@ /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 15:44:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 15:44:11 +0000 Subject: libosmocore[master]: vty: use internal node id for xml ids In-Reply-To: References: Message-ID: Patch Set 2: > Okay makes sense. But is cnode->node unique it seems to be solely > external defined but then it might be more stable? The node ID is what we use to enter VTY nodes, and it is required to be unique within a given main() program. We do this: enum bsc_vty_node { GSMNET_NODE = _LAST_OSMOVTY_NODE + 1, BTS_NODE, TRX_NODE, ... so these numbers should be unique enough. Anyway I would favor using the node name as in the other patch, because it makes writing osmo-gsm-manuals vty references much easier for humans: instead of we can do -- To view, visit https://gerrit.osmocom.org/3978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 20 15:47:10 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 20 Sep 2017 15:47:10 +0000 Subject: libosmocore[master]: vty: use internal node id for xml ids In-Reply-To: References: Message-ID: Patch Set 2: > Anyway I would favor using the node name as in the other patch, > because it makes writing osmo-gsm-manuals vty references much > easier for humans: instead of we can do id='config-smpp'> agreed and hence the +2 -- To view, visit https://gerrit.osmocom.org/3978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 20 15:55:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 15:55:11 +0000 Subject: libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) re "you don't mention duplicate avoidance" -- is that asking to improve the commit log? agreed. https://gerrit.osmocom.org/#/c/3979/3/src/vty/command.c File src/vty/command.c: Line 158: if (!*node->name) > use node->name[0]? But why derive it from the prompt? It seems like an inte node->name is a char[], and if it is unset, it starts with 0 as from struct initialization. Hence an unset node->name means !*node->name. Derive it from the prompt: we have a node struct that defines the node ID, a prompt and a write cb, and its commands. The way we enter this node though is not tied to this struct at all. At some other node there is this "arbitrary" vty command that decides: now let's go to this node. My first idea is to try to derive the node name from the command that enters it, but it is impossible to find out. static struct cmd_node msc_node = { MSC_NODE, "%s(config-msc)# ", 1, }; DEFUN(cfg_msc, cfg_msc_cmd, "msc", "Configure MSC options") { vty->node = MSC_NODE; return CMD_SUCCESS; } install_element(CONFIG_NODE, &cfg_msc_cmd); >From msc_node, it is impossible to find out that cfg_msc_cmd which entered the MSC_NODE is in fact called 'msc'. The next idea is that each cmd_node struct that is created should provide a node name like: static struct cmd_node msc_node = { MSC_NODE, "%s(config-msc)# ", 1, .name = "config-msc", }; but none of your current users of the VTY API do that. We would start off with most nodes being unnamed and it would take some time to find all of them. The nice way would be to define a name, and let the prompt be derived from that. But for hysterical raisins, it is easier to go the other way: all of our nodes have a prompt, and by stripping the special prompt characters we can get a fairly unique name from it without touching any of the dependent code. Line 612: same_name_count = 1; > Why start with 1? For the first node it has not used before? The idea is to get IDs like name name_2 name_3 i.e. the first is just the name, the second gets _2 attached. When I start searching, I know that one 'name' already exists, if I find another one I know that 2 exist. I considered starting with 0, but don't like the result like: name name_1 name_2 nor name_0 name_1 name_2 The _2 suffix is just to make sure we number multiple occurences and should normally not happen. It also is a fallback for empty node names, they will become _1 _2 _3 ... -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 20 16:01:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 16:01:19 +0000 Subject: libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3979/3/src/vty/command.c File src/vty/command.c: Line 158: if (!*node->name) > node->name is a char[], and if it is unset, it starts with 0 as from struct (Note that if the user set a name during struct composition, we don't do the prompt derive dance. So we can always define proper names later.) (One consideration was to make the node name talloc'd, but it would clutter struct cmd_node initialization. Having an array also makes deriving the name from the prompt less complex, allocation wise. Of course the name is limited in size, but 64 characters ought to be enough for anyone.....) -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 20 16:16:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 16:16:28 +0000 Subject: [PATCH] libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3979 to look at the new patch set (#4). vty: derive node name from prompt, use as XML ids The 'show online-help' produces XML output with ids. We reference those from the osmo-gsm-manuals. Instead of numeric IDs coming from internal code, rather use a human-readable node ID -- referencing id='config-msc' is much easier than referencing id='23'. Add a char name[] to struct cmd_node, to hold this name. This may be provided upon struct definition. Since callers of the VTY API so far don't have a name yet, we would need to add names everywhere to get meaningful node IDs. There is a way to get node ID names without touching dependent code: My first idea was to find out which command entered the node, i.e. command 'msc' enters the MSC_NODE. But it is impossible to derive which command entered which node from data structs, it's hidden in the vty command definition. But in fact all (TM) known API callers indeed provide a prompt string that contains a logical and human readable string name. Thus, if the name is unset in the struct, parse the prompt string and strip all "weird" characters to obtain a node name from that. We can still set names later on, but for now will have meaningful node IDs (e.g. 'config-msc' from '%s(config-msc)# ') without touching any dependent code. When VTY nodes get identical node names, which is quite possible, the XML export de-dups these by appending _2, _3,... suffixes. The first occurence is called e.g. 'name', the second 'name_2', then 'name_3', and so forth. If a node has no name (even after parsing the prompt), it will be named merely by the suffix. The first empty node will become id='_1', then '_2', '_3', and so forth. This happens for nodes like VIEW_NODE or AUTH_NODE. If this is merged, we need to adjust the references in osmo-gsm-manuals.git. This can happen in our own time though, because we manually create the vty reference xml and copy it to the osmo-gsm-manuals.git and then update the references from the vty_additions.xml. This anyway has to happen because currently the references tend to be hopelessly out of sync anyway, placing comments at wildly unrelated VTY commands. Change-Id: I8fa555570268b231c5e01727c661da92fad265de --- M include/osmocom/vty/command.h M src/vty/command.c 2 files changed, 49 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/3979/4 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index cb2edaa..58f248f 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -123,6 +123,11 @@ /*! Vector of this node's command list. */ vector cmd_vector; + + /*! Human-readable ID of this node. Should only contain alphanumeric + * plus '-' and '_' characters (is used as XML ID for 'show + * online-help'). If left NUL, this is derived from the prompt.*/ + char name[64]; }; enum { diff --git a/src/vty/command.c b/src/vty/command.c index 9ca7339..dc270c4 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -123,12 +123,40 @@ return str; } +/* For the lack of a better defined way to derive a node name from caller input, + * mangle the provided prompt to make a node name that consists of only alnum, + * '-' and '_'. For example used for XML IDs in 'show online-help'. */ +static const char *node_name_from_prompt(const char *prompt, char *name_buf, size_t name_buf_size) +{ + const char *pos; + int dest = 0; + + if (!prompt || !*prompt) + return ""; + + for (pos = prompt; *pos && dest < (name_buf_size-1); pos++) { + if (pos[0] == '%' && pos[1]) { + /* skip "%s"; loop pos++ does the second one. */ + pos++; + continue; + } + if (!(isalnum(pos[0]) || pos[0] == '-' || pos[0] == '_')) + continue; + name_buf[dest] = pos[0]; + dest++; + } + name_buf[dest] = '\0'; + return name_buf; +} + /*! Install top node of command vector. */ void install_node(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); + if (!*node->name) + node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); } /* Compare two command's string. Used in sort_node (). */ @@ -608,6 +636,7 @@ static int vty_dump_nodes(struct vty *vty) { int i, j; + int same_name_count; vty_out(vty, "%s", VTY_NEWLINE); @@ -617,7 +646,21 @@ if (!cnode) continue; - vty_out(vty, " %s", cnode->node, VTY_NEWLINE); + /* How many times has this same prompt been used before? */ + same_name_count = 1; + for (j = 0; j < i; ++j) { + struct cmd_node *cnode2; + cnode2 = vector_slot(cmdvec, j); + if (!cnode2) + continue; + if (strcmp(cnode->name, cnode2->name) == 0) + same_name_count ++; + } + + vty_out(vty, " %s", VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 16:24:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 16:24:13 +0000 Subject: [PATCH] libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3979 to look at the new patch set (#5). vty: derive node name from prompt, use as XML ids The 'show online-help' produces XML output with ids. We reference those from the osmo-gsm-manuals. Instead of numeric IDs coming from internal code, rather use a human-readable node ID -- referencing id='config-msc' is much easier than referencing id='23'. Add a char name[] to struct cmd_node, to hold this name. This may be provided upon struct definition. Since callers of the VTY API so far don't have a name yet, we would need to add names everywhere to get meaningful node IDs. There is a way to get node ID names without touching dependent code: My first idea was to find out which command entered the node, i.e. command 'msc' enters the MSC_NODE. But it is impossible to derive which command entered which node from data structs, it's hidden in the vty command definition. But in fact all (TM) known API callers indeed provide a prompt string that contains a logical and human readable string name. Thus, if the name is unset in the struct, parse the prompt string and strip all "weird" characters to obtain a node name from that. We can still set names later on, but for now will have meaningful node IDs (e.g. 'config-msc' from '%s(config-msc)# ') without touching any dependent code. When VTY nodes get identical node names, which is quite possible, the XML export de-dups these by appending _2, _3,... suffixes. The first occurence is called e.g. 'name', the second 'name_2', then 'name_3', and so forth. If a node has no name (even after parsing the prompt), it will be named merely by the suffix. The first empty node will become id='_1', then '_2', '_3', and so forth. This happens for nodes like VIEW_NODE or AUTH_NODE. If this is merged, we need to adjust the references in osmo-gsm-manuals.git. This can happen in our own time though, because we manually create the vty reference xml and copy it to the osmo-gsm-manuals.git and then update the references from the vty_additions.xml. This anyway has to happen because currently the references tend to be hopelessly out of sync anyway, placing comments at wildly unrelated VTY commands. Change-Id: I8fa555570268b231c5e01727c661da92fad265de --- M include/osmocom/vty/command.h M src/vty/command.c 2 files changed, 51 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/3979/5 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index cb2edaa..58f248f 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -123,6 +123,11 @@ /*! Vector of this node's command list. */ vector cmd_vector; + + /*! Human-readable ID of this node. Should only contain alphanumeric + * plus '-' and '_' characters (is used as XML ID for 'show + * online-help'). If left NUL, this is derived from the prompt.*/ + char name[64]; }; enum { diff --git a/src/vty/command.c b/src/vty/command.c index 9ca7339..31ad721 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -123,12 +123,40 @@ return str; } +/* Strip all characters from a string (prompt) except for alnum, '-' and '_'. + * For example used to derive a node->name from node->prompt if the user didn't provide a name; + * in turn, this name us used for XML IDs in 'show online-help'. */ +static const char *node_name_from_prompt(const char *prompt, char *name_buf, size_t name_buf_size) +{ + const char *pos; + int dest = 0; + + if (!prompt || !*prompt) + return ""; + + for (pos = prompt; *pos && dest < (name_buf_size-1); pos++) { + if (pos[0] == '%' && pos[1]) { + /* skip "%s"; loop pos++ does the second one. */ + pos++; + continue; + } + if (!(isalnum(pos[0]) || pos[0] == '-' || pos[0] == '_')) + continue; + name_buf[dest] = pos[0]; + dest++; + } + name_buf[dest] = '\0'; + return name_buf; +} + /*! Install top node of command vector. */ void install_node(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); + if (!*node->name) + node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); } /* Compare two command's string. Used in sort_node (). */ @@ -608,6 +636,7 @@ static int vty_dump_nodes(struct vty *vty) { int i, j; + int same_name_count; vty_out(vty, "%s", VTY_NEWLINE); @@ -617,7 +646,23 @@ if (!cnode) continue; - vty_out(vty, " %s", cnode->node, VTY_NEWLINE); + /* De-dup node IDs: how many times has this same name been used before? Count the first + * occurence as _1 and omit that first suffix, so that the first occurence is called + * 'name', the second becomes 'name_2', then 'name_3', ... */ + same_name_count = 1; + for (j = 0; j < i; ++j) { + struct cmd_node *cnode2; + cnode2 = vector_slot(cmdvec, j); + if (!cnode2) + continue; + if (strcmp(cnode->name, cnode2->name) == 0) + same_name_count ++; + } + + vty_out(vty, " %s", VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:01:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3905 to look at the new patch set (#7). Simplify TS alloc: move slot assignment Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 74 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/7 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index eadeef4..36fc7a0 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -754,6 +754,75 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + ts_format(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -923,46 +992,16 @@ /* Step 4: Update MS and TBF and really allocate the resources */ - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - ts_format(slot_info, dl_slots, ul_slots); - LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:01:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3912 to look at the new patch set (#4). Simplify TS alloc: adjust function signatures * document used parameters and return values * use consistent formatting * constify function parameters where appropriate (adjusting parameter types if necessary) Change-Id: I211b10b4da59c73d509b719346774515c761886a Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp 3 files changed, 63 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/3912/4 diff --git a/src/bts.cpp b/src/bts.cpp index 2ede2ca..815cb1c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -439,10 +439,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; diff --git a/src/bts.h b/src/bts.h index 0ce5123..8a9f51b 100644 --- a/src/bts.h +++ b/src/bts.h @@ -365,7 +365,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 9ceceb2..76a84c7 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -103,7 +103,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -121,13 +121,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == NO_FREE_TFI) return -1; @@ -140,16 +138,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -187,22 +184,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -217,11 +211,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -230,7 +232,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -300,30 +302,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -334,9 +329,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -353,32 +348,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -425,7 +429,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -493,9 +497,15 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_bts *bts, - struct gprs_rlcmac_trx *trx, - const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] ms Pointer to MS object + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ +static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -752,7 +762,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -822,14 +832,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -857,7 +866,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -868,7 +877,7 @@ trx = &bts->trx[trx_no]; if (!dl_slots || !ul_slots) { - rc = find_multi_slots(bts, trx, ms, &ul_slots, &dl_slots); + rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; @@ -1057,7 +1066,7 @@ /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:01:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split off RX mask computation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3913 to look at the new patch set (#5). Simplify TS alloc: split off RX mask computation Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 58 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/5 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index f4c4ef0..693a72a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -604,6 +604,56 @@ return (win | win >> 8) & 0xFF; } +enum { MASK_TT, MASK_TR }; + +/*! Fill in RX mask table for a given MS Class + * + * \param[in] ms_cl MS Class pointer + * \param[in] num_tx Number of TX slots to consider + * \param[out] rx_mask RX mask table + */ +static inline void fill_rx_mask(const struct gprs_ms_multislot_class *ms_cl, uint8_t num_tx, uint8_t *rx_mask) +{ + static const char *digit[10] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + uint8_t Tta = ms_cl->ta, Ttb = ms_cl->tb, Tra = ms_cl->ra, Trb = ms_cl->rb, /* Minimum Number of Slots */ + Tx = ms_cl->tx, Sum = ms_cl->sum, /* Maximum Number of Slots: Tx, Sum = Rx + Tx */ + Type = ms_cl->type; /* Type of Mobile */ + + /* MS_A maps to 0 if frequency hopping is disabled */ + /* TODO: Set it to 1 if FH is implemented and enabled */ + if (Ttb == MS_A) + Ttb = 0; + if (Trb == MS_A) + Trb = 0; + + /* MS_A and MS_B are 0 iff FH is disabled and there is no Tx/Rx change. + * This is never the case with the current implementation, so 1 will always be used. */ + if (Ttb == MS_B) + Ttb = 1; + if (Trb == MS_C) + Trb = 1; + + if (num_tx == 1) /* it's enough to log this once per TX slot set iteration */ + LOGP(DRLCMAC, LOGL_DEBUG, " Rx=%u, Tx=%u, Sum Rx + Tx=%s [Tta=%s Ttb=%u] [Tra=%u Trb=%u] Type=%u\n", + ms_cl->rx, Tx, + (Sum == MS_NA) ? "N/A" : digit[Sum], + (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); + + if (ms_cl->type == 1) { + rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; + rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); + rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + } else { + /* Class type 2 MS have independant RX and TX */ + rx_mask[MASK_TT] = 0xff; + rx_mask[MASK_TR] = 0xff; + } + + rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); + rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -615,17 +665,12 @@ static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; - uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ - uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ - uint8_t Type; /* Type of Mobile */ uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; int16_t rx_window, tx_window; - static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; - int max_capacity; - uint8_t max_ul_slots; - uint8_t max_dl_slots; - enum {MASK_TT, MASK_TR}; + int max_capacity = -1; + uint8_t max_ul_slots = 0; + uint8_t max_dl_slots = 0; if (ms->ms_class() >= 32) { LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", @@ -646,33 +691,6 @@ return -EINVAL; } - Tx = ms_class->tx; - Sum = ms_class->sum; - Tta = ms_class->ta; - Ttb = ms_class->tb; - Tra = ms_class->ra; - Trb = ms_class->rb; - Type = ms_class->type; - - /* MS_A maps to 0 if frequency hopping is disabled */ - /* TODO: Set it to 1 if FH is implemented and enabled */ - if (Ttb == MS_A) - Ttb = 0; - if (Trb == MS_A) - Trb = 0; - - /* MS_A and MS_B are 0 iff FH is disabled and there is no Tx/Rx change. - * This is never the case with the current implementation, so 1 will - * always be used. */ - if (Ttb == MS_B) - Ttb = 1; - if (Trb == MS_C) - Trb = 1; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, - (Sum == MS_NA) ? "N/A" : digit[Sum], - (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); - max_slots = OSMO_MAX(ms_class->rx, ms_class->tx); if (*dl_slots == 0) @@ -691,29 +709,12 @@ /* Check for each UL (TX) slot */ - max_capacity = -1; - max_ul_slots = 0; - max_dl_slots = 0; - /* Iterate through possible numbers of TX slots */ for (num_tx = 1; num_tx <= ms_class->tx; num_tx += 1) { uint16_t tx_valid_win = (1 << num_tx) - 1; + uint8_t rx_mask[MASK_TR + 1]; - uint8_t rx_mask[MASK_TR+1]; - if (ms_class->type == 1) { - rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; - rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); - rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); - } else { - /* Class type 2 MS have independant RX and TX */ - rx_mask[MASK_TT] = 0xff; - rx_mask[MASK_TR] = 0xff; - } - - rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); - rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); + fill_rx_mask(ms_class, num_tx, rx_mask); /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9016eb1..22b7746 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3328,12 +3328,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -3367,12 +3367,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -6541,12 +6541,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 11 -- Rx=4 Tx=3 Sum Rx+Tx=5 Tta=3 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=3, Sum Rx + Tx=5 [Tta=3 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:01:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: use defines for constant In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3920 to look at the new patch set (#4). Simplify TS alloc: use defines for constant * define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 4 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/4 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..6debb68 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -458,7 +458,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = NO_FREE_TFI; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index d65cd2f..1d13a64 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define NO_FREE_TFI 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..3b596f4 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -128,7 +128,7 @@ int8_t tfi; tfi_map = pdch->assigned_tfi(dir); - if (tfi_map == 0xffffffffUL) + if (tfi_map == NO_FREE_TFI) return -1; /* look for USF, don't use USF=7 */ @@ -209,7 +209,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -340,10 +340,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == NO_FREE_TFI) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..9bff38a 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -613,17 +613,17 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != NO_FREE_TFI) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != NO_FREE_TFI) continue; busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", + printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", tfi, ms_class, get_dir_char(0x01, ul_slots, dl_slots, busy_slots), get_dir_char(0x02, ul_slots, dl_slots, busy_slots), -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:01:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#5). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 20 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/5 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 76a84c7..8451bb2 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -81,18 +81,19 @@ /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } +} - return buf; +static void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); } static bool test_and_set_bit(uint32_t *bits, size_t elem) @@ -587,11 +588,8 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_format(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ @@ -913,12 +911,10 @@ } if (tbf->direction == GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, dl_slots, 'D'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); + "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); /* assign downlink */ if (dl_slots == 0) { @@ -951,12 +947,10 @@ ul_slots = 1 << ts; usf[ts] = free_usf; + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, ul_slots, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); + "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n",slot_info, single ? ", single" : ""); slotcount++; first_ts = ts; @@ -1001,12 +995,8 @@ ms_->set_reserved_slots(trx, reserved_ul_slots, reserved_dl_slots); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); + ts_format(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); } tbf_->trx = trx; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 602e35b..9016eb1 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6549,7 +6549,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:01:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: separate capacity computation In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3934 to look at the new patch set (#3). Simplify TS alloc: separate capacity computation Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 32 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/34/3934/3 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 78cf539..8311e22 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -499,6 +499,33 @@ return 0; } +/*! Compute capacity of a given TRX + * + * \param[in] trx Pointer to TRX object + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \returns non-negative capacity + */ +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +{ + const struct gprs_rlcmac_pdch *pdch; + unsigned ts, capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF), 1); + + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF), 1); + } + } + + return capacity; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -654,7 +681,6 @@ unsigned rx_slot_count; uint16_t rx_bad; uint8_t rx_good; - unsigned ts; int capacity; /* Filter out bad slots */ @@ -714,25 +740,7 @@ } /* Compute capacity */ - capacity = 0; - - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - } - } + capacity = compute_capacity(trx, rx_window, tx_window); if (capacity <= max_capacity) continue; @@ -740,7 +748,10 @@ max_capacity = capacity; max_ul_slots = tx_window; max_dl_slots = rx_window; - }}}} + } + } + } + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:01:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3935 to look at the new patch set (#3). Simplify TS alloc: move slot check into functions Move timeslot applicability check outside of nested for loop into separate functions and document them. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 96 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/3 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 8311e22..f4c4ef0 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -139,11 +139,11 @@ return -1; } -static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, - const char *mask_reason = NULL) +static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; - int valid_ts_set = 0; + uint8_t valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { @@ -422,7 +422,7 @@ int trx_no; int tfi = -1; int usf = -1; - int mask = 0xff; + uint8_t mask = 0xff; const char *mask_reason = NULL; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; @@ -506,7 +506,7 @@ * \param[in] tx_window Transmit window * \returns non-negative capacity */ -static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int16_t rx_window, int16_t tx_window) { const struct gprs_rlcmac_pdch *pdch; unsigned ts, capacity = 0; @@ -526,6 +526,84 @@ return capacity; } +/*! Decide if a given slot should be skipped by multislot allocator + * + * \param[in] ms_class Pointer to MS Class object + * \param[in] check_tr Flag indicating whether we should check for Tra or Tta parameters for a given MS class + * \param[in] rx_window Receive window + * \param[in] rx_slot_count Number of TS in RX + * \param[in] tx_window Transmit window + * \param[in] tx_slot_count Number of TS in TX + * \param[in,out] checked_rx array with already checked RX timeslots + * \returns true if the slot should be skipped, false otherwise + */ +static bool skip_slot(const struct gprs_ms_multislot_class *ms_class, bool check_tr, int16_t rx_window, + uint8_t rx_slot_count, int16_t tx_window, uint8_t tx_slot_count, uint32_t *checked_rx) +{ + uint8_t common_slot_count, req_common_slots; + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on check_tr. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + uint16_t slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (!check_tr) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (check_tr) + return true; /* Skip Tra */ + } else + return true; /* No supported row in TS 45.002, table 6.4.2.2.1. */ + } + + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + return true; + + return false; +} + +/*! Filter out bad slots + * + * \param[in] mask TS selection mask + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] rx_valid_win Mask for valid RX window value + * \returns negative error code or RX window on success + */ +static int16_t filter_bad_slots(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win) +{ + uint8_t rx_good; + uint16_t rx_bad = (uint16_t)(0xff & ~mask) << ul_slots; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = dl_slots & ~rx_bad; + if (!rx_good) + return -1; + + return rx_good & rx_valid_win; +} + +static inline uint16_t wrap_window(uint16_t win) +{ + return (win | win >> 8) & 0xFF; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -540,18 +618,14 @@ uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ uint8_t Type; /* Type of Mobile */ - int rx_window, tx_window, pdch_slots; + uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; + int16_t rx_window, tx_window; static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; int max_capacity; uint8_t max_ul_slots; uint8_t max_dl_slots; - unsigned max_slots; - - unsigned ul_ts, dl_ts; - unsigned num_tx; enum {MASK_TT, MASK_TR}; - unsigned mask_sel; if (ms->ms_class() >= 32) { LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", @@ -643,13 +717,12 @@ /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; + uint8_t tx_slot_count; uint16_t rx_valid_win; uint32_t checked_rx[256/32] = {0}; /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + tx_valid_win = wrap_window(tx_valid_win); tx_window = tx_valid_win; @@ -666,78 +739,28 @@ tx_slot_count = pcu_bitcount(tx_window); - max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + rx_valid_win = (1 << OSMO_MIN(ms_class->rx, ms_class->sum - num_tx)) - 1; /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { /* Wrap valid window */ - rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; + rx_valid_win = wrap_window(rx_valid_win); /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; + uint8_t rx_slot_count; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; + rx_window = filter_bad_slots(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); + if (rx_window < 0) + continue; - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; rx_slot_count = pcu_bitcount(rx_window); - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) + if (skip_slot(ms_class, mask_sel != MASK_TT, + rx_window, rx_slot_count, + tx_window, tx_slot_count, checked_rx)) continue; - - if (!rx_good) { - continue; - } - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) { - continue; - } /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:02:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:02:03 +0000 Subject: [ABANDON] osmo-pcu[master]: Simplify TS alloc: cosmetic, use proper formatting In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Simplify TS alloc: cosmetic, use proper formatting ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I50b59b12e8d938bd96f9b29d00a649cd3e77bc5e Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 17:20:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 20 Sep 2017 17:20:20 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Patch Set 5: > Where is the recursion? For example: set_flag_chars(set_flag_chars(set_flag_chars(slot_info, > snprintf in call sites is not really an improvement Why? What's bad about it? > Method is called print while it is a format Just like sprintf(). Anyway, renamed it. Too bad we can't rename standard functions. > newer libosmocore without bumping minimum version in configure.ac It's not part of any release yet so I don't know to which version to bump to. -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:12:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:12:27 +0000 Subject: [PATCH] osmo-mgw[master]: set API versions back to 0 Message-ID: Review at https://gerrit.osmocom.org/3999 set API versions back to 0 Roll back the LIBVERSIONs to 0:0:0 -- the bumps so far have been confused and wrong. Let's start over from scratch with API-current of 0 while we still can. Rename the mgcp_client debian .install files back to 0 to match the API version. Change-Id: I3d81853f811f412b186621c3657bab6af397a980 --- M debian/control R debian/libosmo-mgcp-client0.install M src/libosmo-mgcp-client/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/3999/1 diff --git a/debian/control b/debian/control index 2dfeb09..aca5a62 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,7 @@ Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library -Package: libosmo-mgcp-client1 +Package: libosmo-mgcp-client0 Section: libs Architecture: any Multi-Arch: same @@ -46,5 +46,5 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities diff --git a/debian/libosmo-mgcp-client1.install b/debian/libosmo-mgcp-client0.install similarity index 100% rename from debian/libosmo-mgcp-client1.install rename to debian/libosmo-mgcp-client0.install diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 0416081..e644862 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -22,7 +22,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool # documentation before making any modification -MGCP_CLIENT_LIBVERSION=1:0:1 +MGCP_CLIENT_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/3999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d81853f811f412b186621c3657bab6af397a980 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:12:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:12:27 +0000 Subject: [PATCH] osmo-mgw[master]: tweak API version comments Message-ID: Review at https://gerrit.osmocom.org/4000 tweak API version comments Clarify LIBVERSION comments in TODO-RELEASE and reference Makefile.am comments to look there. Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f --- M TODO-RELEASE M src/libosmo-legacy-mgcp/Makefile.am M src/libosmo-mgcp-client/Makefile.am 3 files changed, 30 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/00/4000/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..435f67f 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,9 +1,27 @@ -# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install -# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info -# In short: -# LIBVERSION=c:r:a -# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. -# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. -# If any interfaces have been added since the last public release: c:r:a + 1. -# If any interfaces have been removed or changed since the last public release: c:r:0. +# When cleaning up this file upon a release: +# +# - Note that the release version number is entirely unrelated to the API +# versions. We may choose to coincide the release major to the API current, +# but that is merely circumstantial. +# +# - Bump API version in src/lib*/Makefile.am files according to chapter +# "Library interface versions" of the libtool documentation. +# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# +# - Iff the 'current' API version has changed, rename debian/lib*.install +# +# API version bumping for the impatient: +# LIBVERSION=c:r:a (current:revision_of_current:backwards_compat_age) +# 5:2:4 means that +# - this implements version 5 of the API; +# - this is the 2nd (compatible) revision of API version 5; +# - this is backwards compatible to all APIs since 4 versions ago, +# i.e. callers that need API versions from 1 to 5 can use this. +# +# Bumping API versions recipe: +# If the library source code has changed at all since the last update, r++; +# If any interfaces have been added, removed, or changed since the last update, c++, r=0; +# If any interfaces have been added since the last public release, a++; +# If any interfaces have been removed or changed since the last public release, a=0. +# #library what description / commit summary line diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 32902b9..bcf6242 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -21,9 +21,8 @@ $(LIBBCG729_LIBS) \ $(NULL) -# This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool -# documentation before making any modification +# This is not at all related to the release version, but a range of supported +# API versions. Read TODO_RELEASE in the source tree's root! LEGACY_MGCP_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index e644862..b17477a 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -19,9 +19,8 @@ $(COVERAGE_LDFLAGS) \ $(NULL) -# This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool -# documentation before making any modification +# This is not at all related to the release version, but a range of supported +# API versions. Read TODO_RELEASE in the source tree's root! MGCP_CLIENT_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ -- To view, visit https://gerrit.osmocom.org/4000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:12:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:12:27 +0000 Subject: [PATCH] osmo-mgw[master]: debian: tweak .install: less wildcards Message-ID: Review at https://gerrit.osmocom.org/4001 debian: tweak .install: less wildcards Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 --- M debian/libosmo-legacy-mgcp-dev.install M debian/libosmo-legacy-mgcp0.install M debian/libosmo-mgcp-client0.install 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/01/4001/1 diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install index 4184fef..a57cb50 100644 --- a/debian/libosmo-legacy-mgcp-dev.install +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -1,4 +1,4 @@ usr/include/osmocom/legacy_mgcp -usr/lib/*/*legacy-mgcp*.so -usr/lib/*/*legacy-mgcp*.a -usr/lib/*/pkgconfig/*legacy-mgcp*.pc +usr/lib/*/libosmo-legacy-mgcp.so +usr/lib/*/libosmo-legacy-mgcp.a +usr/lib/*/pkgconfig/libosmo-legacy-mgcp.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install index a47cc34..90ca89d 100644 --- a/debian/libosmo-legacy-mgcp0.install +++ b/debian/libosmo-legacy-mgcp0.install @@ -1 +1 @@ -usr/lib/*/*legacy-mgcp*.so.* +usr/lib/*/libosmo-legacy-mgcp.so.* diff --git a/debian/libosmo-mgcp-client0.install b/debian/libosmo-mgcp-client0.install index 4fc8bc6..7e86498 100644 --- a/debian/libosmo-mgcp-client0.install +++ b/debian/libosmo-mgcp-client0.install @@ -1 +1 @@ -usr/lib/*/*mgcp-client*.so.* +usr/lib/*/libosmo-mgcp-client.so.* -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:12:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:12:28 +0000 Subject: [PATCH] osmo-mgw[master]: create libosmo-mgcp and osmo-mgw by copying legacy code Message-ID: Review at https://gerrit.osmocom.org/4002 create libosmo-mgcp and osmo-mgw by copying legacy code This a cosmetic commit, copying libosmo-legacy-mgcp to libosmo-mgcp and osmo-bsc_mgcp to osmo-mgw 1:1 at first, to provide a basis for next patches that highlight the changes from legacy to new code. Until osmo-msc and osmo-bsc are adjusted to operate with the new code, we will keep the legacy code alongside the new code. The legacy code might be dropped later. Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 --- A doc/examples/osmo-mgw/osmo-mgw.cfg A include/osmocom/mgcp/Makefile.am A include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_transcode.h A include/osmocom/mgcp/osmux.h A include/osmocom/mgcp/vty.h A src/libosmo-mgcp/Makefile.am A src/libosmo-mgcp/g711common.h A src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_network.c A src/libosmo-mgcp/mgcp_osmux.c A src/libosmo-mgcp/mgcp_protocol.c A src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_transcode.c A src/libosmo-mgcp/mgcp_vty.c A src/osmo-mgw/Makefile.am A src/osmo-mgw/mgcp_main.c A tests/mgcp/Makefile.am A tests/mgcp/mgcp_test.c A tests/mgcp/mgcp_test.ok A tests/mgcp/mgcp_transcoding_test.c A tests/mgcp/mgcp_transcoding_test.ok 23 files changed, 10,326 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/02/4002/1 -- To view, visit https://gerrit.osmocom.org/4002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:12:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:12:28 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp Message-ID: Review at https://gerrit.osmocom.org/4003 Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 39 files changed, 3,184 insertions(+), 3,865 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/1 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:12:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:12:28 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: move dep from legacy to libosmo-mgcp Message-ID: Review at https://gerrit.osmocom.org/4004 libosmo-mgcp-client: move dep from legacy to libosmo-mgcp A subsequent patch will drop the interdependency, but first completely forget about libosmo-legacy-mgcp and depend on libosmo-mgcp instead. Change-Id: Ie1f05948f36bf5148b58256312214de262bdf762 --- M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_vty.c M tests/mgcp_client/mgcp_client_test.c 4 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/04/4004/1 diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b17477a..ee60344 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -30,7 +30,7 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ - ../libosmo-legacy-mgcp/mgcp_common.c \ + ../libosmo-mgcp/mgcp_common.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b72fc50..b927fb9 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 1e8bba6..bcb3645 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 6045297..3d826af 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/4004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1f05948f36bf5148b58256312214de262bdf762 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:12:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:12:28 +0000 Subject: [PATCH] osmo-mgw[master]: drop all cross-builts between libosmo-mgcp-client and libosm... Message-ID: Review at https://gerrit.osmocom.org/4005 drop all cross-builts between libosmo-mgcp-client and libosmo-mgcp Remove the shared mgcp_common.c file and hence erase all conflicts in case both libosmo-mgcp-client and libosmo-mgcp were linked. Move the few remaining common definitions to new header . The content of this header is now the only bit shared between mgcp and mgcp-client. However, keep separate separate copies of the file for each of the library to not require debian dependencies between the two libraries. The file is copied from mgcp to mgcp_client during 'make', as a BUILT_SOURCE. Move enum mgcp_connection_mode to mgcp_common.h. Move for_each_non_empty_line() macro to mgcp_common.h. Replace for_each_line() use in mgcp_client with for_each_non_empty_line() (according to comment; for_each_non_empty_line() replaces for_each_line() and uses strtok_r() instead of an own reinvention). Make mgcp_msg_terminate_nul() a static inline and place in mgcp_common.h. The complexity is just above your average static inline, but it's a way to not dup code and use it in both mgcp and mgcp_client without linking problems. Move mgcp_connection_mode_strs to mgcp_client.c, rename to mgcp_client_ prefix. (It would make sense to have something similar in mgcp, but since it is only used in mgcp_client, we can avoid the dup altogether.) Change-Id: Ifd3a2c7cdabb31bc50cb7f671758ffb7cdd10221 --- M include/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/Makefile.am M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_internal.h M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_vty.c M src/libosmo-mgcp/Makefile.am D src/libosmo-mgcp/mgcp_common.c M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp_client/mgcp_client_test.c 19 files changed, 103 insertions(+), 80 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/05/4005/1 diff --git a/include/Makefile.am b/include/Makefile.am index 2e354ae..b52e5ea 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,7 +7,9 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ + osmocom/mgcp/mgcp_common.h \ osmocom/mgcp/mgcp_internal.h \ osmocom/mgcp/osmux.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 3424684..3e387eb 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -167,21 +167,6 @@ MGCP_BSC_NAT, }; -enum mgcp_connection_mode { - MGCP_CONN_NONE = 0, - MGCP_CONN_RECV_ONLY = 1, - MGCP_CONN_SEND_ONLY = 2, - MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, - MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, -}; - -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} - struct mgcp_config { int source_port; char *local_ip; diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h new file mode 100644 index 0000000..bdff555 --- /dev/null +++ b/include/osmocom/mgcp/mgcp_common.h @@ -0,0 +1,64 @@ +/* MGCP common implementations. + * These are used in libosmo-mgcp as well as libosmo-mgcp-client. + * To avoid interdependency, these are implemented in .h file only. */ + +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +#include +#include + +#define for_each_non_empty_line(line, save) \ + for (line = strtok_r(NULL, "\r\n", &save); line; \ + line = strtok_r(NULL, "\r\n", &save)) + +enum mgcp_connection_mode { + MGCP_CONN_NONE = 0, + MGCP_CONN_RECV_ONLY = 1, + MGCP_CONN_SEND_ONLY = 2, + MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, + MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, +}; + +/* Ensure that the msg->l2h is NUL terminated. */ +static inline int mgcp_msg_terminate_nul(struct msgb *msg) +{ + unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ + if (tail[-1] == '\0') + /* nothing to do */; + else if (msgb_tailroom(msg) > 0) + tail[0] = '\0'; + else if (tail[-1] == '\r' || tail[-1] == '\n') + tail[-1] = '\0'; + else { + LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " + "Length: %d, Buffer size: %d\n", + msgb_l2len(msg), msg->data_len); + return -ENOTSUP; + } + return 0; +} + diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index fe54e22..b8fc530 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -316,5 +316,3 @@ return endp->cfg->net_ports.bind_addr; return endp->cfg->source_addr; } - -int mgcp_msg_terminate_nul(struct msgb *msg); diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 24401f1..0eaafcc 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -1,3 +1,11 @@ +BUILT_SOURCES = \ + mgcp_common.h \ + $(NULL) + noinst_HEADERS = \ mgcp_client_internal.h \ $(NULL) + +mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h + echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of \n\n */" > mgcp_common.h + cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index df73811..b560442 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -2,6 +2,8 @@ #include +#include + #define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" #define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 #define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" @@ -71,3 +73,9 @@ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); + +extern const struct value_string mgcp_client_connection_mode_strs[]; +static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) +{ + return get_value_string(mgcp_client_connection_mode_strs, mode); +} diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 1b149e2..690a4af 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -1,5 +1,7 @@ #pragma once +#include + #define MSGB_CB_MGCP_TRANS_ID 0 struct mgcp_client { diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index ee60344..3dd21db 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_builddir) \ $(NULL) @@ -30,7 +31,6 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ - ../libosmo-mgcp/mgcp_common.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b927fb9..1cd37be 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,8 +24,6 @@ #include #include -#include -#include #include #include @@ -208,7 +206,7 @@ *data = '\0'; data ++; - for_each_line(line, data) { + for_each_non_empty_line(line, data) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -584,7 +582,7 @@ trans_id, rtp_endpoint, call_id, - mgcp_cmode_name(mode)); + mgcp_client_cmode_name(mode)); } struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, @@ -602,7 +600,7 @@ , trans_id, rtp_endpoint, - mgcp_cmode_name(mode), + mgcp_client_cmode_name(mode), rtp_conn_addr, rtp_port); } @@ -620,3 +618,12 @@ { return &mgcp->actual; } + +const struct value_string mgcp_client_connection_mode_strs[] = { + { MGCP_CONN_NONE, "none" }, + { MGCP_CONN_RECV_SEND, "sendrecv" }, + { MGCP_CONN_SEND_ONLY, "sendonly" }, + { MGCP_CONN_RECV_ONLY, "recvonly" }, + { MGCP_CONN_LOOPBACK, "loopback" }, + { 0, NULL } +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index bcb3645..c52803f 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -27,7 +27,6 @@ #include #include -#include #include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am index a9c7602..b003f57 100644 --- a/src/libosmo-mgcp/Makefile.am +++ b/src/libosmo-mgcp/Makefile.am @@ -32,7 +32,6 @@ $(NULL) libosmo_mgcp_la_SOURCES = \ - mgcp_common.c \ mgcp_protocol.c \ mgcp_network.c \ mgcp_vty.c \ diff --git a/src/libosmo-mgcp/mgcp_common.c b/src/libosmo-mgcp/mgcp_common.c deleted file mode 100644 index c246742..0000000 --- a/src/libosmo-mgcp/mgcp_common.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Media Gateway Control Protocol Media Gateway: RFC 3435 */ -/* Implementations useful both for the MGCP GW as well as MGCP GW clients */ - -/* - * (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include - -const struct value_string mgcp_connection_mode_strs[] = { - { MGCP_CONN_NONE, "none" }, - { MGCP_CONN_RECV_SEND, "sendrecv" }, - { MGCP_CONN_SEND_ONLY, "sendonly" }, - { MGCP_CONN_RECV_ONLY, "recvonly" }, - { MGCP_CONN_LOOPBACK, "loopback" }, - { 0, NULL } -}; - -/* Ensure that the msg->l2h is NUL terminated. */ -int mgcp_msg_terminate_nul(struct msgb *msg) -{ - unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ - if (tail[-1] == '\0') - /* nothing to do */; - else if (msgb_tailroom(msg) > 0) - tail[0] = '\0'; - else if (tail[-1] == '\r' || tail[-1] == '\n') - tail[-1] = '\0'; - else { - LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " - "Length: %d, Buffer size: %d\n", - msgb_l2len(msg), msg->data_len); - return -ENOTSUP; - } - return 0; -} diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index 38f6961..0c21365 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -22,6 +22,7 @@ */ #include +#include /* Reset codec state and free memory */ static void mgcp_rtp_codec_reset(struct mgcp_rtp_codec *codec) diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index d809447..c9dc887 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -24,6 +24,7 @@ #include #include +#include #include /*! \brief Display an mgcp message on the log output. diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index caed189..ac5fd1a 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index d019602..36ec683 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 4f73cee..5c50419 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 240116a..6a43b7b 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 3d826af..f2f0e0f 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -22,7 +22,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd3a2c7cdabb31bc50cb7f671758ffb7cdd10221 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:13:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:13:18 +0000 Subject: [PATCH] osmo-mgw[master]: sdp: refactoring sdp parser/generator Message-ID: Review at https://gerrit.osmocom.org/4006 sdp: refactoring sdp parser/generator fix sourcecode formatting move SDP generator to mgcp_sdp.c add doxygen comments Change-Id: I9f88c93872ff913bc211f560b26901267f577324 --- M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_sdp.h M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c 5 files changed, 235 insertions(+), 159 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/4006/1 diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am index 6bc01c4..2c084b6 100644 --- a/include/osmocom/mgcp/Makefile.am +++ b/include/osmocom/mgcp/Makefile.am @@ -4,4 +4,5 @@ mgcp_msg.h \ mgcp_conn.h \ mgcp_stat.h \ + mgcp_sdp.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index b8fc530..782990f 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -303,9 +303,6 @@ #define DEFAULT_RTP_AUDIO_DEFAULT_CHANNELS 1 #define PTYPE_UNDEFINED (-1) -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p); -int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, - int payload_type, const char *audio_name); /*! \brief get the ip-address where the mgw application is bound on * \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters diff --git a/include/osmocom/mgcp/mgcp_sdp.h b/include/osmocom/mgcp/mgcp_sdp.h new file mode 100644 index 0000000..0eb376d --- /dev/null +++ b/include/osmocom/mgcp/mgcp_sdp.h @@ -0,0 +1,33 @@ +/* + * SDP generation and parsing + * + * (C) 2009-2015 by Holger Hans Peter Freyther + * (C) 2009-2014 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p); + +int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, + int payload_type, const char *audio_name); + +int mgcp_write_response_sdp(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, char *sdp_record, + size_t size, const char *addr); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 36ec683..64a09ef 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -38,6 +38,7 @@ #include #include #include +#include struct mgcp_request { char *name; @@ -190,80 +191,6 @@ return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL); } -static int write_response_sdp(struct mgcp_endpoint *endp, - struct mgcp_conn_rtp *conn, - char *sdp_record, size_t size, const char *addr) -{ - const char *fmtp_extra; - const char *audio_name; - int payload_type; - int len; - int nchars; - - if (!conn) - return -1; - - endp->cfg->get_net_downlink_format_cb(endp, &payload_type, - &audio_name, &fmtp_extra, conn); - - len = snprintf(sdp_record, size, - "v=0\r\n" - "o=- %u 23 IN IP4 %s\r\n" - "s=-\r\n" - "c=IN IP4 %s\r\n" - "t=0 0\r\n", conn->conn->id, addr, addr); - - if (len < 0 || len >= size) - goto buffer_too_small; - - if (payload_type >= 0) { - nchars = snprintf(sdp_record + len, size - len, - "m=audio %d RTP/AVP %d\r\n", - conn->end.local_port, payload_type); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - - if (audio_name && endp->tcfg->audio_send_name) { - nchars = snprintf(sdp_record + len, size - len, - "a=rtpmap:%d %s\r\n", - payload_type, audio_name); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - if (fmtp_extra) { - nchars = snprintf(sdp_record + len, size - len, - "%s\r\n", fmtp_extra); - - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - } - if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { - nchars = snprintf(sdp_record + len, size - len, - "a=ptime:%u\r\n", - conn->end.packet_duration_ms); - if (nchars < 0 || nchars >= size - len) - goto buffer_too_small; - - len += nchars; - } - - return len; - -buffer_too_small: - LOGP(DLMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", - size, len); - return -1; -} - /* Format MGCP response string (with SDP attached) */ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, @@ -291,8 +218,8 @@ if (len < 0) return NULL; - nchars = write_response_sdp(endp, conn, sdp_record + len, - sizeof(sdp_record) - len - 1, addr); + nchars = mgcp_write_response_sdp(endp, conn, sdp_record + len, + sizeof(sdp_record) - len - 1, addr); if (nchars < 0) return NULL; @@ -688,7 +615,7 @@ /* set up RTP media parameters */ if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); else if (endp->local_options.codec) mgcp_set_audio_info(p->cfg, &conn->end.codec, PTYPE_UNDEFINED, endp->local_options.codec); @@ -835,7 +762,7 @@ conn->conn->mode = conn->conn->mode_orig; if (have_sdp) - mgcp_parse_sdp_data(endp, &conn->end, p); + mgcp_parse_sdp_data(endp, conn, p); set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 7568351..62ee4e5 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -1,5 +1,5 @@ /* - * Some SDP file parsing... + * SDP generation and parsing * * (C) 2009-2015 by Holger Hans Peter Freyther * (C) 2009-2014 by On-Waves @@ -38,6 +38,12 @@ int channels; }; +/*! \brief set codec configuration depending on payload type and codec name + * \endp[in] ctx talloc context + * \endp[out] codec configuration (caller provided memory) + * \endp[in] payload_type codec type id (e.g. 3 for GSM, -1 when undefined) + * \endp[in] audio_name audio codec name (e.g. "GSM/8000/1") + * \returns 0 on success, -1 on failure */ int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, int payload_type, const char *audio_name) { @@ -55,15 +61,23 @@ if (!audio_name) { switch (payload_type) { - case 0: audio_name = "PCMU/8000/1"; break; - case 3: audio_name = "GSM/8000/1"; break; - case 8: audio_name = "PCMA/8000/1"; break; - case 18: audio_name = "G729/8000/1"; break; + case 0: + audio_name = "PCMU/8000/1"; + break; + case 3: + audio_name = "GSM/8000/1"; + break; + case 8: + audio_name = "PCMA/8000/1"; + break; + case 18: + audio_name = "G729/8000/1"; + break; default: - /* Payload type is unknown, don't change rate and - * channels. */ - /* TODO: return value? */ - return 0; + /* Payload type is unknown, don't change rate and + * channels. */ + /* TODO: return value? */ + return 0; } } @@ -107,7 +121,7 @@ return 0; } -void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) +static void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) { int i; @@ -137,7 +151,8 @@ } } -void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, int payload, char *audio_name) +static void codecs_update(void *ctx, struct sdp_rtp_map *codecs, int used, + int payload, char *audio_name) { int i; @@ -148,8 +163,9 @@ if (codecs[i].payload_type != payload) continue; if (sscanf(audio_name, "%63[^/]/%d/%d", - audio_codec, &rate, &channels) < 1) { - LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n", audio_name); + audio_codec, &rate, &channels) < 1) { + LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n", + audio_name); continue; } @@ -160,29 +176,35 @@ return; } - LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, audio_name); + LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, + audio_name); } -int is_codec_compatible(struct mgcp_endpoint *endp, struct sdp_rtp_map *codec) +/* Check if the codec matches what is set up in the trunk config */ +static int is_codec_compatible(struct mgcp_endpoint *endp, + struct sdp_rtp_map *codec) { - char *bts_codec; + char *codec_str; char audio_codec[64]; if (!codec->codec_name) return 0; - /* - * GSM, GSM/8000 and GSM/8000/1 should all be compatible.. let's go - * by name first. - */ - bts_codec = endp->tcfg->audio_name; - if (sscanf(bts_codec, "%63[^/]/%*d/%*d", audio_codec) < 1) + /* GSM, GSM/8000 and GSM/8000/1 should all be compatible... + * let's go by name first. */ + codec_str = endp->tcfg->audio_name; + if (sscanf(codec_str, "%63[^/]/%*d/%*d", audio_codec) < 1) return 0; - return strcasecmp(audio_codec, codec->codec_name) == 0; } -int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, struct mgcp_parse_data *p) +/*! \brief analyze SDP input string + * \endp[in] endp trunk endpoint + * \endp[in] conn associated rtp connection + * \endp[in] caller provided memory to store the parsing results + * \returns 0 on success, -1 on failure */ +int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, + struct mgcp_parse_data *p) { struct sdp_rtp_map codecs[10]; int codecs_used = 0; @@ -191,7 +213,13 @@ int i; int codecs_assigned = 0; void *tmp_ctx = talloc_new(NULL); + struct mgcp_rtp_end *rtp; + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(p); + + rtp = &conn->end; memset(&codecs, 0, sizeof(codecs)); for_each_line(line, p->save) { @@ -202,62 +230,69 @@ case 'v': /* skip these SDP attributes */ break; - case 'a': { - int payload; - int ptime, ptime2 = 0; - char audio_name[64]; + case 'a':{ + int payload; + int ptime, ptime2 = 0; + char audio_name[64]; - - if (sscanf(line, "a=rtpmap:%d %63s", - &payload, audio_name) == 2) { - codecs_update(tmp_ctx, codecs, codecs_used, payload, audio_name); - } else if (sscanf(line, "a=ptime:%d-%d", - &ptime, &ptime2) >= 1) { - if (ptime2 > 0 && ptime2 != ptime) - rtp->packet_duration_ms = 0; - else - rtp->packet_duration_ms = ptime; - } else if (sscanf(line, "a=maxptime:%d", &ptime2) == 1) { - maxptime = ptime2; + if (sscanf(line, "a=rtpmap:%d %63s", + &payload, audio_name) == 2) { + codecs_update(tmp_ctx, codecs, + codecs_used, payload, + audio_name); + } else + if (sscanf + (line, "a=ptime:%d-%d", &ptime, + &ptime2) >= 1) { + if (ptime2 > 0 && ptime2 != ptime) + rtp->packet_duration_ms = 0; + else + rtp->packet_duration_ms = ptime; + } else + if (sscanf(line, "a=maxptime:%d", &ptime2) + == 1) { + maxptime = ptime2; + } + break; } - break; - } - case 'm': { - int port, rc; + case 'm':{ + int port, rc; - rc = sscanf(line, "m=audio %d RTP/AVP %d %d %d %d %d %d %d %d %d %d", - &port, - &codecs[0].payload_type, - &codecs[1].payload_type, - &codecs[2].payload_type, - &codecs[3].payload_type, - &codecs[4].payload_type, - &codecs[5].payload_type, - &codecs[6].payload_type, - &codecs[7].payload_type, - &codecs[8].payload_type, - &codecs[9].payload_type); - if (rc >= 2) { - rtp->rtp_port = htons(port); - rtp->rtcp_port = htons(port + 1); - codecs_used = rc - 1; - codecs_initialize(tmp_ctx, codecs, codecs_used); + rc = sscanf(line, + "m=audio %d RTP/AVP %d %d %d %d %d %d %d %d %d %d", + &port, &codecs[0].payload_type, + &codecs[1].payload_type, + &codecs[2].payload_type, + &codecs[3].payload_type, + &codecs[4].payload_type, + &codecs[5].payload_type, + &codecs[6].payload_type, + &codecs[7].payload_type, + &codecs[8].payload_type, + &codecs[9].payload_type); + if (rc >= 2) { + rtp->rtp_port = htons(port); + rtp->rtcp_port = htons(port + 1); + codecs_used = rc - 1; + codecs_initialize(tmp_ctx, codecs, + codecs_used); + } + break; } - break; - } - case 'c': { - char ipv4[16]; + case 'c':{ + char ipv4[16]; - if (sscanf(line, "c=IN IP4 %15s", ipv4) == 1) { - inet_aton(ipv4, &rtp->addr); + if (sscanf(line, "c=IN IP4 %15s", ipv4) == 1) { + inet_aton(ipv4, &rtp->addr); + } + break; } - break; - } default: if (p->endp) LOGP(DLMGCP, LOGL_NOTICE, "Unhandled SDP option: '%c'/%d on 0x%x\n", - line[0], line[0], ENDPOINT_NUMBER(p->endp)); + line[0], line[0], + ENDPOINT_NUMBER(p->endp)); else LOGP(DLMGCP, LOGL_NOTICE, "Unhandled SDP option: '%c'/%d\n", @@ -269,25 +304,24 @@ /* Now select the primary and alt_codec */ for (i = 0; i < codecs_used && codecs_assigned < 2; ++i) { struct mgcp_rtp_codec *codec = codecs_assigned == 0 ? - &rtp->codec : &rtp->alt_codec; + &rtp->codec : &rtp->alt_codec; if (endp->tcfg->no_audio_transcoding && - !is_codec_compatible(endp, &codecs[i])) { + !is_codec_compatible(endp, &codecs[i])) { LOGP(DLMGCP, LOGL_NOTICE, "Skipping codec %s\n", - codecs[i].codec_name); + codecs[i].codec_name); continue; } mgcp_set_audio_info(p->cfg, codec, - codecs[i].payload_type, - codecs[i].map_line); + codecs[i].payload_type, codecs[i].map_line); codecs_assigned += 1; } if (codecs_assigned > 0) { /* TODO/XXX: Store this per codec and derive it on use */ if (maxptime >= 0 && maxptime * rtp->codec.frame_duration_den > - rtp->codec.frame_duration_num * 1500) { + rtp->codec.frame_duration_num * 1500) { /* more than 1 frame */ rtp->packet_duration_ms = 0; } @@ -296,11 +330,95 @@ "Got media info via SDP: port %d, payload %d (%s), " "duration %d, addr %s\n", ntohs(rtp->rtp_port), rtp->codec.payload_type, - rtp->codec.subtype_name ? rtp->codec.subtype_name : "unknown", - rtp->packet_duration_ms, inet_ntoa(rtp->addr)); + rtp->codec.subtype_name ? rtp-> + codec.subtype_name : "unknown", rtp->packet_duration_ms, + inet_ntoa(rtp->addr)); } talloc_free(tmp_ctx); return codecs_assigned > 0; } +/*! \brief generate SDP response string + * \endp[in] endp trunk endpoint + * \endp[in] conn associated rtp connection + * \endp[out] sdp_record resulting SDP string + * \endp[in] size buffer size of sdp_record + * \endp[in] addr IPV4 address string (e.g. 192.168.100.1) + * \returns 0 on success, -1 on failure */ +int mgcp_write_response_sdp(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn, char *sdp_record, + size_t size, const char *addr) +{ + const char *fmtp_extra; + const char *audio_name; + int payload_type; + int len; + int nchars; + + OSMO_ASSERT(endp); + OSMO_ASSERT(conn); + OSMO_ASSERT(sdp_record); + OSMO_ASSERT(size > 0); + OSMO_ASSERT(addr); + + endp->cfg->get_net_downlink_format_cb(endp, &payload_type, + &audio_name, &fmtp_extra, conn); + + len = snprintf(sdp_record, size, + "v=0\r\n" + "o=- %u 23 IN IP4 %s\r\n" + "s=-\r\n" + "c=IN IP4 %s\r\n" + "t=0 0\r\n", conn->conn->id, addr, addr); + + if (len < 0 || len >= size) + goto buffer_too_small; + + if (payload_type >= 0) { + nchars = snprintf(sdp_record + len, size - len, + "m=audio %d RTP/AVP %d\r\n", + conn->end.local_port, payload_type); + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + + if (audio_name && endp->tcfg->audio_send_name) { + nchars = snprintf(sdp_record + len, size - len, + "a=rtpmap:%d %s\r\n", + payload_type, audio_name); + + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + + if (fmtp_extra) { + nchars = snprintf(sdp_record + len, size - len, + "%s\r\n", fmtp_extra); + + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + } + if (conn->end.packet_duration_ms > 0 && endp->tcfg->audio_send_ptime) { + nchars = snprintf(sdp_record + len, size - len, + "a=ptime:%u\r\n", + conn->end.packet_duration_ms); + if (nchars < 0 || nchars >= size - len) + goto buffer_too_small; + + len += nchars; + } + + return len; + +buffer_too_small: + LOGP(DLMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", + size, len); + return -1; +} -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:13:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:13:18 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp_test: tweak test failure output Message-ID: Review at https://gerrit.osmocom.org/4007 mgcp_test: tweak test failure output Change-Id: Ibfc80f06b2811cc32fe38518b11efd6764b347ee --- M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/mgcp_test.c 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/07/4007/1 diff --git a/tests/legacy_mgcp/mgcp_test.c b/tests/legacy_mgcp/mgcp_test.c index 904ecce..1400893 100644 --- a/tests/legacy_mgcp/mgcp_test.c +++ b/tests/legacy_mgcp/mgcp_test.c @@ -541,7 +541,8 @@ if (msg) printf("%s failed '%s'\n", t->name, (char *) msg->data); } else if (strcmp((char *) msg->data, t->exp_resp) != 0) - printf("%s failed '%s'\n", t->name, (char *) msg->data); + printf("%s failed.\nExpected:\n%s\nGot:\n%s\n", + t->name, t->exp_resp, (char *) msg->data); msgb_free(msg); if (dummy_packets) diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 6a43b7b..c75cf6a 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -598,7 +598,8 @@ OSMO_ASSERT(false); } } else if (strcmp((char *)msg->data, t->exp_resp) != 0) { - printf("%s failed '%s'\n", t->name, (char *)msg->data); + printf("%s failed.\nExpected:\n%s\nGot:\n%s\n", + t->name, t->exp_resp, (char *) msg->data); OSMO_ASSERT(false); } msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/4007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfc80f06b2811cc32fe38518b11efd6764b347ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:33:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:33:24 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 39 files changed, 3,190 insertions(+), 3,865 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/2 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:33:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:33:24 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: make independent of other mgcp libs In-Reply-To: References: Message-ID: libosmo-mgcp-client: make independent of other mgcp libs Remove the shared mgcp_common.c file and hence erase all conflicts in case both libosmo-mgcp-client and libosmo-mgcp were linked. Move the few remaining common definitions to new header . The content of this header is now the only bit shared between mgcp and mgcp-client. However, keep separate copies of the file for each of the library to not require debian dependencies between the two libraries. The file is copied from mgcp to mgcp_client during 'make', as a BUILT_SOURCE. Move enum mgcp_connection_mode to mgcp_common.h. Move for_each_non_empty_line() macro to mgcp_common.h. Replace for_each_line() use in mgcp_client with for_each_non_empty_line() (according to comment; for_each_non_empty_line() replaces for_each_line() and uses strtok_r() instead of an own reinvention). Make mgcp_msg_terminate_nul() a static inline and place in mgcp_common.h. The complexity is just above your average static inline, but it's a way to not dup code and use it in both mgcp and mgcp_client without linking problems. Move mgcp_connection_mode_strs to mgcp_client.c, rename to mgcp_client_ prefix. (It would make sense to have something similar in mgcp, but since it is only used in mgcp_client, we can avoid the dup altogether.) Change-Id: Ifd3a2c7cdabb31bc50cb7f671758ffb7cdd10221 --- M include/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/Makefile.am M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_internal.h M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_vty.c M src/libosmo-mgcp/Makefile.am D src/libosmo-mgcp/mgcp_common.c M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp_client/mgcp_client_test.c 19 files changed, 103 insertions(+), 80 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/05/4005/2 diff --git a/include/Makefile.am b/include/Makefile.am index 2e354ae..b52e5ea 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,7 +7,9 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ + osmocom/mgcp/mgcp_common.h \ osmocom/mgcp/mgcp_internal.h \ osmocom/mgcp/osmux.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 3424684..3e387eb 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -167,21 +167,6 @@ MGCP_BSC_NAT, }; -enum mgcp_connection_mode { - MGCP_CONN_NONE = 0, - MGCP_CONN_RECV_ONLY = 1, - MGCP_CONN_SEND_ONLY = 2, - MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, - MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, -}; - -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} - struct mgcp_config { int source_port; char *local_ip; diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h new file mode 100644 index 0000000..bdff555 --- /dev/null +++ b/include/osmocom/mgcp/mgcp_common.h @@ -0,0 +1,64 @@ +/* MGCP common implementations. + * These are used in libosmo-mgcp as well as libosmo-mgcp-client. + * To avoid interdependency, these are implemented in .h file only. */ + +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +#include +#include + +#define for_each_non_empty_line(line, save) \ + for (line = strtok_r(NULL, "\r\n", &save); line; \ + line = strtok_r(NULL, "\r\n", &save)) + +enum mgcp_connection_mode { + MGCP_CONN_NONE = 0, + MGCP_CONN_RECV_ONLY = 1, + MGCP_CONN_SEND_ONLY = 2, + MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, + MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, +}; + +/* Ensure that the msg->l2h is NUL terminated. */ +static inline int mgcp_msg_terminate_nul(struct msgb *msg) +{ + unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ + if (tail[-1] == '\0') + /* nothing to do */; + else if (msgb_tailroom(msg) > 0) + tail[0] = '\0'; + else if (tail[-1] == '\r' || tail[-1] == '\n') + tail[-1] = '\0'; + else { + LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " + "Length: %d, Buffer size: %d\n", + msgb_l2len(msg), msg->data_len); + return -ENOTSUP; + } + return 0; +} + diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index fe54e22..b8fc530 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -316,5 +316,3 @@ return endp->cfg->net_ports.bind_addr; return endp->cfg->source_addr; } - -int mgcp_msg_terminate_nul(struct msgb *msg); diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 24401f1..0eaafcc 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -1,3 +1,11 @@ +BUILT_SOURCES = \ + mgcp_common.h \ + $(NULL) + noinst_HEADERS = \ mgcp_client_internal.h \ $(NULL) + +mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h + echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of \n\n */" > mgcp_common.h + cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index df73811..b560442 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -2,6 +2,8 @@ #include +#include + #define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" #define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 #define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" @@ -71,3 +73,9 @@ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); + +extern const struct value_string mgcp_client_connection_mode_strs[]; +static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) +{ + return get_value_string(mgcp_client_connection_mode_strs, mode); +} diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 1b149e2..690a4af 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -1,5 +1,7 @@ #pragma once +#include + #define MSGB_CB_MGCP_TRANS_ID 0 struct mgcp_client { diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b17477a..3dd21db 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_builddir) \ $(NULL) @@ -30,7 +31,6 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ - ../libosmo-legacy-mgcp/mgcp_common.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b72fc50..1cd37be 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,8 +24,6 @@ #include #include -#include -#include #include #include @@ -208,7 +206,7 @@ *data = '\0'; data ++; - for_each_line(line, data) { + for_each_non_empty_line(line, data) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -584,7 +582,7 @@ trans_id, rtp_endpoint, call_id, - mgcp_cmode_name(mode)); + mgcp_client_cmode_name(mode)); } struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, @@ -602,7 +600,7 @@ , trans_id, rtp_endpoint, - mgcp_cmode_name(mode), + mgcp_client_cmode_name(mode), rtp_conn_addr, rtp_port); } @@ -620,3 +618,12 @@ { return &mgcp->actual; } + +const struct value_string mgcp_client_connection_mode_strs[] = { + { MGCP_CONN_NONE, "none" }, + { MGCP_CONN_RECV_SEND, "sendrecv" }, + { MGCP_CONN_SEND_ONLY, "sendonly" }, + { MGCP_CONN_RECV_ONLY, "recvonly" }, + { MGCP_CONN_LOOPBACK, "loopback" }, + { 0, NULL } +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 1e8bba6..c52803f 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -27,7 +27,6 @@ #include #include -#include #include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am index a9c7602..b003f57 100644 --- a/src/libosmo-mgcp/Makefile.am +++ b/src/libosmo-mgcp/Makefile.am @@ -32,7 +32,6 @@ $(NULL) libosmo_mgcp_la_SOURCES = \ - mgcp_common.c \ mgcp_protocol.c \ mgcp_network.c \ mgcp_vty.c \ diff --git a/src/libosmo-mgcp/mgcp_common.c b/src/libosmo-mgcp/mgcp_common.c deleted file mode 100644 index c246742..0000000 --- a/src/libosmo-mgcp/mgcp_common.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Media Gateway Control Protocol Media Gateway: RFC 3435 */ -/* Implementations useful both for the MGCP GW as well as MGCP GW clients */ - -/* - * (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include - -const struct value_string mgcp_connection_mode_strs[] = { - { MGCP_CONN_NONE, "none" }, - { MGCP_CONN_RECV_SEND, "sendrecv" }, - { MGCP_CONN_SEND_ONLY, "sendonly" }, - { MGCP_CONN_RECV_ONLY, "recvonly" }, - { MGCP_CONN_LOOPBACK, "loopback" }, - { 0, NULL } -}; - -/* Ensure that the msg->l2h is NUL terminated. */ -int mgcp_msg_terminate_nul(struct msgb *msg) -{ - unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ - if (tail[-1] == '\0') - /* nothing to do */; - else if (msgb_tailroom(msg) > 0) - tail[0] = '\0'; - else if (tail[-1] == '\r' || tail[-1] == '\n') - tail[-1] = '\0'; - else { - LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " - "Length: %d, Buffer size: %d\n", - msgb_l2len(msg), msg->data_len); - return -ENOTSUP; - } - return 0; -} diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index 38f6961..0c21365 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -22,6 +22,7 @@ */ #include +#include /* Reset codec state and free memory */ static void mgcp_rtp_codec_reset(struct mgcp_rtp_codec *codec) diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index d809447..c9dc887 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -24,6 +24,7 @@ #include #include +#include #include /*! \brief Display an mgcp message on the log output. diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index caed189..ac5fd1a 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index d019602..36ec683 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 4f73cee..5c50419 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 240116a..6a43b7b 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 6045297..f2f0e0f 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -22,7 +22,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd3a2c7cdabb31bc50cb7f671758ffb7cdd10221 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:34:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:34:09 +0000 Subject: [ABANDON] osmo-mgw[master]: libosmo-mgcp-client: move dep from legacy to libosmo-mgcp In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: libosmo-mgcp-client: move dep from legacy to libosmo-mgcp ...................................................................... Abandoned squashed with G#4005 to avoid intermediate build problems -- To view, visit https://gerrit.osmocom.org/4004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie1f05948f36bf5148b58256312214de262bdf762 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:49:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:49:42 +0000 Subject: osmo-gsm-tester[master]: fix osmo-stp.cfg: accept-asp-connections must be a child of ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I266b129788b2caaec0f345f80a2c5eab0172bf97 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 20 22:49:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 20 Sep 2017 22:49:49 +0000 Subject: [MERGED] osmo-gsm-tester[master]: fix osmo-stp.cfg: accept-asp-connections must be a child of ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix osmo-stp.cfg: accept-asp-connections must be a child of listen m3ua ...................................................................... fix osmo-stp.cfg: accept-asp-connections must be a child of listen m3ua Change-Id: I266b129788b2caaec0f345f80a2c5eab0172bf97 --- M src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl index ab41de9..eb6ac1d 100644 --- a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl @@ -13,4 +13,4 @@ cs7 instance 0 xua rkm routing-key-allocation dynamic-permitted listen m3ua 2905 - accept-asp-connections dynamic-permitted + accept-asp-connections dynamic-permitted -- To view, visit https://gerrit.osmocom.org/3997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I266b129788b2caaec0f345f80a2c5eab0172bf97 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 21 01:11:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 01:11:20 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4003 to look at the new patch set (#3). Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 39 files changed, 3,191 insertions(+), 3,866 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/3 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Sep 21 01:26:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 01:26:08 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4003 to look at the new patch set (#4). Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h D include/osmocom/mgcp/mgcp_transcode.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c D src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 40 files changed, 3,183 insertions(+), 4,574 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/4 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Sep 21 02:02:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 02:02:54 +0000 Subject: osmo-mgw[master]: set API versions back to 0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d81853f811f412b186621c3657bab6af397a980 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 02:02:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 02:02:57 +0000 Subject: osmo-mgw[master]: tweak API version comments In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 02:05:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 02:05:52 +0000 Subject: osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4001/1//COMMIT_MSG Commit Message: Line 7: debian: tweak .install: less wildcards I can see that you're removin wildcards. what I cannot see from the code is why. So that "why" should be stated in the commit log. thanks! -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 02:06:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 02:06:39 +0000 Subject: osmo-mgw[master]: create libosmo-mgcp and osmo-mgw by copying legacy code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 04:51:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 04:51:19 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 4: (20 comments) https://gerrit.osmocom.org/#/c/4003/4/include/osmocom/mgcp/mgcp.h File include/osmocom/mgcp/mgcp.h: Line 37: #define RTP_PORT_DEFAULT_RANGE_END RTP_PORT_DEFAULT_RANGE_START + 10 why do we have a default range end of only 10 ports higher than the start port? given that each RTP connection needs two ports (even for RTP, odd for RTCP), that means we only have five connections by default? https://gerrit.osmocom.org/#/c/4003/4/include/osmocom/mgcp/mgcp_internal.h File include/osmocom/mgcp/mgcp_internal.h: Line 114: /* Each end has a separete socket for RTP and RTCP */ separate Line 149: struct mgcp_rtp_end end; the 'rtp_end' structure made sense when we had a bts_end and a net_end. Now it _might_ make sense to migrate it into mgcp_conn_rtp, as it is only used once in one place (here). Not a requirement, just a thought. If at all, should be a follow-up patch. Line 193: int mode; should this be some enum? or at least the comment above state what kind of values/bitmask/enum/#defines apply here? Line 223: enum mgcp_type type; if it's an endpoint type, mgcp_endpoint_type might be a better name https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_conn.c File src/libosmo-mgcp/mgcp_conn.c: Line 72: struct mgcp_conn *mgcp_conn_alloc(void *ctx, struct llist_head *conns, as the connection list is per endpoint, it might make sense to pass in the mgcp_endpoint here. the endpoint then is used to derive context + llist_head. Seems more natural to me: pass in the endpoint and state "please alloc a new connection for this endpoint". Line 82: if (llist_count(conns) >= 2) this is something specific to the "rtp bridge/proxy" endpoint type. I suggest introducing something like a 'const struct rtp_endpoint_type' which has a max_conns member. (currently all) mgcp_endpoint would then point to that one struct rtp_endpoint_type, and the comparison here would compare with endpoint->max_conns. This way we're well prepared to introduce other endpoint types in the future. Line 93: conn->type = type; rather than the enum, this would be a pointer to the 'const struct rtp_endpoint_type' which we would initially have for 'rtp_bridge' but which we would in the future have multiple. Line 105: mgcp_rtp_end_reset(&conn->u.rtp.end); why does mgpc_rtp_end_reset() not set those -1 values above? Line 123: struct mgcp_conn *mgcp_conn_get(struct llist_head *conns, uint32_t id) Is there a connection list outside of the context of a struct mgcp_endpoint? If no, I would suggest to pass in the struct mgcp_endpoint here rather than the llist_head pointer. This is what we do in many other places of osmocom code, too. PS4, Line 169: mgcp_conn_get_rtp_by_fd I wonder when do we need this. The below linear iteration seems quite expensive, if you consider it is done for each received RTP packet (every 20ms) on each RTP socket. Normally I would expect osmo_fd.priv to point to the mgcp_conn_rtp, and this function would be just a pointer de-reference. https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_network.c File src/libosmo-mgcp/mgcp_network.c: Line 704: conn_dst->end.packets_tx += 1; using an any of the libosmocore counters might be an idea here, rather than having hand-coded counters. A rate_counter is probably overkill, but then it would come with free CTRL interface access to the counters, as well as VTY dumping? It is what we e.g. use in the SGSN to count per-direction packets and bytes for a PDP context. Line 806: endp = (struct mgcp_endpoint *)fd->data; see my other comment, as the socket/fd is part of the mgcp connection, priv should probably point to that, and not directly to the endpoint? Would you agree? Line 889: conn_src = mgcp_conn_get_rtp_by_fd(&endp->conns, fd); see my other comment, this is a highly inefficient lookup, and we appear to perform it in the most frequently used code path. Line 911: llist_for_each_entry(conn, &endp->conns, entry) { This lookup and the code below is again specific to the endpoint type. I would envision the rtp_endpoint_type should have a callback function member that "consumes" the received RTP and then does whatever is specific for this endpoint type. For the "rtp-relay/proxy" endpoint type, that function then will perform the lookup + sending on the "peer" connection. For future other endpoints such as announcement playback, E1, ... the "consume/receive" function will be different and perform the specific operation. https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_osmux.c File src/libosmo-mgcp/mgcp_osmux.c: Line 443: /* FIXME: Get rid of CONN_ID_XXX! */ whitspace, but then thos FIXME should be resolved before merge anyway. Line 585: return; whitespace Line 613: whitespace https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_protocol.c File src/libosmo-mgcp/mgcp_protocol.c: Line 587: /* Check if we are able to accept the creation of another connection */ this kind of handling (probably pretty much all of the CRCX/MDCX processing after the parsing and some general syntax validation) is again specific to the endpoint type and should be performed in a callback function that is a member of 'struct rtp_endpoint_type'. The specific implementation here only applies to the 'RTP proxy/relay' type. Line 984: LOGP(DLMGCP, LOGL_ERROR, we should probably have some kind of LOGP/DEBUGP macro to which we pass the mgcp_endpoint or mgcp-connection, and which then prints the connection/endpoint identity. Just like in most other osmocom programs. -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:27:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:27:32 +0000 Subject: osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 just to be clear: This just moves code between files and adjust whitepsace/formatting, but there are no API/implementation changes? if yes, +2. "refactoring" can mean many things, that's why I'm asking. -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:27:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:27:48 +0000 Subject: osmo-mgw[master]: mgcp_test: tweak test failure output In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfc80f06b2811cc32fe38518b11efd6764b347ee Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:32:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:32:02 +0000 Subject: libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 I like the idea, but why not simply add the "name" attribute in addtion to the existing "node-id" attribute? This way the old 'vty-additions.xml' would still work, while we could write new ones referring to the names? In any case, if that adds extra work for some reason I'm missing here, nevermind. We can merge it and convert the vty-additions.xml very easily - and as you have stated, this doesn't have to happen at the same time. -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:32:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:32:49 +0000 Subject: libosmocore[master]: vty: use internal node id for xml ids In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:33:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:33:25 +0000 Subject: libosmocore[master]: comment: describe indent_cmp() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia58c16d995f6751bdd69defe8a46665aee163f3d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:34:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:34:05 +0000 Subject: libosmocore[master]: vty_test: add artificial node levels for better testing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9bcf58b655fbd85e196f363fb7d8305d7dfc997 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:35:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:35:53 +0000 Subject: osmo-tetra[master]: Introduce contrib/jenkins.sh to align with other projects In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f Gerrit-PatchSet: 2 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:35:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:35:57 +0000 Subject: [MERGED] osmo-tetra[master]: Introduce contrib/jenkins.sh to align with other projects In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Introduce contrib/jenkins.sh to align with other projects ...................................................................... Introduce contrib/jenkins.sh to align with other projects This change will make jenkins' inline scripts obsolete, so build testing and gerrit verification jobs [1][2] simply invoke: $ ./contrib/jenkins.sh [1] https://jenkins.osmocom.org/jenkins/view/OsmoTETRA/job/OsmoTETRA/ [2] https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/job/OsmoTETRA-gerrit/ Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f --- A contrib/jenkins.sh 1 file changed, 15 insertions(+), 0 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..503b6a0 --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,15 @@ +#!/bin/sh -ex + +rm -rf deps/install +mkdir deps || true +cd deps +osmo-deps.sh libosmocore + +cd libosmocore +autoreconf --install --force +./configure --prefix=$PWD/../install +$MAKE $PARALLEL_MAKE install + +cd ../../src +make clean || true +PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE -- To view, visit https://gerrit.osmocom.org/3989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f Gerrit-PatchSet: 2 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:36:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:36:29 +0000 Subject: python/osmo-python-tests[master]: osmodumpdoc: print generated path In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie39316f0b51ee518b9dce8d5f98b53f748db573b Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:36:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:36:44 +0000 Subject: python/osmo-python-tests[master]: osmodumpdoc: print called commands and OSError messages In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib044cbb8a1b8e02cbe6852f785c75b5c7aae6174 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:37:10 +0000 Subject: python/osmo-python-tests[master]: osmodumpdoc: fix finding cfg when not calling from source tree In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:38:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:38:17 +0000 Subject: osmo-gsm-manuals[master]: INSTALL.txt: add missing dep and vty ref howto In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1068d665b91faf1faa1b295503fcdc33f4ac500a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:38:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:38:32 +0000 Subject: osmo-gsm-manuals[master]: fix make deps: join hint_to_remove_draft_mode to build step In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecf8e18ce2f1dac61bf55019e1fec601b33abb95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:39:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:39:24 +0000 Subject: osmo-gsm-manuals[master]: OsmoNITB: update vty reference In-Reply-To: References: Message-ID: Patch Set 2: we should only merge this after the libosmocore patch is merged to master. -- To view, visit https://gerrit.osmocom.org/3986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48edb65be94be56c4b57293d8edc1b30271acc12 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 05:40:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 21 Sep 2017 05:40:27 +0000 Subject: osmo-gsm-manuals[master]: fix make deps: don't use the FORCE In-Reply-To: References: Message-ID: Patch Set 2: I'm sure the FORCE was added intentionally at the time, as some rebuilds didn't catch all changes. are we sure that we track all dependencies properly now? -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 08:21:30 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 21 Sep 2017 08:21:30 +0000 Subject: osmo-mgw[master]: sdp: refactoring sdp parser/generator In-Reply-To: References: Message-ID: Patch Set 4: > just to be clear: This just moves code between files and adjust > whitepsace/formatting, but there are no API/implementation changes? > if yes, +2. "refactoring" can mean many things, that's why I'm > asking. Yes, it just moves the code. However, the API is slightly changed. I prefixed the public functions with "mgcp_". Also the function do are now called with a connection (conn) and not with &conn->end, but this also does not change the actual implementation. -- To view, visit https://gerrit.osmocom.org/4006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 08:48:57 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Thu, 21 Sep 2017 08:48:57 +0000 Subject: osmo-tetra[master]: Introduce contrib/jenkins.sh to align with other projects In-Reply-To: References: Message-ID: Patch Set 2: Thanks for review/merging. The mentioned OsmoTetra jenkins jobs have been changed, so contrib/jenkins.sh is used now. -- To view, visit https://gerrit.osmocom.org/3989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f Gerrit-PatchSet: 2 Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 10:26:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 21 Sep 2017 10:26:23 +0000 Subject: osmo-mgw[master]: tweak API version comments In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4000/1/TODO-RELEASE File TODO-RELEASE: Line 10: # Nice clarification - might make sense to copy it to other libraries as well. -- To view, visit https://gerrit.osmocom.org/4000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 10:30:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 21 Sep 2017 10:30:01 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: make independent of other mgcp libs In-Reply-To: References: Message-ID: Patch Set 4: Why copying the header file at compile time is preferred over explicit .deb dependency? To me it looks like a strange hack. -- To view, visit https://gerrit.osmocom.org/4005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd3a2c7cdabb31bc50cb7f671758ffb7cdd10221 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 14:05:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 14:05:20 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-2 (1 comment) marking -2 to have a sticky reminder for me to add the missing debian file. https://gerrit.osmocom.org/#/c/4003/4/debian/control File debian/control: Line 52: Package: osmo-bsc-mgcp the debian/osmo-bsc-mgcp.install file for this is still missing (my fault). Will add it once dexter has submitted a new patch set addressing the other comments. -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 14:20:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 14:20:43 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 4: (5 comments) https://gerrit.osmocom.org/#/c/4003/4//COMMIT_MSG Commit Message: Line 29: anymore. This patch removes the related code. IIUC all transcoding has been removed, but I can still find transcoding related VTY commands and config items, as well as code mentioning 'osmux'. Those should all go away, right? We can drop those in a later patch, too. https://gerrit.osmocom.org/#/c/4003/4/include/osmocom/mgcp/mgcp_msg.h File include/osmocom/mgcp/mgcp_msg.h: Line 39: int mgcp_parse_osmux_cid(const char *line); osmux ^ https://gerrit.osmocom.org/#/c/4003/4/include/osmocom/mgcp/osmux.h File include/osmocom/mgcp/osmux.h: Line 3: this whole file is osmux -- related to transcoding? https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_osmux.c File src/libosmo-mgcp/mgcp_osmux.c: Line 126: h->in->osmux_seq = 0; (whitespace) Line 205: (whitespace) -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 14:45:02 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 21 Sep 2017 14:45:02 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 4: (6 comments) https://gerrit.osmocom.org/#/c/4003/4//COMMIT_MSG Commit Message: Line 18: *) use a list to manage rtp connections. Here would be good to say where these structs are embedded into the endpoint and how they are freed. E.g. which lifetime it has. Line 29: anymore. This patch removes the related code. > IIUC all transcoding has been removed, but I can still find transcoding rel Why would you drop the internal/synchronous transcoding? Line 35: the fixed CONN_BTS and CONN_NET constants. Dynamic is code but keep in mind that BTS might be in network/vlan and external network in another? You might want to bind to different interfaces? Line 68: - Add 'I: 1' parameters. did you check the nat code if it always includes the I. It was kind of an anti feature. Line 74: returned. Why 40ms? https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_conn.c File src/libosmo-mgcp/mgcp_conn.c: Line 225: conn = llist_last_entry(conns, struct mgcp_conn, entry); What if the list is empty? -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 14:55:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 21 Sep 2017 14:55:21 +0000 Subject: [PATCH] openbsc[master]: Show OML link uptime in vty Message-ID: Review at https://gerrit.osmocom.org/4008 Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts.c M openbsc/src/libbsc/e1_config.c 4 files changed, 16 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/08/4008/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 6b2269e..c19b125 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -715,6 +715,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index c6ff6d5..76de290 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -307,8 +308,14 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) + vty_out(vty, " since %s", ctime(&(bts->uptime))); + vty_out(vty, "%s", VTY_NEWLINE); + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..c446ef9 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -423,6 +425,7 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + bts->uptime = time(NULL); break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/openbsc/src/libbsc/e1_config.c b/openbsc/src/libbsc/e1_config.c index d57dec5..a58dc3c 100644 --- a/openbsc/src/libbsc/e1_config.c +++ b/openbsc/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -201,6 +201,7 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + bts->uptime = time(NULL); llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 21 14:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 21 Sep 2017 14:56:01 +0000 Subject: [PATCH] osmo-bsc[master]: Show OML link uptime in vty Message-ID: Review at https://gerrit.osmocom.org/4009 Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/bsc_vty.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/e1_config.c 4 files changed, 16 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4009/1 diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 6ce571e..f41bac4 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -722,6 +722,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3a80f06..512f476 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -304,8 +305,14 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) + vty_out(vty, " since %s", ctime(&(bts->uptime))); + vty_out(vty, "%s", VTY_NEWLINE); + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index 1f203f5..4643eac 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -423,6 +425,7 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + bts->uptime = time(NULL); break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index 1923efd..9ef195f 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -201,6 +201,7 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + bts->uptime = time(NULL); llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:31:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:31:20 +0000 Subject: libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (2 comments) (sorry, forgot to submit these comments, lying around as drafts for some hours) https://gerrit.osmocom.org/#/c/3973/3/Makefile.am File Makefile.am: Line 12: .PHONY: release this should be directly above the definition of the target, i.e. in this case in the osmo-release.mk, in this way: .PHONY: release release: ... One advantage of having the .PHONY in the .mk file is that you don't need to repeat the .PHONY in every Makefile.am using the .mk file. https://gerrit.osmocom.org/#/c/3973/3/osmo-release.mk File osmo-release.mk: Line 6: NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty 2>/dev/null | awk -F '=' '{ print $$2 }') This would still attempt to invoke 'bumpversion' if it is not there. If it is there, and if bumpversion had any error messages we need to see to know what went wrong, we would now silence those. Is it somehow possible to only ever call this after we actually invoked the 'make release'? I think make doesn't allow evaluating a variable within a make target... But we could also do something like NEW_VER := $(shell test -z "$(BUMPVER)" || bumpversion ...) This would not need the 2>/dev/null. Another idea would be to cat the bumpversion result to a file within the release target and then use that. -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:38:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:38:53 +0000 Subject: [MERGED] libosmocore[master]: vty_test: add artificial node levels for better testing In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty_test: add artificial node levels for better testing ...................................................................... vty_test: add artificial node levels for better testing In vty_test, add three levels of parent nodes (level1, level2, level3) with each having a leaf child (child1, child2, child3). Use these to enhance the vty_test cfg files and test more diverse situations. The current VTY code expects a go_parent_cb() to be present, otherwise it will bump right back to the CONFIG_NODE, which will not work with more than one node level below the CONFIG_NODE. Hence provide a minimal go_parent_cb(). Change-Id: Ib9bcf58b655fbd85e196f363fb7d8305d7dfc997 --- M tests/vty/fail_not_de-indented.cfg M tests/vty/fail_tabs_and_spaces.cfg M tests/vty/fail_too_much_indent.cfg M tests/vty/ok.cfg M tests/vty/ok_empty_parent.cfg M tests/vty/ok_ignore_blank.cfg M tests/vty/ok_ignore_comment.cfg M tests/vty/ok_indented_root.cfg M tests/vty/ok_more_spaces.cfg M tests/vty/ok_tabs.cfg M tests/vty/ok_tabs_and_spaces.cfg M tests/vty/vty_test.c M tests/vty/vty_test.ok 13 files changed, 440 insertions(+), 39 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/vty/fail_not_de-indented.cfg b/tests/vty/fail_not_de-indented.cfg index 5af833d..ca5a3cd 100644 --- a/tests/vty/fail_not_de-indented.cfg +++ b/tests/vty/fail_not_de-indented.cfg @@ -1,3 +1,3 @@ -line vty - no login - log stderr +level1 a + child1 a + level1 b diff --git a/tests/vty/fail_tabs_and_spaces.cfg b/tests/vty/fail_tabs_and_spaces.cfg index fa6ce05..4cb0cf5 100644 --- a/tests/vty/fail_tabs_and_spaces.cfg +++ b/tests/vty/fail_tabs_and_spaces.cfg @@ -1,4 +1,4 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + child1 b +level1 b diff --git a/tests/vty/fail_too_much_indent.cfg b/tests/vty/fail_too_much_indent.cfg index bacb3e1..3446a05 100644 --- a/tests/vty/fail_too_much_indent.cfg +++ b/tests/vty/fail_too_much_indent.cfg @@ -1,3 +1,3 @@ -line vty - no login - log stderr +level1 a + child1 a + level1 b diff --git a/tests/vty/ok.cfg b/tests/vty/ok.cfg index d5ef23e..f562348 100644 --- a/tests/vty/ok.cfg +++ b/tests/vty/ok.cfg @@ -1,3 +1,28 @@ -line vty - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/ok_empty_parent.cfg b/tests/vty/ok_empty_parent.cfg index fe04fcf..40dd372 100644 --- a/tests/vty/ok_empty_parent.cfg +++ b/tests/vty/ok_empty_parent.cfg @@ -1,2 +1,22 @@ -line vty -log stderr +level1 a + level2 a + level3 a +level1 b + level2 b +level1 c +level1 d + level2 e + level2 f + level3 f + level3 g + level2 g + level2 h +level1 h +level1 i +level1 j + level2 j + child1 j +level1 k + level2 k + level3 k + child1 k diff --git a/tests/vty/ok_ignore_blank.cfg b/tests/vty/ok_ignore_blank.cfg index d16ff64..a4a8bcb 100644 --- a/tests/vty/ok_ignore_blank.cfg +++ b/tests/vty/ok_ignore_blank.cfg @@ -1,7 +1,14 @@ -line vty +level1 - no login + level2 - no login + child2 + -log stderr + + level3 + + + child3 + +level1 diff --git a/tests/vty/ok_ignore_comment.cfg b/tests/vty/ok_ignore_comment.cfg index 5813fc7..1d6d87e 100644 --- a/tests/vty/ok_ignore_comment.cfg +++ b/tests/vty/ok_ignore_comment.cfg @@ -1,7 +1,8 @@ -line vty +level1 ! comment - no login + child1 ! comment - no login + level2 ! comment -log stderr + child2 +level1 diff --git a/tests/vty/ok_indented_root.cfg b/tests/vty/ok_indented_root.cfg index 313c674..b7487f6 100644 --- a/tests/vty/ok_indented_root.cfg +++ b/tests/vty/ok_indented_root.cfg @@ -1,3 +1,5 @@ - line vty - no login - log stderr + level1 a + child1 + level2 + child2 + level1 b diff --git a/tests/vty/ok_more_spaces.cfg b/tests/vty/ok_more_spaces.cfg index b66a9c2..263c682 100644 --- a/tests/vty/ok_more_spaces.cfg +++ b/tests/vty/ok_more_spaces.cfg @@ -1,4 +1,28 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/ok_tabs.cfg b/tests/vty/ok_tabs.cfg index e94609b..3f6085d 100644 --- a/tests/vty/ok_tabs.cfg +++ b/tests/vty/ok_tabs.cfg @@ -1,4 +1,28 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/ok_tabs_and_spaces.cfg b/tests/vty/ok_tabs_and_spaces.cfg index 2049b73..1922aad 100644 --- a/tests/vty/ok_tabs_and_spaces.cfg +++ b/tests/vty/ok_tabs_and_spaces.cfg @@ -1,4 +1,28 @@ -line vty - no login - no login -log stderr +level1 a + child1 a + level2 a + child2 a + level3 a + child3 a +level1 b + child1 b + level2 b + child2 b +level1 c + child1 c + level2 c + child2 c + level3 c + child3 c + level2 d + child2 d +level1 e + child1 e + level2 e + child2 e + level2 f + child2 f +level1 g + child1 g +level1 h + child1 h diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index d9af6ae..fe50e4c 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -298,12 +298,128 @@ OSMO_ASSERT(rc == expect_rc); } +enum test_nodes { + LEVEL1_NODE = _LAST_OSMOVTY_NODE + 1, + LEVEL2_NODE, + LEVEL3_NODE, +}; + +struct cmd_node level1_node = { + LEVEL1_NODE, + "%s(config-level1)# ", + 1 +}; + +struct cmd_node level2_node = { + LEVEL2_NODE, + "%s(config-level1-level2)# ", + 1 +}; + +struct cmd_node level3_node = { + LEVEL3_NODE, + "%s(config-level1-level2-level3)# ", + 1 +}; + +DEFUN(cfg_level1, cfg_level1_cmd, + "level1 [MARKER]", + "Level 1 node for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + vty->index = NULL; + vty->node = LEVEL1_NODE; + printf("called level1 node %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level1_child, cfg_level1_child_cmd, + "child1 [MARKER]", + "Level 1 child cmd for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + printf("called level1 child cmd %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level2, cfg_level2_cmd, + "level2 [MARKER]", + "Level 2 node for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + vty->index = NULL; + vty->node = LEVEL2_NODE; + printf("called level2 node %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level2_child, cfg_level2_child_cmd, + "child2 [MARKER]", + "Level 2 child cmd for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + printf("called level2 child cmd %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level3, cfg_level3_cmd, + "level3 [MARKER]", + "Level 3 node for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + vty->index = NULL; + vty->node = LEVEL3_NODE; + printf("called level3 node %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +DEFUN(cfg_level3_child, cfg_level3_child_cmd, + "child3 [MARKER]", + "Level 3 child cmd for VTY testing purposes\n" + "optional string to mark the line for test debugging\n") +{ + printf("called level3 child cmd %s\n", argc? argv[0] : ""); + return CMD_SUCCESS; +} + +void test_vty_add_cmds() +{ + install_element(CONFIG_NODE, &cfg_level1_cmd); + install_node(&level1_node, NULL); + vty_install_default(LEVEL1_NODE); + install_element(LEVEL1_NODE, &cfg_level1_child_cmd); + install_element(LEVEL1_NODE, &cfg_level2_cmd); + + install_node(&level2_node, NULL); + vty_install_default(LEVEL2_NODE); + install_element(LEVEL2_NODE, &cfg_level2_child_cmd); + install_element(LEVEL2_NODE, &cfg_level3_cmd); + + install_node(&level3_node, NULL); + vty_install_default(LEVEL3_NODE); + install_element(LEVEL3_NODE, &cfg_level3_child_cmd); +} + +static int go_parent_cb(struct vty *vty) +{ + /* + * - For the interactive VTY tests above, it is expected to bounce back to + * the CONFIG_NODE. Hence do so in go_parent_cb(). + * - In the config file parsing tests, setting vty->node in go_parent_cb() has no + * effect, because we will subsequently pop a parent node from the parent stack + * and override to go to the node that was recorded as the actual parent. + */ + vty->node = CONFIG_NODE; + vty->index = NULL; + return 0; +} + int main(int argc, char **argv) { struct vty_app_info vty_info = { .name = "VtyTest", .version = 0, - .go_parent_cb = NULL, + .go_parent_cb = go_parent_cb, .is_config_node = NULL, }; @@ -329,6 +445,8 @@ logging_vty_add_cmds(); osmo_stats_vty_add_cmds(); + test_vty_add_cmds(); + test_cmd_string_from_valstr(); test_node_tree_structure(); test_stats_vty(); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index f9fea34..bd6c5d6 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -109,25 +109,181 @@ Going to execute 'no stats reporter statsd' Returned: 0, Current node: 4 '%s(config)# ' reading file ok.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_more_spaces.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_tabs.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_tabs_and_spaces.cfg, expecting rc=0 +called level1 node a +called level1 child cmd a +called level2 node a +called level2 child cmd a +called level3 node a +called level3 child cmd a +called level1 node b +called level1 child cmd b +called level2 node b +called level2 child cmd b +called level1 node c +called level1 child cmd c +called level2 node c +called level2 child cmd c +called level3 node c +called level3 child cmd c +called level2 node d +called level2 child cmd d +called level1 node e +called level1 child cmd e +called level2 node e +called level2 child cmd e +called level2 node f +called level2 child cmd f +called level1 node g +called level1 child cmd g +called level1 node h +called level1 child cmd h got rc=0 reading file ok_ignore_comment.cfg, expecting rc=0 +called level1 node +called level1 child cmd +called level2 node +called level2 child cmd +called level1 node got rc=0 reading file ok_ignore_blank.cfg, expecting rc=0 +called level1 node +called level2 node +called level2 child cmd +called level3 node +called level3 child cmd +called level1 node got rc=0 reading file fail_not_de-indented.cfg, expecting rc=-22 +called level1 node a +called level1 child cmd a got rc=-22 reading file fail_too_much_indent.cfg, expecting rc=-22 +called level1 node a +called level1 child cmd a got rc=-22 reading file fail_tabs_and_spaces.cfg, expecting rc=-22 +called level1 node a +called level1 child cmd a got rc=-22 reading file ok_indented_root.cfg, expecting rc=0 +called level1 node a +called level1 child cmd +called level2 node +called level2 child cmd +called level1 node b got rc=0 reading file ok_empty_parent.cfg, expecting rc=0 +called level1 node a +called level2 node a +called level3 node a +called level1 node b +called level2 node b +called level1 node c +called level1 node d +called level2 node e +called level2 node f +called level3 node f +called level3 node g +called level2 node g +called level2 node h +called level1 node h +called level1 node i +called level1 node j +called level2 node j +called level1 child cmd j +called level1 node k +called level2 node k +called level3 node k +called level1 child cmd k got rc=0 All tests passed -- To view, visit https://gerrit.osmocom.org/3995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9bcf58b655fbd85e196f363fb7d8305d7dfc997 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:38:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:38:59 +0000 Subject: [MERGED] libosmocore[master]: comment: describe indent_cmp() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: comment: describe indent_cmp() ...................................................................... comment: describe indent_cmp() Change-Id: Ia58c16d995f6751bdd69defe8a46665aee163f3d --- M src/vty/command.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/command.c b/src/vty/command.c index 46c9fa2..a19d5db 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2331,6 +2331,10 @@ return str? strlen(str) : 0; } +/*! Make sure the common length of strings a and b is identical, then compare their lengths. I.e., if a + * is longer than b, a must start with exactly b, and vice versa. + * \returns EINVAL on mismatch, -1 for a < b, 0 for a == b, 1 for a > b. + */ static int indent_cmp(const char *a, const char *b) { size_t al, bl; -- To view, visit https://gerrit.osmocom.org/3993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia58c16d995f6751bdd69defe8a46665aee163f3d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:49:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:49:23 +0000 Subject: libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Patch Set 5: > I like the idea, but why not simply add the "name" attribute in > addtion to the existing "node-id" attribute? This way the old > 'vty-additions.xml' would still work, while we could write new ones > referring to the names? In any case, if that adds extra work for > some reason I'm missing here, nevermind. We can merge it and > convert the vty-additions.xml very easily - and as you have stated, > this doesn't have to happen at the same time. The current situation is that the last time the node ids were generated for the additions.xml, the id was produced by a simple loop counter while exporting. Needless to say that any added or re/moved vty node has jumbled up the node ids. At least for OsmoNITB, the situation I found was that the vty-additions are at all the wrong nodes. That previous patch changes it to use the vty FOO_NODE constants. The patch is nice and simple. https://gerrit.osmocom.org/#/c/3978/3 But to figure out which VTY additions belong where in the current jumbled up state, the easiest is to have the node names available -- when I read something about MNCC, I will swiftly have found the . If it has only a number, I need to parse the XML and cross reference with VTY list commands to figure out which child commands the MNCC node has... So I like the names, right now. We could of course add a name attribute to the tag besides the id attribute (if that is permitted by docbook XML), but - if we ever change the _LAST_OSMO_VTY_NODE, all of these IDs would change, while the name would stay constant. - and either way we can only use one of those criteria to bind additions to the vty-exported XML. Personally, I prefer the name for better XML navigation. And when we have it, there's no need to keep the node id. -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:55:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:55:48 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: fix make deps: join hint_to_remove_draft_mode to build step In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix make deps: join hint_to_remove_draft_mode to build step ...................................................................... fix make deps: join hint_to_remove_draft_mode to build step Change-Id: Iecf8e18ce2f1dac61bf55019e1fec601b33abb95 --- M build/Makefile.asciidoc.inc 1 file changed, 1 insertion(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index 660d72a..e088624 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -29,14 +29,11 @@ all: $(ASCIIDOCPDFS) -.PHONY: hint_to_remove_draft_mode -hint_to_remove_draft_mode: +$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ and remove three lines starting with '% \"DRAFT\" on first page'\n" \ || true - -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc hint_to_remove_draft_mode a2x $(A2X_OPTS) $< || asciidoc -v $(ASCIIDOC_OPTS) $< check: $(ASCIIDOC_CHECKS) -- To view, visit https://gerrit.osmocom.org/3984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecf8e18ce2f1dac61bf55019e1fec601b33abb95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:55:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:55:51 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: INSTALL.txt: add missing dep and vty ref howto In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: INSTALL.txt: add missing dep and vty ref howto ...................................................................... INSTALL.txt: add missing dep and vty ref howto Change-Id: I1068d665b91faf1faa1b295503fcdc33f4ac500a --- M INSTALL.txt 1 file changed, 23 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/INSTALL.txt b/INSTALL.txt index 39653d3..2669c0c 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -7,9 +7,31 @@ dblatex \ mscgen \ graphviz \ - python-pychart + python-pychart \ + python-nwdiag Build PDFs, run: make or for a parallel build using more CPU cores: make -j 5 + +To update the VTY reference for a given program, use osmodumpdoc.py, available +from git.osmocom.org/python/osmo-python-tests -- for example, for osmo-msc: + + cd ~/osmo-python-tests + ./setup.py install + + cd ~/osmo-msc + mkdir build + cd build + ../configure --enable-smpp + make + osmodumpdoc.py -p ~/osmo-msc + + cp doc/msc_vty_reference.xml ~/osmo-gsm-manuals/OsmoMSC/vty/ + cd ~/osmo-gsm-manuals/OsmoMSC + git status + git diff + make + git commit -a -m "OsmoMSC: update VTY reference" + git push origin HEAD:refs/for/master/msc_vty -- To view, visit https://gerrit.osmocom.org/3983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1068d665b91faf1faa1b295503fcdc33f4ac500a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:56:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:56:17 +0000 Subject: osmo-gsm-manuals[master]: fix make deps: don't use the FORCE In-Reply-To: References: Message-ID: Patch Set 2: let me double check and confirm later... -- To view, visit https://gerrit.osmocom.org/3985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 21:59:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 21:59:44 +0000 Subject: osmo-mgw[master]: tweak API version comments In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4000/1/TODO-RELEASE File TODO-RELEASE: Line 5: # but that is merely circumstantial. whoops, that last sentence should have been removed -- To view, visit https://gerrit.osmocom.org/4000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 21 22:02:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 22:02:00 +0000 Subject: [PATCH] osmo-mgw[master]: tweak API version comments In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4000 to look at the new patch set (#2). tweak API version comments Clarify LIBVERSION comments in TODO-RELEASE and reference Makefile.am comments to look there. Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f --- M TODO-RELEASE M src/libosmo-legacy-mgcp/Makefile.am M src/libosmo-mgcp-client/Makefile.am 3 files changed, 29 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/00/4000/2 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..d198b97 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,9 +1,26 @@ -# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install -# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info -# In short: -# LIBVERSION=c:r:a -# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. -# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. -# If any interfaces have been added since the last public release: c:r:a + 1. -# If any interfaces have been removed or changed since the last public release: c:r:0. +# When cleaning up this file upon a release: +# +# - Note that the release version number is entirely unrelated to the API +# versions. A release version 5.2.3 may happily have an API version of 42:7:5. +# +# - Bump API version in src/lib*/Makefile.am files according to chapter +# "Library interface versions" of the libtool documentation. +# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# +# - Iff the 'current' API version has changed, rename debian/lib*.install +# +# API version bumping for the impatient: +# LIBVERSION=c:r:a (current:revision_of_current:backwards_compat_age) +# 5:2:4 means that +# - this implements version 5 of the API; +# - this is the 2nd (compatible) revision of API version 5; +# - this is backwards compatible to all APIs since 4 versions ago, +# i.e. callers that need API versions from 1 to 5 can use this. +# +# Bumping API versions recipe: +# If the library source code has changed at all since the last update, r++; +# If any interfaces have been added, removed, or changed since the last update, c++, r=0; +# If any interfaces have been added since the last public release, a++; +# If any interfaces have been removed or changed since the last public release, a=0. +# #library what description / commit summary line diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 32902b9..bcf6242 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -21,9 +21,8 @@ $(LIBBCG729_LIBS) \ $(NULL) -# This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool -# documentation before making any modification +# This is not at all related to the release version, but a range of supported +# API versions. Read TODO_RELEASE in the source tree's root! LEGACY_MGCP_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index e644862..b17477a 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -19,9 +19,8 @@ $(COVERAGE_LDFLAGS) \ $(NULL) -# This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool -# documentation before making any modification +# This is not at all related to the release version, but a range of supported +# API versions. Read TODO_RELEASE in the source tree's root! MGCP_CLIENT_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ -- To view, visit https://gerrit.osmocom.org/4000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 21 22:02:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 22:02:26 +0000 Subject: osmo-mgw[master]: tweak API version comments In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 just changed one sentence in TODO_RELEASE comments. -- To view, visit https://gerrit.osmocom.org/4000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 21 22:02:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 22:02:29 +0000 Subject: [MERGED] osmo-mgw[master]: tweak API version comments In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: tweak API version comments ...................................................................... tweak API version comments Clarify LIBVERSION comments in TODO-RELEASE and reference Makefile.am comments to look there. Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f --- M TODO-RELEASE M src/libosmo-legacy-mgcp/Makefile.am M src/libosmo-mgcp-client/Makefile.am 3 files changed, 29 insertions(+), 14 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..d198b97 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,9 +1,26 @@ -# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install -# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info -# In short: -# LIBVERSION=c:r:a -# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. -# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. -# If any interfaces have been added since the last public release: c:r:a + 1. -# If any interfaces have been removed or changed since the last public release: c:r:0. +# When cleaning up this file upon a release: +# +# - Note that the release version number is entirely unrelated to the API +# versions. A release version 5.2.3 may happily have an API version of 42:7:5. +# +# - Bump API version in src/lib*/Makefile.am files according to chapter +# "Library interface versions" of the libtool documentation. +# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# +# - Iff the 'current' API version has changed, rename debian/lib*.install +# +# API version bumping for the impatient: +# LIBVERSION=c:r:a (current:revision_of_current:backwards_compat_age) +# 5:2:4 means that +# - this implements version 5 of the API; +# - this is the 2nd (compatible) revision of API version 5; +# - this is backwards compatible to all APIs since 4 versions ago, +# i.e. callers that need API versions from 1 to 5 can use this. +# +# Bumping API versions recipe: +# If the library source code has changed at all since the last update, r++; +# If any interfaces have been added, removed, or changed since the last update, c++, r=0; +# If any interfaces have been added since the last public release, a++; +# If any interfaces have been removed or changed since the last public release, a=0. +# #library what description / commit summary line diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 32902b9..bcf6242 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -21,9 +21,8 @@ $(LIBBCG729_LIBS) \ $(NULL) -# This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool -# documentation before making any modification +# This is not at all related to the release version, but a range of supported +# API versions. Read TODO_RELEASE in the source tree's root! LEGACY_MGCP_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index e644862..b17477a 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -19,9 +19,8 @@ $(COVERAGE_LDFLAGS) \ $(NULL) -# This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool -# documentation before making any modification +# This is not at all related to the release version, but a range of supported +# API versions. Read TODO_RELEASE in the source tree's root! MGCP_CLIENT_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ -- To view, visit https://gerrit.osmocom.org/4000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4edf786fde085f612f8a04972c55175a080ac65f Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 21 22:02:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 22:02:30 +0000 Subject: [MERGED] osmo-mgw[master]: set API versions back to 0 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: set API versions back to 0 ...................................................................... set API versions back to 0 Roll back the LIBVERSIONs to 0:0:0 -- the bumps so far have been confused and wrong. Let's start over from scratch with API-current of 0 while we still can. Rename the mgcp_client debian .install files back to 0 to match the API version. Change-Id: I3d81853f811f412b186621c3657bab6af397a980 --- M debian/control R debian/libosmo-mgcp-client0.install M src/libosmo-mgcp-client/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 2dfeb09..aca5a62 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,7 @@ Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-legacy-mgcp: Osmocom's Media Gateway server library -Package: libosmo-mgcp-client1 +Package: libosmo-mgcp-client0 Section: libs Architecture: any Multi-Arch: same @@ -46,5 +46,5 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: libosmo-mgcp-client1 (= ${binary:Version}), ${misc:Depends} +Depends: libosmo-mgcp-client0 (= ${binary:Version}), ${misc:Depends} Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities diff --git a/debian/libosmo-mgcp-client1.install b/debian/libosmo-mgcp-client0.install similarity index 100% rename from debian/libosmo-mgcp-client1.install rename to debian/libosmo-mgcp-client0.install diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 0416081..e644862 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -22,7 +22,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read Chapter 6 "Library interface versions" of the libtool # documentation before making any modification -MGCP_CLIENT_LIBVERSION=1:0:1 +MGCP_CLIENT_LIBVERSION=0:0:0 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/3999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d81853f811f412b186621c3657bab6af397a980 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 21 22:06:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 22:06:59 +0000 Subject: [PATCH] osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4001 to look at the new patch set (#2). debian: tweak .install: less wildcards With the upcoming addition of libosmo-mgcp, when we try the same scheme of wildcards there, it would also include all of the other libraries: *mgcp*.so.* There we will have to clarify that we mean exactly: libosmo-mgcp.so.* This is a cosmetic change to also be less ambiguous for the current libs: I prefer to state exactly which parts of the file names may vary, so that we have a firmer understanding of what is being installed. Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 --- M debian/libosmo-legacy-mgcp-dev.install M debian/libosmo-legacy-mgcp0.install M debian/libosmo-mgcp-client0.install 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/01/4001/2 diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install index 4184fef..a57cb50 100644 --- a/debian/libosmo-legacy-mgcp-dev.install +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -1,4 +1,4 @@ usr/include/osmocom/legacy_mgcp -usr/lib/*/*legacy-mgcp*.so -usr/lib/*/*legacy-mgcp*.a -usr/lib/*/pkgconfig/*legacy-mgcp*.pc +usr/lib/*/libosmo-legacy-mgcp.so +usr/lib/*/libosmo-legacy-mgcp.a +usr/lib/*/pkgconfig/libosmo-legacy-mgcp.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install index a47cc34..90ca89d 100644 --- a/debian/libosmo-legacy-mgcp0.install +++ b/debian/libosmo-legacy-mgcp0.install @@ -1 +1 @@ -usr/lib/*/*legacy-mgcp*.so.* +usr/lib/*/libosmo-legacy-mgcp.so.* diff --git a/debian/libosmo-mgcp-client0.install b/debian/libosmo-mgcp-client0.install index 4fc8bc6..7e86498 100644 --- a/debian/libosmo-mgcp-client0.install +++ b/debian/libosmo-mgcp-client0.install @@ -1 +1 @@ -usr/lib/*/*mgcp-client*.so.* +usr/lib/*/libosmo-mgcp-client.so.* -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 21 22:07:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 21 Sep 2017 22:07:12 +0000 Subject: osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Patch Set 2: is that good reasoning? -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 22 00:09:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 22 Sep 2017 00:09:32 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained Message-ID: Review at https://gerrit.osmocom.org/4010 libosmo-mgcp-client: fix debian, make self-contained Add mgcp_common.h to libosmo-mgcp-client, to not need to share a header file with libosmo-legacy-mgcp (nor the upcoming libosmo-mgcp). Both libraries use the enum mgcp_connection_mode (and a for-loop macro and a string mangling function), so far declared in mgcp.h, and both mgcp-dev and mgcp-client-dev debian packages would require this header file to be installed. So far the mgcp-client-dev lacks this header file, which causes the osmo-msc debian package to fail building. Ways to solve: - If both -dev debian packages installed the same header file in the same place, they would conflict if ever installed at the same time. - mgcp-client-dev can depend on mgcp-dev, but it seems bad to keep such a large dependency for just one enum and two helpers. - Instead, this patch solves this by copying the few definitions to libosmo-mgcp-client. Once libosmo-mgcp-client has its own copy of those definitions, it is fully self-contained and depending builds (osmo-msc deb) will succeed. Copy the few actually common definitions to new header . The nature of this .h is that it may be shared with future libosmo-mgcp without causing linking problems. Remove libosmo-legacy-mgcp/mgcp_common.c file from the build of libosmo-mgcp-client, no longer needed. Add to new mgcp_common.h: - enum mgcp_connection_mode; - for_each_non_empty_line() macro. - mgcp_msg_terminate_nul() as static function. Its complexity is just above your average static inline, but being inline is a way to use it in both mgcp and mgcp_client without linking problems. Replace for_each_line() use in mgcp_client with for_each_non_empty_line() (for_each_non_empty_line() replaces for_each_line() and uses strtok_r() instead of a local reinvention). mgcp_connection_mode_strs are actually only used in libosmo-mgcp-client, so rename to mgcp_client_ prefix and move to mgcp_client.c. BTW, the future plan for upcoming libosmo-mgcp is to use the identical header file, and keep only one copy in the git source tree. The second copy may be generated during 'make', to avoid code dup while having two distinct headers. Related: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f --- M include/Makefile.am M include/osmocom/legacy_mgcp/mgcp.h M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_internal.h A include/osmocom/mgcp_client/mgcp_common.h M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_vty.c M tests/mgcp_client/mgcp_client_test.c 9 files changed, 88 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/10/4010/1 diff --git a/include/Makefile.am b/include/Makefile.am index 94d74bb..0027386 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,4 +7,5 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_common.h \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcp.h b/include/osmocom/legacy_mgcp/mgcp.h index c017faf..147a0d5 100644 --- a/include/osmocom/legacy_mgcp/mgcp.h +++ b/include/osmocom/legacy_mgcp/mgcp.h @@ -177,13 +177,6 @@ MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, }; -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} - struct mgcp_config { int source_port; char *local_ip; diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index df73811..efc1f76 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -2,6 +2,8 @@ #include +#include + #define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" #define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 #define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" @@ -71,3 +73,9 @@ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); + +extern const struct value_string mgcp_client_connection_mode_strs[]; +static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) +{ + return get_value_string(mgcp_client_connection_mode_strs, mode); +} diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 1b149e2..690a4af 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -1,5 +1,7 @@ #pragma once +#include + #define MSGB_CB_MGCP_TRANS_ID 0 struct mgcp_client { diff --git a/include/osmocom/mgcp_client/mgcp_common.h b/include/osmocom/mgcp_client/mgcp_common.h new file mode 100644 index 0000000..bdff555 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_common.h @@ -0,0 +1,64 @@ +/* MGCP common implementations. + * These are used in libosmo-mgcp as well as libosmo-mgcp-client. + * To avoid interdependency, these are implemented in .h file only. */ + +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +#include +#include + +#define for_each_non_empty_line(line, save) \ + for (line = strtok_r(NULL, "\r\n", &save); line; \ + line = strtok_r(NULL, "\r\n", &save)) + +enum mgcp_connection_mode { + MGCP_CONN_NONE = 0, + MGCP_CONN_RECV_ONLY = 1, + MGCP_CONN_SEND_ONLY = 2, + MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, + MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, +}; + +/* Ensure that the msg->l2h is NUL terminated. */ +static inline int mgcp_msg_terminate_nul(struct msgb *msg) +{ + unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ + if (tail[-1] == '\0') + /* nothing to do */; + else if (msgb_tailroom(msg) > 0) + tail[0] = '\0'; + else if (tail[-1] == '\r' || tail[-1] == '\n') + tail[-1] = '\0'; + else { + LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " + "Length: %d, Buffer size: %d\n", + msgb_l2len(msg), msg->data_len); + return -ENOTSUP; + } + return 0; +} + diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b17477a..a2eb2be 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -30,7 +30,6 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ - ../libosmo-legacy-mgcp/mgcp_common.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b72fc50..5ce0918 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,8 +24,7 @@ #include #include -#include -#include +//#include #include #include @@ -208,7 +207,7 @@ *data = '\0'; data ++; - for_each_line(line, data) { + for_each_non_empty_line(line, data) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -584,7 +583,7 @@ trans_id, rtp_endpoint, call_id, - mgcp_cmode_name(mode)); + mgcp_client_cmode_name(mode)); } struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, @@ -602,7 +601,7 @@ , trans_id, rtp_endpoint, - mgcp_cmode_name(mode), + mgcp_client_cmode_name(mode), rtp_conn_addr, rtp_port); } @@ -620,3 +619,12 @@ { return &mgcp->actual; } + +const struct value_string mgcp_client_connection_mode_strs[] = { + { MGCP_CONN_NONE, "none" }, + { MGCP_CONN_RECV_SEND, "sendrecv" }, + { MGCP_CONN_SEND_ONLY, "sendonly" }, + { MGCP_CONN_RECV_ONLY, "recvonly" }, + { MGCP_CONN_LOOPBACK, "loopback" }, + { 0, NULL } +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 1e8bba6..c52803f 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -27,7 +27,6 @@ #include #include -#include #include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 6045297..f2f0e0f 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -22,7 +22,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 22 08:49:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 22 Sep 2017 08:49:16 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained In-Reply-To: References: Message-ID: Patch Set 1: > it seems bad to keep such a large dependency for just one enum and two helpers Why? What sort of mischief and mayhem it would possibly cause? Besides loosing extra Kb of precious disk space. > the future plan for upcoming libosmo-mgcp is to use the identical header file I'm not following. If the header is planned to be used from several places anyway than why not make it part of a single library and make all the users simply depend on it? Why the need to copy to different repo, than copy at build time etc. We do not copy libosmocore headers into every repo which uses it. How is libosmo-mgcp different? > Replace for_each_line() use in mgcp_client with for_each_non_empty_line() What this have to do with moving headers back and forth? Could it be a separate patch? -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 22 10:38:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 22 Sep 2017 10:38:34 +0000 Subject: libosmocore[master]: bitvec: implement write L or H value to vector In-Reply-To: References: Message-ID: Patch Set 2: The implementation looks very similar to existing bitvec_write_field() so it might make sense to combine the 2 into internal function which can set arbitrary values and implement both bitvec_write_field() and bitvec_write_field_lh() as tiny wrappers around it. Not critical for merging though - it can be added later on as a follow-up commit. -- To view, visit https://gerrit.osmocom.org/3990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36a76916a5986f098b6be6b5b779639c470725ef Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 22 12:38:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 22 Sep 2017 12:38:01 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Expand OsmoGGSN manual Message-ID: Review at https://gerrit.osmocom.org/4011 Expand OsmoGGSN manual * add cross-references * add example of running without root priviledges Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 --- M OsmoGGSN/chapters/configuration.adoc 1 file changed, 51 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/11/4011/1 diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc index e37b709..26a7d33 100644 --- a/OsmoGGSN/chapters/configuration.adoc +++ b/OsmoGGSN/chapters/configuration.adoc @@ -1,7 +1,7 @@ == Configuring OsmoGGSN All configuration of OsmoGGSN is performed using the VTY. For more -general information on the VTY interface, see FIXME. +general information on the VTY interface, see <>. === Configuring a virtual GGSN instance @@ -49,7 +49,7 @@ configure the properties of this GGSN instance. NOTE:: After creating a new GGSN instance, it is in `shutdown` mode. See -FIXME to take it out of shutdown, but make sure to configure it fully +<> to take it out of shutdown, but make sure to configure it fully before taking it out of shutdown. ==== Configuring a GGSN instance @@ -66,7 +66,7 @@ There are some further configuration statements that can be used at the GGSN node, some examples are given below. For a full list, see the -OpenGGSN VTY reference manual (FIXME). +_OsmoGGSN VTY reference manual_ FIXME. ---- OsmoGGSN(config-ggsn)# default-apn foobar <1> @@ -152,7 +152,7 @@ <5> Your prompt is now in the `ggsn` config node, where you can configure the properties of this GGSN instance. -NOTE:: The newly-create APN is created in `shutdown` mode. See FIXME to take it +NOTE:: The newly-create APN is created in `shutdown` mode. See <> to take it out of shutdown. @@ -178,7 +178,7 @@ NOTE:: If you use the optional `ip ifconfig` command to set the network device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` support. It might be better to configure related tun devices at system -startup and run OsmoGGSN as non-privileged user. See FIXME for more +startup and run OsmoGGSN as non-privileged user. See <> for more details. @@ -198,7 +198,7 @@ <3> Enter the config node of the GGSN instance `ggsn0` <4> Delete the APN `internet` - +[[unshutdown_apn]] ==== Taking an APN out of shutdown In order to bring a deactived APN in `shutdown` state into active @@ -241,3 +241,48 @@ <4> Enter the config ndoe of the APN `internet` <5> Shut down the APN +[[ggsn_no_root]] +=== Configuring for running without root priveleges + +It's possible to run OsmoGGSN without root privileges if the tun devices are already configured. + +.Example: device config via systemd-networkd using ggsn.netdev +---- +[NetDev] +Name=ggsn +Kind=tun + +[Tun] +User=username +Group=username +---- + +.Example: network settings via systemd-networkd using ggsn.network +---- +[Match] +Name=ggsn + +[Network] +Address=192.168.7.1 +IPMasquerade=yes +---- + +The pair of the configuration files above allows you to create and configure tun device which can be +used by OsmoGGSN as follows. + +.Example: using externally configured tun device as non-root +---- +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device ggsn + type-support v4 + ip prefix dynamic 192.168.7.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + no shutdown + default-apn internet + no shutdown ggsn +---- -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 22 15:44:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 22 Sep 2017 15:44:11 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add OsmoMSC manual Message-ID: Review at https://gerrit.osmocom.org/4012 add OsmoMSC manual Add OsmoMSC and OsmoHLR to bibliography (even though the OsmoHLR manual does not yet exist, a reference to it has been added in OsmoMSC's manual). Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee --- M Makefile A OsmoMSC/Makefile A OsmoMSC/chapters/control.adoc A OsmoMSC/chapters/mncc.adoc A OsmoMSC/chapters/net.adoc A OsmoMSC/chapters/overview.adoc A OsmoMSC/chapters/running.adoc A OsmoMSC/chapters/smpp.adoc A OsmoMSC/osmomsc-usermanual-docinfo.xml A OsmoMSC/osmomsc-usermanual.adoc A OsmoMSC/osmomsc-vty-reference.xml A OsmoMSC/vty/msc_vty_additions.xml A OsmoMSC/vty/msc_vty_reference.xml M common/chapters/bibliography.adoc 14 files changed, 4,031 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/12/4012/1 diff --git a/Makefile b/Makefile index c09dd58..ffa25de 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) + cd OsmoMSC; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -19,6 +20,7 @@ cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean + cd OsmoMSC; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -30,6 +32,7 @@ cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload + cd OsmoMSC; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -42,6 +45,7 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + cd OsmoMSC; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile new file mode 100644 index 0000000..febf7d1 --- /dev/null +++ b/OsmoMSC/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +msc_reference = $(topdir)/osmomsc-vty-reference.xml +manuals = $(msc_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmomsc-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmomsc-usermanual__*.svg + -rm osmomsc-usermanual__*.png + -rm osmomsc-usermanual.check + +generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/msc_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/msc_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging MSC VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting MSC VTY to DocBook) diff --git a/OsmoMSC/chapters/control.adoc b/OsmoMSC/chapters/control.adoc new file mode 100644 index 0000000..af03be7 --- /dev/null +++ b/OsmoMSC/chapters/control.adoc @@ -0,0 +1,31 @@ +[[control]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoMSC. + +.Variables available on OsmoMSC's Control interface +[options="header",width="100%",cols="20%,5%,5%,50%,20%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber-list-active-v1|RO|No||Return list of active subscribers. +|=== + +=== subscriber-list-active-v1 + +Return a list of subscribers that are successfully attached (including full +successful authentication and ciphering if those are enabled). + +The reply comprises of one subscriber per line, of the format + +---- +,\n[,\n[...]] +---- + +For example: + +---- +901700000015252,22801 +901700000015253,22802 +---- diff --git a/OsmoMSC/chapters/mncc.adoc b/OsmoMSC/chapters/mncc.adoc new file mode 100644 index 0000000..a2e7379 --- /dev/null +++ b/OsmoMSC/chapters/mncc.adoc @@ -0,0 +1,206 @@ +[[mncc]] +== MNCC for External Call Control + +The 3GPP GSM specifications define an interface point (service access +point) inside the MSC between the call-control part and the rest of the +system. This service access point is called the MNCC-SAP. It is +described in _3GPP TS 24.007_ <<3gpp-ts-24-007>> Chapter 7.1. + +However, like for all internal interfaces, 3GPP does not give any +specific encoding for the primitives passed at this SAP. + +The MNCC protocol of OsmoMSC has been created by the Osmocom community +and allows to control the call handling and audio processing by an +external application. The interface is currently exposed using Unix +Domain Sockets. The protocol is defined in the `mncc.h` header file. + +OsmoMSC can run in two different modes: + +. with internal MNCC handler +. with external MNCC handler + +=== Internal MNCC handler + +When the internal MNCC handler is enabled, OsmoMSC will switch voice +calls between GSM subscribers internally and automatically based on +the subscribers __extension__ number. No external software is required. + +NOTE: Internal MNCC is the default behavior. + +==== Internal MNCC Configuration + +The internal MNCC handler offers some configuration parameters under the +`mncc-int` VTY configuration node. + +===== `default-codec tch-f (fr|efr|amr)` + +Using this command, you can configure the default voice codec to be used +by voice calls on TCH/F channels. + +===== `default-codec tch-h (hr|amr)` + +Using this command, you can configure the default voice codec to be used +by voice calls on TCH/H channels. + +[[mncc-external]] +=== External MNCC handler + +When the external MNCC handler is enabled, OsmoMSC will not perform any +internal call switching, but delegate all call-control handling towards +the external MNCC program connected via the MNCC socket. + +If you intend to operate OsmoMSC with external MNCC handler, you have +to start it with the `-m` or `--mncc-sock` command line option. + +At the time of this writing, the only external application implementing +the MNCC interface compatible with the OsmoMSC MNCC socket was `lcr`, +the Linux Call Router. + +=== MNCC protocol description + +The protocol follows the primitives specified in 3GPP TS 04.07 Chapter 7.1. +The encoding of the primitives is provided in the `osmocom/msc/mncc.h` header +file, which uses some common definitions from `osmocom/gsm/mncc.h` (part of +libosmocore.git). + +However, OsmoMSC MNCC specifies a number of additional primitives +beyond those listed in the 3GPP specification. + +The different calls in the network are distinguished by their callref +(call reference), which is a unique unsigned 32bit integer. + +==== MNCC_HOLD_IND + +Direction: MSC -> Handler + +A 'CC HOLD' message was received from the MS. + +==== MNCC_HOLD_CNF + +Direction: Handler -> MSC + +Acknowledge a previously-received 'CC HOLD' message, causes the +transmission of a 'CC HOLD ACK' message to the MS. + +==== MNCC_HOLD_REJ + +Direction: Handler -> MSC + +Reject a previously-received 'CC HOLD' message, causes the +transmission of a 'CC HOLD REJ' message to the MS. + +==== MNCC_RETRIEVE_IND + +Direction: MSC -> Handler + +A 'CC RETRIEVE' message was received from the MS. + +==== MNCC_RETRIEVE_CNF + +Direction: Handler -> MSC + +Acknowledge a previously-received 'CC RETRIEVE' message, causes the +transmission of a 'CC RETRIEVE ACK' message to the MS. + +==== MNCC_RETRIEVE_REJ + +Direction: Handler -> MSC + +Reject a previously-received 'CC RETRIEVE' message, causes the +transmission of a 'CC RETRIEVE REJ' message to the MS. + +==== MNCC_USERINFO_REQ + +Direction: MSC -> Handler + +Causes a 'CC USER INFO' message to be sent to the MS. + +==== MNCC_USERINFO_IND + +Direction: MSC -> Handler + +Indicates that a 'CC USER-USER' message has been received from the MS. + +==== MNCC_BRIDGE + +Direction: Handler -> MSC + +Requests that the TCH (voice) channels of two calls shall be +inter-connected. This is the old-fashioned way of using MNCC, +primarily required for circuit-switched BTSs whose TRAU frames are +received via an E1 interface card on the MSC machine. + +==== MNCC_FRAME_RECV + +Direction: Handler -> MSC + +Enable the forwarding of TCHF voice frames via the MNCC interface in +MSC->Handler direction for the specified call. + +==== MNCC_FRAME_DROP + +Direction: Handler -> MSC + +Disable the forwarding of TCHF voice frames via the MNCC interface in +MSC->Handler direction for the specified call. + +==== MNCC_LCHAN_MODIFY + +Direction: Handler -> MSC + +Modify the current dedicated radio channel from signalling to voice, or +if it is a signalling-only channel (SDCCH), assign a TCH to the MS. + +==== MNCC_RTP_CREATE + +Direction: Handler -> MSC + +Create a RTP socket for this call at the BTS/TRAU that serves this BTS. + +==== MNCC_RTP_CONNECT + +Direction: Handler -> MSC + +Connect the RTP socket of this call to the given remote IP address and +port. + +==== MNCC_RTP_FREE + +Direction: Handler -> MSC + +Release a RTP connection for one given call. + +==== GSM_TCHF_FRAME + +Direction: both + +Transfer the payload of a GSM Full-Rate (FR) voice frame between the +MSC and an external MNCC handler. + +==== GSM_TCHF_FRAME_EFR + +Direction: both + +Transfer the payload of a GSM Enhanced Full-Rate (EFR) voice frame +between the MSC and an external MNCC handler. + +==== GSM_TCHH_FRAME + +Direction: both + +Transfer the payload of a GSM Half-Rate (HR) voice frame between the +MSC and an external MNCC handler. + +==== GSM_TCH_FRAE_AMR + +Direction: both + +Transfer the payload of a GSM Adaptive-Multi-Rate (AMR) voice frame +between the MSC and an external MNCC handler. + +==== GSM_BAD_FRAME + +Direction: MSC -> Handler + +Indicate that no valid voice frame, but a 'bad frame' was received over +the radio link from the MS. diff --git a/OsmoMSC/chapters/net.adoc b/OsmoMSC/chapters/net.adoc new file mode 100644 index 0000000..06be4ba --- /dev/null +++ b/OsmoMSC/chapters/net.adoc @@ -0,0 +1,154 @@ +[[net]] +== Configuring the Core Network + +The core network parameters are configured by the config file (as in `osmo-msc +-c osmo-msc.cfg`). The config file is parsed by the VTY, which is also +available via telnet in the running `osmo-msc` instance. Be aware that even +though you may be able to change these parameters without restarting +`osmo-msc`, some may not take immediate effect, and it is safest to use the +config file to have these parameters set at startup time. + +The core network parameters are found in the `config` / `network`. + +A full reference to the available commands can be found in the _OsmoMSC VTY +reference manual_ <>. This section describes only the most +commonly used settings. + +Here is an overview of the config items, described in more detail below: + +---- +network + network country code 262 + mobile network code 89 + mm info 1 + short name OsmoMSC + long name OsmoMSC + authentication required + encryption a5 3 +---- + +[TIP] +==== +Use the telnet VTY interface to query the current configuration of a running +`osmo-msc` process: + +---- +$ telnet localhost 4254 +OsmoMSC> enable +OsmoMSC# show running-config +---- + +Some parameters may be changed without restarting `osmo-msc`. To reach the +`network` node, enter: + +---- +OsmoMSC> enable +OsmoMSC# configure terminal +OsmoMSC(config)# network +OsmoMSC(config-net)# short name Example-Name +OsmoMSC(config-net)# exit +OsmoMSC(config)# +---- + +The telnet VTY features tab-completion as well as context sensitive help shown +when entering a `?` question mark. + +You can always use the `list` VTY command or enter `?` on the blank prompt to +get a list of all possible commands at the current node. +==== + + +=== MCC/MNC + +The key identities of every GSM PLMN is the Mobile Country Code and the Mobile +Network Code. They are identical over the entire network. In most cases, the +MCC/MNC will be allocated to the operator by the respective local regulatory +authority. For example, to set the MCC/MNC of 262-89, have this in your +osmo-msc.cfg: + +---- +network + network country code 262 + mobile network code 89 +---- + + +=== Configuring MM INFO + +The _MM INFO_ procedure can be used after a successful _LOCATION UPDATE_ in +order to transmit the human-readable network name as well as local time zone +information to the MS. By default, _MM INFO_ is not active, i.e. `0`. Set to `1` +to activate this feature: + +---- +network + mm info 1 + short name OsmoMSC + long name OsmoMSC +---- + +[NOTE] +==== +Not all phones support the MM INFO procedure. If a phone is not +factory-programmed to contain the name for your MCC/MNC, it will likely only +provide a numeric display of the network name, such as _262-89_, or show the +country code transformed into a letter, such as _D 89_. +==== + +The time information transmitted is determined by the local system time of the +operating system on which OsmoMSC is running. + + +=== Authentication + +Authorized subscribers must be entered in the HLR database, see the _OsmoHLR +reference manual_ <>. If authentication tokens (such as KI for +2G, or K and OP/OPC for UMTS) are present in the HLR, OsmoMSC will only attach +a subscriber after successful authentication. + +If no authentication keys are present in the HLR for a given subscriber, +OsmoMSC will attach the subscriber _without_ authentication. You can reject +subscribers that lack authentication info in the HLR with this setting: + +---- +network + authentication required +---- + +=== Ciphering + +To enable ciphering on the radio link, authentication must take place first: +the Kc resulting from authentication is the key used for ciphering. Hence, all +subscribers must have authentication tokens available in the HLR for ciphering. + +The MS, BTS and MSC must agree on a ciphering algorithm to use. + +- The MS sends its supported ciphering algorithms via Classmark IEs during + Location Updating. +- Typically the BSC needs to know which A5 ciphers are supported by connected + BTSes. +- Finally, OsmoMSC may impose that specific A5 ciphers shall not be considered. + +It is the responsibility of the BSC to then pick an A5 cipher that satisfies +all requirements. + +- In OsmoMSC, A5/0 means that ciphering is turned off. ++ +---- +network + encryption a5 0 +---- + +- A5/1 and A5/3 are currently supported by Osmocom. ++ +---- +network + encryption a5 3 +---- + +- Never use A5/2: it is an "export grade cipher" and has been deprecated for + its low ciphering strength. + +NOTE: At the time of writing, OsmoMSC supports setting only a single A5 cipher, +while it should be able to allow a set of ciphers. This is subject to ongoing +development. diff --git a/OsmoMSC/chapters/overview.adoc b/OsmoMSC/chapters/overview.adoc new file mode 100644 index 0000000..0bb47d7 --- /dev/null +++ b/OsmoMSC/chapters/overview.adoc @@ -0,0 +1,127 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoMSC. It will cover +aspects of configuring and running the OsmoMSC. + +[[intro_overview]] +=== About OsmoMSC + +OsmoMSC is the Osmocom implementation of a Mobile Switching Center (MSC) for 2G +and 3G GSM and UMTS mobile networks. Its interfaces are: + +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. + +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. +Before it was split off, OsmoMSC originated from libmsc of the old openbsc.git. +Since a true _A_ interface and IuCS for 3G support is available, OsmoMSC +exists only as a separate standalone entity. + +Key differences of the new OsmoMSC compared to the old OsmoNITB are: + +- The complete VLR implementation that communicates with the separate HLR + (OsmoHLR) for subscriber management. In contrast to the OsmoNITB, HLR queries + are fully asynchronous, and the separate HLR allows using centralized + subscriber management for both circuit-switched and packet-switched domains + (i.e. one OsmoHLR for both OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- Addition of a true _A_ interface for 2G voice services. Previously, OsmoBSC + had an SCCPlite based _A_ interface towards 3rd party MSC implementations. + OsmoMSC features a true SCCP/M3UA _A_ interface, which allows running OsmoBSC + against this Osmocom based MSC implementation. The new SCCP/M3UA SIGTRAN for + the _A_ interface is implemented in libosmo-sccp, which is used by OsmoMSC + and OsmoBSC (and others), to establish a link via an STP (e.g. OsmoSTP). + +- Addition of an _IuCS_ interface to allow operating 3G voice services, also + via SCCP/M3UA SIGTRAN, for example connecting via OsmoHNBGW to a 3G small + cell device. + +Find the OsmoMSC issue tracker and wiki online at + +- https://osmocom.org/projects/osmomsc +- https://osmocom.org/projects/osmomsc/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoMSC +[graphviz] +---- +digraph G { + rankdir=LR; + MS0 [label="MS"] + MS1 [label="MS"] + MS2 [label="MS"] + MS3 [label="MS"] + UE0 [label="UE"] + UE1 [label="UE"] + BTS0 [label="BTS"] + BTS1 [label="BTS"] + STP [label="STP\n(SCCP routing)"] + HLR [label="HLR+AUC+EIR"] + HNB [label="RNC or hNodeB"] + MGW + MS0->BTS0 [label="Um"] + MS1->BTS0 [label="Um"] + MS2->BTS1 [label="Um"] + MS3->BTS1 [label="Um"] + UE0->HNB + UE1->HNB + BTS0->BSC [label="Abis"] + BTS1->BSC [label="Abis"] + BSC->STP [label="A/SCCP/M3UA"] + STP->MSC [label="A/SCCP/M3UA"] + STP->MSC [label="IuCS/SCCP/M3UA"] + VLR->HLR [label="GSUP"] + HNB->HNBGW [label="Iuh"] + HNBGW->STP [label="IuCS/SCCP/M3UA"] + MSC->MGW [label="MGCP"] + BTS0->MGW [label="RTP"] + BTS1->MGW [label="RTP"] + subgraph cluster_msc { + label = "OsmoMSC"; + MSC->SMSC; + MSC->VLR + } +} +---- + + +=== Software Components + +This is a brief description of OsmoMSC's internal software components. + +==== SMSC + +A minimal store-and-forward server for SMS, supporting both MO and MT +SMS service, as well as multi-part messages. + +The built-in SMSC also supports an external SMSC interface. For more +information, see <>. + +==== MSC + +The MSC component implements the mobility management (MM) functions of the TS +04.08 and delegates to SMSC for SMS message handling and the VLR for subscriber +management. + +Furthermore, it can handle TS 04.08 Call Control (CC), either by use of +an internal MNCC handler, or by use of an external MNCC agent. For more +information see <>. + +==== VLR + +A fully featured Visitor Location Register handles the subscriber management +and authentication, and interfaces via GSUP to the external HLR. diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc new file mode 100644 index 0000000..3caa2a0 --- /dev/null +++ b/OsmoMSC/chapters/running.adoc @@ -0,0 +1,149 @@ +== Running OsmoMSC + +The OsmoMSC executable (`osmo-msc`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-msc* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] [-M 'SOCKETPATH'] [-C] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as HLR/AUC + storage +*-M, --mncc-sock-path*:: + Enable the MNCC socket for an external MNCC handler. See + <> for further information. +*-m, --mncc-sock*:: + Same as option -M (deprecated). +*-C, --no-dbcounter*:: + Disable the regular periodic synchronization of statistics + counters to the database. + + +=== Multiple instances + +Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, +CTRL) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different IP +addresses. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +If external SMPP is enabled, you may bind it to a different interface using: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 +---- + +More on SMPP configuration in <>. + +The external MNCC handler is configured by the `--mncc-sock` commandline +argument. Choose a different such socket path for each OsmoMSC instance running +on the same file system. See more in <>. + +For the following links, OsmoMSC acts as a client and does not listen/bind to a +specific interface, and will hence not encounter conflicts for multiple instances +running on the same interface: + +- The SCCP/M3UA links are established by OsmoMSC contacting an STP. +- The GSUP link is established by OsmoMSC contacting an HLR. + + +=== Configure primary links + +==== Configure SCCP/M3UA to accept _A_ and _IuCS_ links + +OsmoMSC will contact an STP instance to establish an SCCP/M3UA link. BSC and +HNBGW will then reach the MSC via this link. By default, an STP instance is +assumed to listen on the default M3UA port (2905) on the local host. + +Establishing an SCCP/M3UA link towards an STP instance not on the local host +can be configured as follows: + +---- +cs7 instance 0 + asp my-OsmoMSC 2905 0 m3ua + ! IP address of the remote STP: + remote-ip 10.23.24.1 +---- + +Note that _A_ and _IuCS_ may use different SCCP instances, if so desired: + +---- +cs7 instance 0 + asp my-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.42.1 +cs7 instance 1 + asp my-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.42.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 +---- + +A full configuration needs an `asp` on an `as` -- an Application Server Process +running on an Application Server -- as well as a local point code and routing +configuration. The SCCP VTY automatically creates those parts that are missing, +by assuming sane defaults. A complete configuration would look like this: + +---- +cs7 instance 0 + point-code 0.23.1 + asp my-OsmoMSC-A-Iu 2905 0 m3ua + remote-ip 127.0.0.1 + as my-as-for-OsmoMSC-A-Iu m3ua + asp my-OsmoMSC-A-Iu + routing-key 0 0.23.1 +---- + +==== Configure GSUP to reach the HLR + +OsmoMSC will assume a GSUP server (OsmoHLR) to run on the local host and the +default GSUP port (4222). Contacting an HLR at a different IP address can be +configured as follows: + +---- +hlr + ! IP address of the remote HLR: + remote-ip 10.23.42.1 + ! default port is 4222, optionally configurable by: + remote-port 1234 +---- diff --git a/OsmoMSC/chapters/smpp.adoc b/OsmoMSC/chapters/smpp.adoc new file mode 100644 index 0000000..aab5a2c --- /dev/null +++ b/OsmoMSC/chapters/smpp.adoc @@ -0,0 +1,147 @@ +[[smpp]] +== Short Message Peer to Peer (SMPP) + +In OsmoMSC, the _Short Message Peer to Peer_ (SMPP) Protocol <> +interface allows sending MT-SMS to an attached subscriber or receiving unrouted +MO-SMS. OsmoMSC implements version 3.4 of the protocol. + +NOTE: `osmo-msc` must have been compiled with the `--enable-smpp` configure +option to offer the SMPP interface. + +Multiple ESMEs (External SMS Entities) may interact with an SMSC (SMS Service +Center) via the SMPP protocol. Each entity is identified by its System Id, a +character string which is configured by the system administrator. + +OsmoMSC implements the SMSC side of SMPP and acts as a TCP server accepting +incoming connections from ESME client programs. + +Each ESME identifies itself to the SMSC with its system-id and an +optional shared password. + + +[[smpp-config-global]] +=== Global SMPP configuration + +Configure OsmoMSC's SMPP behavior at the top-level `smpp` VTY node, for +example: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 + system-id osmomsc123 + policy closed + no smpp-first +---- + +Use the `local-tcp-ip` command to define the TCP IP and port at which the +OsmoMSC internal SMSC should listen for incoming SMPP connections. The default +is to listen on all IPs (0.0.0.0) and the default port assigned to SMPP (2775). + +Use the `system-id` command to define the System ID of the SMSC. + +Use the `policy` parameter to define whether only explicitly configured +ESMEs are permitted to access the SMSC (`closed`), or whether any +ESME should be accepted (`accept-all`). + +Use the `smpp-first` command to define if SMPP routes have higher precedence +than MSISDNs contained in the HLR, or `no smpp-first` if only MSISDNs not +present in the HLR should be considered for routing to SMPP. + + +[[esme]] +=== ESME configuration + +Under the `smpp` vty node, you can add any number of `esme` nodes, one +for each ESME that you wish to configure. For example: + +---- +smpp + policy closed + no smpp-first + esme example1 + password s3cr3t + default-route + deliver-src-imsi + osmocom-extensions + esme example2 + password p4ssw0rd + deliver-src-imsi + osmocom-extensions + route prefix national isdn 2342 +---- + +Use the `esme NAME` command (where NAME corresponds to the system-id of +the ESME to be configured) under the SMPP vty node to enter the +configuration node for this given ESME. + +Use the `password` command to specify the password (if any) for the +ESME. + +Use the `default-route` command to indicate that any MO-SMS without a +more specific route should be routed to this ESME. + +Use the `deliver-src-imsi` command to indicate that the SMPP DELIVER +messages for MO SMS and the SMPP ALERT should state the IMSI (rather +than the MSISDN) as source address. + +Use the `osmocom-extensions` command to request that Osmocom specific +extension TLVs shall be included in the SMPP PDUs. Those extensions +include the ARFCN of the cell, the L1 transmit power of the MS, the +timing advance, the uplink and dwnlink RxLev and RxQual, as well as the +IMEI of the terminal at the time of generating the SMPP DELIVER PDU. + +Use the `dcs-transparent` command to transparently pass the DCS value +from the SMS Layer3 protocols to SMPP, instead of converting them to the +SMPP-specific values. + +Use the `route prefix` command to specify a route towards this ESME. +Using routes, you specify which destination MSISDNs should be routed +towards your ESME. + + +=== Osmocom SMPP protocol extensions + +Osmocom has implemented some extensions to the SMPP v3.4 protocol. + +These extensions can be enabled using the `osmocom-extensions` VTY +command at `esme` level, see <>. + +The TLV definitions can be found in the +`` header file provided by +libosmocore. + +==== RF channel measuremets + +When the Osmocom SMPP extensions are enabled, we add the following +TLVs to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length (Octets) | Purpose +| TLVID_osmo_arfcn | 0x2300 | 2 | GSM ARFCN of the radio interface +| TLVID_osmo_ta | 0x2301 | 1 | Timing Advance on the radio interface +| TLVID_osmo_ms_l1_txpwr | 0x2307 | 1 | Transmit Power of the MS in uplink direction +| TLVID_osmo_rxlev_ul | 0x2302 | 2 | Uplink receive level as measured by BTS in dBm (int16_t) +| TLVID_osmo_rxqual_ul | 0x2303 | 1 | Uplink RxQual value as measured by BTS +| TLVID_osmo_rxlev_dl | 0x2304 | 2 | Downlink receive level as measured by MS in dBm (int16_t) +| TLVID_osmo_rxqual_dl | 0x2305 | 1 | Downlink RxQual value as measured by MS +|=== + +All of the above values reflect the *last measurement report* as +recieved vi A-bis RSL from the BTS. It is thus a snapshot value (of +the average within one 480ms SACCH period), and not an average over +all the SACCH periods during which the channel was open or the SMS was +received. Not all measurement reports contain all the values. So you +might not get an TLVID_osmo_rxlev_dl IE, as that particular uplink +frame might habe benn lost for the given snapshot we report. + +==== Equipment IMEI + +If we know the IMEI of the subscribers phone, we add the following TLV +to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length | Purpose +| TLVID_osmo_imei | 0x2306 | variable | IMEI of the subscibers phone (ME) +|=== diff --git a/OsmoMSC/osmomsc-usermanual-docinfo.xml b/OsmoMSC/osmomsc-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc new file mode 100644 index 0000000..e77e6d8 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -0,0 +1,35 @@ +:gfdl-enabled: + +OsmoMSC User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/net.adoc[] + +include::chapters/smpp.adoc[] + +include::chapters/mncc.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoMSC/osmomsc-vty-reference.xml b/OsmoMSC/osmomsc-vty-reference.xml new file mode 100644 index 0000000..a954b84 --- /dev/null +++ b/OsmoMSC/osmomsc-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoMSC VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoMSC/vty/msc_vty_additions.xml b/OsmoMSC/vty/msc_vty_additions.xml new file mode 100644 index 0000000..0d473bd --- /dev/null +++ b/OsmoMSC/vty/msc_vty_additions.xml @@ -0,0 +1,24 @@ + + + + MNCC Internal Configuration + This node allows to configure the default codecs for + the internal call control handling. + + + + SMPP Configuration + This node allows to configure the SMPP interface + for interfacing with external SMS applications. This section + contains generic/common SMPP related configuration, and no + per-ESME specific parameters. + + + + ESME Configuration + This node allows to configure one particular SMPP + ESME, which is an External SMS Entity such as a SMS based + application server. You can define any number of ESME within + the SMPP node of the OsmoNITB VTY. + + diff --git a/OsmoMSC/vty/msc_vty_reference.xml b/OsmoMSC/vty/msc_vty_reference.xml new file mode 100644 index 0000000..b7311ab --- /dev/null +++ b/OsmoMSC/vty/msc_vty_reference.xml @@ -0,0 +1,3019 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index a3c6436..e417d02 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -14,6 +14,14 @@ http://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf - [[[vty-ref-osmobsc]]] Osmocom Project: OsmoBSC VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf +- [[[userman-osmomsc]]] Osmocom Project: OsmoMSC User Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-usermanual.pdf +- [[[vty-ref-osmomsc]]] Osmocom Project: OsmoMSC VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-vty-reference.pdf +- [[[userman-osmohlr]]] Osmocom Project: OsmoHLR User Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-usermanual.pdf +- [[[vty-ref-osmohlr]]] Osmocom Project: OsmoHLR VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-vty-reference.pdf - [[[userman-osmopcu]]] Osmocom Project: OsmoPCU User Manual. http://ftp.osmocom.org/docs/latest/osmopcu-usermanual.pdf - [[[vty-ref-osmopcu]]] Osmocom Project: OsmoPCU VTY Reference Manual. -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 22 15:44:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 22 Sep 2017 15:44:21 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: fix various grammar and typos in: preface, cell-broadcast Message-ID: Review at https://gerrit.osmocom.org/4013 fix various grammar and typos in: preface, cell-broadcast Change-Id: I0c61ad0e824b0d62bb9332f2208b247d3852dbb5 --- M common/chapters/cell-broadcast.adoc M common/chapters/preface.adoc 2 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/13/4013/1 diff --git a/common/chapters/cell-broadcast.adoc b/common/chapters/cell-broadcast.adoc index d439128..a87efae 100644 --- a/common/chapters/cell-broadcast.adoc +++ b/common/chapters/cell-broadcast.adoc @@ -46,7 +46,7 @@ include::osmocom-cbs.msc[] ---- -==== What'a miaaing +==== What's missing What's missing (for production operation in larger networks) diff --git a/common/chapters/preface.adoc b/common/chapters/preface.adoc index 975dcca..d85e318 100644 --- a/common/chapters/preface.adoc +++ b/common/chapters/preface.adoc @@ -133,24 +133,24 @@ Some of the founders of the Osmocom project have established sysmocom as a company to provide products and services related to Osmocom. -sysmocom and its staff are the by far the largest developers and -contributors to the Osmocom mobile network infrastructure projects. +sysmocom and its staff have by far contributed the largest part of development +and maintenance to the Osmocom mobile network infrastructure projects. As part of this work, sysmocom has also created the manual you are reading. At sysmocom, we draw a clear line between what is the Osmocom FOSS project, and what is sysmocom as a commercial entity. Under no -circumstances requires participation in the FOSS projects any commercial +circumstances does participation in the FOSS projects require any commercial relationship with sysmocom as a company. === Corrections -We have prepared this manual in the hope it will guide you through the +We have prepared this manual in the hope that it will guide you through the process of installing, configuring and debugging your deployment of cellular network infrastructure elements using Osmocom software. If -you do find errors, mistakes and/or omissions, or have any suggestions +you do find errors, typos and/or omissions, or have any suggestions on missing topics, please do take the extra time and let us know. @@ -248,7 +248,7 @@ Osmocom software or those of traditional telecom suppliers. GSM knowledge has many different fields, from radio planning through -site installation through to core network configuration/administration. +site installation to core network configuration/administration. The detailed skills required will depend on the type of installation and/or deployment that you are planning, as well as its associated -- To view, visit https://gerrit.osmocom.org/4013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c61ad0e824b0d62bb9332f2208b247d3852dbb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 22 15:48:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 22 Sep 2017 15:48:39 +0000 Subject: osmo-gsm-manuals[master]: Expand OsmoGGSN manual In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4011/1/OsmoGGSN/chapters/configuration.adoc File OsmoGGSN/chapters/configuration.adoc: Line 69: _OsmoGGSN VTY reference manual_ FIXME. could add OsmoGGSN to /common/chapters/bibliography.adoc mainly by copy-paste and use [[userman-osmoggsn]] here. (and drop the OpenGGSN from it) -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 22 16:17:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 22 Sep 2017 16:17:30 +0000 Subject: osmo-gsm-manuals[master]: Expand OsmoGGSN manual In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) There's no need to wait until vty reference is merged - we can merge this already and follow up with more fixes later on. https://gerrit.osmocom.org/#/c/4011/1/OsmoGGSN/chapters/configuration.adoc File OsmoGGSN/chapters/configuration.adoc: Line 69: _OsmoGGSN VTY reference manual_ FIXME. > could add OsmoGGSN to /common/chapters/bibliography.adoc mainly by copy-pas That's not user manual, that's vty reference. We can add it in a separate commit. -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 22 16:19:14 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 22 Sep 2017 16:19:14 +0000 Subject: [PATCH] osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4001 to look at the new patch set (#3). debian: tweak .install: less wildcards Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 --- M debian/libosmo-legacy-mgcp-dev.install M debian/libosmo-legacy-mgcp0.install M debian/libosmo-mgcp-client0.install 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/01/4001/3 diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install index 4184fef..a57cb50 100644 --- a/debian/libosmo-legacy-mgcp-dev.install +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -1,4 +1,4 @@ usr/include/osmocom/legacy_mgcp -usr/lib/*/*legacy-mgcp*.so -usr/lib/*/*legacy-mgcp*.a -usr/lib/*/pkgconfig/*legacy-mgcp*.pc +usr/lib/*/libosmo-legacy-mgcp.so +usr/lib/*/libosmo-legacy-mgcp.a +usr/lib/*/pkgconfig/libosmo-legacy-mgcp.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install index a47cc34..90ca89d 100644 --- a/debian/libosmo-legacy-mgcp0.install +++ b/debian/libosmo-legacy-mgcp0.install @@ -1 +1 @@ -usr/lib/*/*legacy-mgcp*.so.* +usr/lib/*/libosmo-legacy-mgcp.so.* diff --git a/debian/libosmo-mgcp-client0.install b/debian/libosmo-mgcp-client0.install index 4fc8bc6..7e86498 100644 --- a/debian/libosmo-mgcp-client0.install +++ b/debian/libosmo-mgcp-client0.install @@ -1 +1 @@ -usr/lib/*/*mgcp-client*.so.* +usr/lib/*/libosmo-mgcp-client.so.* -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Sep 22 16:23:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 22 Sep 2017 16:23:47 +0000 Subject: [PATCH] libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3973 to look at the new patch set (#4). Remove bogus error message * mark 'release' target as virtual (not tied to a presence of a certain file) * silence bumpversion test warning outside of release target Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Related: OS#1861 --- M osmo-release.mk 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/3973/4 diff --git a/osmo-release.mk b/osmo-release.mk index 40eb121..ef86e18 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -2,12 +2,14 @@ REL := patch endif -BUMPVER := $(shell bumpversion) -NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +BUMPVER := $(shell which bumpversion 2>/dev/null) +NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty 2>/dev/null | awk -F '=' '{ print $$2 }') LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) ISODATE := $(shell date -I) +.PHONY: release + release: ifeq ($(BUMPVER),) -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 22 16:36:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 22 Sep 2017 16:36:05 +0000 Subject: libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Patch Set 4: > Is it somehow possible to only ever call this after we actually invoked the 'make release'? Not that I know of unfortunately. Patches/ideas are welcome. > if bumpversion had any error messages we need to see to know what went wrong No, we only need to see it if it's relevant - if the 'make release' was called explicitly. > we would now silence those No, the issue with bumpversion will be caught by the check below. > we could also do something like Yes, but why? There're bunch of ways to hide unwanted output, I don't see a point in using anything more complex than redirection to /dev/null. -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 22 19:53:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 22 Sep 2017 19:53:36 +0000 Subject: osmo-gsm-manuals[master]: Expand OsmoGGSN manual In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4011/1/OsmoGGSN/chapters/configuration.adoc File OsmoGGSN/chapters/configuration.adoc: Line 69: _OsmoGGSN VTY reference manual_ FIXME. > That's not user manual, that's vty reference. We can add it in a separate c ok sure, either way you can add the references already now, whether the vty/other manuals are present or not, and don't need to leave FIXMEs behind that we will forget. It may be a dead link at first, better than a fixme any day -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 22 23:40:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 22 Sep 2017 23:40:55 +0000 Subject: libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 ok, scrap my comment about keeping the old ID numbers. -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 22 23:46:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 22 Sep 2017 23:46:56 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4010/1/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: Line 27: //#include why the commented out #include? -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 22 23:48:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 22 Sep 2017 23:48:56 +0000 Subject: osmo-gsm-manuals[master]: Expand OsmoGGSN manual In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 neels' comments make sense, otherwise ok! -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 22 23:52:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 22 Sep 2017 23:52:04 +0000 Subject: osmo-gsm-manuals[master]: fix various grammar and typos in: preface, cell-broadcast In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c61ad0e824b0d62bb9332f2208b247d3852dbb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 22 23:53:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 22 Sep 2017 23:53:57 +0000 Subject: osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4012/1/OsmoMSC/chapters/mncc.adoc File OsmoMSC/chapters/mncc.adoc: Line 1: [[mncc]] Is MNCC in OsmoMSC any different from OsmoNITB? If not, this chapter should probably be in common/chapters/mncc.adoc and referenced from both manuals? -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 23 04:03:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 04:03:42 +0000 Subject: osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Patch Set 3: > is that good reasoning? excellent, thanks -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 04:57:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 04:57:38 +0000 Subject: openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4008/1/openbsc/src/libbsc/bsc_vty.c File openbsc/src/libbsc/bsc_vty.c: Line 315: vty_out(vty, " since %s", ctime(&(bts->uptime))); migt make sense to also add the number of secconds since when it is up, and expose this number of seconds via CTRl. If you chose to export the absolute timestamp, that would fail to work in case the date/time on the BSC host and on the CTRL user is not the same. -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 23 04:57:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 04:57:44 +0000 Subject: osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:05:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:05:23 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 I'm all for moving this ahead, leaving it up to Neels to decide when this is +2 and should be merged -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 7 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:15:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:15:08 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 1: Please kindly provide a more verbose commit log message. I'm not asking for a lot, just very briefly: * where (in which messages) are the bits wrong * why are they wrong so far Also, this commit depends on a new function in libosmocore, so the commit log must reference that it depends on that new function, and its related Change-Id. Thanks! -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:20:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:20:33 +0000 Subject: libosmocore[master]: bitvec: implement write L or H value to vector In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3990/2/src/bitvec.c File src/bitvec.c: Line 513: int bitvec_write_field_lh(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len) So this function takes an unsigned int and converts it to L/H values which are then appended to the bitvector. We already have bitvec_set_bit() which can accept a single 0/1/L/H value, and we have bitvec_set_bits() accepts multiple consecutive 0/1/L/H values. I'm not quite sure if it makes sense to add this function, unless we often have integer numbers that must be expressed as L/H values. The two callers in the IA rest octets don't convince me, as the spec states HH, and not '3'. Us mentally converting HH to '3' and then adding a function to convert back doesn't seem very straight-forward and easy to understand, sorry. -- To view, visit https://gerrit.osmocom.org/3990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36a76916a5986f098b6be6b5b779639c470725ef Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:22:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:22:45 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/3991/1/src/encoding.cpp File src/encoding.cpp: Line 118 bitvec_set_bit(dest, H); would be more readable, don't you agree? Line 88: bitvec_write_field_lh(dest, &wp, 3, 2); // "HH" I would suggest to either use two successive "bitvec_set_bit(dest, H);" lines or to use something like enum bit_value hh[] = { H, H }; bitvec_set_bits(dest, hh, ARRAY_SIZE(hh)); this avoids having to introduce a new API function to libosmocore (and related dependency on latest version of it) and is much more readable, IMHO. Otherwise, great catch, thanks for the patch! -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:23:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:23:26 +0000 Subject: osmo-bts[master]: vty: mgr: sysmobts, lc15: install default commands for ACT_N... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia1b3d5e010c5b6ea8e655b79d9b36b08cd1ef4c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:23:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:23:42 +0000 Subject: [MERGED] osmo-bts[master]: vty: mgr: sysmobts, lc15: install default commands for ACT_N... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE ...................................................................... vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE Change-Id: Ia1b3d5e010c5b6ea8e655b79d9b36b08cd1ef4c4 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index e7e33e5..189a7e2 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -1056,6 +1056,7 @@ install_node(&act_norm_node, config_write_dummy); install_element(MGR_NODE, &cfg_action_normal_cmd); register_normal_action(ACT_NORM_NODE); + vty_install_default(ACT_NORM_NODE); /* install the warning and critical node */ install_node(&act_warn_node, config_write_dummy); diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c index b49f282..cba4fbb 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c @@ -507,6 +507,7 @@ install_node(&act_norm_node, config_write_dummy); install_element(MGR_NODE, &cfg_action_normal_cmd); register_normal_action(ACT_NORM_NODE); + vty_install_default(ACT_NORM_NODE); /* install the warning and critical node */ install_node(&act_warn_node, config_write_dummy); -- To view, visit https://gerrit.osmocom.org/3987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia1b3d5e010c5b6ea8e655b79d9b36b08cd1ef4c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:29:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:29:42 +0000 Subject: osmo-sgsn[master]: gbproxy: check peer allocation result In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3977/1/src/gprs/gb_proxy.c File src/gprs/gb_proxy.c: Line 1023: if (!from_peer) { our general policy is to not try to intelligently recover from memory allocation failures. As gbproxy_peer_alloc() only fails on memory allocation failure and for no other cause, a simple OSMO_ASSERT() here should be sufficient. -- To view, visit https://gerrit.osmocom.org/3977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:31:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:31:21 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:31:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:31:40 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 1: +2 despite I'm somewhat worried of any possible fall-out -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:33:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:33:17 +0000 Subject: osmo-ggsn[master]: Move PDP logging macro to header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3961/1/gtp/pdp.h File gtp/pdp.h: Line 19: LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) The idea seems fine, but you cannot assume that all users of this macro will have a "DGGSN" log level. Not everyone is a GGSN... -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 23 05:36:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 05:36:25 +0000 Subject: osmo-bsc[master]: Wrap channel state assignment in macro In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 The best way forward would of course to move to osmo_fsm which would then add this functionality implicitly, as well as other goodies such as state introspection via CTRL/VTY. But I know, we all have limited time and other tasks :/ -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 06:05:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 06:05:22 +0000 Subject: libosmo-sccp[master]: simple client: prevent overwriting asp settings In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3948/1/src/sccp_user.c File src/sccp_user.c: Line 418: * the default asp name. */ > thinking ... if I've added an ASP for a *different* AS but stupidly enough I'm not quie sure if I'm following. Howe can we "steal" it? As per SIGTRAN architecture, an ASP can be part of multiple AS, there is no master/child relationship. Each AS reachable via an ASP uses a different routing context/routing key (I guess that's the reason they exist). -- To view, visit https://gerrit.osmocom.org/3948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53d73059f804c3bbea6cb43dc73ad49a753b3b15 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 23 06:05:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 06:05:38 +0000 Subject: osmo-sip-connector[master]: vty: install default commands for SIP, MNCC, APP_NODE In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee51881cc07d56209647fb4f505f8f6be6b885f0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 06:05:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 23 Sep 2017 06:05:45 +0000 Subject: [MERGED] osmo-sip-connector[master]: vty: install default commands for SIP, MNCC, APP_NODE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: install default commands for SIP,MNCC,APP_NODE ...................................................................... vty: install default commands for SIP,MNCC,APP_NODE Change-Id: Iee51881cc07d56209647fb4f505f8f6be6b885f0 --- M src/vty.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty.c b/src/vty.c index f3d9467..83e250d 100644 --- a/src/vty.c +++ b/src/vty.c @@ -300,15 +300,18 @@ install_element(CONFIG_NODE, &cfg_sip_cmd); install_node(&sip_node, config_write_sip); + vty_install_default(SIP_NODE); install_element(SIP_NODE, &cfg_sip_local_addr_cmd); install_element(SIP_NODE, &cfg_sip_remote_addr_cmd); install_element(CONFIG_NODE, &cfg_mncc_cmd); install_node(&mncc_node, config_write_mncc); + vty_install_default(MNCC_NODE); install_element(MNCC_NODE, &cfg_mncc_path_cmd); install_element(CONFIG_NODE, &cfg_app_cmd); install_node(&app_node, config_write_app); + vty_install_default(APP_NODE); install_element(APP_NODE, &cfg_use_imsi_cmd); install_element(APP_NODE, &cfg_no_use_imsi_cmd); -- To view, visit https://gerrit.osmocom.org/3988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee51881cc07d56209647fb4f505f8f6be6b885f0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 23 10:13:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 10:13:57 +0000 Subject: [MERGED] osmo-bsc[master]: Wrap channel state assignment in macro In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Wrap channel state assignment in macro ...................................................................... Wrap channel state assignment in macro Previously we've used function so debug print always pointed to the same place which is not very useful. Wrap it with macro so proper file:line is printed. Also, make sure that we always change state only through this wrapper and log only when the state has changed. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 --- M include/osmocom/bsc/abis_rsl.h M src/libbsc/abis_rsl.c M src/libbsc/chan_alloc.c 3 files changed, 10 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h index f983fce..c092723 100644 --- a/include/osmocom/bsc/abis_rsl.h +++ b/include/osmocom/bsc/abis_rsl.h @@ -34,6 +34,9 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) +#define rsl_lchan_set_state(lch_, st_) \ + rsl_lchan_set_state_with_log(lch_, st_, __BASE_FILE__, __LINE__) + int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); @@ -74,7 +77,7 @@ int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, enum rsl_rel_mode release_mode); -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); +int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, enum gsm_lchan_state state, const char *file, unsigned line); int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); /* to be provided by external code */ diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 09fb14b..9968602 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1225,11 +1225,12 @@ return 0; } -int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) +int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, enum gsm_lchan_state state, const char *file, unsigned line) { - DEBUGP(DRSL, "%s state %s -> %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), - gsm_lchans_name(state)); + if (lchan->state != state) + LOGPSRC(DRSL, LOGL_DEBUG, file, line, "%s state %s -> %s\n", + gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), gsm_lchans_name(state)); + lchan->state = state; return 0; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 679ad42..f0275bc 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -448,7 +448,7 @@ osmo_timer_del(&lchan->error_timer); lchan->type = GSM_LCHAN_NONE; - lchan->state = LCHAN_S_NONE; + rsl_lchan_set_state(lchan, LCHAN_S_NONE); if (lchan->abis_ip.rtp_socket) { rtp_socket_free(lchan->abis_ip.rtp_socket); -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 23 10:15:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 10:15:17 +0000 Subject: osmo-bsc[master]: Wrap channel state assignment in macro In-Reply-To: References: Message-ID: Patch Set 7: > The best way forward would of course to move to osmo_fsm Would be nice indeed. Is there some spec. which describes related FSMs explicitly or it's smth implementation-specific? -- To view, visit https://gerrit.osmocom.org/3828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 11:46:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 11:46:48 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Expand OsmoGGSN manual In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4011 to look at the new patch set (#2). Expand OsmoGGSN manual * add cross-references * add example of running without root priviledges Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 --- M OsmoGGSN/chapters/configuration.adoc M common/chapters/bibliography.adoc 2 files changed, 55 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/11/4011/2 diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc index e37b709..9e07fb6 100644 --- a/OsmoGGSN/chapters/configuration.adoc +++ b/OsmoGGSN/chapters/configuration.adoc @@ -1,7 +1,7 @@ == Configuring OsmoGGSN All configuration of OsmoGGSN is performed using the VTY. For more -general information on the VTY interface, see FIXME. +general information on the VTY interface, see <>. === Configuring a virtual GGSN instance @@ -49,7 +49,7 @@ configure the properties of this GGSN instance. NOTE:: After creating a new GGSN instance, it is in `shutdown` mode. See -FIXME to take it out of shutdown, but make sure to configure it fully +<> to take it out of shutdown, but make sure to configure it fully before taking it out of shutdown. ==== Configuring a GGSN instance @@ -66,7 +66,7 @@ There are some further configuration statements that can be used at the GGSN node, some examples are given below. For a full list, see the -OpenGGSN VTY reference manual (FIXME). +_OsmoGGSN VTY reference manual_ <>. ---- OsmoGGSN(config-ggsn)# default-apn foobar <1> @@ -152,7 +152,7 @@ <5> Your prompt is now in the `ggsn` config node, where you can configure the properties of this GGSN instance. -NOTE:: The newly-create APN is created in `shutdown` mode. See FIXME to take it +NOTE:: The newly-create APN is created in `shutdown` mode. See <> to take it out of shutdown. @@ -178,7 +178,7 @@ NOTE:: If you use the optional `ip ifconfig` command to set the network device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` support. It might be better to configure related tun devices at system -startup and run OsmoGGSN as non-privileged user. See FIXME for more +startup and run OsmoGGSN as non-privileged user. See <> for more details. @@ -198,7 +198,7 @@ <3> Enter the config node of the GGSN instance `ggsn0` <4> Delete the APN `internet` - +[[unshutdown_apn]] ==== Taking an APN out of shutdown In order to bring a deactived APN in `shutdown` state into active @@ -241,3 +241,48 @@ <4> Enter the config ndoe of the APN `internet` <5> Shut down the APN +[[ggsn_no_root]] +=== Configuring for running without root priveleges + +It's possible to run OsmoGGSN without root privileges if the tun devices are already configured. + +.Example: device config via systemd-networkd using ggsn.netdev +---- +[NetDev] +Name=ggsn +Kind=tun + +[Tun] +User=username +Group=username +---- + +.Example: network settings via systemd-networkd using ggsn.network +---- +[Match] +Name=ggsn + +[Network] +Address=192.168.7.1 +IPMasquerade=yes +---- + +The pair of the configuration files above allows you to create and configure tun device which can be +used by OsmoGGSN as follows. + +.Example: using externally configured tun device as non-root +---- +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device ggsn + type-support v4 + ip prefix dynamic 192.168.7.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + no shutdown + default-apn internet + no shutdown ggsn +---- diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index a3c6436..9d4c234 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -26,8 +26,10 @@ http://ftp.osmocom.org/docs/latest/osmosgsn-usermanual.pdf - [[[vty-ref-osmosgsn]]] Osmocom Project: OsmoSGSN VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmonitb-vty-reference.pdf -//- [[[userman-openggsn]]] Osmocom Project: OpenGGSN User Manual. - +- [[[userman-osmoggsn]]] Osmocom Project: OpenGGSN User Manual. + http://ftp.osmocom.org/docs/latest/osmoggsn-usermanual.pdf +- [[[vty-ref-osmoggsn]]] Osmocom Project: OsmoGGSN VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmoggsn-vty-reference.pdf - [[[3gpp-ts-23-048]]] 3GPP TS 23.048: Security mechanisms for the (U)SIM application toolkit; Stage 2 http://www.3gpp.org/DynaReport/23048.htm -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 23 11:54:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 11:54:12 +0000 Subject: [PATCH] osmo-ggsn[master]: Move extended PDP logging macro to header In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3961 to look at the new patch set (#2). Move extended PDP logging macro to header It might be useful for any user of libgtp who uses libosmocore so let's make generalized version of it available as part of installable header. Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Related: SYS#3610 --- M TODO-RELEASE M ggsn/ggsn.c M gtp/pdp.h 3 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/3961/2 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..5317459 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libgtp API change add LOGPDPX() helper to public API. diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 46850a6..95f68c9 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -83,8 +83,7 @@ #define LOGPGGSN(level, ggsn, fmt, args...) \ LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) -#define LOGPPDP(level, pdp, fmt, args...) \ - LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) +#define LOGPPDP(level, pdp, fmt, args...) LOGPPDPX(DGGSN, pdp, fmt, ## args) static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); diff --git a/gtp/pdp.h b/gtp/pdp.h index cb98920..0594087 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -15,6 +15,9 @@ struct gsn_t; +#define LOGPPDPX(ss, level, pdp, fmt, args...) \ + LOGP(ss, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 23 11:58:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 11:58:22 +0000 Subject: [PATCH] osmo-sgsn[master]: gbproxy: ensure peer allocation result In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3977 to look at the new patch set (#2). gbproxy: ensure peer allocation result gbproxy_peer_alloc() could return NULL which wasn't checked and used right away. Fix it by making this assumption explicit with OSMO_ASSERT(); While at it, also format log messages consistently. Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 --- M src/gprs/gb_proxy.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/77/3977/2 diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index eb2bbcc..17a0109 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1018,9 +1018,9 @@ if (!from_peer) { /* if a PTP-BVC is reset, and we don't know that * PTP-BVCI yet, we should allocate a new peer */ - LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for " - "BVCI=%u via NSEI=%u\n", bvci, nsei); + LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for BVCI=%u via NSEI=%u\n", bvci, nsei); from_peer = gbproxy_peer_alloc(cfg, bvci); + OSMO_ASSERT(from_peer); from_peer->nsei = nsei; } -- To view, visit https://gerrit.osmocom.org/3977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 23 12:06:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 12:06:36 +0000 Subject: [PATCH] osmo-ggsn[master]: Move extended PDP logging macro to header In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3961 to look at the new patch set (#3). Move extended PDP logging macro to header It might be useful for any user of libgtp who uses libosmocore so let's make generalized version of it available as part of installable header. Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Related: SYS#3610 --- M TODO-RELEASE M ggsn/ggsn.c M gtp/pdp.h 3 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/3961/3 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..5317459 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libgtp API change add LOGPDPX() helper to public API. diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 46850a6..db8b241 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -83,8 +83,7 @@ #define LOGPGGSN(level, ggsn, fmt, args...) \ LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) -#define LOGPPDP(level, pdp, fmt, args...) \ - LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) +#define LOGPPDP(level, pdp, fmt, args...) LOGPDPX(DGGSN, level, pdp, fmt, ## args) static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); diff --git a/gtp/pdp.h b/gtp/pdp.h index cb98920..65a95ef 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -15,6 +15,9 @@ struct gsn_t; +#define LOGPDPX(ss, level, pdp, fmt, args...) \ + LOGP(ss, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 23 12:25:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 23 Sep 2017 12:25:00 +0000 Subject: [MERGED] libosmocore[master]: vty: derive node name from prompt, use as XML ids In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: derive node name from prompt, use as XML ids ...................................................................... vty: derive node name from prompt, use as XML ids The 'show online-help' produces XML output with ids. We reference those from the osmo-gsm-manuals. Instead of numeric IDs coming from internal code, rather use a human-readable node ID -- referencing id='config-msc' is much easier than referencing id='23'. Add a char name[] to struct cmd_node, to hold this name. This may be provided upon struct definition. Since callers of the VTY API so far don't have a name yet, we would need to add names everywhere to get meaningful node IDs. There is a way to get node ID names without touching dependent code: My first idea was to find out which command entered the node, i.e. command 'msc' enters the MSC_NODE. But it is impossible to derive which command entered which node from data structs, it's hidden in the vty command definition. But in fact all (TM) known API callers indeed provide a prompt string that contains a logical and human readable string name. Thus, if the name is unset in the struct, parse the prompt string and strip all "weird" characters to obtain a node name from that. We can still set names later on, but for now will have meaningful node IDs (e.g. 'config-msc' from '%s(config-msc)# ') without touching any dependent code. When VTY nodes get identical node names, which is quite possible, the XML export de-dups these by appending _2, _3,... suffixes. The first occurence is called e.g. 'name', the second 'name_2', then 'name_3', and so forth. If a node has no name (even after parsing the prompt), it will be named merely by the suffix. The first empty node will become id='_1', then '_2', '_3', and so forth. This happens for nodes like VIEW_NODE or AUTH_NODE. If this is merged, we need to adjust the references in osmo-gsm-manuals.git. This can happen in our own time though, because we manually create the vty reference xml and copy it to the osmo-gsm-manuals.git and then update the references from the vty_additions.xml. This anyway has to happen because currently the references tend to be hopelessly out of sync anyway, placing comments at wildly unrelated VTY commands. Change-Id: I8fa555570268b231c5e01727c661da92fad265de --- M include/osmocom/vty/command.h M src/vty/command.c 2 files changed, 51 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index cb2edaa..58f248f 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -123,6 +123,11 @@ /*! Vector of this node's command list. */ vector cmd_vector; + + /*! Human-readable ID of this node. Should only contain alphanumeric + * plus '-' and '_' characters (is used as XML ID for 'show + * online-help'). If left NUL, this is derived from the prompt.*/ + char name[64]; }; enum { diff --git a/src/vty/command.c b/src/vty/command.c index af936ee..8ad2e97 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -123,12 +123,40 @@ return str; } +/* Strip all characters from a string (prompt) except for alnum, '-' and '_'. + * For example used to derive a node->name from node->prompt if the user didn't provide a name; + * in turn, this name us used for XML IDs in 'show online-help'. */ +static const char *node_name_from_prompt(const char *prompt, char *name_buf, size_t name_buf_size) +{ + const char *pos; + int dest = 0; + + if (!prompt || !*prompt) + return ""; + + for (pos = prompt; *pos && dest < (name_buf_size-1); pos++) { + if (pos[0] == '%' && pos[1]) { + /* skip "%s"; loop pos++ does the second one. */ + pos++; + continue; + } + if (!(isalnum(pos[0]) || pos[0] == '-' || pos[0] == '_')) + continue; + name_buf[dest] = pos[0]; + dest++; + } + name_buf[dest] = '\0'; + return name_buf; +} + /*! Install top node of command vector. */ void install_node(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); + if (!*node->name) + node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); } /* Compare two command's string. Used in sort_node (). */ @@ -608,6 +636,7 @@ static int vty_dump_nodes(struct vty *vty) { int i, j; + int same_name_count; vty_out(vty, "%s", VTY_NEWLINE); @@ -617,7 +646,23 @@ if (!cnode) continue; - vty_out(vty, " %s", cnode->node, VTY_NEWLINE); + /* De-dup node IDs: how many times has this same name been used before? Count the first + * occurence as _1 and omit that first suffix, so that the first occurence is called + * 'name', the second becomes 'name_2', then 'name_3', ... */ + same_name_count = 1; + for (j = 0; j < i; ++j) { + struct cmd_node *cnode2; + cnode2 = vector_slot(cmdvec, j); + if (!cnode2) + continue; + if (strcmp(cnode->name, cnode2->name) == 0) + same_name_count ++; + } + + vty_out(vty, " %s", VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- To view, visit https://gerrit.osmocom.org/3979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8fa555570268b231c5e01727c661da92fad265de Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 23 12:25:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 23 Sep 2017 12:25:01 +0000 Subject: [MERGED] libosmocore[master]: vty: use internal node id for xml ids In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: use internal node id for xml ids ...................................................................... vty: use internal node id for xml ids The 'show online-help' produces XML output with ids. We reference those from the osmo-gsm-manuals, but until now, these ids fall out of sync when the amount of VTY nodes changes. Change these ids to use the internal node ID constant (as in enum bsc_vty_node) instead of a simple counter. If this is merged, we need to adjust the references in osmo-gsm-manuals.git. Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 --- M src/vty/command.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/vty/command.c b/src/vty/command.c index a19d5db..af936ee 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -617,7 +617,7 @@ if (!cnode) continue; - vty_out(vty, " %s", i, VTY_NEWLINE); + vty_out(vty, " %s", cnode->node, VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- To view, visit https://gerrit.osmocom.org/3978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib07fb9d9106e19f5be6539493e82b5d5991f8bc2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Sep 23 12:32:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 12:32:10 +0000 Subject: [PATCH] osmo-bsc[master]: Further cleanup leftovers from BSC/MSC split Message-ID: Review at https://gerrit.osmocom.org/4014 Further cleanup leftovers from BSC/MSC split * drop unused header * fix name of jenkins test * remove dead code Change-Id: I986904864741995910b6ba92173b9f7b1b03e2f1 --- M contrib/jenkins.sh M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h D include/osmocom/bsc/osmo_msc.h M src/libbsc/bsc_init.c M tests/gsm0408/gsm0408_test.c 6 files changed, 1 insertion(+), 131 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/4014/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2685d04..eb302d1 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -33,7 +33,7 @@ echo echo echo -echo " =============================== osmo-msc ===============================" +echo " =============================== osmo-bsc ===============================" echo set -x diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 3b8dbdf..8ad2b5d 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -42,7 +42,6 @@ osmo_bsc.h \ osmo_bsc_grace.h \ osmo_bsc_rf.h \ - osmo_msc.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ osmux.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d7f7667..4e56db5 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -670,7 +670,6 @@ /* control interface handling */ int bsc_base_ctrl_cmds_install(void); -int msc_ctrl_cmds_install(struct gsm_network *net); /* dependency handling */ void bts_depend_mark(struct gsm_bts *bts, int dep); diff --git a/include/osmocom/bsc/osmo_msc.h b/include/osmocom/bsc/osmo_msc.h deleted file mode 100644 index c08cb26..0000000 --- a/include/osmocom/bsc/osmo_msc.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Routines for the MSC handling */ - -#ifndef OSMO_MSC_H -#define OSMO_MSC_H - -#include -#include - -#include - -#include "bsc_api.h" - -#define MSC_HLR_REMOTE_IP_DEFAULT "127.0.0.1" -#define MSC_HLR_REMOTE_PORT_DEFAULT OSMO_GSUP_PORT - -enum subscr_conn_fsm_event { - /* Mark 0 as invalid to catch uninitialized vars */ - SUBSCR_CONN_E_INVALID = 0, - /* Timeout on connection establishment starts */ - SUBSCR_CONN_E_START, - /* LU or Process Access FSM has determined that this conn is good */ - SUBSCR_CONN_E_ACCEPTED, - /* received first reply from MS in "real" CC, SMS, USSD communication */ - SUBSCR_CONN_E_COMMUNICATING, - /* Some async action has completed, check again whether all is done */ - SUBSCR_CONN_E_BUMP, - /* MS/BTS/BSC originated close request */ - SUBSCR_CONN_E_MO_CLOSE, - /* MSC originated close request, e.g. failed authentication */ - SUBSCR_CONN_E_CN_CLOSE, -}; - -enum subscr_conn_fsm_state { - SUBSCR_CONN_S_INIT, - SUBSCR_CONN_S_NEW, - SUBSCR_CONN_S_ACCEPTED, - SUBSCR_CONN_S_COMMUNICATING, - SUBSCR_CONN_S_RELEASED, -}; - -enum subscr_conn_from { - SUBSCR_CONN_FROM_INVALID, - SUBSCR_CONN_FROM_LU, - SUBSCR_CONN_FROM_CM_SERVICE_REQ, - SUBSCR_CONN_FROM_PAGING_RESP, -}; - -extern const struct value_string subscr_conn_from_names[]; -static inline const char *subscr_conn_from_name(enum subscr_conn_from val) -{ - return get_value_string(subscr_conn_from_names, val); -} - -enum msc_compl_l3_rc { - MSC_CONN_ACCEPT = 0, - MSC_CONN_REJECT = 1, -}; - -struct bsc_api *msc_bsc_api(); - -int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id); - -int msc_vlr_alloc(struct gsm_network *net); -int msc_vlr_start(struct gsm_network *net); - -void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci); -int msc_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause); -int msc_compl_l3(struct gsm_subscriber_connection *conn, - struct msgb *msg, uint16_t chosen_channel); -void msc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, - struct msgb *msg); -void msc_cipher_mode_compl(struct gsm_subscriber_connection *conn, - struct msgb *msg, uint8_t alg_id); -void msc_rx_sec_mode_compl(struct gsm_subscriber_connection *conn); -void msc_classmark_chg(struct gsm_subscriber_connection *conn, - const uint8_t *cm2, uint8_t cm2_len, - const uint8_t *cm3, uint8_t cm3_len); -void msc_assign_fail(struct gsm_subscriber_connection *conn, - uint8_t cause, uint8_t *rr_cause); - -void msc_subscr_conn_init(void); -bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn); -void msc_subscr_conn_communicating(struct gsm_subscriber_connection *conn); -void msc_subscr_conn_close(struct gsm_subscriber_connection *conn, - uint32_t cause); - -#define msc_subscr_conn_get(conn) \ - _msc_subscr_conn_get(conn, __BASE_FILE__, __LINE__) -#define msc_subscr_conn_put(conn) \ - _msc_subscr_conn_put(conn, __BASE_FILE__, __LINE__) -struct gsm_subscriber_connection * -_msc_subscr_conn_get(struct gsm_subscriber_connection *conn, - const char *file, int line); -void _msc_subscr_conn_put(struct gsm_subscriber_connection *conn, - const char *file, int line); - -void msc_stop_paging(struct vlr_subscr *vsub); - -#endif diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 5b6530d..f3e13e2 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -37,7 +37,6 @@ #include #include #include -#include #include /* global pointer to the gsm network data structure */ diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 974ebe5..d5a5363 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -647,31 +647,6 @@ VERIFY(f0, ==, 1); } -#ifdef BEFORE_MSCSPLIT -static void test_gsm411_rp_ref_wrap(void) -{ - struct gsm_subscriber_connection conn; - int res; - - printf("testing RP-Reference wrap\n"); - - memset(&conn, 0, sizeof(conn)); - conn.next_rp_ref = 255; - - res = sms_next_rp_msg_ref(&conn.next_rp_ref); - printf("Allocated reference: %d\n", res); - OSMO_ASSERT(res == 255); - - res = sms_next_rp_msg_ref(&conn.next_rp_ref); - printf("Allocated reference: %d\n", res); - OSMO_ASSERT(res == 0); - - res = sms_next_rp_msg_ref(&conn.next_rp_ref); - printf("Allocated reference: %d\n", res); - OSMO_ASSERT(res == 1); -} -#endif - int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -684,9 +659,6 @@ test_arfcn_filter(); test_print_encoding(); test_range_encoding(); -#ifdef BEFORE_MSCSPLIT - test_gsm411_rp_ref_wrap(); -#endif test_si2q_segfault(); test_si2q_e(); -- To view, visit https://gerrit.osmocom.org/4014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I986904864741995910b6ba92173b9f7b1b03e2f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sat Sep 23 12:45:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 12:45:52 +0000 Subject: [PATCH] osmo-bsc[master]: CTRL: cleanup write-only command functions Message-ID: Review at https://gerrit.osmocom.org/4015 CTRL: cleanup write-only command functions Remove trivial functions by using more specific defines for CTRL commands. Change-Id: I10d6d18663aed87324d60472a0fc3bd1d0961dea --- M src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 3 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/15/4015/1 diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 2446312..6330892 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -466,13 +466,7 @@ return 1; } -CTRL_CMD_DEFINE(net_notification, "notification"); -static int get_net_notification(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_notification, "notification"); static int set_net_notification(struct ctrl_cmd *cmd, void *data) { struct ctrl_cmd *trap; @@ -502,18 +496,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_notification(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_inform_msc, "inform-msc-v1"); -static int get_net_inform_msc(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_inform_msc, "inform-msc-v1"); static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data) { struct gsm_network *net; @@ -540,18 +523,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_inform_msc(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_ussd_notify, "ussd-notify-v1"); -static int get_net_ussd_notify(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO(net_ussd_notify, "ussd-notify-v1"); static int set_net_ussd_notify(struct ctrl_cmd *cmd, void *data) { struct gsm_subscriber_connection *conn; -- To view, visit https://gerrit.osmocom.org/4015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10d6d18663aed87324d60472a0fc3bd1d0961dea Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sat Sep 23 12:53:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 12:53:48 +0000 Subject: [PATCH] openbsc[master]: CTRL: cleanup write-only command functions Message-ID: Review at https://gerrit.osmocom.org/4016 CTRL: cleanup write-only command functions Remove trivial functions by using more specific defines for CTRL commands. Change-Id: I719b75b6ca1e9372ea11e7e9ff7896021f357035 --- M openbsc/src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 3 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/16/4016/1 diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index c23ed21..423ed34 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -466,13 +466,7 @@ return 1; } -CTRL_CMD_DEFINE(net_notification, "notification"); -static int get_net_notification(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_notification, "notification"); static int set_net_notification(struct ctrl_cmd *cmd, void *data) { struct ctrl_cmd *trap; @@ -502,18 +496,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_notification(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_inform_msc, "inform-msc-v1"); -static int get_net_inform_msc(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_inform_msc, "inform-msc-v1"); static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data) { struct gsm_network *net; @@ -540,18 +523,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_inform_msc(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_ussd_notify, "ussd-notify-v1"); -static int get_net_ussd_notify(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO(net_ussd_notify, "ussd-notify-v1"); static int set_net_ussd_notify(struct ctrl_cmd *cmd, void *data) { struct gsm_subscriber_connection *conn; -- To view, visit https://gerrit.osmocom.org/4016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I719b75b6ca1e9372ea11e7e9ff7896021f357035 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sat Sep 23 13:55:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 13:55:23 +0000 Subject: [PATCH] openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4008 to look at the new patch set (#2). Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts.c M openbsc/src/libbsc/e1_config.c 4 files changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/08/4008/2 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 6b2269e..c19b125 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -715,6 +715,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index c6ff6d5..1fff0d3 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -237,6 +238,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -307,8 +309,19 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + sec = (unsigned long long)difftime(time(NULL), bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec. since %s", + (sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24), + (sec % (60 * 60 * 24)) / (60 * 60), + (sec % (60 * 60)) / 60, sec % 60, ctime(&(bts->uptime))); + } + vty_out(vty, "%s", VTY_NEWLINE); + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..c446ef9 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -423,6 +425,7 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + bts->uptime = time(NULL); break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/openbsc/src/libbsc/e1_config.c b/openbsc/src/libbsc/e1_config.c index d57dec5..a58dc3c 100644 --- a/openbsc/src/libbsc/e1_config.c +++ b/openbsc/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -201,6 +201,7 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + bts->uptime = time(NULL); llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 23 13:55:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 13:55:27 +0000 Subject: [PATCH] osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4009 to look at the new patch set (#2). Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/bsc_vty.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/e1_config.c 4 files changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4009/2 diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 6ce571e..f41bac4 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -722,6 +722,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3a80f06..7f230bd 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -234,6 +235,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -304,8 +306,19 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + sec = (unsigned long long)difftime(time(NULL), bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec. since %s", + (sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24), + (sec % (60 * 60 * 24)) / (60 * 60), + (sec % (60 * 60)) / 60, sec % 60, ctime(&(bts->uptime))); + } + vty_out(vty, "%s", VTY_NEWLINE); + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index 1f203f5..4643eac 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -423,6 +425,7 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + bts->uptime = time(NULL); break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index 1923efd..9ef195f 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -201,6 +201,7 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + bts->uptime = time(NULL); llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 23 13:57:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 23 Sep 2017 13:57:59 +0000 Subject: openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 2: I've added relative uptime to vty. As for exposing it over CTRL I think it should be part of a separate commit. -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 23 16:53:12 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 23 Sep 2017 16:53:12 +0000 Subject: [PATCH] libosmocore[master]: vty/vty.c: do not bind vty context to application's one Message-ID: Review at https://gerrit.osmocom.org/4017 vty/vty.c: do not bind vty context to application's one The 'vty_app_info' struct could be used by some applications to provide its talloc context. In the future, it will facilitate the implementation of talloc context introspection via VTY. But the 'vty' talloc context, that contains lots of items (memory chunks), is being bound to an application's one, so it becomes hard to read the last. Let's do not bind the 'vty' context automatically, until some common talloc context export policy is implemented. Change-Id: I9cb6ce9f24dbae400029e2d9f9c933fbfb16248f --- M src/vty/vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/4017/1 diff --git a/src/vty/vty.c b/src/vty/vty.c index bd0d2c3..3d9c0d6 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1773,7 +1773,7 @@ /* Install vty's own commands like `who' command. */ void vty_init(struct vty_app_info *app_info) { - tall_vty_ctx = talloc_named_const(app_info->tall_ctx, 0, "vty"); + tall_vty_ctx = talloc_named_const(NULL, 0, "vty"); tall_vty_vec_ctx = talloc_named_const(tall_vty_ctx, 0, "vty_vector"); tall_vty_cmd_ctx = talloc_named_const(tall_vty_ctx, 0, "vty_command"); -- To view, visit https://gerrit.osmocom.org/4017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9cb6ce9f24dbae400029e2d9f9c933fbfb16248f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Sep 23 16:53:18 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 23 Sep 2017 16:53:18 +0000 Subject: [PATCH] libosmocore[master]: VTY: implement talloc context introspection command Message-ID: Review at https://gerrit.osmocom.org/4018 VTY: implement talloc context introspection command This change introduces a new command, which could be used to inspect the application's talloc context directly from VTY. To enable this feature, an application need to provide it's context via the 'vty_app_info' struct, and register the VTY command by calling the osmo_talloc_vty_add_cmds(). The new command is a sub-command of 'show': show talloc-context [filter] Currently the following contexts may be inspected: - application - a context provided by an application; - null - all contexts, if NULL-context tracking is enabled. A report depth is defined by the next parameter, and could be: - full - full tree report, as the talloc_report_full() does; - brief - brief tree report, as the talloc_report() does; - DEPTH - user defined maximal report depth. Also, there are two optional report filters: - regexp - print only contexts, matching a regular expression; - tree - print a specific context, pointed by specified address. Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d --- M include/osmocom/vty/misc.h M src/vty/Makefile.am A src/vty/talloc_ctx_vty.c 3 files changed, 242 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/4018/1 diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index 545955c..335558d 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -28,6 +28,7 @@ void vty_out_fsm(struct vty *vty, struct osmo_fsm *fsm); void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi); void osmo_fsm_vty_add_cmds(void); +void osmo_talloc_vty_add_cmds(void); int osmo_vty_write_config_file(const char *filename); diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index e083a1c..1dc76c3 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -10,7 +10,8 @@ lib_LTLIBRARIES = libosmovty.la libosmovty_la_SOURCES = buffer.c command.c vty.c vector.c utils.c \ - telnet_interface.c logging_vty.c stats_vty.c fsm_vty.c + telnet_interface.c logging_vty.c stats_vty.c \ + fsm_vty.c talloc_ctx_vty.c libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined $(TALLOC_LIBS) libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la endif diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c new file mode 100644 index 0000000..6050ec3 --- /dev/null +++ b/src/vty/talloc_ctx_vty.c @@ -0,0 +1,239 @@ +/* + * Osmocom talloc context introspection via VTY + * + * (C) 2017 by Vadim Yanitskiy + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include +#include + +extern void *tall_vty_ctx; +extern struct host host; + +enum walk_filter_type { + WALK_FILTER_NONE = 0, + WALK_FILTER_REGEXP, + WALK_FILTER_TREE, +}; + +struct walk_cb_params { + enum walk_filter_type filter; + unsigned int depth_pass; + const void *chunk_ptr; + struct vty *vty; + regex_t regexp; +}; + +static void talloc_ctx_walk_cb(const void *chunk, int depth, + int max_depth, int is_ref, void *data) +{ + struct walk_cb_params *p = (struct walk_cb_params *) data; + const char *chunk_name = talloc_get_name(chunk); + struct vty *vty = p->vty; + int rc; + + if (depth > 0 && p->filter) { + if (p->depth_pass && depth > p->depth_pass) + goto filter_bypass; + else + p->depth_pass = 0; + + if (p->filter == WALK_FILTER_REGEXP) { + /* Filter chunks using a regular expression */ + rc = regexec(&p->regexp, chunk_name, 0, NULL, 0); + if (rc) + return; + } else if (p->filter == WALK_FILTER_TREE) { + /* Print a specific memory tree only */ + if (chunk != p->chunk_ptr) + return; + } + + p->depth_pass = depth; + } + +filter_bypass: + + if (is_ref) { + vty_out(vty, "%*sreference to: %s%s", + depth * 2, "", chunk_name, VTY_NEWLINE); + return; + } + + size_t chunk_blocks = talloc_total_blocks(chunk); + size_t chunk_size = talloc_total_size(chunk); + + if (depth == 0) { + vty_out(vty, "%stalloc report on '%s' " + "(total %6zu bytes in %3zu blocks)%s", + (max_depth < 0 ? "full " : ""), chunk_name, + chunk_size, chunk_blocks, VTY_NEWLINE); + return; + } + + vty_out(vty, "%*s%-30s contains %6zu bytes " + "in %3zu blocks (ref %zu) %p%s", depth * 2, "", + chunk_name, chunk_size, chunk_blocks, + talloc_reference_count(chunk), + chunk, VTY_NEWLINE); +} + +static void talloc_ctx_walk(const char *ctx, const char *depth, + struct walk_cb_params *params) +{ + const void *talloc_ctx = NULL; + int max_depth; + + /* Determine a context for report */ + if (!strncmp(ctx, "app", 3)) + talloc_ctx = host.app_info->tall_ctx; + else if (!strncmp(ctx, "all", 3)) + talloc_ctx = NULL; + + /* Determine report depth */ + if (depth[0] == 'f') + max_depth = -1; + else if (depth[0] == 'b') + max_depth = 1; + else + max_depth = atoi(depth); + + talloc_report_depth_cb(talloc_ctx, 0, max_depth, + &talloc_ctx_walk_cb, params); +} + +DEFUN(show_talloc_ctx, show_talloc_ctx_cmd, + "show talloc-context (application|all) (full|brief|DEPTH)", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value") +{ + struct walk_cb_params *params; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Set up callback parameters */ + params->filter = WALK_FILTER_NONE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_filter, show_talloc_ctx_filter_cmd, + "show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value\n" + "Filter chunks using regular expression\n" + "Regular expression") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to compile a regular expression */ + rc = regcomp(¶ms->regexp, argv[2], 0); + if (rc) { + vty_out(vty, "Invalid expression%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_REGEXP; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + regfree(¶ms->regexp); + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_tree, show_talloc_ctx_tree_cmd, + "show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value\n" + "Display only a specific memory chunk\n" + "Chunk address (e.g. 0xdeadbeef)") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to parse an address */ + rc = sscanf(argv[2], "%p", ¶ms->chunk_ptr); + if (rc != 1) { + vty_out(vty, "Invalid chunk address%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_TREE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +void osmo_talloc_vty_add_cmds(void) +{ + install_element_ve(&show_talloc_ctx_cmd); + install_element_ve(&show_talloc_ctx_tree_cmd); + install_element_ve(&show_talloc_ctx_filter_cmd); +} -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:28:08 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer su... Message-ID: Review at https://gerrit.osmocom.org/4019 sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supported It seems like modern gengetopt no longer supports 'unsigned int' argument types, and we need to use 'int' instead. tested with 2.22.6 Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e --- M sgsnemu/cmdline.ggo 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/19/4019/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index ee5e55d..6559f55 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -40,8 +40,8 @@ option "ipdown" - "Script to run after link-down" string no option "pinghost" - "Ping remote host" string no -option "pingrate" - "Number of ping req per second" unsigned int default="1" no -option "pingsize" - "Number of ping data bytes" unsigned int default="56" no -option "pingcount" - "Number of ping req to send" unsigned int default="0" no +option "pingrate" - "Number of ping req per second" int default="1" no +option "pingsize" - "Number of ping data bytes" int default="56" no +option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off -- To view, visit https://gerrit.osmocom.org/4019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:28:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:28:09 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 Message-ID: Review at https://gerrit.osmocom.org/4020 sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In commit 11a398fbc3ad9b655d8ba947bea7012f7ce81604 we introduced the --qose{1,2,3,4} command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 --- M sgsnemu/cmdline.ggo 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/20/4020/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 6559f55..41d62a3 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -28,7 +28,11 @@ option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -option "qos" q "Requested quality of service" int default="0x0b921f" no +option "qos" q "Requested quality of service" int default="0x000b921f" no +option "qose1" - "Requested quality of service Extension 1" int default="0x9396404074f9ffff" no +option "qose2" - "Requested quality of service Extension 2" int default="0x11" no +option "qose3" - "Requested quality of service Extension 3" int default="0x0101" no +option "qose4" - "Requested quality of service Extension 4" int default="0x4040" no option "charging" - "Charging characteristics" int default="0x0800" no option "uid" u "Login user ID" string default="mig" no option "pwd" p "Login password" string default="hemmelig" no -- To view, visit https://gerrit.osmocom.org/4020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:28:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:28:09 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, i... Message-ID: Review at https://gerrit.osmocom.org/4021 sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisv In commit 944dce3e66f3bc5b74f24dfbbee2370a231a39a9 we introduced various command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a --- M sgsnemu/cmdline.ggo 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/21/4021/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 41d62a3..0cf2ba2 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -25,6 +25,10 @@ option "gtpversion" - "GTP version to use" int default="1" no option "apn" a "Access point name" string default="internet" no option "selmode" - "Selection mode" int default="0x01" no +option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" +option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" +option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:28:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:28:10 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for RAI Message-ID: Review at https://gerrit.osmocom.org/4022 sgsnemu: Fix up gengetopt file for RAI In commit 41af5691ef08fb70e2c65aba03c8b9e6c20983a6 we introduced the --rai command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/22/4022/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0cf2ba2..019fc94 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -27,6 +27,7 @@ option "selmode" - "Selection mode" int default="0x01" no option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no -- To view, visit https://gerrit.osmocom.org/4022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:28:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:28:10 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for --norecovery Message-ID: Review at https://gerrit.osmocom.org/4023 sgsnemu: Fix up gengetopt file for --norecovery In commit 3a4c67b4bf0067c4949a60bc750d01e0576c5e08 we introduced the --norecovery command line option, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/23/4023/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 019fc94..2170e8b 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -30,6 +30,7 @@ option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no +option "norecovery" - "Do not send recovery" flag off option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:28:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:28:10 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Re-generate cmdline.[ch] using gengetopt Message-ID: Review at https://gerrit.osmocom.org/4024 sgsnemu: Re-generate cmdline.[ch] using gengetopt This will replace the manual additions to cmdline.[ch] with auto-generated code from gengetopt. We need to fix-up the RAT Type in sgsnemu.c as the manually-added code diverged from what gengetopt generates. Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 1,492 insertions(+), 1,473 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/24/4024/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 1ff1a59..88210d7 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -1,5 +1,5 @@ /* - File autogenerated by gengetopt version 2.17 + File autogenerated by gengetopt version 2.22.6 generated with the following command: gengetopt --conf-parser @@ -17,7 +17,11 @@ #include #include -#include "getopt.h" +#ifndef FIX_UNUSED +#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ +#endif + +#include #include "cmdline.h" @@ -26,50 +30,57 @@ const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_versiontext = ""; + +const char *gengetopt_args_info_description = ""; + const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file", - " --pidfile=STRING Filename of process id file (default=`./sgsnemu.pid')", - " --statedir=STRING Directory of nonvolatile data (default=`./')", - " --dns=STRING DNS Server to use", - " -l, --listen=STRING Local interface", - " -r, --remote=STRING Remote host", - " --contexts=INT Number of contexts (default=`1')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " --gtpversion=INT GTP version to use (default=`1')", - " -a, --apn=STRING Access point name (default=`internet')", - " --selmode=INT Selection mode (default=`0x01')", - " --rattype=INT Radio Access Technology Type (optional-1to5)", - " --userloc=STRING User Location Information (optional-type.MCC.MNC.LAC.CIorSACorRAC)", - " --rai=STRING Routing Area Information (optional-MCC.MNC.LAC.RAC)", - " --mstz=STRING MS Time Zone (optional- sign.NbQuartersOfAnHour.DSTAdjustment)", - " --imeisv=STRING IMEI(SV) International Mobile Equipment Identity (and Software Version) (optional,16 digits)", - " -i, --imsi=STRING IMSI (default=`240010123456789')", - " --nsapi=INT NSAPI (default=`0')", - " -m, --msisdn=STRING Mobile Station ISDN number (default=`46702123456')", - " -q, --qos=INT Requested quality of service (default=`0x000b921f')", - " --qose1=INT Requested quality of service Extension 1 (example=`0x9396404074f9ffff')", - " --qose2=INT Requested quality of service Extension 2 (example=`0x11')", - " --qose3=INT Requested quality of service Extension 3 (example=`0x0101')", - " --qose4=INT Requested quality of service Extension 4 (example=`0x4040')", - " --charging=INT Charging characteristics (default=`0x0800')", - " -u, --uid=STRING Login user ID (default=`mig')", - " -p, --pwd=STRING Login password (default=`hemmelig')", - " --createif Create local network interface (default=off)", - " -n, --net=STRING Network address for local interface", - " --defaultroute Create default route (default=off)", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --pinghost=STRING Ping remote host", - " --pingrate=INT Number of ping req per second (default=`1')", - " --pingsize=INT Number of ping data bytes (default=`56')", - " --pingcount=INT Number of ping req to send (default=`0')", - " --pingquiet Do not print ping packet info (default=off)", - " --norecovery Do not send recovery (default=off)", + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -d, --debug Run in debug mode (default=off)", + " -c, --conf=STRING Read configuration file", + " --pidfile=STRING Filename of process id file\n (default=`./sgsnemu.pid')", + " --statedir=STRING Directory of nonvolatile data (default=`./')", + " --dns=STRING DNS Server to use", + " -l, --listen=STRING Local interface", + " -r, --remote=STRING Remote host", + " --contexts=INT Number of contexts (default=`1')", + " --timelimit=INT Exit after timelimit seconds (default=`0')", + " --gtpversion=INT GTP version to use (default=`1')", + " -a, --apn=STRING Access point name (default=`internet')", + " --selmode=INT Selection mode (default=`0x01')", + " --rattype=1..5 Radio Access Technology Type (default=`1')", + " --userloc=type.MCC.MNC.LAC.CIorSACorRAC\n User Location Information\n (default=`02509946241207')", + " --rai=MCC.MNC.LAC.RAC Routing Area Information\n (default=`02509946241207')", + " --mstz=sign.NbQuartersOfAnHour.DSTAdjustment\n MS Time Zone (default=`0')", + " --imeisv=STRING IMEI(SV) International Mobile Equipment\n Identity (and Software Version)\n (default=`2143658709214365')", + " --norecovery Do not send recovery (default=off)", + " -i, --imsi=STRING IMSI (default=`240010123456789')", + " --nsapi=INT NSAPI (default=`0')", + " -m, --msisdn=STRING Mobile Station ISDN number\n (default=`46702123456')", + " -q, --qos=INT Requested quality of service\n (default=`0x000b921f')", + " --qose1=INT Requested quality of service Extension 1\n (default=`0x9396404074f9ffff')", + " --qose2=INT Requested quality of service Extension 2\n (default=`0x11')", + " --qose3=INT Requested quality of service Extension 3\n (default=`0x0101')", + " --qose4=INT Requested quality of service Extension 4\n (default=`0x4040')", + " --charging=INT Charging characteristics (default=`0x0800')", + " -u, --uid=STRING Login user ID (default=`mig')", + " -p, --pwd=STRING Login password (default=`hemmelig')", + " --createif Create local network interface (default=off)", + " -n, --net=STRING Network address for local interface", + " --defaultroute Create default route (default=off)", + " --ipup=STRING Script to run after link-up", + " --ipdown=STRING Script to run after link-down", + " --pinghost=STRING Ping remote host", + " --pingrate=INT Number of ping req per second (default=`1')", + " --pingsize=INT Number of ping data bytes (default=`56')", + " --pingcount=INT Number of ping req to send (default=`0')", + " --pingquiet Do not print ping packet info (default=off)", 0 }; + +typedef enum { ARG_NO, ARG_FLAG, ARG_STRING, ARG_INT +} cmdline_parser_arg_type; static void clear_given(struct gengetopt_args_info *args_info); @@ -77,9 +88,9 @@ void clear_args(struct gengetopt_args_info *args_info); static int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error); struct line_list { @@ -127,6 +138,7 @@ args_info->rai_given = 0; args_info->mstz_given = 0; args_info->imeisv_given = 0; + args_info->norecovery_given = 0; args_info->imsi_given = 0; args_info->nsapi_given = 0; args_info->msisdn_given = 0; @@ -148,12 +160,12 @@ args_info->pingsize_given = 0; args_info->pingcount_given = 0; args_info->pingquiet_given = 0; - args_info->norecovery_given = 0; } static void clear_args(struct gengetopt_args_info *args_info) { + FIX_UNUSED(args_info); args_info->debug_flag = 0; args_info->conf_arg = NULL; args_info->conf_orig = NULL; @@ -177,16 +189,17 @@ args_info->apn_orig = NULL; args_info->selmode_arg = 0x01; args_info->selmode_orig = NULL; - args_info->rattype_arg = "1"; + args_info->rattype_arg = 1; args_info->rattype_orig = NULL; - args_info->userloc_arg = strdup("02509946241207"); + args_info->userloc_arg = gengetopt_strdup("02509946241207"); args_info->userloc_orig = NULL; - args_info->rai_arg = strdup("02509946241207"); + args_info->rai_arg = gengetopt_strdup("02509946241207"); args_info->rai_orig = NULL; - args_info->mstz_arg = strdup("0"); + args_info->mstz_arg = gengetopt_strdup("0"); args_info->mstz_orig = NULL; - args_info->imeisv_arg = strdup("2143658709214365"); + args_info->imeisv_arg = gengetopt_strdup("2143658709214365"); args_info->imeisv_orig = NULL; + args_info->norecovery_flag = 0; args_info->imsi_arg = gengetopt_strdup("240010123456789"); args_info->imsi_orig = NULL; args_info->nsapi_arg = 0; @@ -226,13 +239,13 @@ args_info->pingcount_arg = 0; args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; - args_info->norecovery_flag = 0; } static void init_args_info(struct gengetopt_args_info *args_info) { + args_info->help_help = gengetopt_args_info_help[0]; args_info->version_help = gengetopt_args_info_help[1]; args_info->debug_help = gengetopt_args_info_help[2]; @@ -247,41 +260,67 @@ args_info->gtpversion_help = gengetopt_args_info_help[11]; args_info->apn_help = gengetopt_args_info_help[12]; args_info->selmode_help = gengetopt_args_info_help[13]; - args_info->imsi_help = gengetopt_args_info_help[14]; - args_info->nsapi_help = gengetopt_args_info_help[15]; - args_info->msisdn_help = gengetopt_args_info_help[16]; - args_info->qos_help = gengetopt_args_info_help[17]; - args_info->charging_help = gengetopt_args_info_help[18]; - args_info->uid_help = gengetopt_args_info_help[19]; - args_info->pwd_help = gengetopt_args_info_help[20]; - args_info->createif_help = gengetopt_args_info_help[21]; - args_info->net_help = gengetopt_args_info_help[22]; - args_info->defaultroute_help = gengetopt_args_info_help[23]; - args_info->ipup_help = gengetopt_args_info_help[24]; - args_info->ipdown_help = gengetopt_args_info_help[25]; - args_info->pinghost_help = gengetopt_args_info_help[26]; - args_info->pingrate_help = gengetopt_args_info_help[27]; - args_info->pingsize_help = gengetopt_args_info_help[28]; - args_info->pingcount_help = gengetopt_args_info_help[29]; - args_info->pingquiet_help = gengetopt_args_info_help[30]; - args_info->norecovery_help = gengetopt_args_info_help[31]; + args_info->rattype_help = gengetopt_args_info_help[14]; + args_info->userloc_help = gengetopt_args_info_help[15]; + args_info->rai_help = gengetopt_args_info_help[16]; + args_info->mstz_help = gengetopt_args_info_help[17]; + args_info->imeisv_help = gengetopt_args_info_help[18]; + args_info->norecovery_help = gengetopt_args_info_help[19]; + args_info->imsi_help = gengetopt_args_info_help[20]; + args_info->nsapi_help = gengetopt_args_info_help[21]; + args_info->msisdn_help = gengetopt_args_info_help[22]; + args_info->qos_help = gengetopt_args_info_help[23]; + args_info->qose1_help = gengetopt_args_info_help[24]; + args_info->qose2_help = gengetopt_args_info_help[25]; + args_info->qose3_help = gengetopt_args_info_help[26]; + args_info->qose4_help = gengetopt_args_info_help[27]; + args_info->charging_help = gengetopt_args_info_help[28]; + args_info->uid_help = gengetopt_args_info_help[29]; + args_info->pwd_help = gengetopt_args_info_help[30]; + args_info->createif_help = gengetopt_args_info_help[31]; + args_info->net_help = gengetopt_args_info_help[32]; + args_info->defaultroute_help = gengetopt_args_info_help[33]; + args_info->ipup_help = gengetopt_args_info_help[34]; + args_info->ipdown_help = gengetopt_args_info_help[35]; + args_info->pinghost_help = gengetopt_args_info_help[36]; + args_info->pingrate_help = gengetopt_args_info_help[37]; + args_info->pingsize_help = gengetopt_args_info_help[38]; + args_info->pingcount_help = gengetopt_args_info_help[39]; + args_info->pingquiet_help = gengetopt_args_info_help[40]; } void cmdline_parser_print_version(void) { - printf("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); + printf("%s %s\n", + (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? + CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), + CMDLINE_PARSER_VERSION); + + if (strlen(gengetopt_args_info_versiontext) > 0) + printf("\n%s\n", gengetopt_args_info_versiontext); } -void cmdline_parser_print_help(void) +static void print_help_common(void) { - int i = 0; cmdline_parser_print_version(); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); - printf("\n%s\n\n", gengetopt_args_info_usage); + if (strlen(gengetopt_args_info_usage) > 0) + printf("\n%s\n", gengetopt_args_info_usage); + + printf("\n"); + + if (strlen(gengetopt_args_info_description) > 0) + printf("%s\n\n", gengetopt_args_info_description); +} + +void cmdline_parser_print_help(void) +{ + int i = 0; + print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } @@ -293,171 +332,210 @@ init_args_info(args_info); } +void cmdline_parser_params_init(struct cmdline_parser_params *params) +{ + if (params) { + params->override = 0; + params->initialize = 1; + params->check_required = 1; + params->check_ambiguity = 0; + params->print_errors = 1; + } +} + +struct cmdline_parser_params *cmdline_parser_params_create(void) +{ + struct cmdline_parser_params *params = + (struct cmdline_parser_params *) + malloc(sizeof(struct cmdline_parser_params)); + cmdline_parser_params_init(params); + return params; +} + +static void free_string_field(char **s) +{ + if (*s) { + free(*s); + *s = 0; + } +} + static void cmdline_parser_release(struct gengetopt_args_info *args_info) { - if (args_info->conf_arg) { - free(args_info->conf_arg); /* free previous argument */ - args_info->conf_arg = 0; - } - if (args_info->conf_orig) { - free(args_info->conf_orig); /* free previous argument */ - args_info->conf_orig = 0; - } - if (args_info->pidfile_arg) { - free(args_info->pidfile_arg); /* free previous argument */ - args_info->pidfile_arg = 0; - } - if (args_info->pidfile_orig) { - free(args_info->pidfile_orig); /* free previous argument */ - args_info->pidfile_orig = 0; - } - if (args_info->statedir_arg) { - free(args_info->statedir_arg); /* free previous argument */ - args_info->statedir_arg = 0; - } - if (args_info->statedir_orig) { - free(args_info->statedir_orig); /* free previous argument */ - args_info->statedir_orig = 0; - } - if (args_info->dns_arg) { - free(args_info->dns_arg); /* free previous argument */ - args_info->dns_arg = 0; - } - if (args_info->dns_orig) { - free(args_info->dns_orig); /* free previous argument */ - args_info->dns_orig = 0; - } - if (args_info->listen_arg) { - free(args_info->listen_arg); /* free previous argument */ - args_info->listen_arg = 0; - } - if (args_info->listen_orig) { - free(args_info->listen_orig); /* free previous argument */ - args_info->listen_orig = 0; - } - if (args_info->remote_arg) { - free(args_info->remote_arg); /* free previous argument */ - args_info->remote_arg = 0; - } - if (args_info->remote_orig) { - free(args_info->remote_orig); /* free previous argument */ - args_info->remote_orig = 0; - } - if (args_info->contexts_orig) { - free(args_info->contexts_orig); /* free previous argument */ - args_info->contexts_orig = 0; - } - if (args_info->timelimit_orig) { - free(args_info->timelimit_orig); /* free previous argument */ - args_info->timelimit_orig = 0; - } - if (args_info->gtpversion_orig) { - free(args_info->gtpversion_orig); /* free previous argument */ - args_info->gtpversion_orig = 0; - } - if (args_info->apn_arg) { - free(args_info->apn_arg); /* free previous argument */ - args_info->apn_arg = 0; - } - if (args_info->apn_orig) { - free(args_info->apn_orig); /* free previous argument */ - args_info->apn_orig = 0; - } - if (args_info->selmode_orig) { - free(args_info->selmode_orig); /* free previous argument */ - args_info->selmode_orig = 0; - } - if (args_info->imsi_arg) { - free(args_info->imsi_arg); /* free previous argument */ - args_info->imsi_arg = 0; - } - if (args_info->imsi_orig) { - free(args_info->imsi_orig); /* free previous argument */ - args_info->imsi_orig = 0; - } - if (args_info->nsapi_orig) { - free(args_info->nsapi_orig); /* free previous argument */ - args_info->nsapi_orig = 0; - } - if (args_info->msisdn_arg) { - free(args_info->msisdn_arg); /* free previous argument */ - args_info->msisdn_arg = 0; - } - if (args_info->msisdn_orig) { - free(args_info->msisdn_orig); /* free previous argument */ - args_info->msisdn_orig = 0; - } - if (args_info->qos_orig) { - free(args_info->qos_orig); /* free previous argument */ - args_info->qos_orig = 0; - } - if (args_info->charging_orig) { - free(args_info->charging_orig); /* free previous argument */ - args_info->charging_orig = 0; - } - if (args_info->uid_arg) { - free(args_info->uid_arg); /* free previous argument */ - args_info->uid_arg = 0; - } - if (args_info->uid_orig) { - free(args_info->uid_orig); /* free previous argument */ - args_info->uid_orig = 0; - } - if (args_info->pwd_arg) { - free(args_info->pwd_arg); /* free previous argument */ - args_info->pwd_arg = 0; - } - if (args_info->pwd_orig) { - free(args_info->pwd_orig); /* free previous argument */ - args_info->pwd_orig = 0; - } - if (args_info->net_arg) { - free(args_info->net_arg); /* free previous argument */ - args_info->net_arg = 0; - } - if (args_info->net_orig) { - free(args_info->net_orig); /* free previous argument */ - args_info->net_orig = 0; - } - if (args_info->ipup_arg) { - free(args_info->ipup_arg); /* free previous argument */ - args_info->ipup_arg = 0; - } - if (args_info->ipup_orig) { - free(args_info->ipup_orig); /* free previous argument */ - args_info->ipup_orig = 0; - } - if (args_info->ipdown_arg) { - free(args_info->ipdown_arg); /* free previous argument */ - args_info->ipdown_arg = 0; - } - if (args_info->ipdown_orig) { - free(args_info->ipdown_orig); /* free previous argument */ - args_info->ipdown_orig = 0; - } - if (args_info->pinghost_arg) { - free(args_info->pinghost_arg); /* free previous argument */ - args_info->pinghost_arg = 0; - } - if (args_info->pinghost_orig) { - free(args_info->pinghost_orig); /* free previous argument */ - args_info->pinghost_orig = 0; - } - if (args_info->pingrate_orig) { - free(args_info->pingrate_orig); /* free previous argument */ - args_info->pingrate_orig = 0; - } - if (args_info->pingsize_orig) { - free(args_info->pingsize_orig); /* free previous argument */ - args_info->pingsize_orig = 0; - } - if (args_info->pingcount_orig) { - free(args_info->pingcount_orig); /* free previous argument */ - args_info->pingcount_orig = 0; - } + free_string_field(&(args_info->conf_arg)); + free_string_field(&(args_info->conf_orig)); + free_string_field(&(args_info->pidfile_arg)); + free_string_field(&(args_info->pidfile_orig)); + free_string_field(&(args_info->statedir_arg)); + free_string_field(&(args_info->statedir_orig)); + free_string_field(&(args_info->dns_arg)); + free_string_field(&(args_info->dns_orig)); + free_string_field(&(args_info->listen_arg)); + free_string_field(&(args_info->listen_orig)); + free_string_field(&(args_info->remote_arg)); + free_string_field(&(args_info->remote_orig)); + free_string_field(&(args_info->contexts_orig)); + free_string_field(&(args_info->timelimit_orig)); + free_string_field(&(args_info->gtpversion_orig)); + free_string_field(&(args_info->apn_arg)); + free_string_field(&(args_info->apn_orig)); + free_string_field(&(args_info->selmode_orig)); + free_string_field(&(args_info->rattype_orig)); + free_string_field(&(args_info->userloc_arg)); + free_string_field(&(args_info->userloc_orig)); + free_string_field(&(args_info->rai_arg)); + free_string_field(&(args_info->rai_orig)); + free_string_field(&(args_info->mstz_arg)); + free_string_field(&(args_info->mstz_orig)); + free_string_field(&(args_info->imeisv_arg)); + free_string_field(&(args_info->imeisv_orig)); + free_string_field(&(args_info->imsi_arg)); + free_string_field(&(args_info->imsi_orig)); + free_string_field(&(args_info->nsapi_orig)); + free_string_field(&(args_info->msisdn_arg)); + free_string_field(&(args_info->msisdn_orig)); + free_string_field(&(args_info->qos_orig)); + free_string_field(&(args_info->qose1_orig)); + free_string_field(&(args_info->qose2_orig)); + free_string_field(&(args_info->qose3_orig)); + free_string_field(&(args_info->qose4_orig)); + free_string_field(&(args_info->charging_orig)); + free_string_field(&(args_info->uid_arg)); + free_string_field(&(args_info->uid_orig)); + free_string_field(&(args_info->pwd_arg)); + free_string_field(&(args_info->pwd_orig)); + free_string_field(&(args_info->net_arg)); + free_string_field(&(args_info->net_orig)); + free_string_field(&(args_info->ipup_arg)); + free_string_field(&(args_info->ipup_orig)); + free_string_field(&(args_info->ipdown_arg)); + free_string_field(&(args_info->ipdown_orig)); + free_string_field(&(args_info->pinghost_arg)); + free_string_field(&(args_info->pinghost_orig)); + free_string_field(&(args_info->pingrate_orig)); + free_string_field(&(args_info->pingsize_orig)); + free_string_field(&(args_info->pingcount_orig)); clear_given(args_info); +} + +static void +write_into_file(FILE * outfile, const char *opt, const char *arg, + const char *values[]) +{ + FIX_UNUSED(values); + if (arg) { + fprintf(outfile, "%s=\"%s\"\n", opt, arg); + } else { + fprintf(outfile, "%s\n", opt); + } +} + +int cmdline_parser_dump(FILE * outfile, struct gengetopt_args_info *args_info) +{ + int i = 0; + + if (!outfile) { + fprintf(stderr, "%s: cannot dump options to stream\n", + CMDLINE_PARSER_PACKAGE); + return EXIT_FAILURE; + } + + if (args_info->help_given) + write_into_file(outfile, "help", 0, 0); + if (args_info->version_given) + write_into_file(outfile, "version", 0, 0); + if (args_info->debug_given) + write_into_file(outfile, "debug", 0, 0); + if (args_info->conf_given) + write_into_file(outfile, "conf", args_info->conf_orig, 0); + if (args_info->pidfile_given) + write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); + if (args_info->statedir_given) + write_into_file(outfile, "statedir", args_info->statedir_orig, + 0); + if (args_info->dns_given) + write_into_file(outfile, "dns", args_info->dns_orig, 0); + if (args_info->listen_given) + write_into_file(outfile, "listen", args_info->listen_orig, 0); + if (args_info->remote_given) + write_into_file(outfile, "remote", args_info->remote_orig, 0); + if (args_info->contexts_given) + write_into_file(outfile, "contexts", args_info->contexts_orig, + 0); + if (args_info->timelimit_given) + write_into_file(outfile, "timelimit", args_info->timelimit_orig, + 0); + if (args_info->gtpversion_given) + write_into_file(outfile, "gtpversion", + args_info->gtpversion_orig, 0); + if (args_info->apn_given) + write_into_file(outfile, "apn", args_info->apn_orig, 0); + if (args_info->selmode_given) + write_into_file(outfile, "selmode", args_info->selmode_orig, 0); + if (args_info->rattype_given) + write_into_file(outfile, "rattype", args_info->rattype_orig, 0); + if (args_info->userloc_given) + write_into_file(outfile, "userloc", args_info->userloc_orig, 0); + if (args_info->rai_given) + write_into_file(outfile, "rai", args_info->rai_orig, 0); + if (args_info->mstz_given) + write_into_file(outfile, "mstz", args_info->mstz_orig, 0); + if (args_info->imeisv_given) + write_into_file(outfile, "imeisv", args_info->imeisv_orig, 0); + if (args_info->norecovery_given) + write_into_file(outfile, "norecovery", 0, 0); + if (args_info->imsi_given) + write_into_file(outfile, "imsi", args_info->imsi_orig, 0); + if (args_info->nsapi_given) + write_into_file(outfile, "nsapi", args_info->nsapi_orig, 0); + if (args_info->msisdn_given) + write_into_file(outfile, "msisdn", args_info->msisdn_orig, 0); + if (args_info->qos_given) + write_into_file(outfile, "qos", args_info->qos_orig, 0); + if (args_info->qose1_given) + write_into_file(outfile, "qose1", args_info->qose1_orig, 0); + if (args_info->qose2_given) + write_into_file(outfile, "qose2", args_info->qose2_orig, 0); + if (args_info->qose3_given) + write_into_file(outfile, "qose3", args_info->qose3_orig, 0); + if (args_info->qose4_given) + write_into_file(outfile, "qose4", args_info->qose4_orig, 0); + if (args_info->charging_given) + write_into_file(outfile, "charging", args_info->charging_orig, + 0); + if (args_info->uid_given) + write_into_file(outfile, "uid", args_info->uid_orig, 0); + if (args_info->pwd_given) + write_into_file(outfile, "pwd", args_info->pwd_orig, 0); + if (args_info->createif_given) + write_into_file(outfile, "createif", 0, 0); + if (args_info->net_given) + write_into_file(outfile, "net", args_info->net_orig, 0); + if (args_info->defaultroute_given) + write_into_file(outfile, "defaultroute", 0, 0); + if (args_info->ipup_given) + write_into_file(outfile, "ipup", args_info->ipup_orig, 0); + if (args_info->ipdown_given) + write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); + if (args_info->pinghost_given) + write_into_file(outfile, "pinghost", args_info->pinghost_orig, + 0); + if (args_info->pingrate_given) + write_into_file(outfile, "pingrate", args_info->pingrate_orig, + 0); + if (args_info->pingsize_given) + write_into_file(outfile, "pingsize", args_info->pingsize_orig, + 0); + if (args_info->pingcount_given) + write_into_file(outfile, "pingcount", args_info->pingcount_orig, + 0); + if (args_info->pingquiet_given) + write_into_file(outfile, "pingquiet", 0, 0); + + i = EXIT_SUCCESS; + return i; } int @@ -475,231 +553,9 @@ return EXIT_FAILURE; } - if (args_info->help_given) { - fprintf(outfile, "%s\n", "help"); - } - if (args_info->version_given) { - fprintf(outfile, "%s\n", "version"); - } - if (args_info->debug_given) { - fprintf(outfile, "%s\n", "debug"); - } - if (args_info->conf_given) { - if (args_info->conf_orig) { - fprintf(outfile, "%s=\"%s\"\n", "conf", - args_info->conf_orig); - } else { - fprintf(outfile, "%s\n", "conf"); - } - } - if (args_info->pidfile_given) { - if (args_info->pidfile_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pidfile", - args_info->pidfile_orig); - } else { - fprintf(outfile, "%s\n", "pidfile"); - } - } - if (args_info->statedir_given) { - if (args_info->statedir_orig) { - fprintf(outfile, "%s=\"%s\"\n", "statedir", - args_info->statedir_orig); - } else { - fprintf(outfile, "%s\n", "statedir"); - } - } - if (args_info->dns_given) { - if (args_info->dns_orig) { - fprintf(outfile, "%s=\"%s\"\n", "dns", - args_info->dns_orig); - } else { - fprintf(outfile, "%s\n", "dns"); - } - } - if (args_info->listen_given) { - if (args_info->listen_orig) { - fprintf(outfile, "%s=\"%s\"\n", "listen", - args_info->listen_orig); - } else { - fprintf(outfile, "%s\n", "listen"); - } - } - if (args_info->remote_given) { - if (args_info->remote_orig) { - fprintf(outfile, "%s=\"%s\"\n", "remote", - args_info->remote_orig); - } else { - fprintf(outfile, "%s\n", "remote"); - } - } - if (args_info->contexts_given) { - if (args_info->contexts_orig) { - fprintf(outfile, "%s=\"%s\"\n", "contexts", - args_info->contexts_orig); - } else { - fprintf(outfile, "%s\n", "contexts"); - } - } - if (args_info->timelimit_given) { - if (args_info->timelimit_orig) { - fprintf(outfile, "%s=\"%s\"\n", "timelimit", - args_info->timelimit_orig); - } else { - fprintf(outfile, "%s\n", "timelimit"); - } - } - if (args_info->gtpversion_given) { - if (args_info->gtpversion_orig) { - fprintf(outfile, "%s=\"%s\"\n", "gtpversion", - args_info->gtpversion_orig); - } else { - fprintf(outfile, "%s\n", "gtpversion"); - } - } - if (args_info->apn_given) { - if (args_info->apn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "apn", - args_info->apn_orig); - } else { - fprintf(outfile, "%s\n", "apn"); - } - } - if (args_info->selmode_given) { - if (args_info->selmode_orig) { - fprintf(outfile, "%s=\"%s\"\n", "selmode", - args_info->selmode_orig); - } else { - fprintf(outfile, "%s\n", "selmode"); - } - } - if (args_info->imsi_given) { - if (args_info->imsi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "imsi", - args_info->imsi_orig); - } else { - fprintf(outfile, "%s\n", "imsi"); - } - } - if (args_info->nsapi_given) { - if (args_info->nsapi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "nsapi", - args_info->nsapi_orig); - } else { - fprintf(outfile, "%s\n", "nsapi"); - } - } - if (args_info->msisdn_given) { - if (args_info->msisdn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "msisdn", - args_info->msisdn_orig); - } else { - fprintf(outfile, "%s\n", "msisdn"); - } - } - if (args_info->qos_given) { - if (args_info->qos_orig) { - fprintf(outfile, "%s=\"%s\"\n", "qos", - args_info->qos_orig); - } else { - fprintf(outfile, "%s\n", "qos"); - } - } - if (args_info->charging_given) { - if (args_info->charging_orig) { - fprintf(outfile, "%s=\"%s\"\n", "charging", - args_info->charging_orig); - } else { - fprintf(outfile, "%s\n", "charging"); - } - } - if (args_info->uid_given) { - if (args_info->uid_orig) { - fprintf(outfile, "%s=\"%s\"\n", "uid", - args_info->uid_orig); - } else { - fprintf(outfile, "%s\n", "uid"); - } - } - if (args_info->pwd_given) { - if (args_info->pwd_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pwd", - args_info->pwd_orig); - } else { - fprintf(outfile, "%s\n", "pwd"); - } - } - if (args_info->createif_given) { - fprintf(outfile, "%s\n", "createif"); - } - if (args_info->net_given) { - if (args_info->net_orig) { - fprintf(outfile, "%s=\"%s\"\n", "net", - args_info->net_orig); - } else { - fprintf(outfile, "%s\n", "net"); - } - } - if (args_info->defaultroute_given) { - fprintf(outfile, "%s\n", "defaultroute"); - } - if (args_info->ipup_given) { - if (args_info->ipup_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipup", - args_info->ipup_orig); - } else { - fprintf(outfile, "%s\n", "ipup"); - } - } - if (args_info->ipdown_given) { - if (args_info->ipdown_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipdown", - args_info->ipdown_orig); - } else { - fprintf(outfile, "%s\n", "ipdown"); - } - } - if (args_info->pinghost_given) { - if (args_info->pinghost_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pinghost", - args_info->pinghost_orig); - } else { - fprintf(outfile, "%s\n", "pinghost"); - } - } - if (args_info->pingrate_given) { - if (args_info->pingrate_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingrate", - args_info->pingrate_orig); - } else { - fprintf(outfile, "%s\n", "pingrate"); - } - } - if (args_info->pingsize_given) { - if (args_info->pingsize_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingsize", - args_info->pingsize_orig); - } else { - fprintf(outfile, "%s\n", "pingsize"); - } - } - if (args_info->pingcount_given) { - if (args_info->pingcount_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingcount", - args_info->pingcount_orig); - } else { - fprintf(outfile, "%s\n", "pingcount"); - } - } - if (args_info->pingquiet_given) { - fprintf(outfile, "%s\n", "pingquiet"); - } - if (args_info->norecovery_given) { - fprintf(outfile, "%s\n", "norecovery"); - } - + i = cmdline_parser_dump(outfile, args_info); fclose(outfile); - i = EXIT_SUCCESS; return i; } @@ -708,11 +564,10 @@ cmdline_parser_release(args_info); } -/* gengetopt_strdup() */ -/* strdup.c replacement of strdup, which is not standard */ +/** @brief replacement of strdup, which is not standard */ char *gengetopt_strdup(const char *s) { - char *result = NULL; + char *result = 0; if (!s) return result; @@ -723,23 +578,40 @@ return result; } -int -cmdline_parser(int argc, char *const *argv, - struct gengetopt_args_info *args_info) +int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2(argc, argv, args_info, 0, 1, 1); } int -cmdline_parser2(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) { int result; + result = cmdline_parser_internal(argc, argv, args_info, params, 0); - result = - cmdline_parser_internal(argc, argv, args_info, override, initialize, - check_required, NULL); + if (result == EXIT_FAILURE) { + cmdline_parser_free(args_info); + exit(EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + int result; + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + result = cmdline_parser_internal(argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free(args_info); @@ -753,19 +625,152 @@ cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name) { + FIX_UNUSED(args_info); + FIX_UNUSED(prog_name); return EXIT_SUCCESS; } +static char *package_name = 0; + +/** + * @brief updates an option + * @param field the generic pointer to the field to update + * @param orig_field the pointer to the orig field + * @param field_given the pointer to the number of occurrence of this option + * @param prev_given the pointer to the number of occurrence already seen + * @param value the argument for this option (if null no arg was specified) + * @param possible_values the possible values for this option (if specified) + * @param default_value the default value (in case the option only accepts fixed values) + * @param arg_type the type of this option + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity + * @param override @see cmdline_parser_params.override + * @param no_free whether to free a possible previous value + * @param multiple_option whether this is a multiple option + * @param long_opt the corresponding long option + * @param short_opt the corresponding short option (or '-' if none) + * @param additional_error possible further error specification + */ +static +int update_arg(void *field, char **orig_field, + unsigned int *field_given, unsigned int *prev_given, + char *value, const char *possible_values[], + const char *default_value, + cmdline_parser_arg_type arg_type, + int check_ambiguity, int override, + int no_free, int multiple_option, + const char *long_opt, char short_opt, + const char *additional_error) +{ + char *stop_char = 0; + const char *val = value; + int found; + char **string_field; + FIX_UNUSED(field); + + stop_char = 0; + found = 0; + + if (!multiple_option && prev_given + && (*prev_given || (check_ambiguity && *field_given))) { + if (short_opt != '-') + fprintf(stderr, + "%s: `--%s' (`-%c') option given more than once%s\n", + package_name, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf(stderr, + "%s: `--%s' option given more than once%s\n", + package_name, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + FIX_UNUSED(default_value); + + if (field_given && *field_given && !override) + return 0; + if (prev_given) + (*prev_given)++; + if (field_given) + (*field_given)++; + if (possible_values) + val = possible_values[found]; + + switch (arg_type) { + case ARG_FLAG: + *((int *)field) = !*((int *)field); + break; + case ARG_INT: + if (val) + *((int *)field) = strtol(val, &stop_char, 0); + break; + case ARG_STRING: + if (val) { + string_field = (char **)field; + if (!no_free && *string_field) + free(*string_field); /* free previous string */ + *string_field = gengetopt_strdup(val); + } + break; + default: + break; + }; + + /* check numeric conversion */ + switch (arg_type) { + case ARG_INT: + if (val && !(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", + package_name, val); + return 1; /* failure */ + } + break; + default: + ; + }; + + /* store the original value */ + switch (arg_type) { + case ARG_NO: + case ARG_FLAG: + break; + default: + if (value && orig_field) { + if (no_free) { + *orig_field = value; + } else { + if (*orig_field) + free(*orig_field); /* free previous string */ + *orig_field = gengetopt_strdup(value); + } + } + }; + + return 0; /* OK */ +} + int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ - int error = 0; + int error_occurred = 0; struct gengetopt_args_info local_args_info; + + int override; + int initialize; + int check_required; + int check_ambiguity; + + package_name = argv[0]; + + override = params->override; + initialize = params->initialize; + check_required = params->check_required; + check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init(args_info); @@ -774,12 +779,11 @@ optarg = 0; optind = 0; - opterr = 1; + opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; - char *stop_char; static struct option long_options[] = { {"help", 0, NULL, 'h'}, @@ -801,6 +805,7 @@ {"rai", 1, NULL, 0}, {"mstz", 1, NULL, 0}, {"imeisv", 1, NULL, 0}, + {"norecovery", 0, NULL, 0}, {"imsi", 1, NULL, 'i'}, {"nsapi", 1, NULL, 0}, {"msisdn", 1, NULL, 'm'}, @@ -822,11 +827,9 @@ {"pingsize", 1, NULL, 0}, {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, - {"norecovery", 0, NULL, 0}, - {NULL, 0, NULL, 0} + {0, 0, 0, 0} }; - stop_char = 0; c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:", long_options, &option_index); @@ -845,884 +848,559 @@ exit(EXIT_SUCCESS); case 'd': /* Run in debug mode. */ - if (local_args_info.debug_given) { - fprintf(stderr, - "%s: `--debug' (`-d') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->debug_given && !override) - continue; - local_args_info.debug_given = 1; - args_info->debug_given = 1; - args_info->debug_flag = !(args_info->debug_flag); - break; + if (update_arg + ((void *)&(args_info->debug_flag), 0, + &(args_info->debug_given), + &(local_args_info.debug_given), optarg, 0, 0, + ARG_FLAG, check_ambiguity, override, 1, 0, "debug", + 'd', additional_error)) + goto failure; + + break; case 'c': /* Read configuration file. */ - if (local_args_info.conf_given) { - fprintf(stderr, - "%s: `--conf' (`-c') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->conf_given && !override) - continue; - local_args_info.conf_given = 1; - args_info->conf_given = 1; - if (args_info->conf_arg) - free(args_info->conf_arg); /* free previous string */ - args_info->conf_arg = gengetopt_strdup(optarg); - if (args_info->conf_orig) - free(args_info->conf_orig); /* free previous string */ - args_info->conf_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->conf_arg), + &(args_info->conf_orig), + &(args_info->conf_given), + &(local_args_info.conf_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "conf", 'c', additional_error)) + goto failure; + + break; case 'l': /* Local interface. */ - if (local_args_info.listen_given) { - fprintf(stderr, - "%s: `--listen' (`-l') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->listen_given && !override) - continue; - local_args_info.listen_given = 1; - args_info->listen_given = 1; - if (args_info->listen_arg) - free(args_info->listen_arg); /* free previous string */ - args_info->listen_arg = gengetopt_strdup(optarg); - if (args_info->listen_orig) - free(args_info->listen_orig); /* free previous string */ - args_info->listen_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->listen_arg), + &(args_info->listen_orig), + &(args_info->listen_given), + &(local_args_info.listen_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "listen", 'l', + additional_error)) + goto failure; + + break; case 'r': /* Remote host. */ - if (local_args_info.remote_given) { - fprintf(stderr, - "%s: `--remote' (`-r') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->remote_given && !override) - continue; - local_args_info.remote_given = 1; - args_info->remote_given = 1; - if (args_info->remote_arg) - free(args_info->remote_arg); /* free previous string */ - args_info->remote_arg = gengetopt_strdup(optarg); - if (args_info->remote_orig) - free(args_info->remote_orig); /* free previous string */ - args_info->remote_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->remote_arg), + &(args_info->remote_orig), + &(args_info->remote_given), + &(local_args_info.remote_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "remote", 'r', + additional_error)) + goto failure; + + break; case 'a': /* Access point name. */ - if (local_args_info.apn_given) { - fprintf(stderr, - "%s: `--apn' (`-a') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->apn_given && !override) - continue; - local_args_info.apn_given = 1; - args_info->apn_given = 1; - if (args_info->apn_arg) - free(args_info->apn_arg); /* free previous string */ - args_info->apn_arg = gengetopt_strdup(optarg); - if (args_info->apn_orig) - free(args_info->apn_orig); /* free previous string */ - args_info->apn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->apn_arg), + &(args_info->apn_orig), + &(args_info->apn_given), + &(local_args_info.apn_given), optarg, 0, + "internet", ARG_STRING, check_ambiguity, + override, 0, 0, "apn", 'a', + additional_error)) + goto failure; + + break; case 'i': /* IMSI. */ - if (local_args_info.imsi_given) { - fprintf(stderr, - "%s: `--imsi' (`-i') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->imsi_given && !override) - continue; - local_args_info.imsi_given = 1; - args_info->imsi_given = 1; - if (args_info->imsi_arg) - free(args_info->imsi_arg); /* free previous string */ - args_info->imsi_arg = gengetopt_strdup(optarg); - if (args_info->imsi_orig) - free(args_info->imsi_orig); /* free previous string */ - args_info->imsi_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->imsi_arg), + &(args_info->imsi_orig), + &(args_info->imsi_given), + &(local_args_info.imsi_given), optarg, 0, + "240010123456789", ARG_STRING, + check_ambiguity, override, 0, 0, "imsi", + 'i', additional_error)) + goto failure; + + break; case 'm': /* Mobile Station ISDN number. */ - if (local_args_info.msisdn_given) { - fprintf(stderr, - "%s: `--msisdn' (`-m') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->msisdn_given && !override) - continue; - local_args_info.msisdn_given = 1; - args_info->msisdn_given = 1; - if (args_info->msisdn_arg) - free(args_info->msisdn_arg); /* free previous string */ - args_info->msisdn_arg = gengetopt_strdup(optarg); - if (args_info->msisdn_orig) - free(args_info->msisdn_orig); /* free previous string */ - args_info->msisdn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->msisdn_arg), + &(args_info->msisdn_orig), + &(args_info->msisdn_given), + &(local_args_info.msisdn_given), optarg, + 0, "46702123456", ARG_STRING, + check_ambiguity, override, 0, 0, + "msisdn", 'm', additional_error)) + goto failure; + + break; case 'q': /* Requested quality of service. */ - if (local_args_info.qos_given) { - fprintf(stderr, - "%s: `--qos' (`-q') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->qos_given && !override) - continue; - local_args_info.qos_given = 1; - args_info->qos_given = 1; - args_info->qos_arg = strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qos_orig) - free(args_info->qos_orig); /* free previous string */ - args_info->qos_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->qos_arg), + &(args_info->qos_orig), + &(args_info->qos_given), + &(local_args_info.qos_given), optarg, 0, + "0x000b921f", ARG_INT, check_ambiguity, + override, 0, 0, "qos", 'q', + additional_error)) + goto failure; + + break; case 'u': /* Login user ID. */ - if (local_args_info.uid_given) { - fprintf(stderr, - "%s: `--uid' (`-u') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->uid_given && !override) - continue; - local_args_info.uid_given = 1; - args_info->uid_given = 1; - if (args_info->uid_arg) - free(args_info->uid_arg); /* free previous string */ - args_info->uid_arg = gengetopt_strdup(optarg); - if (args_info->uid_orig) - free(args_info->uid_orig); /* free previous string */ - args_info->uid_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->uid_arg), + &(args_info->uid_orig), + &(args_info->uid_given), + &(local_args_info.uid_given), optarg, 0, + "mig", ARG_STRING, check_ambiguity, + override, 0, 0, "uid", 'u', + additional_error)) + goto failure; + + break; case 'p': /* Login password. */ - if (local_args_info.pwd_given) { - fprintf(stderr, - "%s: `--pwd' (`-p') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->pwd_given && !override) - continue; - local_args_info.pwd_given = 1; - args_info->pwd_given = 1; - if (args_info->pwd_arg) - free(args_info->pwd_arg); /* free previous string */ - args_info->pwd_arg = gengetopt_strdup(optarg); - if (args_info->pwd_orig) - free(args_info->pwd_orig); /* free previous string */ - args_info->pwd_orig = gengetopt_strdup(optarg); - break; - case 'n': /* Network address for local interface. */ - if (local_args_info.net_given) { - fprintf(stderr, - "%s: `--net' (`-n') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); + if (update_arg((void *)&(args_info->pwd_arg), + &(args_info->pwd_orig), + &(args_info->pwd_given), + &(local_args_info.pwd_given), optarg, 0, + "hemmelig", ARG_STRING, check_ambiguity, + override, 0, 0, "pwd", 'p', + additional_error)) goto failure; - } - if (args_info->net_given && !override) - continue; - local_args_info.net_given = 1; - args_info->net_given = 1; - if (args_info->net_arg) - free(args_info->net_arg); /* free previous string */ - args_info->net_arg = gengetopt_strdup(optarg); - if (args_info->net_orig) - free(args_info->net_orig); /* free previous string */ - args_info->net_orig = gengetopt_strdup(optarg); + + break; + case 'n': /* Network address for local interface. */ + + if (update_arg((void *)&(args_info->net_arg), + &(args_info->net_orig), + &(args_info->net_given), + &(local_args_info.net_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "net", 'n', additional_error)) + goto failure; + break; case 0: /* Long option with no short option */ /* Filename of process id file. */ if (strcmp(long_options[option_index].name, "pidfile") == 0) { - if (local_args_info.pidfile_given) { - fprintf(stderr, - "%s: `--pidfile' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->pidfile_arg), + &(args_info->pidfile_orig), + &(args_info->pidfile_given), + &(local_args_info.pidfile_given), optarg, + 0, "./sgsnemu.pid", ARG_STRING, + check_ambiguity, override, 0, 0, "pidfile", + '-', additional_error)) goto failure; - } - if (args_info->pidfile_given && !override) - continue; - local_args_info.pidfile_given = 1; - args_info->pidfile_given = 1; - if (args_info->pidfile_arg) - free(args_info->pidfile_arg); /* free previous string */ - args_info->pidfile_arg = - gengetopt_strdup(optarg); - if (args_info->pidfile_orig) - free(args_info->pidfile_orig); /* free previous string */ - args_info->pidfile_orig = - gengetopt_strdup(optarg); + } /* Directory of nonvolatile data. */ else if (strcmp (long_options[option_index].name, "statedir") == 0) { - if (local_args_info.statedir_given) { - fprintf(stderr, - "%s: `--statedir' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->statedir_arg), + &(args_info->statedir_orig), + &(args_info->statedir_given), + &(local_args_info.statedir_given), optarg, + 0, "./", ARG_STRING, check_ambiguity, + override, 0, 0, "statedir", '-', + additional_error)) goto failure; - } - if (args_info->statedir_given && !override) - continue; - local_args_info.statedir_given = 1; - args_info->statedir_given = 1; - if (args_info->statedir_arg) - free(args_info->statedir_arg); /* free previous string */ - args_info->statedir_arg = - gengetopt_strdup(optarg); - if (args_info->statedir_orig) - free(args_info->statedir_orig); /* free previous string */ - args_info->statedir_orig = - gengetopt_strdup(optarg); + } /* DNS Server to use. */ else if (strcmp(long_options[option_index].name, "dns") == 0) { - if (local_args_info.dns_given) { - fprintf(stderr, - "%s: `--dns' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->dns_arg), + &(args_info->dns_orig), + &(args_info->dns_given), + &(local_args_info.dns_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "dns", '-', additional_error)) goto failure; - } - if (args_info->dns_given && !override) - continue; - local_args_info.dns_given = 1; - args_info->dns_given = 1; - if (args_info->dns_arg) - free(args_info->dns_arg); /* free previous string */ - args_info->dns_arg = gengetopt_strdup(optarg); - if (args_info->dns_orig) - free(args_info->dns_orig); /* free previous string */ - args_info->dns_orig = gengetopt_strdup(optarg); + } /* Number of contexts. */ else if (strcmp (long_options[option_index].name, "contexts") == 0) { - if (local_args_info.contexts_given) { - fprintf(stderr, - "%s: `--contexts' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->contexts_arg), + &(args_info->contexts_orig), + &(args_info->contexts_given), + &(local_args_info.contexts_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "contexts", '-', additional_error)) goto failure; - } - if (args_info->contexts_given && !override) - continue; - local_args_info.contexts_given = 1; - args_info->contexts_given = 1; - args_info->contexts_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->contexts_orig) - free(args_info->contexts_orig); /* free previous string */ - args_info->contexts_orig = - gengetopt_strdup(optarg); + } /* Exit after timelimit seconds. */ else if (strcmp (long_options[option_index].name, "timelimit") == 0) { - if (local_args_info.timelimit_given) { - fprintf(stderr, - "%s: `--timelimit' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->timelimit_arg), + &(args_info->timelimit_orig), + &(args_info->timelimit_given), + &(local_args_info.timelimit_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "timelimit", '-', additional_error)) goto failure; - } - if (args_info->timelimit_given && !override) - continue; - local_args_info.timelimit_given = 1; - args_info->timelimit_given = 1; - args_info->timelimit_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->timelimit_orig) - free(args_info->timelimit_orig); /* free previous string */ - args_info->timelimit_orig = - gengetopt_strdup(optarg); + } /* GTP version to use. */ else if (strcmp (long_options[option_index].name, "gtpversion") == 0) { - if (local_args_info.gtpversion_given) { - fprintf(stderr, - "%s: `--gtpversion' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->gtpversion_arg), + &(args_info->gtpversion_orig), + &(args_info->gtpversion_given), + &(local_args_info.gtpversion_given), + optarg, 0, "1", ARG_INT, check_ambiguity, + override, 0, 0, "gtpversion", '-', + additional_error)) goto failure; - } - if (args_info->gtpversion_given && !override) - continue; - local_args_info.gtpversion_given = 1; - args_info->gtpversion_given = 1; - args_info->gtpversion_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->gtpversion_orig) - free(args_info->gtpversion_orig); /* free previous string */ - args_info->gtpversion_orig = - gengetopt_strdup(optarg); + } /* Selection mode. */ else if (strcmp (long_options[option_index].name, "selmode") == 0) { - if (local_args_info.selmode_given) { - fprintf(stderr, - "%s: `--selmode' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->selmode_arg), + &(args_info->selmode_orig), + &(args_info->selmode_given), + &(local_args_info.selmode_given), optarg, + 0, "0x01", ARG_INT, check_ambiguity, + override, 0, 0, "selmode", '-', + additional_error)) goto failure; - } - if (args_info->selmode_given && !override) - continue; - local_args_info.selmode_given = 1; - args_info->selmode_given = 1; - args_info->selmode_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->selmode_orig) - free(args_info->selmode_orig); /* free previous string */ - args_info->selmode_orig = - gengetopt_strdup(optarg); - } - /* QoS Extension 1. */ - else if (strcmp - (long_options[option_index].name, - "qose1") == 0) { - if (args_info->qose1_given) { - fprintf(stderr, - "%s: `--qose1' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose1_given = 1; - args_info->qose1_arg = - strtoull(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose1_orig) - free(args_info->qose1_orig); /* free previous string */ - args_info->qose1_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 2. */ - else if (strcmp - (long_options[option_index].name, - "qose2") == 0) { - if (args_info->qose2_given) { - fprintf(stderr, - "%s: `--qose2' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose2_given = 1; - args_info->qose2_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose2_orig) - free(args_info->qose2_orig); /* free previous string */ - args_info->qose2_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 3. */ - else if (strcmp - (long_options[option_index].name, - "qose3") == 0) { - if (args_info->qose3_given) { - fprintf(stderr, - "%s: `--qose3' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose3_given = 1; - args_info->qose3_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose3_orig) - free(args_info->qose3_orig); /* free previous string */ - args_info->qose3_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 4. */ - else if (strcmp - (long_options[option_index].name, - "qose4") == 0) { - if (args_info->qose4_given) { - fprintf(stderr, - "%s: `--qose4' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose4_given = 1; - args_info->qose4_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose4_orig) - free(args_info->qose4_orig); /* free previous string */ - args_info->qose4_orig = - gengetopt_strdup(optarg); - break; + } /* Radio Access Technology Type. */ else if (strcmp (long_options[option_index].name, "rattype") == 0) { - if (args_info->rattype_given) { - fprintf(stderr, - "%s: `--rattype' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rattype_given = 1; - /* args_info->rattype_arg = strtol (optarg,&stop_char,0); */ - args_info->rattype_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->rattype_arg), + &(args_info->rattype_orig), + &(args_info->rattype_given), + &(local_args_info.rattype_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "rattype", '-', additional_error)) + goto failure; + } /* User Location Information. */ else if (strcmp (long_options[option_index].name, "userloc") == 0) { - if (args_info->userloc_given) { - fprintf(stderr, - "%s: `--userloc' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->userloc_given = 1; - args_info->userloc_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->userloc_arg), + &(args_info->userloc_orig), + &(args_info->userloc_given), + &(local_args_info.userloc_given), optarg, + 0, "02509946241207", ARG_STRING, + check_ambiguity, override, 0, 0, "userloc", + '-', additional_error)) + goto failure; + } /* Routing Area Information. */ else if (strcmp(long_options[option_index].name, "rai") == 0) { - if (args_info->rai_given) { - fprintf(stderr, - "%s: `--rai' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rai_given = 1; - args_info->rai_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->rai_arg), + &(args_info->rai_orig), + &(args_info->rai_given), + &(local_args_info.rai_given), + optarg, 0, "02509946241207", + ARG_STRING, check_ambiguity, + override, 0, 0, "rai", '-', + additional_error)) + goto failure; + } - /* MS Time Zone */ + /* MS Time Zone. */ else if (strcmp(long_options[option_index].name, "mstz") == 0) { - if (args_info->mstz_given) { - fprintf(stderr, - "%s: `--mstz' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->mstz_given = 1; - args_info->mstz_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->mstz_arg), + &(args_info->mstz_orig), + &(args_info->mstz_given), + &(local_args_info.mstz_given), + optarg, 0, "0", ARG_STRING, + check_ambiguity, override, 0, 0, + "mstz", '-', additional_error)) + goto failure; + } - /* IMEI(SV) */ + /* IMEI(SV) International Mobile Equipment Identity (and Software Version). */ else if (strcmp (long_options[option_index].name, "imeisv") == 0) { - if (args_info->imeisv_given) { - fprintf(stderr, - "%s: `--imeisv' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->imeisv_given = 1; - args_info->imeisv_arg = strdup(optarg); - break; - } - /* NSAPI. */ - else if (strcmp - (long_options[option_index].name, - "nsapi") == 0) { - if (local_args_info.nsapi_given) { - fprintf(stderr, - "%s: `--nsapi' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->imeisv_arg), + &(args_info->imeisv_orig), + &(args_info->imeisv_given), + &(local_args_info.imeisv_given), + optarg, 0, "2143658709214365", + ARG_STRING, check_ambiguity, + override, 0, 0, "imeisv", '-', + additional_error)) goto failure; - } - if (args_info->nsapi_given && !override) - continue; - local_args_info.nsapi_given = 1; - args_info->nsapi_given = 1; - args_info->nsapi_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->nsapi_orig) - free(args_info->nsapi_orig); /* free previous string */ - args_info->nsapi_orig = - gengetopt_strdup(optarg); - } - /* Charging characteristics. */ - else if (strcmp - (long_options[option_index].name, - "charging") == 0) { - if (local_args_info.charging_given) { - fprintf(stderr, - "%s: `--charging' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->charging_given && !override) - continue; - local_args_info.charging_given = 1; - args_info->charging_given = 1; - args_info->charging_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->charging_orig) - free(args_info->charging_orig); /* free previous string */ - args_info->charging_orig = - gengetopt_strdup(optarg); - } - /* Create local network interface. */ - else if (strcmp - (long_options[option_index].name, - "createif") == 0) { - if (local_args_info.createif_given) { - fprintf(stderr, - "%s: `--createif' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->createif_given && !override) - continue; - local_args_info.createif_given = 1; - args_info->createif_given = 1; - args_info->createif_flag = - !(args_info->createif_flag); - } - /* Create default route. */ - else if (strcmp - (long_options[option_index].name, - "defaultroute") == 0) { - if (local_args_info.defaultroute_given) { - fprintf(stderr, - "%s: `--defaultroute' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->defaultroute_given && !override) - continue; - local_args_info.defaultroute_given = 1; - args_info->defaultroute_given = 1; - args_info->defaultroute_flag = - !(args_info->defaultroute_flag); - } - /* Script to run after link-up. */ - else if (strcmp(long_options[option_index].name, "ipup") - == 0) { - if (local_args_info.ipup_given) { - fprintf(stderr, - "%s: `--ipup' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipup_given && !override) - continue; - local_args_info.ipup_given = 1; - args_info->ipup_given = 1; - if (args_info->ipup_arg) - free(args_info->ipup_arg); /* free previous string */ - args_info->ipup_arg = gengetopt_strdup(optarg); - if (args_info->ipup_orig) - free(args_info->ipup_orig); /* free previous string */ - args_info->ipup_orig = gengetopt_strdup(optarg); - } - /* Script to run after link-down. */ - else if (strcmp - (long_options[option_index].name, - "ipdown") == 0) { - if (local_args_info.ipdown_given) { - fprintf(stderr, - "%s: `--ipdown' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipdown_given && !override) - continue; - local_args_info.ipdown_given = 1; - args_info->ipdown_given = 1; - if (args_info->ipdown_arg) - free(args_info->ipdown_arg); /* free previous string */ - args_info->ipdown_arg = - gengetopt_strdup(optarg); - if (args_info->ipdown_orig) - free(args_info->ipdown_orig); /* free previous string */ - args_info->ipdown_orig = - gengetopt_strdup(optarg); - } - /* Ping remote host. */ - else if (strcmp - (long_options[option_index].name, - "pinghost") == 0) { - if (local_args_info.pinghost_given) { - fprintf(stderr, - "%s: `--pinghost' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pinghost_given && !override) - continue; - local_args_info.pinghost_given = 1; - args_info->pinghost_given = 1; - if (args_info->pinghost_arg) - free(args_info->pinghost_arg); /* free previous string */ - args_info->pinghost_arg = - gengetopt_strdup(optarg); - if (args_info->pinghost_orig) - free(args_info->pinghost_orig); /* free previous string */ - args_info->pinghost_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req per second. */ - else if (strcmp - (long_options[option_index].name, - "pingrate") == 0) { - if (local_args_info.pingrate_given) { - fprintf(stderr, - "%s: `--pingrate' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingrate_given && !override) - continue; - local_args_info.pingrate_given = 1; - args_info->pingrate_given = 1; - args_info->pingrate_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingrate_orig) - free(args_info->pingrate_orig); /* free previous string */ - args_info->pingrate_orig = - gengetopt_strdup(optarg); - } - /* Number of ping data bytes. */ - else if (strcmp - (long_options[option_index].name, - "pingsize") == 0) { - if (local_args_info.pingsize_given) { - fprintf(stderr, - "%s: `--pingsize' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingsize_given && !override) - continue; - local_args_info.pingsize_given = 1; - args_info->pingsize_given = 1; - args_info->pingsize_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingsize_orig) - free(args_info->pingsize_orig); /* free previous string */ - args_info->pingsize_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req to send. */ - else if (strcmp - (long_options[option_index].name, - "pingcount") == 0) { - if (local_args_info.pingcount_given) { - fprintf(stderr, - "%s: `--pingcount' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingcount_given && !override) - continue; - local_args_info.pingcount_given = 1; - args_info->pingcount_given = 1; - args_info->pingcount_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingcount_orig) - free(args_info->pingcount_orig); /* free previous string */ - args_info->pingcount_orig = - gengetopt_strdup(optarg); - } - /* Do not print ping packet info. */ - else if (strcmp - (long_options[option_index].name, - "pingquiet") == 0) { - if (local_args_info.pingquiet_given) { - fprintf(stderr, - "%s: `--pingquiet' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingquiet_given && !override) - continue; - local_args_info.pingquiet_given = 1; - args_info->pingquiet_given = 1; - args_info->pingquiet_flag = - !(args_info->pingquiet_flag); + } /* Do not send recovery. */ else if (strcmp (long_options[option_index].name, "norecovery") == 0) { - if (local_args_info.norecovery_given) { - fprintf(stderr, - "%s: `--norecovery' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->norecovery_flag), 0, + &(args_info->norecovery_given), + &(local_args_info.norecovery_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "norecovery", '-', + additional_error)) goto failure; - } - if (args_info->norecovery_given && !override) - continue; - local_args_info.norecovery_given = 1; - args_info->norecovery_given = 1; - args_info->norecovery_flag = - !(args_info->norecovery_flag); + + } + /* NSAPI. */ + else if (strcmp + (long_options[option_index].name, + "nsapi") == 0) { + + if (update_arg((void *)&(args_info->nsapi_arg), + &(args_info->nsapi_orig), + &(args_info->nsapi_given), + &(local_args_info.nsapi_given), + optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "nsapi", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 1. */ + else if (strcmp + (long_options[option_index].name, + "qose1") == 0) { + + if (update_arg((void *)&(args_info->qose1_arg), + &(args_info->qose1_orig), + &(args_info->qose1_given), + &(local_args_info.qose1_given), + optarg, 0, "0x9396404074f9ffff", + ARG_INT, check_ambiguity, + override, 0, 0, "qose1", '-', + additional_error)) + goto failure; + + } + /* Requested quality of service Extension 2. */ + else if (strcmp + (long_options[option_index].name, + "qose2") == 0) { + + if (update_arg((void *)&(args_info->qose2_arg), + &(args_info->qose2_orig), + &(args_info->qose2_given), + &(local_args_info.qose2_given), + optarg, 0, "0x11", ARG_INT, + check_ambiguity, override, 0, 0, + "qose2", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 3. */ + else if (strcmp + (long_options[option_index].name, + "qose3") == 0) { + + if (update_arg((void *)&(args_info->qose3_arg), + &(args_info->qose3_orig), + &(args_info->qose3_given), + &(local_args_info.qose3_given), + optarg, 0, "0x0101", ARG_INT, + check_ambiguity, override, 0, 0, + "qose3", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 4. */ + else if (strcmp + (long_options[option_index].name, + "qose4") == 0) { + + if (update_arg((void *)&(args_info->qose4_arg), + &(args_info->qose4_orig), + &(args_info->qose4_given), + &(local_args_info.qose4_given), + optarg, 0, "0x4040", ARG_INT, + check_ambiguity, override, 0, 0, + "qose4", '-', additional_error)) + goto failure; + + } + /* Charging characteristics. */ + else if (strcmp + (long_options[option_index].name, + "charging") == 0) { + + if (update_arg + ((void *)&(args_info->charging_arg), + &(args_info->charging_orig), + &(args_info->charging_given), + &(local_args_info.charging_given), optarg, + 0, "0x0800", ARG_INT, check_ambiguity, + override, 0, 0, "charging", '-', + additional_error)) + goto failure; + + } + /* Create local network interface. */ + else if (strcmp + (long_options[option_index].name, + "createif") == 0) { + + if (update_arg + ((void *)&(args_info->createif_flag), 0, + &(args_info->createif_given), + &(local_args_info.createif_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "createif", '-', additional_error)) + goto failure; + + } + /* Create default route. */ + else if (strcmp + (long_options[option_index].name, + "defaultroute") == 0) { + + if (update_arg + ((void *)&(args_info->defaultroute_flag), 0, + &(args_info->defaultroute_given), + &(local_args_info.defaultroute_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "defaultroute", '-', + additional_error)) + goto failure; + + } + /* Script to run after link-up. */ + else if (strcmp(long_options[option_index].name, "ipup") + == 0) { + + if (update_arg((void *)&(args_info->ipup_arg), + &(args_info->ipup_orig), + &(args_info->ipup_given), + &(local_args_info.ipup_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipup", '-', additional_error)) + goto failure; + + } + /* Script to run after link-down. */ + else if (strcmp + (long_options[option_index].name, + "ipdown") == 0) { + + if (update_arg((void *)&(args_info->ipdown_arg), + &(args_info->ipdown_orig), + &(args_info->ipdown_given), + &(local_args_info.ipdown_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipdown", '-', additional_error)) + goto failure; + + } + /* Ping remote host. */ + else if (strcmp + (long_options[option_index].name, + "pinghost") == 0) { + + if (update_arg + ((void *)&(args_info->pinghost_arg), + &(args_info->pinghost_orig), + &(args_info->pinghost_given), + &(local_args_info.pinghost_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "pinghost", '-', + additional_error)) + goto failure; + + } + /* Number of ping req per second. */ + else if (strcmp + (long_options[option_index].name, + "pingrate") == 0) { + + if (update_arg + ((void *)&(args_info->pingrate_arg), + &(args_info->pingrate_orig), + &(args_info->pingrate_given), + &(local_args_info.pingrate_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "pingrate", '-', additional_error)) + goto failure; + + } + /* Number of ping data bytes. */ + else if (strcmp + (long_options[option_index].name, + "pingsize") == 0) { + + if (update_arg + ((void *)&(args_info->pingsize_arg), + &(args_info->pingsize_orig), + &(args_info->pingsize_given), + &(local_args_info.pingsize_given), optarg, + 0, "56", ARG_INT, check_ambiguity, + override, 0, 0, "pingsize", '-', + additional_error)) + goto failure; + + } + /* Number of ping req to send. */ + else if (strcmp + (long_options[option_index].name, + "pingcount") == 0) { + + if (update_arg + ((void *)&(args_info->pingcount_arg), + &(args_info->pingcount_orig), + &(args_info->pingcount_given), + &(local_args_info.pingcount_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "pingcount", '-', additional_error)) + goto failure; + + } + /* Do not print ping packet info. */ + else if (strcmp + (long_options[option_index].name, + "pingquiet") == 0) { + + if (update_arg + ((void *)&(args_info->pingquiet_flag), 0, + &(args_info->pingquiet_given), + &(local_args_info.pingquiet_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "pingquiet", '-', additional_error)) + goto failure; + } break; @@ -1740,7 +1418,7 @@ cmdline_parser_release(&local_args_info); - if (error) + if (error_occurred) return (EXIT_FAILURE); return 0; @@ -1759,40 +1437,25 @@ #define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) /* 3 is for "--" and "=" */ -char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; - -int -cmdline_parser_configfile(char *const filename, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +static int _cmdline_parser_configfile(const char *filename, int *my_argc) { FILE *file; + char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; char linebuf[CONFIG_FILE_LINE_SIZE]; int line_num = 0; - int i, result, equal; + int result = 0, equal; char *fopt, *farg; char *str_index; size_t len, next_token; char delimiter; - int my_argc = 0; - char **my_argv_arg; - char *additional_error; - /* store the program name */ - cmd_line_list_tmp = - (struct line_list *)malloc(sizeof(struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); - - if ((file = fopen(filename, "r")) == NULL) { + if ((file = fopen(filename, "r")) == 0) { fprintf(stderr, "%s: Error opening configuration file '%s'\n", CMDLINE_PARSER_PACKAGE, filename); - result = EXIT_FAILURE; - goto conf_failure; + return EXIT_FAILURE; } - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != NULL) { + while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) { ++line_num; my_argv[0] = '\0'; len = strlen(linebuf); @@ -1801,7 +1464,7 @@ "%s:%s:%d: Line too long in configuration file\n", CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } /* find first non-whitespace character in the line */ @@ -1817,7 +1480,7 @@ next_token = strcspn(fopt, " \t\r\n="); if (fopt[next_token] == '\0') { /* the line is over */ - farg = NULL; + farg = 0; equal = 0; goto noarg; } @@ -1828,6 +1491,7 @@ /* advance pointers to the next token after the end of fopt */ next_token += strspn(fopt + next_token, " \t\r\n"); + /* check for the presence of equal sign, and if so, skip it */ if (!equal) if ((equal = (fopt[next_token] == '='))) { @@ -1848,7 +1512,7 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } else { /* read up the remaining part up to a delimiter */ next_token = strcspn(farg, " \t\r\n#\'\""); @@ -1868,20 +1532,31 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } noarg: - ++my_argc; + if (!strcmp(fopt, "include")) { + if (farg && *farg) { + result = + _cmdline_parser_configfile(farg, my_argc); + } else { + fprintf(stderr, + "%s:%s:%d: include requires a filename argument.\n", + CMDLINE_PARSER_PACKAGE, filename, + line_num); + } + continue; + } len = strlen(fopt); - strcat(my_argv, len > 1 ? "--" : "-"); strcat(my_argv, fopt); if (len > 1 && ((farg && *farg) || equal)) strcat(my_argv, "="); if (farg && *farg) strcat(my_argv, farg); + ++(*my_argc); cmd_line_list_tmp = (struct line_list *)malloc(sizeof(struct line_list)); @@ -1890,30 +1565,69 @@ cmd_line_list->string_arg = gengetopt_strdup(my_argv); } /* while */ - ++my_argc; /* for program name */ - my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - my_argv_arg[my_argc] = 0; - - additional_error = - (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy(additional_error, ADDITIONAL_ERROR); - strcat(additional_error, filename); - result = - cmdline_parser_internal(my_argc, my_argv_arg, args_info, override, - initialize, check_required, - additional_error); - - free(additional_error); - free(my_argv_arg); - -conf_failure: if (file) fclose(file); + return result; +} + +int +cmdline_parser_configfile(const char *filename, + struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + return cmdline_parser_config_file(filename, args_info, ¶ms); +} + +int +cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) +{ + int i, result; + int my_argc = 1; + char **my_argv_arg; + char *additional_error; + + /* store the program name */ + cmd_line_list_tmp = + (struct line_list *)malloc(sizeof(struct line_list)); + cmd_line_list_tmp->next = cmd_line_list; + cmd_line_list = cmd_line_list_tmp; + cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); + + result = _cmdline_parser_configfile(filename, &my_argc); + + if (result != EXIT_FAILURE) { + my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); + cmd_line_list_tmp = cmd_line_list; + + for (i = my_argc - 1; i >= 0; --i) { + my_argv_arg[i] = cmd_line_list_tmp->string_arg; + cmd_line_list_tmp = cmd_line_list_tmp->next; + } + + my_argv_arg[my_argc] = 0; + + additional_error = + (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + + 1); + strcpy(additional_error, ADDITIONAL_ERROR); + strcat(additional_error, filename); + result = + cmdline_parser_internal(my_argc, my_argv_arg, args_info, + params, additional_error); + + free(additional_error); + free(my_argv_arg); + } free_cmd_list(); if (result == EXIT_FAILURE) { diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 2170e8b..0184775 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -6,7 +6,11 @@ # notice and this permission notice is included in all copies or # substantial portions of the software. # -# Use "gengetopt --conf-parser < cmdline.ggo" +# Use +# gengetopt --conf-parser < cmdline.ggo +# linux-2.6/scripts/Lindent cmdline.c +# linux-2.6/scripts/Lindent cmdline.h +# sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h option "debug" d "Run in debug mode" flag off diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 17f7c18..248384e 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -1,6 +1,9 @@ -/* cmdline.h */ - -/* File autogenerated by gengetopt version 2.17 */ +/** @file cmdline.h + * @brief The header file for the command line option parser + * generated by GNU Gengetopt version 2.22.6 + * http://www.gnu.org/software/gengetopt. + * DO NOT modify this file, since it can be overwritten + * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H @@ -10,197 +13,495 @@ #include "config.h" #endif +#include /* for FILE */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE +/** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE PACKAGE #endif +#ifndef CMDLINE_PARSER_PACKAGE_NAME +/** @brief the complete program name (used for help and version) */ +#ifdef PACKAGE_NAME +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME +#else +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE +#endif +#endif + #ifndef CMDLINE_PARSER_VERSION +/** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif +/** @brief Where the command line options are stored */ struct gengetopt_args_info { - const char *help_help; /* Print help and exit help description. */ - const char *version_help; /* Print version and exit help description. */ - int debug_flag; /* Run in debug mode (default=off). */ - const char *debug_help; /* Run in debug mode help description. */ - char *conf_arg; /* Read configuration file. */ - char *conf_orig; /* Read configuration file original value given at command line. */ - const char *conf_help; /* Read configuration file help description. */ - char *pidfile_arg; /* Filename of process id file (default='./sgsnemu.pid'). */ - char *pidfile_orig; /* Filename of process id file original value given at command line. */ - const char *pidfile_help; /* Filename of process id file help description. */ - char *statedir_arg; /* Directory of nonvolatile data (default='./'). */ - char *statedir_orig; /* Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /* Directory of nonvolatile data help description. */ - char *dns_arg; /* DNS Server to use. */ - char *dns_orig; /* DNS Server to use original value given at command line. */ - const char *dns_help; /* DNS Server to use help description. */ - char *listen_arg; /* Local interface. */ - char *listen_orig; /* Local interface original value given at command line. */ - const char *listen_help; /* Local interface help description. */ - char *remote_arg; /* Remote host. */ - char *remote_orig; /* Remote host original value given at command line. */ - const char *remote_help; /* Remote host help description. */ - int contexts_arg; /* Number of contexts (default='1'). */ - char *contexts_orig; /* Number of contexts original value given at command line. */ - const char *contexts_help; /* Number of contexts help description. */ - int timelimit_arg; /* Exit after timelimit seconds (default='0'). */ - char *timelimit_orig; /* Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /* Exit after timelimit seconds help description. */ - int gtpversion_arg; /* GTP version to use (default='1'). */ - char *gtpversion_orig; /* GTP version to use original value given at command line. */ - const char *gtpversion_help; /* GTP version to use help description. */ - char *apn_arg; /* Access point name (default='internet'). */ - char *apn_orig; /* Access point name original value given at command line. */ - const char *apn_help; /* Access point name help description. */ - int selmode_arg; /* Selection mode (default='0x01'). */ - char *selmode_orig; /* Selection mode original value given at command line. */ - const char *selmode_help; /* Selection mode help description. */ - char *rattype_arg; /* Radio Access Technology Type (optional). */ + const char *help_help; + /**< @brief Print help and exit help description. */ + const char *version_help; + /**< @brief Print version and exit help description. */ + int debug_flag; + /**< @brief Run in debug mode (default=off). */ + const char *debug_help; + /**< @brief Run in debug mode help description. */ + char *conf_arg; + /**< @brief Read configuration file. */ + char *conf_orig; + /**< @brief Read configuration file original value given at command line. */ + const char *conf_help; + /**< @brief Read configuration file help description. */ + char *pidfile_arg; + /**< @brief Filename of process id file (default='./sgsnemu.pid'). */ + char *pidfile_orig; + /**< @brief Filename of process id file original value given at command line. */ + const char *pidfile_help; + /**< @brief Filename of process id file help description. */ + char *statedir_arg; + /**< @brief Directory of nonvolatile data (default='./'). */ + char *statedir_orig; + /**< @brief Directory of nonvolatile data original value given at command line. */ + const char *statedir_help; + /**< @brief Directory of nonvolatile data help description. */ + char *dns_arg; + /**< @brief DNS Server to use. */ + char *dns_orig; + /**< @brief DNS Server to use original value given at command line. */ + const char *dns_help; + /**< @brief DNS Server to use help description. */ + char *listen_arg; + /**< @brief Local interface. */ + char *listen_orig; + /**< @brief Local interface original value given at command line. */ + const char *listen_help; + /**< @brief Local interface help description. */ + char *remote_arg; + /**< @brief Remote host. */ + char *remote_orig; + /**< @brief Remote host original value given at command line. */ + const char *remote_help; + /**< @brief Remote host help description. */ + int contexts_arg; + /**< @brief Number of contexts (default='1'). */ + char *contexts_orig; + /**< @brief Number of contexts original value given at command line. */ + const char *contexts_help; + /**< @brief Number of contexts help description. */ + int timelimit_arg; + /**< @brief Exit after timelimit seconds (default='0'). */ + char *timelimit_orig; + /**< @brief Exit after timelimit seconds original value given at command line. */ + const char *timelimit_help; + /**< @brief Exit after timelimit seconds help description. */ + int gtpversion_arg; + /**< @brief GTP version to use (default='1'). */ + char *gtpversion_orig; + /**< @brief GTP version to use original value given at command line. */ + const char *gtpversion_help; + /**< @brief GTP version to use help description. */ + char *apn_arg; + /**< @brief Access point name (default='internet'). */ + char *apn_orig; + /**< @brief Access point name original value given at command line. */ + const char *apn_help; + /**< @brief Access point name help description. */ + int selmode_arg; + /**< @brief Selection mode (default='0x01'). */ + char *selmode_orig; + /**< @brief Selection mode original value given at command line. */ + const char *selmode_help; + /**< @brief Selection mode help description. */ + int rattype_arg; + /**< @brief Radio Access Technology Type (default='1'). */ char *rattype_orig; - char *rattype_help; - char *userloc_arg; /* User Location Information (optional). */ + /**< @brief Radio Access Technology Type original value given at command line. */ + const char *rattype_help; + /**< @brief Radio Access Technology Type help description. */ + char *userloc_arg; + /**< @brief User Location Information (default='02509946241207'). */ char *userloc_orig; - char *userloc_help; - char *rai_arg; /* Routing Area Information (optional). */ + /**< @brief User Location Information original value given at command line. */ + const char *userloc_help; + /**< @brief User Location Information help description. */ + char *rai_arg; + /**< @brief Routing Area Information (default='02509946241207'). */ char *rai_orig; - char *rai_help; - char *mstz_arg; /* MS Time Zone (optional). */ + /**< @brief Routing Area Information original value given at command line. */ + const char *rai_help; + /**< @brief Routing Area Information help description. */ + char *mstz_arg; + /**< @brief MS Time Zone (default='0'). */ char *mstz_orig; - char *mstz_help; - char *imeisv_arg; /* IMEI(SV) (optional). */ + /**< @brief MS Time Zone original value given at command line. */ + const char *mstz_help; + /**< @brief MS Time Zone help description. */ + char *imeisv_arg; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) (default='2143658709214365'). */ char *imeisv_orig; - char *imeisv_help; - char *imsi_arg; /* IMSI (default='240010123456789'). */ - char *imsi_orig; /* IMSI original value given at command line. */ - const char *imsi_help; /* IMSI help description. */ - int nsapi_arg; /* NSAPI (default='0'). */ - char *nsapi_orig; /* NSAPI original value given at command line. */ - const char *nsapi_help; /* NSAPI help description. */ - char *msisdn_arg; /* Mobile Station ISDN number (default='46702123456'). */ - char *msisdn_orig; /* Mobile Station ISDN number original value given at command line. */ - const char *msisdn_help; /* Mobile Station ISDN number help description. */ - int qos_arg; /* Requested quality of service (default='0x0b921f'). */ - char *qos_orig; /* Requested quality of service original value given at command line. */ - const char *qos_help; /* Requested quality of service help description. */ - unsigned long long int qose1_arg; /* Requested quality of service Extension 1 */ - char *qose1_orig; /* Requested quality of service Extension 1 original value given at command line. */ - int qose2_arg; /* Requested quality of service Extension 2 */ - char *qose2_orig; /* Requested quality of service Extension 2 original value given at command line. */ - int qose3_arg; /* Requested quality of service Extension 3 */ - char *qose3_orig; /* Requested quality of service Extension 3 original value given at command line. */ - int qose4_arg; /* Requested quality of service Extension 4 */ - char *qose4_orig; /* Requested quality of service Extension 4 original value given at command line. */ - int charging_arg; /* Charging characteristics (default='0x0800'). */ - char *charging_orig; /* Charging characteristics original value given at command line. */ - const char *charging_help; /* Charging characteristics help description. */ - char *uid_arg; /* Login user ID (default='mig'). */ - char *uid_orig; /* Login user ID original value given at command line. */ - const char *uid_help; /* Login user ID help description. */ - char *pwd_arg; /* Login password (default='hemmelig'). */ - char *pwd_orig; /* Login password original value given at command line. */ - const char *pwd_help; /* Login password help description. */ - int createif_flag; /* Create local network interface (default=off). */ - const char *createif_help; /* Create local network interface help description. */ - char *net_arg; /* Network address for local interface. */ - char *net_orig; /* Network address for local interface original value given at command line. */ - const char *net_help; /* Network address for local interface help description. */ - int defaultroute_flag; /* Create default route (default=off). */ - const char *defaultroute_help; /* Create default route help description. */ - char *ipup_arg; /* Script to run after link-up. */ - char *ipup_orig; /* Script to run after link-up original value given at command line. */ - const char *ipup_help; /* Script to run after link-up help description. */ - char *ipdown_arg; /* Script to run after link-down. */ - char *ipdown_orig; /* Script to run after link-down original value given at command line. */ - const char *ipdown_help; /* Script to run after link-down help description. */ - char *pinghost_arg; /* Ping remote host. */ - char *pinghost_orig; /* Ping remote host original value given at command line. */ - const char *pinghost_help; /* Ping remote host help description. */ - int pingrate_arg; /* Number of ping req per second (default='1'). */ - char *pingrate_orig; /* Number of ping req per second original value given at command line. */ - const char *pingrate_help; /* Number of ping req per second help description. */ - int pingsize_arg; /* Number of ping data bytes (default='56'). */ - char *pingsize_orig; /* Number of ping data bytes original value given at command line. */ - const char *pingsize_help; /* Number of ping data bytes help description. */ - int pingcount_arg; /* Number of ping req to send (default='0'). */ - char *pingcount_orig; /* Number of ping req to send original value given at command line. */ - const char *pingcount_help; /* Number of ping req to send help description. */ - int pingquiet_flag; /* Do not print ping packet info (default=off). */ - const char *pingquiet_help; /* Do not print ping packet info help description. */ - int norecovery_flag; /* Do not print ping packet info (default=off). */ - const char *norecovery_help; /* Do not print ping packet info help description. */ + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) original value given at command line. */ + const char *imeisv_help; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) help description. */ + int norecovery_flag; + /**< @brief Do not send recovery (default=off). */ + const char *norecovery_help; + /**< @brief Do not send recovery help description. */ + char *imsi_arg; + /**< @brief IMSI (default='240010123456789'). */ + char *imsi_orig; + /**< @brief IMSI original value given at command line. */ + const char *imsi_help; + /**< @brief IMSI help description. */ + int nsapi_arg; + /**< @brief NSAPI (default='0'). */ + char *nsapi_orig; + /**< @brief NSAPI original value given at command line. */ + const char *nsapi_help; + /**< @brief NSAPI help description. */ + char *msisdn_arg; + /**< @brief Mobile Station ISDN number (default='46702123456'). */ + char *msisdn_orig; + /**< @brief Mobile Station ISDN number original value given at command line. */ + const char *msisdn_help; + /**< @brief Mobile Station ISDN number help description. */ + int qos_arg; + /**< @brief Requested quality of service (default='0x000b921f'). */ + char *qos_orig; + /**< @brief Requested quality of service original value given at command line. */ + const char *qos_help; + /**< @brief Requested quality of service help description. */ + unsigned long long int qose1_arg; + /**< @brief Requested quality of service Extension 1 (default='0x9396404074f9ffff'). */ + char *qose1_orig; + /**< @brief Requested quality of service Extension 1 original value given at command line. */ + const char *qose1_help; + /**< @brief Requested quality of service Extension 1 help description. */ + int qose2_arg; + /**< @brief Requested quality of service Extension 2 (default='0x11'). */ + char *qose2_orig; + /**< @brief Requested quality of service Extension 2 original value given at command line. */ + const char *qose2_help; + /**< @brief Requested quality of service Extension 2 help description. */ + int qose3_arg; + /**< @brief Requested quality of service Extension 3 (default='0x0101'). */ + char *qose3_orig; + /**< @brief Requested quality of service Extension 3 original value given at command line. */ + const char *qose3_help; + /**< @brief Requested quality of service Extension 3 help description. */ + int qose4_arg; + /**< @brief Requested quality of service Extension 4 (default='0x4040'). */ + char *qose4_orig; + /**< @brief Requested quality of service Extension 4 original value given at command line. */ + const char *qose4_help; + /**< @brief Requested quality of service Extension 4 help description. */ + int charging_arg; + /**< @brief Charging characteristics (default='0x0800'). */ + char *charging_orig; + /**< @brief Charging characteristics original value given at command line. */ + const char *charging_help; + /**< @brief Charging characteristics help description. */ + char *uid_arg; + /**< @brief Login user ID (default='mig'). */ + char *uid_orig; + /**< @brief Login user ID original value given at command line. */ + const char *uid_help; + /**< @brief Login user ID help description. */ + char *pwd_arg; + /**< @brief Login password (default='hemmelig'). */ + char *pwd_orig; + /**< @brief Login password original value given at command line. */ + const char *pwd_help; + /**< @brief Login password help description. */ + int createif_flag; + /**< @brief Create local network interface (default=off). */ + const char *createif_help; + /**< @brief Create local network interface help description. */ + char *net_arg; + /**< @brief Network address for local interface. */ + char *net_orig; + /**< @brief Network address for local interface original value given at command line. */ + const char *net_help; + /**< @brief Network address for local interface help description. */ + int defaultroute_flag; + /**< @brief Create default route (default=off). */ + const char *defaultroute_help; + /**< @brief Create default route help description. */ + char *ipup_arg; + /**< @brief Script to run after link-up. */ + char *ipup_orig; + /**< @brief Script to run after link-up original value given at command line. */ + const char *ipup_help; + /**< @brief Script to run after link-up help description. */ + char *ipdown_arg; + /**< @brief Script to run after link-down. */ + char *ipdown_orig; + /**< @brief Script to run after link-down original value given at command line. */ + const char *ipdown_help; + /**< @brief Script to run after link-down help description. */ + char *pinghost_arg; + /**< @brief Ping remote host. */ + char *pinghost_orig; + /**< @brief Ping remote host original value given at command line. */ + const char *pinghost_help; + /**< @brief Ping remote host help description. */ + int pingrate_arg; + /**< @brief Number of ping req per second (default='1'). */ + char *pingrate_orig; + /**< @brief Number of ping req per second original value given at command line. */ + const char *pingrate_help; + /**< @brief Number of ping req per second help description. */ + int pingsize_arg; + /**< @brief Number of ping data bytes (default='56'). */ + char *pingsize_orig; + /**< @brief Number of ping data bytes original value given at command line. */ + const char *pingsize_help; + /**< @brief Number of ping data bytes help description. */ + int pingcount_arg; + /**< @brief Number of ping req to send (default='0'). */ + char *pingcount_orig; + /**< @brief Number of ping req to send original value given at command line. */ + const char *pingcount_help; + /**< @brief Number of ping req to send help description. */ + int pingquiet_flag; + /**< @brief Do not print ping packet info (default=off). */ + const char *pingquiet_help; + /**< @brief Do not print ping packet info help description. */ - int help_given; /* Whether help was given. */ - int version_given; /* Whether version was given. */ - int debug_given; /* Whether debug was given. */ - int conf_given; /* Whether conf was given. */ - int pidfile_given; /* Whether pidfile was given. */ - int statedir_given; /* Whether statedir was given. */ - int dns_given; /* Whether dns was given. */ - int listen_given; /* Whether listen was given. */ - int remote_given; /* Whether remote was given. */ - int contexts_given; /* Whether contexts was given. */ - int timelimit_given; /* Whether timelimit was given. */ - int gtpversion_given; /* Whether gtpversion was given. */ - int apn_given; /* Whether apn was given. */ - int selmode_given; /* Whether selmode was given. */ - int rattype_given; /* Whether rattype was given. */ - int userloc_given; /* Whether userloc was given. */ - int rai_given; /* Whether RAI was given. */ - int mstz_given; /* Whether mstz was given. */ - int imeisv_given; /* Whether imeisv was given. */ - int imsi_given; /* Whether imsi was given. */ - int nsapi_given; /* Whether nsapi was given. */ - int msisdn_given; /* Whether msisdn was given. */ - int qos_given; /* Whether qos was given. */ - int qose1_given; /* Whether qos Extension 1 was given. */ - int qose2_given; /* Whether qos Extension 2 was given. */ - int qose3_given; /* Whether qos Extension 3 was given. */ - int qose4_given; /* Whether qos Extension 4 was given. */ - int charging_given; /* Whether charging was given. */ - int uid_given; /* Whether uid was given. */ - int pwd_given; /* Whether pwd was given. */ - int createif_given; /* Whether createif was given. */ - int net_given; /* Whether net was given. */ - int defaultroute_given; /* Whether defaultroute was given. */ - int ipup_given; /* Whether ipup was given. */ - int ipdown_given; /* Whether ipdown was given. */ - int pinghost_given; /* Whether pinghost was given. */ - int pingrate_given; /* Whether pingrate was given. */ - int pingsize_given; /* Whether pingsize was given. */ - int pingcount_given; /* Whether pingcount was given. */ - int pingquiet_given; /* Whether pingquiet was given. */ - int norecovery_given; /* Whether norecovery was given. */ + unsigned int help_given; + /**< @brief Whether help was given. */ + unsigned int version_given; + /**< @brief Whether version was given. */ + unsigned int debug_given; + /**< @brief Whether debug was given. */ + unsigned int conf_given; + /**< @brief Whether conf was given. */ + unsigned int pidfile_given; + /**< @brief Whether pidfile was given. */ + unsigned int statedir_given; + /**< @brief Whether statedir was given. */ + unsigned int dns_given; + /**< @brief Whether dns was given. */ + unsigned int listen_given; + /**< @brief Whether listen was given. */ + unsigned int remote_given; + /**< @brief Whether remote was given. */ + unsigned int contexts_given; + /**< @brief Whether contexts was given. */ + unsigned int timelimit_given; + /**< @brief Whether timelimit was given. */ + unsigned int gtpversion_given; + /**< @brief Whether gtpversion was given. */ + unsigned int apn_given; + /**< @brief Whether apn was given. */ + unsigned int selmode_given; + /**< @brief Whether selmode was given. */ + unsigned int rattype_given; + /**< @brief Whether rattype was given. */ + unsigned int userloc_given; + /**< @brief Whether userloc was given. */ + unsigned int rai_given; + /**< @brief Whether rai was given. */ + unsigned int mstz_given; + /**< @brief Whether mstz was given. */ + unsigned int imeisv_given; + /**< @brief Whether imeisv was given. */ + unsigned int norecovery_given; + /**< @brief Whether norecovery was given. */ + unsigned int imsi_given; + /**< @brief Whether imsi was given. */ + unsigned int nsapi_given; + /**< @brief Whether nsapi was given. */ + unsigned int msisdn_given; + /**< @brief Whether msisdn was given. */ + unsigned int qos_given; + /**< @brief Whether qos was given. */ + unsigned int qose1_given; + /**< @brief Whether qose1 was given. */ + unsigned int qose2_given; + /**< @brief Whether qose2 was given. */ + unsigned int qose3_given; + /**< @brief Whether qose3 was given. */ + unsigned int qose4_given; + /**< @brief Whether qose4 was given. */ + unsigned int charging_given; + /**< @brief Whether charging was given. */ + unsigned int uid_given; + /**< @brief Whether uid was given. */ + unsigned int pwd_given; + /**< @brief Whether pwd was given. */ + unsigned int createif_given; + /**< @brief Whether createif was given. */ + unsigned int net_given; + /**< @brief Whether net was given. */ + unsigned int defaultroute_given; + /**< @brief Whether defaultroute was given. */ + unsigned int ipup_given; + /**< @brief Whether ipup was given. */ + unsigned int ipdown_given; + /**< @brief Whether ipdown was given. */ + unsigned int pinghost_given; + /**< @brief Whether pinghost was given. */ + unsigned int pingrate_given; + /**< @brief Whether pingrate was given. */ + unsigned int pingsize_given; + /**< @brief Whether pingsize was given. */ + unsigned int pingcount_given; + /**< @brief Whether pingcount was given. */ + unsigned int pingquiet_given; + /**< @brief Whether pingquiet was given. */ }; +/** @brief The additional parameters to pass to parser functions */ + struct cmdline_parser_params { + int override; + /**< @brief whether to override possibly already present options (default 0) */ + int initialize; + /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ + int check_required; + /**< @brief whether to check that all required options were provided (default 1) */ + int check_ambiguity; + /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ + int print_errors; + /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ + }; + +/** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; +/** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; +/** @brief the description string of the program */ + extern const char *gengetopt_args_info_description; +/** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; - int cmdline_parser(int argc, char *const *argv, +/** + * The command line parser + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info); - int cmdline_parser2(int argc, char *const *argv, + +/** + * The command line parser (version with additional parameters - deprecated) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_ext() instead + */ + int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); + +/** + * The command line parser (version with additional parameters) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_ext(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Save the contents of the option struct into an already open FILE stream. + * @param outfile the stream where to dump options + * @param args_info the option struct to dump + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_dump(FILE * outfile, + struct gengetopt_args_info *args_info); + +/** + * Save the contents of the option struct into a (text) file. + * This file can be read by the config file parser (if generated by gengetopt) + * @param filename the file where to save + * @param args_info the option struct to save + * @return 0 if everything went fine, NON 0 if an error took place + */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); +/** + * Print the help + */ void cmdline_parser_print_help(void); +/** + * Print the version + */ void cmdline_parser_print_version(void); +/** + * Initializes all the fields a cmdline_parser_params structure + * to their default values + * @param params the structure to initialize + */ + void cmdline_parser_params_init(struct cmdline_parser_params *params); + +/** + * Allocates dynamically a cmdline_parser_params structure and initializes + * all its fields to their default values + * @return the created and initialized cmdline_parser_params structure + */ + struct cmdline_parser_params *cmdline_parser_params_create(void); + +/** + * Initializes the passed gengetopt_args_info structure's fields + * (also set default values for options that have a default) + * @param args_info the structure to initialize + */ void cmdline_parser_init(struct gengetopt_args_info *args_info); +/** + * Deallocates the string fields of the gengetopt_args_info structure + * (but does not deallocate the structure itself) + * @param args_info the structure to deallocate + */ void cmdline_parser_free(struct gengetopt_args_info *args_info); - int cmdline_parser_configfile(char *const filename, +/** + * The config file parser (deprecated version) + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_config_file() instead + */ + int cmdline_parser_configfile(const char *filename, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); +/** + * The config file parser + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Checks that all the required options were specified + * @param args_info the structure to check + * @param prog_name the name of the program that will be used to print + * possible errors + * @return + */ int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 0157e22..2bfe801 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -565,9 +565,9 @@ /* rattype */ if (args_info.rattype_given == 1) { options.rattype_given = 1; - options.rattype.l = strlen(args_info.rattype_arg); - options.rattype.v[0] = atoi(args_info.rattype_arg); - printf("Using RAT Type: %s\n", args_info.rattype_arg); + options.rattype.l = 1; + options.rattype.v[0] = args_info.rattype_arg; + printf("Using RAT Type: %d\n", args_info.rattype_arg); } /* userloc */ -- To view, visit https://gerrit.osmocom.org/4024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:45:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:45:43 +0000 Subject: osmo-ggsn[master]: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer su... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:45:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:45:53 +0000 Subject: osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:02 +0000 Subject: osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, i... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:08 +0000 Subject: osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for RAI In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:12 +0000 Subject: osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for --norecovery In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:31 +0000 Subject: osmo-ggsn[master]: sgsnemu: Re-generate cmdline.[ch] using gengetopt In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:35 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Re-generate cmdline.[ch] using gengetopt In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Re-generate cmdline.[ch] using gengetopt ...................................................................... sgsnemu: Re-generate cmdline.[ch] using gengetopt This will replace the manual additions to cmdline.[ch] with auto-generated code from gengetopt. We need to fix-up the RAT Type in sgsnemu.c as the manually-added code diverged from what gengetopt generates. Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 1,492 insertions(+), 1,473 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 1ff1a59..88210d7 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -1,5 +1,5 @@ /* - File autogenerated by gengetopt version 2.17 + File autogenerated by gengetopt version 2.22.6 generated with the following command: gengetopt --conf-parser @@ -17,7 +17,11 @@ #include #include -#include "getopt.h" +#ifndef FIX_UNUSED +#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ +#endif + +#include #include "cmdline.h" @@ -26,50 +30,57 @@ const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_versiontext = ""; + +const char *gengetopt_args_info_description = ""; + const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file", - " --pidfile=STRING Filename of process id file (default=`./sgsnemu.pid')", - " --statedir=STRING Directory of nonvolatile data (default=`./')", - " --dns=STRING DNS Server to use", - " -l, --listen=STRING Local interface", - " -r, --remote=STRING Remote host", - " --contexts=INT Number of contexts (default=`1')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " --gtpversion=INT GTP version to use (default=`1')", - " -a, --apn=STRING Access point name (default=`internet')", - " --selmode=INT Selection mode (default=`0x01')", - " --rattype=INT Radio Access Technology Type (optional-1to5)", - " --userloc=STRING User Location Information (optional-type.MCC.MNC.LAC.CIorSACorRAC)", - " --rai=STRING Routing Area Information (optional-MCC.MNC.LAC.RAC)", - " --mstz=STRING MS Time Zone (optional- sign.NbQuartersOfAnHour.DSTAdjustment)", - " --imeisv=STRING IMEI(SV) International Mobile Equipment Identity (and Software Version) (optional,16 digits)", - " -i, --imsi=STRING IMSI (default=`240010123456789')", - " --nsapi=INT NSAPI (default=`0')", - " -m, --msisdn=STRING Mobile Station ISDN number (default=`46702123456')", - " -q, --qos=INT Requested quality of service (default=`0x000b921f')", - " --qose1=INT Requested quality of service Extension 1 (example=`0x9396404074f9ffff')", - " --qose2=INT Requested quality of service Extension 2 (example=`0x11')", - " --qose3=INT Requested quality of service Extension 3 (example=`0x0101')", - " --qose4=INT Requested quality of service Extension 4 (example=`0x4040')", - " --charging=INT Charging characteristics (default=`0x0800')", - " -u, --uid=STRING Login user ID (default=`mig')", - " -p, --pwd=STRING Login password (default=`hemmelig')", - " --createif Create local network interface (default=off)", - " -n, --net=STRING Network address for local interface", - " --defaultroute Create default route (default=off)", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --pinghost=STRING Ping remote host", - " --pingrate=INT Number of ping req per second (default=`1')", - " --pingsize=INT Number of ping data bytes (default=`56')", - " --pingcount=INT Number of ping req to send (default=`0')", - " --pingquiet Do not print ping packet info (default=off)", - " --norecovery Do not send recovery (default=off)", + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -d, --debug Run in debug mode (default=off)", + " -c, --conf=STRING Read configuration file", + " --pidfile=STRING Filename of process id file\n (default=`./sgsnemu.pid')", + " --statedir=STRING Directory of nonvolatile data (default=`./')", + " --dns=STRING DNS Server to use", + " -l, --listen=STRING Local interface", + " -r, --remote=STRING Remote host", + " --contexts=INT Number of contexts (default=`1')", + " --timelimit=INT Exit after timelimit seconds (default=`0')", + " --gtpversion=INT GTP version to use (default=`1')", + " -a, --apn=STRING Access point name (default=`internet')", + " --selmode=INT Selection mode (default=`0x01')", + " --rattype=1..5 Radio Access Technology Type (default=`1')", + " --userloc=type.MCC.MNC.LAC.CIorSACorRAC\n User Location Information\n (default=`02509946241207')", + " --rai=MCC.MNC.LAC.RAC Routing Area Information\n (default=`02509946241207')", + " --mstz=sign.NbQuartersOfAnHour.DSTAdjustment\n MS Time Zone (default=`0')", + " --imeisv=STRING IMEI(SV) International Mobile Equipment\n Identity (and Software Version)\n (default=`2143658709214365')", + " --norecovery Do not send recovery (default=off)", + " -i, --imsi=STRING IMSI (default=`240010123456789')", + " --nsapi=INT NSAPI (default=`0')", + " -m, --msisdn=STRING Mobile Station ISDN number\n (default=`46702123456')", + " -q, --qos=INT Requested quality of service\n (default=`0x000b921f')", + " --qose1=INT Requested quality of service Extension 1\n (default=`0x9396404074f9ffff')", + " --qose2=INT Requested quality of service Extension 2\n (default=`0x11')", + " --qose3=INT Requested quality of service Extension 3\n (default=`0x0101')", + " --qose4=INT Requested quality of service Extension 4\n (default=`0x4040')", + " --charging=INT Charging characteristics (default=`0x0800')", + " -u, --uid=STRING Login user ID (default=`mig')", + " -p, --pwd=STRING Login password (default=`hemmelig')", + " --createif Create local network interface (default=off)", + " -n, --net=STRING Network address for local interface", + " --defaultroute Create default route (default=off)", + " --ipup=STRING Script to run after link-up", + " --ipdown=STRING Script to run after link-down", + " --pinghost=STRING Ping remote host", + " --pingrate=INT Number of ping req per second (default=`1')", + " --pingsize=INT Number of ping data bytes (default=`56')", + " --pingcount=INT Number of ping req to send (default=`0')", + " --pingquiet Do not print ping packet info (default=off)", 0 }; + +typedef enum { ARG_NO, ARG_FLAG, ARG_STRING, ARG_INT +} cmdline_parser_arg_type; static void clear_given(struct gengetopt_args_info *args_info); @@ -77,9 +88,9 @@ void clear_args(struct gengetopt_args_info *args_info); static int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error); struct line_list { @@ -127,6 +138,7 @@ args_info->rai_given = 0; args_info->mstz_given = 0; args_info->imeisv_given = 0; + args_info->norecovery_given = 0; args_info->imsi_given = 0; args_info->nsapi_given = 0; args_info->msisdn_given = 0; @@ -148,12 +160,12 @@ args_info->pingsize_given = 0; args_info->pingcount_given = 0; args_info->pingquiet_given = 0; - args_info->norecovery_given = 0; } static void clear_args(struct gengetopt_args_info *args_info) { + FIX_UNUSED(args_info); args_info->debug_flag = 0; args_info->conf_arg = NULL; args_info->conf_orig = NULL; @@ -177,16 +189,17 @@ args_info->apn_orig = NULL; args_info->selmode_arg = 0x01; args_info->selmode_orig = NULL; - args_info->rattype_arg = "1"; + args_info->rattype_arg = 1; args_info->rattype_orig = NULL; - args_info->userloc_arg = strdup("02509946241207"); + args_info->userloc_arg = gengetopt_strdup("02509946241207"); args_info->userloc_orig = NULL; - args_info->rai_arg = strdup("02509946241207"); + args_info->rai_arg = gengetopt_strdup("02509946241207"); args_info->rai_orig = NULL; - args_info->mstz_arg = strdup("0"); + args_info->mstz_arg = gengetopt_strdup("0"); args_info->mstz_orig = NULL; - args_info->imeisv_arg = strdup("2143658709214365"); + args_info->imeisv_arg = gengetopt_strdup("2143658709214365"); args_info->imeisv_orig = NULL; + args_info->norecovery_flag = 0; args_info->imsi_arg = gengetopt_strdup("240010123456789"); args_info->imsi_orig = NULL; args_info->nsapi_arg = 0; @@ -226,13 +239,13 @@ args_info->pingcount_arg = 0; args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; - args_info->norecovery_flag = 0; } static void init_args_info(struct gengetopt_args_info *args_info) { + args_info->help_help = gengetopt_args_info_help[0]; args_info->version_help = gengetopt_args_info_help[1]; args_info->debug_help = gengetopt_args_info_help[2]; @@ -247,41 +260,67 @@ args_info->gtpversion_help = gengetopt_args_info_help[11]; args_info->apn_help = gengetopt_args_info_help[12]; args_info->selmode_help = gengetopt_args_info_help[13]; - args_info->imsi_help = gengetopt_args_info_help[14]; - args_info->nsapi_help = gengetopt_args_info_help[15]; - args_info->msisdn_help = gengetopt_args_info_help[16]; - args_info->qos_help = gengetopt_args_info_help[17]; - args_info->charging_help = gengetopt_args_info_help[18]; - args_info->uid_help = gengetopt_args_info_help[19]; - args_info->pwd_help = gengetopt_args_info_help[20]; - args_info->createif_help = gengetopt_args_info_help[21]; - args_info->net_help = gengetopt_args_info_help[22]; - args_info->defaultroute_help = gengetopt_args_info_help[23]; - args_info->ipup_help = gengetopt_args_info_help[24]; - args_info->ipdown_help = gengetopt_args_info_help[25]; - args_info->pinghost_help = gengetopt_args_info_help[26]; - args_info->pingrate_help = gengetopt_args_info_help[27]; - args_info->pingsize_help = gengetopt_args_info_help[28]; - args_info->pingcount_help = gengetopt_args_info_help[29]; - args_info->pingquiet_help = gengetopt_args_info_help[30]; - args_info->norecovery_help = gengetopt_args_info_help[31]; + args_info->rattype_help = gengetopt_args_info_help[14]; + args_info->userloc_help = gengetopt_args_info_help[15]; + args_info->rai_help = gengetopt_args_info_help[16]; + args_info->mstz_help = gengetopt_args_info_help[17]; + args_info->imeisv_help = gengetopt_args_info_help[18]; + args_info->norecovery_help = gengetopt_args_info_help[19]; + args_info->imsi_help = gengetopt_args_info_help[20]; + args_info->nsapi_help = gengetopt_args_info_help[21]; + args_info->msisdn_help = gengetopt_args_info_help[22]; + args_info->qos_help = gengetopt_args_info_help[23]; + args_info->qose1_help = gengetopt_args_info_help[24]; + args_info->qose2_help = gengetopt_args_info_help[25]; + args_info->qose3_help = gengetopt_args_info_help[26]; + args_info->qose4_help = gengetopt_args_info_help[27]; + args_info->charging_help = gengetopt_args_info_help[28]; + args_info->uid_help = gengetopt_args_info_help[29]; + args_info->pwd_help = gengetopt_args_info_help[30]; + args_info->createif_help = gengetopt_args_info_help[31]; + args_info->net_help = gengetopt_args_info_help[32]; + args_info->defaultroute_help = gengetopt_args_info_help[33]; + args_info->ipup_help = gengetopt_args_info_help[34]; + args_info->ipdown_help = gengetopt_args_info_help[35]; + args_info->pinghost_help = gengetopt_args_info_help[36]; + args_info->pingrate_help = gengetopt_args_info_help[37]; + args_info->pingsize_help = gengetopt_args_info_help[38]; + args_info->pingcount_help = gengetopt_args_info_help[39]; + args_info->pingquiet_help = gengetopt_args_info_help[40]; } void cmdline_parser_print_version(void) { - printf("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); + printf("%s %s\n", + (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? + CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), + CMDLINE_PARSER_VERSION); + + if (strlen(gengetopt_args_info_versiontext) > 0) + printf("\n%s\n", gengetopt_args_info_versiontext); } -void cmdline_parser_print_help(void) +static void print_help_common(void) { - int i = 0; cmdline_parser_print_version(); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); - printf("\n%s\n\n", gengetopt_args_info_usage); + if (strlen(gengetopt_args_info_usage) > 0) + printf("\n%s\n", gengetopt_args_info_usage); + + printf("\n"); + + if (strlen(gengetopt_args_info_description) > 0) + printf("%s\n\n", gengetopt_args_info_description); +} + +void cmdline_parser_print_help(void) +{ + int i = 0; + print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } @@ -293,171 +332,210 @@ init_args_info(args_info); } +void cmdline_parser_params_init(struct cmdline_parser_params *params) +{ + if (params) { + params->override = 0; + params->initialize = 1; + params->check_required = 1; + params->check_ambiguity = 0; + params->print_errors = 1; + } +} + +struct cmdline_parser_params *cmdline_parser_params_create(void) +{ + struct cmdline_parser_params *params = + (struct cmdline_parser_params *) + malloc(sizeof(struct cmdline_parser_params)); + cmdline_parser_params_init(params); + return params; +} + +static void free_string_field(char **s) +{ + if (*s) { + free(*s); + *s = 0; + } +} + static void cmdline_parser_release(struct gengetopt_args_info *args_info) { - if (args_info->conf_arg) { - free(args_info->conf_arg); /* free previous argument */ - args_info->conf_arg = 0; - } - if (args_info->conf_orig) { - free(args_info->conf_orig); /* free previous argument */ - args_info->conf_orig = 0; - } - if (args_info->pidfile_arg) { - free(args_info->pidfile_arg); /* free previous argument */ - args_info->pidfile_arg = 0; - } - if (args_info->pidfile_orig) { - free(args_info->pidfile_orig); /* free previous argument */ - args_info->pidfile_orig = 0; - } - if (args_info->statedir_arg) { - free(args_info->statedir_arg); /* free previous argument */ - args_info->statedir_arg = 0; - } - if (args_info->statedir_orig) { - free(args_info->statedir_orig); /* free previous argument */ - args_info->statedir_orig = 0; - } - if (args_info->dns_arg) { - free(args_info->dns_arg); /* free previous argument */ - args_info->dns_arg = 0; - } - if (args_info->dns_orig) { - free(args_info->dns_orig); /* free previous argument */ - args_info->dns_orig = 0; - } - if (args_info->listen_arg) { - free(args_info->listen_arg); /* free previous argument */ - args_info->listen_arg = 0; - } - if (args_info->listen_orig) { - free(args_info->listen_orig); /* free previous argument */ - args_info->listen_orig = 0; - } - if (args_info->remote_arg) { - free(args_info->remote_arg); /* free previous argument */ - args_info->remote_arg = 0; - } - if (args_info->remote_orig) { - free(args_info->remote_orig); /* free previous argument */ - args_info->remote_orig = 0; - } - if (args_info->contexts_orig) { - free(args_info->contexts_orig); /* free previous argument */ - args_info->contexts_orig = 0; - } - if (args_info->timelimit_orig) { - free(args_info->timelimit_orig); /* free previous argument */ - args_info->timelimit_orig = 0; - } - if (args_info->gtpversion_orig) { - free(args_info->gtpversion_orig); /* free previous argument */ - args_info->gtpversion_orig = 0; - } - if (args_info->apn_arg) { - free(args_info->apn_arg); /* free previous argument */ - args_info->apn_arg = 0; - } - if (args_info->apn_orig) { - free(args_info->apn_orig); /* free previous argument */ - args_info->apn_orig = 0; - } - if (args_info->selmode_orig) { - free(args_info->selmode_orig); /* free previous argument */ - args_info->selmode_orig = 0; - } - if (args_info->imsi_arg) { - free(args_info->imsi_arg); /* free previous argument */ - args_info->imsi_arg = 0; - } - if (args_info->imsi_orig) { - free(args_info->imsi_orig); /* free previous argument */ - args_info->imsi_orig = 0; - } - if (args_info->nsapi_orig) { - free(args_info->nsapi_orig); /* free previous argument */ - args_info->nsapi_orig = 0; - } - if (args_info->msisdn_arg) { - free(args_info->msisdn_arg); /* free previous argument */ - args_info->msisdn_arg = 0; - } - if (args_info->msisdn_orig) { - free(args_info->msisdn_orig); /* free previous argument */ - args_info->msisdn_orig = 0; - } - if (args_info->qos_orig) { - free(args_info->qos_orig); /* free previous argument */ - args_info->qos_orig = 0; - } - if (args_info->charging_orig) { - free(args_info->charging_orig); /* free previous argument */ - args_info->charging_orig = 0; - } - if (args_info->uid_arg) { - free(args_info->uid_arg); /* free previous argument */ - args_info->uid_arg = 0; - } - if (args_info->uid_orig) { - free(args_info->uid_orig); /* free previous argument */ - args_info->uid_orig = 0; - } - if (args_info->pwd_arg) { - free(args_info->pwd_arg); /* free previous argument */ - args_info->pwd_arg = 0; - } - if (args_info->pwd_orig) { - free(args_info->pwd_orig); /* free previous argument */ - args_info->pwd_orig = 0; - } - if (args_info->net_arg) { - free(args_info->net_arg); /* free previous argument */ - args_info->net_arg = 0; - } - if (args_info->net_orig) { - free(args_info->net_orig); /* free previous argument */ - args_info->net_orig = 0; - } - if (args_info->ipup_arg) { - free(args_info->ipup_arg); /* free previous argument */ - args_info->ipup_arg = 0; - } - if (args_info->ipup_orig) { - free(args_info->ipup_orig); /* free previous argument */ - args_info->ipup_orig = 0; - } - if (args_info->ipdown_arg) { - free(args_info->ipdown_arg); /* free previous argument */ - args_info->ipdown_arg = 0; - } - if (args_info->ipdown_orig) { - free(args_info->ipdown_orig); /* free previous argument */ - args_info->ipdown_orig = 0; - } - if (args_info->pinghost_arg) { - free(args_info->pinghost_arg); /* free previous argument */ - args_info->pinghost_arg = 0; - } - if (args_info->pinghost_orig) { - free(args_info->pinghost_orig); /* free previous argument */ - args_info->pinghost_orig = 0; - } - if (args_info->pingrate_orig) { - free(args_info->pingrate_orig); /* free previous argument */ - args_info->pingrate_orig = 0; - } - if (args_info->pingsize_orig) { - free(args_info->pingsize_orig); /* free previous argument */ - args_info->pingsize_orig = 0; - } - if (args_info->pingcount_orig) { - free(args_info->pingcount_orig); /* free previous argument */ - args_info->pingcount_orig = 0; - } + free_string_field(&(args_info->conf_arg)); + free_string_field(&(args_info->conf_orig)); + free_string_field(&(args_info->pidfile_arg)); + free_string_field(&(args_info->pidfile_orig)); + free_string_field(&(args_info->statedir_arg)); + free_string_field(&(args_info->statedir_orig)); + free_string_field(&(args_info->dns_arg)); + free_string_field(&(args_info->dns_orig)); + free_string_field(&(args_info->listen_arg)); + free_string_field(&(args_info->listen_orig)); + free_string_field(&(args_info->remote_arg)); + free_string_field(&(args_info->remote_orig)); + free_string_field(&(args_info->contexts_orig)); + free_string_field(&(args_info->timelimit_orig)); + free_string_field(&(args_info->gtpversion_orig)); + free_string_field(&(args_info->apn_arg)); + free_string_field(&(args_info->apn_orig)); + free_string_field(&(args_info->selmode_orig)); + free_string_field(&(args_info->rattype_orig)); + free_string_field(&(args_info->userloc_arg)); + free_string_field(&(args_info->userloc_orig)); + free_string_field(&(args_info->rai_arg)); + free_string_field(&(args_info->rai_orig)); + free_string_field(&(args_info->mstz_arg)); + free_string_field(&(args_info->mstz_orig)); + free_string_field(&(args_info->imeisv_arg)); + free_string_field(&(args_info->imeisv_orig)); + free_string_field(&(args_info->imsi_arg)); + free_string_field(&(args_info->imsi_orig)); + free_string_field(&(args_info->nsapi_orig)); + free_string_field(&(args_info->msisdn_arg)); + free_string_field(&(args_info->msisdn_orig)); + free_string_field(&(args_info->qos_orig)); + free_string_field(&(args_info->qose1_orig)); + free_string_field(&(args_info->qose2_orig)); + free_string_field(&(args_info->qose3_orig)); + free_string_field(&(args_info->qose4_orig)); + free_string_field(&(args_info->charging_orig)); + free_string_field(&(args_info->uid_arg)); + free_string_field(&(args_info->uid_orig)); + free_string_field(&(args_info->pwd_arg)); + free_string_field(&(args_info->pwd_orig)); + free_string_field(&(args_info->net_arg)); + free_string_field(&(args_info->net_orig)); + free_string_field(&(args_info->ipup_arg)); + free_string_field(&(args_info->ipup_orig)); + free_string_field(&(args_info->ipdown_arg)); + free_string_field(&(args_info->ipdown_orig)); + free_string_field(&(args_info->pinghost_arg)); + free_string_field(&(args_info->pinghost_orig)); + free_string_field(&(args_info->pingrate_orig)); + free_string_field(&(args_info->pingsize_orig)); + free_string_field(&(args_info->pingcount_orig)); clear_given(args_info); +} + +static void +write_into_file(FILE * outfile, const char *opt, const char *arg, + const char *values[]) +{ + FIX_UNUSED(values); + if (arg) { + fprintf(outfile, "%s=\"%s\"\n", opt, arg); + } else { + fprintf(outfile, "%s\n", opt); + } +} + +int cmdline_parser_dump(FILE * outfile, struct gengetopt_args_info *args_info) +{ + int i = 0; + + if (!outfile) { + fprintf(stderr, "%s: cannot dump options to stream\n", + CMDLINE_PARSER_PACKAGE); + return EXIT_FAILURE; + } + + if (args_info->help_given) + write_into_file(outfile, "help", 0, 0); + if (args_info->version_given) + write_into_file(outfile, "version", 0, 0); + if (args_info->debug_given) + write_into_file(outfile, "debug", 0, 0); + if (args_info->conf_given) + write_into_file(outfile, "conf", args_info->conf_orig, 0); + if (args_info->pidfile_given) + write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); + if (args_info->statedir_given) + write_into_file(outfile, "statedir", args_info->statedir_orig, + 0); + if (args_info->dns_given) + write_into_file(outfile, "dns", args_info->dns_orig, 0); + if (args_info->listen_given) + write_into_file(outfile, "listen", args_info->listen_orig, 0); + if (args_info->remote_given) + write_into_file(outfile, "remote", args_info->remote_orig, 0); + if (args_info->contexts_given) + write_into_file(outfile, "contexts", args_info->contexts_orig, + 0); + if (args_info->timelimit_given) + write_into_file(outfile, "timelimit", args_info->timelimit_orig, + 0); + if (args_info->gtpversion_given) + write_into_file(outfile, "gtpversion", + args_info->gtpversion_orig, 0); + if (args_info->apn_given) + write_into_file(outfile, "apn", args_info->apn_orig, 0); + if (args_info->selmode_given) + write_into_file(outfile, "selmode", args_info->selmode_orig, 0); + if (args_info->rattype_given) + write_into_file(outfile, "rattype", args_info->rattype_orig, 0); + if (args_info->userloc_given) + write_into_file(outfile, "userloc", args_info->userloc_orig, 0); + if (args_info->rai_given) + write_into_file(outfile, "rai", args_info->rai_orig, 0); + if (args_info->mstz_given) + write_into_file(outfile, "mstz", args_info->mstz_orig, 0); + if (args_info->imeisv_given) + write_into_file(outfile, "imeisv", args_info->imeisv_orig, 0); + if (args_info->norecovery_given) + write_into_file(outfile, "norecovery", 0, 0); + if (args_info->imsi_given) + write_into_file(outfile, "imsi", args_info->imsi_orig, 0); + if (args_info->nsapi_given) + write_into_file(outfile, "nsapi", args_info->nsapi_orig, 0); + if (args_info->msisdn_given) + write_into_file(outfile, "msisdn", args_info->msisdn_orig, 0); + if (args_info->qos_given) + write_into_file(outfile, "qos", args_info->qos_orig, 0); + if (args_info->qose1_given) + write_into_file(outfile, "qose1", args_info->qose1_orig, 0); + if (args_info->qose2_given) + write_into_file(outfile, "qose2", args_info->qose2_orig, 0); + if (args_info->qose3_given) + write_into_file(outfile, "qose3", args_info->qose3_orig, 0); + if (args_info->qose4_given) + write_into_file(outfile, "qose4", args_info->qose4_orig, 0); + if (args_info->charging_given) + write_into_file(outfile, "charging", args_info->charging_orig, + 0); + if (args_info->uid_given) + write_into_file(outfile, "uid", args_info->uid_orig, 0); + if (args_info->pwd_given) + write_into_file(outfile, "pwd", args_info->pwd_orig, 0); + if (args_info->createif_given) + write_into_file(outfile, "createif", 0, 0); + if (args_info->net_given) + write_into_file(outfile, "net", args_info->net_orig, 0); + if (args_info->defaultroute_given) + write_into_file(outfile, "defaultroute", 0, 0); + if (args_info->ipup_given) + write_into_file(outfile, "ipup", args_info->ipup_orig, 0); + if (args_info->ipdown_given) + write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); + if (args_info->pinghost_given) + write_into_file(outfile, "pinghost", args_info->pinghost_orig, + 0); + if (args_info->pingrate_given) + write_into_file(outfile, "pingrate", args_info->pingrate_orig, + 0); + if (args_info->pingsize_given) + write_into_file(outfile, "pingsize", args_info->pingsize_orig, + 0); + if (args_info->pingcount_given) + write_into_file(outfile, "pingcount", args_info->pingcount_orig, + 0); + if (args_info->pingquiet_given) + write_into_file(outfile, "pingquiet", 0, 0); + + i = EXIT_SUCCESS; + return i; } int @@ -475,231 +553,9 @@ return EXIT_FAILURE; } - if (args_info->help_given) { - fprintf(outfile, "%s\n", "help"); - } - if (args_info->version_given) { - fprintf(outfile, "%s\n", "version"); - } - if (args_info->debug_given) { - fprintf(outfile, "%s\n", "debug"); - } - if (args_info->conf_given) { - if (args_info->conf_orig) { - fprintf(outfile, "%s=\"%s\"\n", "conf", - args_info->conf_orig); - } else { - fprintf(outfile, "%s\n", "conf"); - } - } - if (args_info->pidfile_given) { - if (args_info->pidfile_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pidfile", - args_info->pidfile_orig); - } else { - fprintf(outfile, "%s\n", "pidfile"); - } - } - if (args_info->statedir_given) { - if (args_info->statedir_orig) { - fprintf(outfile, "%s=\"%s\"\n", "statedir", - args_info->statedir_orig); - } else { - fprintf(outfile, "%s\n", "statedir"); - } - } - if (args_info->dns_given) { - if (args_info->dns_orig) { - fprintf(outfile, "%s=\"%s\"\n", "dns", - args_info->dns_orig); - } else { - fprintf(outfile, "%s\n", "dns"); - } - } - if (args_info->listen_given) { - if (args_info->listen_orig) { - fprintf(outfile, "%s=\"%s\"\n", "listen", - args_info->listen_orig); - } else { - fprintf(outfile, "%s\n", "listen"); - } - } - if (args_info->remote_given) { - if (args_info->remote_orig) { - fprintf(outfile, "%s=\"%s\"\n", "remote", - args_info->remote_orig); - } else { - fprintf(outfile, "%s\n", "remote"); - } - } - if (args_info->contexts_given) { - if (args_info->contexts_orig) { - fprintf(outfile, "%s=\"%s\"\n", "contexts", - args_info->contexts_orig); - } else { - fprintf(outfile, "%s\n", "contexts"); - } - } - if (args_info->timelimit_given) { - if (args_info->timelimit_orig) { - fprintf(outfile, "%s=\"%s\"\n", "timelimit", - args_info->timelimit_orig); - } else { - fprintf(outfile, "%s\n", "timelimit"); - } - } - if (args_info->gtpversion_given) { - if (args_info->gtpversion_orig) { - fprintf(outfile, "%s=\"%s\"\n", "gtpversion", - args_info->gtpversion_orig); - } else { - fprintf(outfile, "%s\n", "gtpversion"); - } - } - if (args_info->apn_given) { - if (args_info->apn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "apn", - args_info->apn_orig); - } else { - fprintf(outfile, "%s\n", "apn"); - } - } - if (args_info->selmode_given) { - if (args_info->selmode_orig) { - fprintf(outfile, "%s=\"%s\"\n", "selmode", - args_info->selmode_orig); - } else { - fprintf(outfile, "%s\n", "selmode"); - } - } - if (args_info->imsi_given) { - if (args_info->imsi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "imsi", - args_info->imsi_orig); - } else { - fprintf(outfile, "%s\n", "imsi"); - } - } - if (args_info->nsapi_given) { - if (args_info->nsapi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "nsapi", - args_info->nsapi_orig); - } else { - fprintf(outfile, "%s\n", "nsapi"); - } - } - if (args_info->msisdn_given) { - if (args_info->msisdn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "msisdn", - args_info->msisdn_orig); - } else { - fprintf(outfile, "%s\n", "msisdn"); - } - } - if (args_info->qos_given) { - if (args_info->qos_orig) { - fprintf(outfile, "%s=\"%s\"\n", "qos", - args_info->qos_orig); - } else { - fprintf(outfile, "%s\n", "qos"); - } - } - if (args_info->charging_given) { - if (args_info->charging_orig) { - fprintf(outfile, "%s=\"%s\"\n", "charging", - args_info->charging_orig); - } else { - fprintf(outfile, "%s\n", "charging"); - } - } - if (args_info->uid_given) { - if (args_info->uid_orig) { - fprintf(outfile, "%s=\"%s\"\n", "uid", - args_info->uid_orig); - } else { - fprintf(outfile, "%s\n", "uid"); - } - } - if (args_info->pwd_given) { - if (args_info->pwd_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pwd", - args_info->pwd_orig); - } else { - fprintf(outfile, "%s\n", "pwd"); - } - } - if (args_info->createif_given) { - fprintf(outfile, "%s\n", "createif"); - } - if (args_info->net_given) { - if (args_info->net_orig) { - fprintf(outfile, "%s=\"%s\"\n", "net", - args_info->net_orig); - } else { - fprintf(outfile, "%s\n", "net"); - } - } - if (args_info->defaultroute_given) { - fprintf(outfile, "%s\n", "defaultroute"); - } - if (args_info->ipup_given) { - if (args_info->ipup_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipup", - args_info->ipup_orig); - } else { - fprintf(outfile, "%s\n", "ipup"); - } - } - if (args_info->ipdown_given) { - if (args_info->ipdown_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipdown", - args_info->ipdown_orig); - } else { - fprintf(outfile, "%s\n", "ipdown"); - } - } - if (args_info->pinghost_given) { - if (args_info->pinghost_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pinghost", - args_info->pinghost_orig); - } else { - fprintf(outfile, "%s\n", "pinghost"); - } - } - if (args_info->pingrate_given) { - if (args_info->pingrate_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingrate", - args_info->pingrate_orig); - } else { - fprintf(outfile, "%s\n", "pingrate"); - } - } - if (args_info->pingsize_given) { - if (args_info->pingsize_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingsize", - args_info->pingsize_orig); - } else { - fprintf(outfile, "%s\n", "pingsize"); - } - } - if (args_info->pingcount_given) { - if (args_info->pingcount_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingcount", - args_info->pingcount_orig); - } else { - fprintf(outfile, "%s\n", "pingcount"); - } - } - if (args_info->pingquiet_given) { - fprintf(outfile, "%s\n", "pingquiet"); - } - if (args_info->norecovery_given) { - fprintf(outfile, "%s\n", "norecovery"); - } - + i = cmdline_parser_dump(outfile, args_info); fclose(outfile); - i = EXIT_SUCCESS; return i; } @@ -708,11 +564,10 @@ cmdline_parser_release(args_info); } -/* gengetopt_strdup() */ -/* strdup.c replacement of strdup, which is not standard */ +/** @brief replacement of strdup, which is not standard */ char *gengetopt_strdup(const char *s) { - char *result = NULL; + char *result = 0; if (!s) return result; @@ -723,23 +578,40 @@ return result; } -int -cmdline_parser(int argc, char *const *argv, - struct gengetopt_args_info *args_info) +int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2(argc, argv, args_info, 0, 1, 1); } int -cmdline_parser2(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) { int result; + result = cmdline_parser_internal(argc, argv, args_info, params, 0); - result = - cmdline_parser_internal(argc, argv, args_info, override, initialize, - check_required, NULL); + if (result == EXIT_FAILURE) { + cmdline_parser_free(args_info); + exit(EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + int result; + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + result = cmdline_parser_internal(argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free(args_info); @@ -753,19 +625,152 @@ cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name) { + FIX_UNUSED(args_info); + FIX_UNUSED(prog_name); return EXIT_SUCCESS; } +static char *package_name = 0; + +/** + * @brief updates an option + * @param field the generic pointer to the field to update + * @param orig_field the pointer to the orig field + * @param field_given the pointer to the number of occurrence of this option + * @param prev_given the pointer to the number of occurrence already seen + * @param value the argument for this option (if null no arg was specified) + * @param possible_values the possible values for this option (if specified) + * @param default_value the default value (in case the option only accepts fixed values) + * @param arg_type the type of this option + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity + * @param override @see cmdline_parser_params.override + * @param no_free whether to free a possible previous value + * @param multiple_option whether this is a multiple option + * @param long_opt the corresponding long option + * @param short_opt the corresponding short option (or '-' if none) + * @param additional_error possible further error specification + */ +static +int update_arg(void *field, char **orig_field, + unsigned int *field_given, unsigned int *prev_given, + char *value, const char *possible_values[], + const char *default_value, + cmdline_parser_arg_type arg_type, + int check_ambiguity, int override, + int no_free, int multiple_option, + const char *long_opt, char short_opt, + const char *additional_error) +{ + char *stop_char = 0; + const char *val = value; + int found; + char **string_field; + FIX_UNUSED(field); + + stop_char = 0; + found = 0; + + if (!multiple_option && prev_given + && (*prev_given || (check_ambiguity && *field_given))) { + if (short_opt != '-') + fprintf(stderr, + "%s: `--%s' (`-%c') option given more than once%s\n", + package_name, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf(stderr, + "%s: `--%s' option given more than once%s\n", + package_name, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + FIX_UNUSED(default_value); + + if (field_given && *field_given && !override) + return 0; + if (prev_given) + (*prev_given)++; + if (field_given) + (*field_given)++; + if (possible_values) + val = possible_values[found]; + + switch (arg_type) { + case ARG_FLAG: + *((int *)field) = !*((int *)field); + break; + case ARG_INT: + if (val) + *((int *)field) = strtol(val, &stop_char, 0); + break; + case ARG_STRING: + if (val) { + string_field = (char **)field; + if (!no_free && *string_field) + free(*string_field); /* free previous string */ + *string_field = gengetopt_strdup(val); + } + break; + default: + break; + }; + + /* check numeric conversion */ + switch (arg_type) { + case ARG_INT: + if (val && !(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", + package_name, val); + return 1; /* failure */ + } + break; + default: + ; + }; + + /* store the original value */ + switch (arg_type) { + case ARG_NO: + case ARG_FLAG: + break; + default: + if (value && orig_field) { + if (no_free) { + *orig_field = value; + } else { + if (*orig_field) + free(*orig_field); /* free previous string */ + *orig_field = gengetopt_strdup(value); + } + } + }; + + return 0; /* OK */ +} + int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ - int error = 0; + int error_occurred = 0; struct gengetopt_args_info local_args_info; + + int override; + int initialize; + int check_required; + int check_ambiguity; + + package_name = argv[0]; + + override = params->override; + initialize = params->initialize; + check_required = params->check_required; + check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init(args_info); @@ -774,12 +779,11 @@ optarg = 0; optind = 0; - opterr = 1; + opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; - char *stop_char; static struct option long_options[] = { {"help", 0, NULL, 'h'}, @@ -801,6 +805,7 @@ {"rai", 1, NULL, 0}, {"mstz", 1, NULL, 0}, {"imeisv", 1, NULL, 0}, + {"norecovery", 0, NULL, 0}, {"imsi", 1, NULL, 'i'}, {"nsapi", 1, NULL, 0}, {"msisdn", 1, NULL, 'm'}, @@ -822,11 +827,9 @@ {"pingsize", 1, NULL, 0}, {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, - {"norecovery", 0, NULL, 0}, - {NULL, 0, NULL, 0} + {0, 0, 0, 0} }; - stop_char = 0; c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:", long_options, &option_index); @@ -845,884 +848,559 @@ exit(EXIT_SUCCESS); case 'd': /* Run in debug mode. */ - if (local_args_info.debug_given) { - fprintf(stderr, - "%s: `--debug' (`-d') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->debug_given && !override) - continue; - local_args_info.debug_given = 1; - args_info->debug_given = 1; - args_info->debug_flag = !(args_info->debug_flag); - break; + if (update_arg + ((void *)&(args_info->debug_flag), 0, + &(args_info->debug_given), + &(local_args_info.debug_given), optarg, 0, 0, + ARG_FLAG, check_ambiguity, override, 1, 0, "debug", + 'd', additional_error)) + goto failure; + + break; case 'c': /* Read configuration file. */ - if (local_args_info.conf_given) { - fprintf(stderr, - "%s: `--conf' (`-c') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->conf_given && !override) - continue; - local_args_info.conf_given = 1; - args_info->conf_given = 1; - if (args_info->conf_arg) - free(args_info->conf_arg); /* free previous string */ - args_info->conf_arg = gengetopt_strdup(optarg); - if (args_info->conf_orig) - free(args_info->conf_orig); /* free previous string */ - args_info->conf_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->conf_arg), + &(args_info->conf_orig), + &(args_info->conf_given), + &(local_args_info.conf_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "conf", 'c', additional_error)) + goto failure; + + break; case 'l': /* Local interface. */ - if (local_args_info.listen_given) { - fprintf(stderr, - "%s: `--listen' (`-l') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->listen_given && !override) - continue; - local_args_info.listen_given = 1; - args_info->listen_given = 1; - if (args_info->listen_arg) - free(args_info->listen_arg); /* free previous string */ - args_info->listen_arg = gengetopt_strdup(optarg); - if (args_info->listen_orig) - free(args_info->listen_orig); /* free previous string */ - args_info->listen_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->listen_arg), + &(args_info->listen_orig), + &(args_info->listen_given), + &(local_args_info.listen_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "listen", 'l', + additional_error)) + goto failure; + + break; case 'r': /* Remote host. */ - if (local_args_info.remote_given) { - fprintf(stderr, - "%s: `--remote' (`-r') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->remote_given && !override) - continue; - local_args_info.remote_given = 1; - args_info->remote_given = 1; - if (args_info->remote_arg) - free(args_info->remote_arg); /* free previous string */ - args_info->remote_arg = gengetopt_strdup(optarg); - if (args_info->remote_orig) - free(args_info->remote_orig); /* free previous string */ - args_info->remote_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->remote_arg), + &(args_info->remote_orig), + &(args_info->remote_given), + &(local_args_info.remote_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "remote", 'r', + additional_error)) + goto failure; + + break; case 'a': /* Access point name. */ - if (local_args_info.apn_given) { - fprintf(stderr, - "%s: `--apn' (`-a') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->apn_given && !override) - continue; - local_args_info.apn_given = 1; - args_info->apn_given = 1; - if (args_info->apn_arg) - free(args_info->apn_arg); /* free previous string */ - args_info->apn_arg = gengetopt_strdup(optarg); - if (args_info->apn_orig) - free(args_info->apn_orig); /* free previous string */ - args_info->apn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->apn_arg), + &(args_info->apn_orig), + &(args_info->apn_given), + &(local_args_info.apn_given), optarg, 0, + "internet", ARG_STRING, check_ambiguity, + override, 0, 0, "apn", 'a', + additional_error)) + goto failure; + + break; case 'i': /* IMSI. */ - if (local_args_info.imsi_given) { - fprintf(stderr, - "%s: `--imsi' (`-i') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->imsi_given && !override) - continue; - local_args_info.imsi_given = 1; - args_info->imsi_given = 1; - if (args_info->imsi_arg) - free(args_info->imsi_arg); /* free previous string */ - args_info->imsi_arg = gengetopt_strdup(optarg); - if (args_info->imsi_orig) - free(args_info->imsi_orig); /* free previous string */ - args_info->imsi_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->imsi_arg), + &(args_info->imsi_orig), + &(args_info->imsi_given), + &(local_args_info.imsi_given), optarg, 0, + "240010123456789", ARG_STRING, + check_ambiguity, override, 0, 0, "imsi", + 'i', additional_error)) + goto failure; + + break; case 'm': /* Mobile Station ISDN number. */ - if (local_args_info.msisdn_given) { - fprintf(stderr, - "%s: `--msisdn' (`-m') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->msisdn_given && !override) - continue; - local_args_info.msisdn_given = 1; - args_info->msisdn_given = 1; - if (args_info->msisdn_arg) - free(args_info->msisdn_arg); /* free previous string */ - args_info->msisdn_arg = gengetopt_strdup(optarg); - if (args_info->msisdn_orig) - free(args_info->msisdn_orig); /* free previous string */ - args_info->msisdn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->msisdn_arg), + &(args_info->msisdn_orig), + &(args_info->msisdn_given), + &(local_args_info.msisdn_given), optarg, + 0, "46702123456", ARG_STRING, + check_ambiguity, override, 0, 0, + "msisdn", 'm', additional_error)) + goto failure; + + break; case 'q': /* Requested quality of service. */ - if (local_args_info.qos_given) { - fprintf(stderr, - "%s: `--qos' (`-q') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->qos_given && !override) - continue; - local_args_info.qos_given = 1; - args_info->qos_given = 1; - args_info->qos_arg = strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qos_orig) - free(args_info->qos_orig); /* free previous string */ - args_info->qos_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->qos_arg), + &(args_info->qos_orig), + &(args_info->qos_given), + &(local_args_info.qos_given), optarg, 0, + "0x000b921f", ARG_INT, check_ambiguity, + override, 0, 0, "qos", 'q', + additional_error)) + goto failure; + + break; case 'u': /* Login user ID. */ - if (local_args_info.uid_given) { - fprintf(stderr, - "%s: `--uid' (`-u') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->uid_given && !override) - continue; - local_args_info.uid_given = 1; - args_info->uid_given = 1; - if (args_info->uid_arg) - free(args_info->uid_arg); /* free previous string */ - args_info->uid_arg = gengetopt_strdup(optarg); - if (args_info->uid_orig) - free(args_info->uid_orig); /* free previous string */ - args_info->uid_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->uid_arg), + &(args_info->uid_orig), + &(args_info->uid_given), + &(local_args_info.uid_given), optarg, 0, + "mig", ARG_STRING, check_ambiguity, + override, 0, 0, "uid", 'u', + additional_error)) + goto failure; + + break; case 'p': /* Login password. */ - if (local_args_info.pwd_given) { - fprintf(stderr, - "%s: `--pwd' (`-p') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->pwd_given && !override) - continue; - local_args_info.pwd_given = 1; - args_info->pwd_given = 1; - if (args_info->pwd_arg) - free(args_info->pwd_arg); /* free previous string */ - args_info->pwd_arg = gengetopt_strdup(optarg); - if (args_info->pwd_orig) - free(args_info->pwd_orig); /* free previous string */ - args_info->pwd_orig = gengetopt_strdup(optarg); - break; - case 'n': /* Network address for local interface. */ - if (local_args_info.net_given) { - fprintf(stderr, - "%s: `--net' (`-n') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); + if (update_arg((void *)&(args_info->pwd_arg), + &(args_info->pwd_orig), + &(args_info->pwd_given), + &(local_args_info.pwd_given), optarg, 0, + "hemmelig", ARG_STRING, check_ambiguity, + override, 0, 0, "pwd", 'p', + additional_error)) goto failure; - } - if (args_info->net_given && !override) - continue; - local_args_info.net_given = 1; - args_info->net_given = 1; - if (args_info->net_arg) - free(args_info->net_arg); /* free previous string */ - args_info->net_arg = gengetopt_strdup(optarg); - if (args_info->net_orig) - free(args_info->net_orig); /* free previous string */ - args_info->net_orig = gengetopt_strdup(optarg); + + break; + case 'n': /* Network address for local interface. */ + + if (update_arg((void *)&(args_info->net_arg), + &(args_info->net_orig), + &(args_info->net_given), + &(local_args_info.net_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "net", 'n', additional_error)) + goto failure; + break; case 0: /* Long option with no short option */ /* Filename of process id file. */ if (strcmp(long_options[option_index].name, "pidfile") == 0) { - if (local_args_info.pidfile_given) { - fprintf(stderr, - "%s: `--pidfile' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->pidfile_arg), + &(args_info->pidfile_orig), + &(args_info->pidfile_given), + &(local_args_info.pidfile_given), optarg, + 0, "./sgsnemu.pid", ARG_STRING, + check_ambiguity, override, 0, 0, "pidfile", + '-', additional_error)) goto failure; - } - if (args_info->pidfile_given && !override) - continue; - local_args_info.pidfile_given = 1; - args_info->pidfile_given = 1; - if (args_info->pidfile_arg) - free(args_info->pidfile_arg); /* free previous string */ - args_info->pidfile_arg = - gengetopt_strdup(optarg); - if (args_info->pidfile_orig) - free(args_info->pidfile_orig); /* free previous string */ - args_info->pidfile_orig = - gengetopt_strdup(optarg); + } /* Directory of nonvolatile data. */ else if (strcmp (long_options[option_index].name, "statedir") == 0) { - if (local_args_info.statedir_given) { - fprintf(stderr, - "%s: `--statedir' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->statedir_arg), + &(args_info->statedir_orig), + &(args_info->statedir_given), + &(local_args_info.statedir_given), optarg, + 0, "./", ARG_STRING, check_ambiguity, + override, 0, 0, "statedir", '-', + additional_error)) goto failure; - } - if (args_info->statedir_given && !override) - continue; - local_args_info.statedir_given = 1; - args_info->statedir_given = 1; - if (args_info->statedir_arg) - free(args_info->statedir_arg); /* free previous string */ - args_info->statedir_arg = - gengetopt_strdup(optarg); - if (args_info->statedir_orig) - free(args_info->statedir_orig); /* free previous string */ - args_info->statedir_orig = - gengetopt_strdup(optarg); + } /* DNS Server to use. */ else if (strcmp(long_options[option_index].name, "dns") == 0) { - if (local_args_info.dns_given) { - fprintf(stderr, - "%s: `--dns' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->dns_arg), + &(args_info->dns_orig), + &(args_info->dns_given), + &(local_args_info.dns_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "dns", '-', additional_error)) goto failure; - } - if (args_info->dns_given && !override) - continue; - local_args_info.dns_given = 1; - args_info->dns_given = 1; - if (args_info->dns_arg) - free(args_info->dns_arg); /* free previous string */ - args_info->dns_arg = gengetopt_strdup(optarg); - if (args_info->dns_orig) - free(args_info->dns_orig); /* free previous string */ - args_info->dns_orig = gengetopt_strdup(optarg); + } /* Number of contexts. */ else if (strcmp (long_options[option_index].name, "contexts") == 0) { - if (local_args_info.contexts_given) { - fprintf(stderr, - "%s: `--contexts' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->contexts_arg), + &(args_info->contexts_orig), + &(args_info->contexts_given), + &(local_args_info.contexts_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "contexts", '-', additional_error)) goto failure; - } - if (args_info->contexts_given && !override) - continue; - local_args_info.contexts_given = 1; - args_info->contexts_given = 1; - args_info->contexts_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->contexts_orig) - free(args_info->contexts_orig); /* free previous string */ - args_info->contexts_orig = - gengetopt_strdup(optarg); + } /* Exit after timelimit seconds. */ else if (strcmp (long_options[option_index].name, "timelimit") == 0) { - if (local_args_info.timelimit_given) { - fprintf(stderr, - "%s: `--timelimit' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->timelimit_arg), + &(args_info->timelimit_orig), + &(args_info->timelimit_given), + &(local_args_info.timelimit_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "timelimit", '-', additional_error)) goto failure; - } - if (args_info->timelimit_given && !override) - continue; - local_args_info.timelimit_given = 1; - args_info->timelimit_given = 1; - args_info->timelimit_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->timelimit_orig) - free(args_info->timelimit_orig); /* free previous string */ - args_info->timelimit_orig = - gengetopt_strdup(optarg); + } /* GTP version to use. */ else if (strcmp (long_options[option_index].name, "gtpversion") == 0) { - if (local_args_info.gtpversion_given) { - fprintf(stderr, - "%s: `--gtpversion' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->gtpversion_arg), + &(args_info->gtpversion_orig), + &(args_info->gtpversion_given), + &(local_args_info.gtpversion_given), + optarg, 0, "1", ARG_INT, check_ambiguity, + override, 0, 0, "gtpversion", '-', + additional_error)) goto failure; - } - if (args_info->gtpversion_given && !override) - continue; - local_args_info.gtpversion_given = 1; - args_info->gtpversion_given = 1; - args_info->gtpversion_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->gtpversion_orig) - free(args_info->gtpversion_orig); /* free previous string */ - args_info->gtpversion_orig = - gengetopt_strdup(optarg); + } /* Selection mode. */ else if (strcmp (long_options[option_index].name, "selmode") == 0) { - if (local_args_info.selmode_given) { - fprintf(stderr, - "%s: `--selmode' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->selmode_arg), + &(args_info->selmode_orig), + &(args_info->selmode_given), + &(local_args_info.selmode_given), optarg, + 0, "0x01", ARG_INT, check_ambiguity, + override, 0, 0, "selmode", '-', + additional_error)) goto failure; - } - if (args_info->selmode_given && !override) - continue; - local_args_info.selmode_given = 1; - args_info->selmode_given = 1; - args_info->selmode_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->selmode_orig) - free(args_info->selmode_orig); /* free previous string */ - args_info->selmode_orig = - gengetopt_strdup(optarg); - } - /* QoS Extension 1. */ - else if (strcmp - (long_options[option_index].name, - "qose1") == 0) { - if (args_info->qose1_given) { - fprintf(stderr, - "%s: `--qose1' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose1_given = 1; - args_info->qose1_arg = - strtoull(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose1_orig) - free(args_info->qose1_orig); /* free previous string */ - args_info->qose1_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 2. */ - else if (strcmp - (long_options[option_index].name, - "qose2") == 0) { - if (args_info->qose2_given) { - fprintf(stderr, - "%s: `--qose2' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose2_given = 1; - args_info->qose2_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose2_orig) - free(args_info->qose2_orig); /* free previous string */ - args_info->qose2_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 3. */ - else if (strcmp - (long_options[option_index].name, - "qose3") == 0) { - if (args_info->qose3_given) { - fprintf(stderr, - "%s: `--qose3' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose3_given = 1; - args_info->qose3_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose3_orig) - free(args_info->qose3_orig); /* free previous string */ - args_info->qose3_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 4. */ - else if (strcmp - (long_options[option_index].name, - "qose4") == 0) { - if (args_info->qose4_given) { - fprintf(stderr, - "%s: `--qose4' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose4_given = 1; - args_info->qose4_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose4_orig) - free(args_info->qose4_orig); /* free previous string */ - args_info->qose4_orig = - gengetopt_strdup(optarg); - break; + } /* Radio Access Technology Type. */ else if (strcmp (long_options[option_index].name, "rattype") == 0) { - if (args_info->rattype_given) { - fprintf(stderr, - "%s: `--rattype' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rattype_given = 1; - /* args_info->rattype_arg = strtol (optarg,&stop_char,0); */ - args_info->rattype_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->rattype_arg), + &(args_info->rattype_orig), + &(args_info->rattype_given), + &(local_args_info.rattype_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "rattype", '-', additional_error)) + goto failure; + } /* User Location Information. */ else if (strcmp (long_options[option_index].name, "userloc") == 0) { - if (args_info->userloc_given) { - fprintf(stderr, - "%s: `--userloc' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->userloc_given = 1; - args_info->userloc_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->userloc_arg), + &(args_info->userloc_orig), + &(args_info->userloc_given), + &(local_args_info.userloc_given), optarg, + 0, "02509946241207", ARG_STRING, + check_ambiguity, override, 0, 0, "userloc", + '-', additional_error)) + goto failure; + } /* Routing Area Information. */ else if (strcmp(long_options[option_index].name, "rai") == 0) { - if (args_info->rai_given) { - fprintf(stderr, - "%s: `--rai' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rai_given = 1; - args_info->rai_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->rai_arg), + &(args_info->rai_orig), + &(args_info->rai_given), + &(local_args_info.rai_given), + optarg, 0, "02509946241207", + ARG_STRING, check_ambiguity, + override, 0, 0, "rai", '-', + additional_error)) + goto failure; + } - /* MS Time Zone */ + /* MS Time Zone. */ else if (strcmp(long_options[option_index].name, "mstz") == 0) { - if (args_info->mstz_given) { - fprintf(stderr, - "%s: `--mstz' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->mstz_given = 1; - args_info->mstz_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->mstz_arg), + &(args_info->mstz_orig), + &(args_info->mstz_given), + &(local_args_info.mstz_given), + optarg, 0, "0", ARG_STRING, + check_ambiguity, override, 0, 0, + "mstz", '-', additional_error)) + goto failure; + } - /* IMEI(SV) */ + /* IMEI(SV) International Mobile Equipment Identity (and Software Version). */ else if (strcmp (long_options[option_index].name, "imeisv") == 0) { - if (args_info->imeisv_given) { - fprintf(stderr, - "%s: `--imeisv' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->imeisv_given = 1; - args_info->imeisv_arg = strdup(optarg); - break; - } - /* NSAPI. */ - else if (strcmp - (long_options[option_index].name, - "nsapi") == 0) { - if (local_args_info.nsapi_given) { - fprintf(stderr, - "%s: `--nsapi' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->imeisv_arg), + &(args_info->imeisv_orig), + &(args_info->imeisv_given), + &(local_args_info.imeisv_given), + optarg, 0, "2143658709214365", + ARG_STRING, check_ambiguity, + override, 0, 0, "imeisv", '-', + additional_error)) goto failure; - } - if (args_info->nsapi_given && !override) - continue; - local_args_info.nsapi_given = 1; - args_info->nsapi_given = 1; - args_info->nsapi_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->nsapi_orig) - free(args_info->nsapi_orig); /* free previous string */ - args_info->nsapi_orig = - gengetopt_strdup(optarg); - } - /* Charging characteristics. */ - else if (strcmp - (long_options[option_index].name, - "charging") == 0) { - if (local_args_info.charging_given) { - fprintf(stderr, - "%s: `--charging' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->charging_given && !override) - continue; - local_args_info.charging_given = 1; - args_info->charging_given = 1; - args_info->charging_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->charging_orig) - free(args_info->charging_orig); /* free previous string */ - args_info->charging_orig = - gengetopt_strdup(optarg); - } - /* Create local network interface. */ - else if (strcmp - (long_options[option_index].name, - "createif") == 0) { - if (local_args_info.createif_given) { - fprintf(stderr, - "%s: `--createif' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->createif_given && !override) - continue; - local_args_info.createif_given = 1; - args_info->createif_given = 1; - args_info->createif_flag = - !(args_info->createif_flag); - } - /* Create default route. */ - else if (strcmp - (long_options[option_index].name, - "defaultroute") == 0) { - if (local_args_info.defaultroute_given) { - fprintf(stderr, - "%s: `--defaultroute' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->defaultroute_given && !override) - continue; - local_args_info.defaultroute_given = 1; - args_info->defaultroute_given = 1; - args_info->defaultroute_flag = - !(args_info->defaultroute_flag); - } - /* Script to run after link-up. */ - else if (strcmp(long_options[option_index].name, "ipup") - == 0) { - if (local_args_info.ipup_given) { - fprintf(stderr, - "%s: `--ipup' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipup_given && !override) - continue; - local_args_info.ipup_given = 1; - args_info->ipup_given = 1; - if (args_info->ipup_arg) - free(args_info->ipup_arg); /* free previous string */ - args_info->ipup_arg = gengetopt_strdup(optarg); - if (args_info->ipup_orig) - free(args_info->ipup_orig); /* free previous string */ - args_info->ipup_orig = gengetopt_strdup(optarg); - } - /* Script to run after link-down. */ - else if (strcmp - (long_options[option_index].name, - "ipdown") == 0) { - if (local_args_info.ipdown_given) { - fprintf(stderr, - "%s: `--ipdown' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipdown_given && !override) - continue; - local_args_info.ipdown_given = 1; - args_info->ipdown_given = 1; - if (args_info->ipdown_arg) - free(args_info->ipdown_arg); /* free previous string */ - args_info->ipdown_arg = - gengetopt_strdup(optarg); - if (args_info->ipdown_orig) - free(args_info->ipdown_orig); /* free previous string */ - args_info->ipdown_orig = - gengetopt_strdup(optarg); - } - /* Ping remote host. */ - else if (strcmp - (long_options[option_index].name, - "pinghost") == 0) { - if (local_args_info.pinghost_given) { - fprintf(stderr, - "%s: `--pinghost' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pinghost_given && !override) - continue; - local_args_info.pinghost_given = 1; - args_info->pinghost_given = 1; - if (args_info->pinghost_arg) - free(args_info->pinghost_arg); /* free previous string */ - args_info->pinghost_arg = - gengetopt_strdup(optarg); - if (args_info->pinghost_orig) - free(args_info->pinghost_orig); /* free previous string */ - args_info->pinghost_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req per second. */ - else if (strcmp - (long_options[option_index].name, - "pingrate") == 0) { - if (local_args_info.pingrate_given) { - fprintf(stderr, - "%s: `--pingrate' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingrate_given && !override) - continue; - local_args_info.pingrate_given = 1; - args_info->pingrate_given = 1; - args_info->pingrate_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingrate_orig) - free(args_info->pingrate_orig); /* free previous string */ - args_info->pingrate_orig = - gengetopt_strdup(optarg); - } - /* Number of ping data bytes. */ - else if (strcmp - (long_options[option_index].name, - "pingsize") == 0) { - if (local_args_info.pingsize_given) { - fprintf(stderr, - "%s: `--pingsize' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingsize_given && !override) - continue; - local_args_info.pingsize_given = 1; - args_info->pingsize_given = 1; - args_info->pingsize_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingsize_orig) - free(args_info->pingsize_orig); /* free previous string */ - args_info->pingsize_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req to send. */ - else if (strcmp - (long_options[option_index].name, - "pingcount") == 0) { - if (local_args_info.pingcount_given) { - fprintf(stderr, - "%s: `--pingcount' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingcount_given && !override) - continue; - local_args_info.pingcount_given = 1; - args_info->pingcount_given = 1; - args_info->pingcount_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingcount_orig) - free(args_info->pingcount_orig); /* free previous string */ - args_info->pingcount_orig = - gengetopt_strdup(optarg); - } - /* Do not print ping packet info. */ - else if (strcmp - (long_options[option_index].name, - "pingquiet") == 0) { - if (local_args_info.pingquiet_given) { - fprintf(stderr, - "%s: `--pingquiet' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingquiet_given && !override) - continue; - local_args_info.pingquiet_given = 1; - args_info->pingquiet_given = 1; - args_info->pingquiet_flag = - !(args_info->pingquiet_flag); + } /* Do not send recovery. */ else if (strcmp (long_options[option_index].name, "norecovery") == 0) { - if (local_args_info.norecovery_given) { - fprintf(stderr, - "%s: `--norecovery' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->norecovery_flag), 0, + &(args_info->norecovery_given), + &(local_args_info.norecovery_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "norecovery", '-', + additional_error)) goto failure; - } - if (args_info->norecovery_given && !override) - continue; - local_args_info.norecovery_given = 1; - args_info->norecovery_given = 1; - args_info->norecovery_flag = - !(args_info->norecovery_flag); + + } + /* NSAPI. */ + else if (strcmp + (long_options[option_index].name, + "nsapi") == 0) { + + if (update_arg((void *)&(args_info->nsapi_arg), + &(args_info->nsapi_orig), + &(args_info->nsapi_given), + &(local_args_info.nsapi_given), + optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "nsapi", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 1. */ + else if (strcmp + (long_options[option_index].name, + "qose1") == 0) { + + if (update_arg((void *)&(args_info->qose1_arg), + &(args_info->qose1_orig), + &(args_info->qose1_given), + &(local_args_info.qose1_given), + optarg, 0, "0x9396404074f9ffff", + ARG_INT, check_ambiguity, + override, 0, 0, "qose1", '-', + additional_error)) + goto failure; + + } + /* Requested quality of service Extension 2. */ + else if (strcmp + (long_options[option_index].name, + "qose2") == 0) { + + if (update_arg((void *)&(args_info->qose2_arg), + &(args_info->qose2_orig), + &(args_info->qose2_given), + &(local_args_info.qose2_given), + optarg, 0, "0x11", ARG_INT, + check_ambiguity, override, 0, 0, + "qose2", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 3. */ + else if (strcmp + (long_options[option_index].name, + "qose3") == 0) { + + if (update_arg((void *)&(args_info->qose3_arg), + &(args_info->qose3_orig), + &(args_info->qose3_given), + &(local_args_info.qose3_given), + optarg, 0, "0x0101", ARG_INT, + check_ambiguity, override, 0, 0, + "qose3", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 4. */ + else if (strcmp + (long_options[option_index].name, + "qose4") == 0) { + + if (update_arg((void *)&(args_info->qose4_arg), + &(args_info->qose4_orig), + &(args_info->qose4_given), + &(local_args_info.qose4_given), + optarg, 0, "0x4040", ARG_INT, + check_ambiguity, override, 0, 0, + "qose4", '-', additional_error)) + goto failure; + + } + /* Charging characteristics. */ + else if (strcmp + (long_options[option_index].name, + "charging") == 0) { + + if (update_arg + ((void *)&(args_info->charging_arg), + &(args_info->charging_orig), + &(args_info->charging_given), + &(local_args_info.charging_given), optarg, + 0, "0x0800", ARG_INT, check_ambiguity, + override, 0, 0, "charging", '-', + additional_error)) + goto failure; + + } + /* Create local network interface. */ + else if (strcmp + (long_options[option_index].name, + "createif") == 0) { + + if (update_arg + ((void *)&(args_info->createif_flag), 0, + &(args_info->createif_given), + &(local_args_info.createif_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "createif", '-', additional_error)) + goto failure; + + } + /* Create default route. */ + else if (strcmp + (long_options[option_index].name, + "defaultroute") == 0) { + + if (update_arg + ((void *)&(args_info->defaultroute_flag), 0, + &(args_info->defaultroute_given), + &(local_args_info.defaultroute_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "defaultroute", '-', + additional_error)) + goto failure; + + } + /* Script to run after link-up. */ + else if (strcmp(long_options[option_index].name, "ipup") + == 0) { + + if (update_arg((void *)&(args_info->ipup_arg), + &(args_info->ipup_orig), + &(args_info->ipup_given), + &(local_args_info.ipup_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipup", '-', additional_error)) + goto failure; + + } + /* Script to run after link-down. */ + else if (strcmp + (long_options[option_index].name, + "ipdown") == 0) { + + if (update_arg((void *)&(args_info->ipdown_arg), + &(args_info->ipdown_orig), + &(args_info->ipdown_given), + &(local_args_info.ipdown_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipdown", '-', additional_error)) + goto failure; + + } + /* Ping remote host. */ + else if (strcmp + (long_options[option_index].name, + "pinghost") == 0) { + + if (update_arg + ((void *)&(args_info->pinghost_arg), + &(args_info->pinghost_orig), + &(args_info->pinghost_given), + &(local_args_info.pinghost_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "pinghost", '-', + additional_error)) + goto failure; + + } + /* Number of ping req per second. */ + else if (strcmp + (long_options[option_index].name, + "pingrate") == 0) { + + if (update_arg + ((void *)&(args_info->pingrate_arg), + &(args_info->pingrate_orig), + &(args_info->pingrate_given), + &(local_args_info.pingrate_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "pingrate", '-', additional_error)) + goto failure; + + } + /* Number of ping data bytes. */ + else if (strcmp + (long_options[option_index].name, + "pingsize") == 0) { + + if (update_arg + ((void *)&(args_info->pingsize_arg), + &(args_info->pingsize_orig), + &(args_info->pingsize_given), + &(local_args_info.pingsize_given), optarg, + 0, "56", ARG_INT, check_ambiguity, + override, 0, 0, "pingsize", '-', + additional_error)) + goto failure; + + } + /* Number of ping req to send. */ + else if (strcmp + (long_options[option_index].name, + "pingcount") == 0) { + + if (update_arg + ((void *)&(args_info->pingcount_arg), + &(args_info->pingcount_orig), + &(args_info->pingcount_given), + &(local_args_info.pingcount_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "pingcount", '-', additional_error)) + goto failure; + + } + /* Do not print ping packet info. */ + else if (strcmp + (long_options[option_index].name, + "pingquiet") == 0) { + + if (update_arg + ((void *)&(args_info->pingquiet_flag), 0, + &(args_info->pingquiet_given), + &(local_args_info.pingquiet_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "pingquiet", '-', additional_error)) + goto failure; + } break; @@ -1740,7 +1418,7 @@ cmdline_parser_release(&local_args_info); - if (error) + if (error_occurred) return (EXIT_FAILURE); return 0; @@ -1759,40 +1437,25 @@ #define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) /* 3 is for "--" and "=" */ -char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; - -int -cmdline_parser_configfile(char *const filename, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +static int _cmdline_parser_configfile(const char *filename, int *my_argc) { FILE *file; + char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; char linebuf[CONFIG_FILE_LINE_SIZE]; int line_num = 0; - int i, result, equal; + int result = 0, equal; char *fopt, *farg; char *str_index; size_t len, next_token; char delimiter; - int my_argc = 0; - char **my_argv_arg; - char *additional_error; - /* store the program name */ - cmd_line_list_tmp = - (struct line_list *)malloc(sizeof(struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); - - if ((file = fopen(filename, "r")) == NULL) { + if ((file = fopen(filename, "r")) == 0) { fprintf(stderr, "%s: Error opening configuration file '%s'\n", CMDLINE_PARSER_PACKAGE, filename); - result = EXIT_FAILURE; - goto conf_failure; + return EXIT_FAILURE; } - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != NULL) { + while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) { ++line_num; my_argv[0] = '\0'; len = strlen(linebuf); @@ -1801,7 +1464,7 @@ "%s:%s:%d: Line too long in configuration file\n", CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } /* find first non-whitespace character in the line */ @@ -1817,7 +1480,7 @@ next_token = strcspn(fopt, " \t\r\n="); if (fopt[next_token] == '\0') { /* the line is over */ - farg = NULL; + farg = 0; equal = 0; goto noarg; } @@ -1828,6 +1491,7 @@ /* advance pointers to the next token after the end of fopt */ next_token += strspn(fopt + next_token, " \t\r\n"); + /* check for the presence of equal sign, and if so, skip it */ if (!equal) if ((equal = (fopt[next_token] == '='))) { @@ -1848,7 +1512,7 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } else { /* read up the remaining part up to a delimiter */ next_token = strcspn(farg, " \t\r\n#\'\""); @@ -1868,20 +1532,31 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } noarg: - ++my_argc; + if (!strcmp(fopt, "include")) { + if (farg && *farg) { + result = + _cmdline_parser_configfile(farg, my_argc); + } else { + fprintf(stderr, + "%s:%s:%d: include requires a filename argument.\n", + CMDLINE_PARSER_PACKAGE, filename, + line_num); + } + continue; + } len = strlen(fopt); - strcat(my_argv, len > 1 ? "--" : "-"); strcat(my_argv, fopt); if (len > 1 && ((farg && *farg) || equal)) strcat(my_argv, "="); if (farg && *farg) strcat(my_argv, farg); + ++(*my_argc); cmd_line_list_tmp = (struct line_list *)malloc(sizeof(struct line_list)); @@ -1890,30 +1565,69 @@ cmd_line_list->string_arg = gengetopt_strdup(my_argv); } /* while */ - ++my_argc; /* for program name */ - my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - my_argv_arg[my_argc] = 0; - - additional_error = - (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy(additional_error, ADDITIONAL_ERROR); - strcat(additional_error, filename); - result = - cmdline_parser_internal(my_argc, my_argv_arg, args_info, override, - initialize, check_required, - additional_error); - - free(additional_error); - free(my_argv_arg); - -conf_failure: if (file) fclose(file); + return result; +} + +int +cmdline_parser_configfile(const char *filename, + struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + return cmdline_parser_config_file(filename, args_info, ¶ms); +} + +int +cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) +{ + int i, result; + int my_argc = 1; + char **my_argv_arg; + char *additional_error; + + /* store the program name */ + cmd_line_list_tmp = + (struct line_list *)malloc(sizeof(struct line_list)); + cmd_line_list_tmp->next = cmd_line_list; + cmd_line_list = cmd_line_list_tmp; + cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); + + result = _cmdline_parser_configfile(filename, &my_argc); + + if (result != EXIT_FAILURE) { + my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); + cmd_line_list_tmp = cmd_line_list; + + for (i = my_argc - 1; i >= 0; --i) { + my_argv_arg[i] = cmd_line_list_tmp->string_arg; + cmd_line_list_tmp = cmd_line_list_tmp->next; + } + + my_argv_arg[my_argc] = 0; + + additional_error = + (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + + 1); + strcpy(additional_error, ADDITIONAL_ERROR); + strcat(additional_error, filename); + result = + cmdline_parser_internal(my_argc, my_argv_arg, args_info, + params, additional_error); + + free(additional_error); + free(my_argv_arg); + } free_cmd_list(); if (result == EXIT_FAILURE) { diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 2170e8b..0184775 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -6,7 +6,11 @@ # notice and this permission notice is included in all copies or # substantial portions of the software. # -# Use "gengetopt --conf-parser < cmdline.ggo" +# Use +# gengetopt --conf-parser < cmdline.ggo +# linux-2.6/scripts/Lindent cmdline.c +# linux-2.6/scripts/Lindent cmdline.h +# sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h option "debug" d "Run in debug mode" flag off diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 17f7c18..248384e 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -1,6 +1,9 @@ -/* cmdline.h */ - -/* File autogenerated by gengetopt version 2.17 */ +/** @file cmdline.h + * @brief The header file for the command line option parser + * generated by GNU Gengetopt version 2.22.6 + * http://www.gnu.org/software/gengetopt. + * DO NOT modify this file, since it can be overwritten + * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H @@ -10,197 +13,495 @@ #include "config.h" #endif +#include /* for FILE */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE +/** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE PACKAGE #endif +#ifndef CMDLINE_PARSER_PACKAGE_NAME +/** @brief the complete program name (used for help and version) */ +#ifdef PACKAGE_NAME +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME +#else +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE +#endif +#endif + #ifndef CMDLINE_PARSER_VERSION +/** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif +/** @brief Where the command line options are stored */ struct gengetopt_args_info { - const char *help_help; /* Print help and exit help description. */ - const char *version_help; /* Print version and exit help description. */ - int debug_flag; /* Run in debug mode (default=off). */ - const char *debug_help; /* Run in debug mode help description. */ - char *conf_arg; /* Read configuration file. */ - char *conf_orig; /* Read configuration file original value given at command line. */ - const char *conf_help; /* Read configuration file help description. */ - char *pidfile_arg; /* Filename of process id file (default='./sgsnemu.pid'). */ - char *pidfile_orig; /* Filename of process id file original value given at command line. */ - const char *pidfile_help; /* Filename of process id file help description. */ - char *statedir_arg; /* Directory of nonvolatile data (default='./'). */ - char *statedir_orig; /* Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /* Directory of nonvolatile data help description. */ - char *dns_arg; /* DNS Server to use. */ - char *dns_orig; /* DNS Server to use original value given at command line. */ - const char *dns_help; /* DNS Server to use help description. */ - char *listen_arg; /* Local interface. */ - char *listen_orig; /* Local interface original value given at command line. */ - const char *listen_help; /* Local interface help description. */ - char *remote_arg; /* Remote host. */ - char *remote_orig; /* Remote host original value given at command line. */ - const char *remote_help; /* Remote host help description. */ - int contexts_arg; /* Number of contexts (default='1'). */ - char *contexts_orig; /* Number of contexts original value given at command line. */ - const char *contexts_help; /* Number of contexts help description. */ - int timelimit_arg; /* Exit after timelimit seconds (default='0'). */ - char *timelimit_orig; /* Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /* Exit after timelimit seconds help description. */ - int gtpversion_arg; /* GTP version to use (default='1'). */ - char *gtpversion_orig; /* GTP version to use original value given at command line. */ - const char *gtpversion_help; /* GTP version to use help description. */ - char *apn_arg; /* Access point name (default='internet'). */ - char *apn_orig; /* Access point name original value given at command line. */ - const char *apn_help; /* Access point name help description. */ - int selmode_arg; /* Selection mode (default='0x01'). */ - char *selmode_orig; /* Selection mode original value given at command line. */ - const char *selmode_help; /* Selection mode help description. */ - char *rattype_arg; /* Radio Access Technology Type (optional). */ + const char *help_help; + /**< @brief Print help and exit help description. */ + const char *version_help; + /**< @brief Print version and exit help description. */ + int debug_flag; + /**< @brief Run in debug mode (default=off). */ + const char *debug_help; + /**< @brief Run in debug mode help description. */ + char *conf_arg; + /**< @brief Read configuration file. */ + char *conf_orig; + /**< @brief Read configuration file original value given at command line. */ + const char *conf_help; + /**< @brief Read configuration file help description. */ + char *pidfile_arg; + /**< @brief Filename of process id file (default='./sgsnemu.pid'). */ + char *pidfile_orig; + /**< @brief Filename of process id file original value given at command line. */ + const char *pidfile_help; + /**< @brief Filename of process id file help description. */ + char *statedir_arg; + /**< @brief Directory of nonvolatile data (default='./'). */ + char *statedir_orig; + /**< @brief Directory of nonvolatile data original value given at command line. */ + const char *statedir_help; + /**< @brief Directory of nonvolatile data help description. */ + char *dns_arg; + /**< @brief DNS Server to use. */ + char *dns_orig; + /**< @brief DNS Server to use original value given at command line. */ + const char *dns_help; + /**< @brief DNS Server to use help description. */ + char *listen_arg; + /**< @brief Local interface. */ + char *listen_orig; + /**< @brief Local interface original value given at command line. */ + const char *listen_help; + /**< @brief Local interface help description. */ + char *remote_arg; + /**< @brief Remote host. */ + char *remote_orig; + /**< @brief Remote host original value given at command line. */ + const char *remote_help; + /**< @brief Remote host help description. */ + int contexts_arg; + /**< @brief Number of contexts (default='1'). */ + char *contexts_orig; + /**< @brief Number of contexts original value given at command line. */ + const char *contexts_help; + /**< @brief Number of contexts help description. */ + int timelimit_arg; + /**< @brief Exit after timelimit seconds (default='0'). */ + char *timelimit_orig; + /**< @brief Exit after timelimit seconds original value given at command line. */ + const char *timelimit_help; + /**< @brief Exit after timelimit seconds help description. */ + int gtpversion_arg; + /**< @brief GTP version to use (default='1'). */ + char *gtpversion_orig; + /**< @brief GTP version to use original value given at command line. */ + const char *gtpversion_help; + /**< @brief GTP version to use help description. */ + char *apn_arg; + /**< @brief Access point name (default='internet'). */ + char *apn_orig; + /**< @brief Access point name original value given at command line. */ + const char *apn_help; + /**< @brief Access point name help description. */ + int selmode_arg; + /**< @brief Selection mode (default='0x01'). */ + char *selmode_orig; + /**< @brief Selection mode original value given at command line. */ + const char *selmode_help; + /**< @brief Selection mode help description. */ + int rattype_arg; + /**< @brief Radio Access Technology Type (default='1'). */ char *rattype_orig; - char *rattype_help; - char *userloc_arg; /* User Location Information (optional). */ + /**< @brief Radio Access Technology Type original value given at command line. */ + const char *rattype_help; + /**< @brief Radio Access Technology Type help description. */ + char *userloc_arg; + /**< @brief User Location Information (default='02509946241207'). */ char *userloc_orig; - char *userloc_help; - char *rai_arg; /* Routing Area Information (optional). */ + /**< @brief User Location Information original value given at command line. */ + const char *userloc_help; + /**< @brief User Location Information help description. */ + char *rai_arg; + /**< @brief Routing Area Information (default='02509946241207'). */ char *rai_orig; - char *rai_help; - char *mstz_arg; /* MS Time Zone (optional). */ + /**< @brief Routing Area Information original value given at command line. */ + const char *rai_help; + /**< @brief Routing Area Information help description. */ + char *mstz_arg; + /**< @brief MS Time Zone (default='0'). */ char *mstz_orig; - char *mstz_help; - char *imeisv_arg; /* IMEI(SV) (optional). */ + /**< @brief MS Time Zone original value given at command line. */ + const char *mstz_help; + /**< @brief MS Time Zone help description. */ + char *imeisv_arg; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) (default='2143658709214365'). */ char *imeisv_orig; - char *imeisv_help; - char *imsi_arg; /* IMSI (default='240010123456789'). */ - char *imsi_orig; /* IMSI original value given at command line. */ - const char *imsi_help; /* IMSI help description. */ - int nsapi_arg; /* NSAPI (default='0'). */ - char *nsapi_orig; /* NSAPI original value given at command line. */ - const char *nsapi_help; /* NSAPI help description. */ - char *msisdn_arg; /* Mobile Station ISDN number (default='46702123456'). */ - char *msisdn_orig; /* Mobile Station ISDN number original value given at command line. */ - const char *msisdn_help; /* Mobile Station ISDN number help description. */ - int qos_arg; /* Requested quality of service (default='0x0b921f'). */ - char *qos_orig; /* Requested quality of service original value given at command line. */ - const char *qos_help; /* Requested quality of service help description. */ - unsigned long long int qose1_arg; /* Requested quality of service Extension 1 */ - char *qose1_orig; /* Requested quality of service Extension 1 original value given at command line. */ - int qose2_arg; /* Requested quality of service Extension 2 */ - char *qose2_orig; /* Requested quality of service Extension 2 original value given at command line. */ - int qose3_arg; /* Requested quality of service Extension 3 */ - char *qose3_orig; /* Requested quality of service Extension 3 original value given at command line. */ - int qose4_arg; /* Requested quality of service Extension 4 */ - char *qose4_orig; /* Requested quality of service Extension 4 original value given at command line. */ - int charging_arg; /* Charging characteristics (default='0x0800'). */ - char *charging_orig; /* Charging characteristics original value given at command line. */ - const char *charging_help; /* Charging characteristics help description. */ - char *uid_arg; /* Login user ID (default='mig'). */ - char *uid_orig; /* Login user ID original value given at command line. */ - const char *uid_help; /* Login user ID help description. */ - char *pwd_arg; /* Login password (default='hemmelig'). */ - char *pwd_orig; /* Login password original value given at command line. */ - const char *pwd_help; /* Login password help description. */ - int createif_flag; /* Create local network interface (default=off). */ - const char *createif_help; /* Create local network interface help description. */ - char *net_arg; /* Network address for local interface. */ - char *net_orig; /* Network address for local interface original value given at command line. */ - const char *net_help; /* Network address for local interface help description. */ - int defaultroute_flag; /* Create default route (default=off). */ - const char *defaultroute_help; /* Create default route help description. */ - char *ipup_arg; /* Script to run after link-up. */ - char *ipup_orig; /* Script to run after link-up original value given at command line. */ - const char *ipup_help; /* Script to run after link-up help description. */ - char *ipdown_arg; /* Script to run after link-down. */ - char *ipdown_orig; /* Script to run after link-down original value given at command line. */ - const char *ipdown_help; /* Script to run after link-down help description. */ - char *pinghost_arg; /* Ping remote host. */ - char *pinghost_orig; /* Ping remote host original value given at command line. */ - const char *pinghost_help; /* Ping remote host help description. */ - int pingrate_arg; /* Number of ping req per second (default='1'). */ - char *pingrate_orig; /* Number of ping req per second original value given at command line. */ - const char *pingrate_help; /* Number of ping req per second help description. */ - int pingsize_arg; /* Number of ping data bytes (default='56'). */ - char *pingsize_orig; /* Number of ping data bytes original value given at command line. */ - const char *pingsize_help; /* Number of ping data bytes help description. */ - int pingcount_arg; /* Number of ping req to send (default='0'). */ - char *pingcount_orig; /* Number of ping req to send original value given at command line. */ - const char *pingcount_help; /* Number of ping req to send help description. */ - int pingquiet_flag; /* Do not print ping packet info (default=off). */ - const char *pingquiet_help; /* Do not print ping packet info help description. */ - int norecovery_flag; /* Do not print ping packet info (default=off). */ - const char *norecovery_help; /* Do not print ping packet info help description. */ + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) original value given at command line. */ + const char *imeisv_help; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) help description. */ + int norecovery_flag; + /**< @brief Do not send recovery (default=off). */ + const char *norecovery_help; + /**< @brief Do not send recovery help description. */ + char *imsi_arg; + /**< @brief IMSI (default='240010123456789'). */ + char *imsi_orig; + /**< @brief IMSI original value given at command line. */ + const char *imsi_help; + /**< @brief IMSI help description. */ + int nsapi_arg; + /**< @brief NSAPI (default='0'). */ + char *nsapi_orig; + /**< @brief NSAPI original value given at command line. */ + const char *nsapi_help; + /**< @brief NSAPI help description. */ + char *msisdn_arg; + /**< @brief Mobile Station ISDN number (default='46702123456'). */ + char *msisdn_orig; + /**< @brief Mobile Station ISDN number original value given at command line. */ + const char *msisdn_help; + /**< @brief Mobile Station ISDN number help description. */ + int qos_arg; + /**< @brief Requested quality of service (default='0x000b921f'). */ + char *qos_orig; + /**< @brief Requested quality of service original value given at command line. */ + const char *qos_help; + /**< @brief Requested quality of service help description. */ + unsigned long long int qose1_arg; + /**< @brief Requested quality of service Extension 1 (default='0x9396404074f9ffff'). */ + char *qose1_orig; + /**< @brief Requested quality of service Extension 1 original value given at command line. */ + const char *qose1_help; + /**< @brief Requested quality of service Extension 1 help description. */ + int qose2_arg; + /**< @brief Requested quality of service Extension 2 (default='0x11'). */ + char *qose2_orig; + /**< @brief Requested quality of service Extension 2 original value given at command line. */ + const char *qose2_help; + /**< @brief Requested quality of service Extension 2 help description. */ + int qose3_arg; + /**< @brief Requested quality of service Extension 3 (default='0x0101'). */ + char *qose3_orig; + /**< @brief Requested quality of service Extension 3 original value given at command line. */ + const char *qose3_help; + /**< @brief Requested quality of service Extension 3 help description. */ + int qose4_arg; + /**< @brief Requested quality of service Extension 4 (default='0x4040'). */ + char *qose4_orig; + /**< @brief Requested quality of service Extension 4 original value given at command line. */ + const char *qose4_help; + /**< @brief Requested quality of service Extension 4 help description. */ + int charging_arg; + /**< @brief Charging characteristics (default='0x0800'). */ + char *charging_orig; + /**< @brief Charging characteristics original value given at command line. */ + const char *charging_help; + /**< @brief Charging characteristics help description. */ + char *uid_arg; + /**< @brief Login user ID (default='mig'). */ + char *uid_orig; + /**< @brief Login user ID original value given at command line. */ + const char *uid_help; + /**< @brief Login user ID help description. */ + char *pwd_arg; + /**< @brief Login password (default='hemmelig'). */ + char *pwd_orig; + /**< @brief Login password original value given at command line. */ + const char *pwd_help; + /**< @brief Login password help description. */ + int createif_flag; + /**< @brief Create local network interface (default=off). */ + const char *createif_help; + /**< @brief Create local network interface help description. */ + char *net_arg; + /**< @brief Network address for local interface. */ + char *net_orig; + /**< @brief Network address for local interface original value given at command line. */ + const char *net_help; + /**< @brief Network address for local interface help description. */ + int defaultroute_flag; + /**< @brief Create default route (default=off). */ + const char *defaultroute_help; + /**< @brief Create default route help description. */ + char *ipup_arg; + /**< @brief Script to run after link-up. */ + char *ipup_orig; + /**< @brief Script to run after link-up original value given at command line. */ + const char *ipup_help; + /**< @brief Script to run after link-up help description. */ + char *ipdown_arg; + /**< @brief Script to run after link-down. */ + char *ipdown_orig; + /**< @brief Script to run after link-down original value given at command line. */ + const char *ipdown_help; + /**< @brief Script to run after link-down help description. */ + char *pinghost_arg; + /**< @brief Ping remote host. */ + char *pinghost_orig; + /**< @brief Ping remote host original value given at command line. */ + const char *pinghost_help; + /**< @brief Ping remote host help description. */ + int pingrate_arg; + /**< @brief Number of ping req per second (default='1'). */ + char *pingrate_orig; + /**< @brief Number of ping req per second original value given at command line. */ + const char *pingrate_help; + /**< @brief Number of ping req per second help description. */ + int pingsize_arg; + /**< @brief Number of ping data bytes (default='56'). */ + char *pingsize_orig; + /**< @brief Number of ping data bytes original value given at command line. */ + const char *pingsize_help; + /**< @brief Number of ping data bytes help description. */ + int pingcount_arg; + /**< @brief Number of ping req to send (default='0'). */ + char *pingcount_orig; + /**< @brief Number of ping req to send original value given at command line. */ + const char *pingcount_help; + /**< @brief Number of ping req to send help description. */ + int pingquiet_flag; + /**< @brief Do not print ping packet info (default=off). */ + const char *pingquiet_help; + /**< @brief Do not print ping packet info help description. */ - int help_given; /* Whether help was given. */ - int version_given; /* Whether version was given. */ - int debug_given; /* Whether debug was given. */ - int conf_given; /* Whether conf was given. */ - int pidfile_given; /* Whether pidfile was given. */ - int statedir_given; /* Whether statedir was given. */ - int dns_given; /* Whether dns was given. */ - int listen_given; /* Whether listen was given. */ - int remote_given; /* Whether remote was given. */ - int contexts_given; /* Whether contexts was given. */ - int timelimit_given; /* Whether timelimit was given. */ - int gtpversion_given; /* Whether gtpversion was given. */ - int apn_given; /* Whether apn was given. */ - int selmode_given; /* Whether selmode was given. */ - int rattype_given; /* Whether rattype was given. */ - int userloc_given; /* Whether userloc was given. */ - int rai_given; /* Whether RAI was given. */ - int mstz_given; /* Whether mstz was given. */ - int imeisv_given; /* Whether imeisv was given. */ - int imsi_given; /* Whether imsi was given. */ - int nsapi_given; /* Whether nsapi was given. */ - int msisdn_given; /* Whether msisdn was given. */ - int qos_given; /* Whether qos was given. */ - int qose1_given; /* Whether qos Extension 1 was given. */ - int qose2_given; /* Whether qos Extension 2 was given. */ - int qose3_given; /* Whether qos Extension 3 was given. */ - int qose4_given; /* Whether qos Extension 4 was given. */ - int charging_given; /* Whether charging was given. */ - int uid_given; /* Whether uid was given. */ - int pwd_given; /* Whether pwd was given. */ - int createif_given; /* Whether createif was given. */ - int net_given; /* Whether net was given. */ - int defaultroute_given; /* Whether defaultroute was given. */ - int ipup_given; /* Whether ipup was given. */ - int ipdown_given; /* Whether ipdown was given. */ - int pinghost_given; /* Whether pinghost was given. */ - int pingrate_given; /* Whether pingrate was given. */ - int pingsize_given; /* Whether pingsize was given. */ - int pingcount_given; /* Whether pingcount was given. */ - int pingquiet_given; /* Whether pingquiet was given. */ - int norecovery_given; /* Whether norecovery was given. */ + unsigned int help_given; + /**< @brief Whether help was given. */ + unsigned int version_given; + /**< @brief Whether version was given. */ + unsigned int debug_given; + /**< @brief Whether debug was given. */ + unsigned int conf_given; + /**< @brief Whether conf was given. */ + unsigned int pidfile_given; + /**< @brief Whether pidfile was given. */ + unsigned int statedir_given; + /**< @brief Whether statedir was given. */ + unsigned int dns_given; + /**< @brief Whether dns was given. */ + unsigned int listen_given; + /**< @brief Whether listen was given. */ + unsigned int remote_given; + /**< @brief Whether remote was given. */ + unsigned int contexts_given; + /**< @brief Whether contexts was given. */ + unsigned int timelimit_given; + /**< @brief Whether timelimit was given. */ + unsigned int gtpversion_given; + /**< @brief Whether gtpversion was given. */ + unsigned int apn_given; + /**< @brief Whether apn was given. */ + unsigned int selmode_given; + /**< @brief Whether selmode was given. */ + unsigned int rattype_given; + /**< @brief Whether rattype was given. */ + unsigned int userloc_given; + /**< @brief Whether userloc was given. */ + unsigned int rai_given; + /**< @brief Whether rai was given. */ + unsigned int mstz_given; + /**< @brief Whether mstz was given. */ + unsigned int imeisv_given; + /**< @brief Whether imeisv was given. */ + unsigned int norecovery_given; + /**< @brief Whether norecovery was given. */ + unsigned int imsi_given; + /**< @brief Whether imsi was given. */ + unsigned int nsapi_given; + /**< @brief Whether nsapi was given. */ + unsigned int msisdn_given; + /**< @brief Whether msisdn was given. */ + unsigned int qos_given; + /**< @brief Whether qos was given. */ + unsigned int qose1_given; + /**< @brief Whether qose1 was given. */ + unsigned int qose2_given; + /**< @brief Whether qose2 was given. */ + unsigned int qose3_given; + /**< @brief Whether qose3 was given. */ + unsigned int qose4_given; + /**< @brief Whether qose4 was given. */ + unsigned int charging_given; + /**< @brief Whether charging was given. */ + unsigned int uid_given; + /**< @brief Whether uid was given. */ + unsigned int pwd_given; + /**< @brief Whether pwd was given. */ + unsigned int createif_given; + /**< @brief Whether createif was given. */ + unsigned int net_given; + /**< @brief Whether net was given. */ + unsigned int defaultroute_given; + /**< @brief Whether defaultroute was given. */ + unsigned int ipup_given; + /**< @brief Whether ipup was given. */ + unsigned int ipdown_given; + /**< @brief Whether ipdown was given. */ + unsigned int pinghost_given; + /**< @brief Whether pinghost was given. */ + unsigned int pingrate_given; + /**< @brief Whether pingrate was given. */ + unsigned int pingsize_given; + /**< @brief Whether pingsize was given. */ + unsigned int pingcount_given; + /**< @brief Whether pingcount was given. */ + unsigned int pingquiet_given; + /**< @brief Whether pingquiet was given. */ }; +/** @brief The additional parameters to pass to parser functions */ + struct cmdline_parser_params { + int override; + /**< @brief whether to override possibly already present options (default 0) */ + int initialize; + /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ + int check_required; + /**< @brief whether to check that all required options were provided (default 1) */ + int check_ambiguity; + /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ + int print_errors; + /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ + }; + +/** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; +/** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; +/** @brief the description string of the program */ + extern const char *gengetopt_args_info_description; +/** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; - int cmdline_parser(int argc, char *const *argv, +/** + * The command line parser + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info); - int cmdline_parser2(int argc, char *const *argv, + +/** + * The command line parser (version with additional parameters - deprecated) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_ext() instead + */ + int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); + +/** + * The command line parser (version with additional parameters) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_ext(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Save the contents of the option struct into an already open FILE stream. + * @param outfile the stream where to dump options + * @param args_info the option struct to dump + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_dump(FILE * outfile, + struct gengetopt_args_info *args_info); + +/** + * Save the contents of the option struct into a (text) file. + * This file can be read by the config file parser (if generated by gengetopt) + * @param filename the file where to save + * @param args_info the option struct to save + * @return 0 if everything went fine, NON 0 if an error took place + */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); +/** + * Print the help + */ void cmdline_parser_print_help(void); +/** + * Print the version + */ void cmdline_parser_print_version(void); +/** + * Initializes all the fields a cmdline_parser_params structure + * to their default values + * @param params the structure to initialize + */ + void cmdline_parser_params_init(struct cmdline_parser_params *params); + +/** + * Allocates dynamically a cmdline_parser_params structure and initializes + * all its fields to their default values + * @return the created and initialized cmdline_parser_params structure + */ + struct cmdline_parser_params *cmdline_parser_params_create(void); + +/** + * Initializes the passed gengetopt_args_info structure's fields + * (also set default values for options that have a default) + * @param args_info the structure to initialize + */ void cmdline_parser_init(struct gengetopt_args_info *args_info); +/** + * Deallocates the string fields of the gengetopt_args_info structure + * (but does not deallocate the structure itself) + * @param args_info the structure to deallocate + */ void cmdline_parser_free(struct gengetopt_args_info *args_info); - int cmdline_parser_configfile(char *const filename, +/** + * The config file parser (deprecated version) + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_config_file() instead + */ + int cmdline_parser_configfile(const char *filename, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); +/** + * The config file parser + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Checks that all the required options were specified + * @param args_info the structure to check + * @param prog_name the name of the program that will be used to print + * possible errors + * @return + */ int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 0157e22..2bfe801 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -565,9 +565,9 @@ /* rattype */ if (args_info.rattype_given == 1) { options.rattype_given = 1; - options.rattype.l = strlen(args_info.rattype_arg); - options.rattype.v[0] = atoi(args_info.rattype_arg); - printf("Using RAT Type: %s\n", args_info.rattype_arg); + options.rattype.l = 1; + options.rattype.v[0] = args_info.rattype_arg; + printf("Using RAT Type: %d\n", args_info.rattype_arg); } /* userloc */ -- To view, visit https://gerrit.osmocom.org/4024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:35 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for --norecovery In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for --norecovery ...................................................................... sgsnemu: Fix up gengetopt file for --norecovery In commit 3a4c67b4bf0067c4949a60bc750d01e0576c5e08 we introduced the --norecovery command line option, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 019fc94..2170e8b 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -30,6 +30,7 @@ option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no +option "norecovery" - "Do not send recovery" flag off option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:35 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for RAI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for RAI ...................................................................... sgsnemu: Fix up gengetopt file for RAI In commit 41af5691ef08fb70e2c65aba03c8b9e6c20983a6 we introduced the --rai command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0cf2ba2..019fc94 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -27,6 +27,7 @@ option "selmode" - "Selection mode" int default="0x01" no option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no -- To view, visit https://gerrit.osmocom.org/4022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:35 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, i... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisv ...................................................................... sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisv In commit 944dce3e66f3bc5b74f24dfbbee2370a231a39a9 we introduced various command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a --- M sgsnemu/cmdline.ggo 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 41d62a3..0cf2ba2 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -25,6 +25,10 @@ option "gtpversion" - "GTP version to use" int default="1" no option "apn" a "Access point name" string default="internet" no option "selmode" - "Selection mode" int default="0x01" no +option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" +option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" +option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:35 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 ...................................................................... sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In commit 11a398fbc3ad9b655d8ba947bea7012f7ce81604 we introduced the --qose{1,2,3,4} command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 --- M sgsnemu/cmdline.ggo 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 6559f55..41d62a3 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -28,7 +28,11 @@ option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -option "qos" q "Requested quality of service" int default="0x0b921f" no +option "qos" q "Requested quality of service" int default="0x000b921f" no +option "qose1" - "Requested quality of service Extension 1" int default="0x9396404074f9ffff" no +option "qose2" - "Requested quality of service Extension 2" int default="0x11" no +option "qose3" - "Requested quality of service Extension 3" int default="0x0101" no +option "qose4" - "Requested quality of service Extension 4" int default="0x4040" no option "charging" - "Charging characteristics" int default="0x0800" no option "uid" u "Login user ID" string default="mig" no option "pwd" p "Login password" string default="hemmelig" no -- To view, visit https://gerrit.osmocom.org/4020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:46:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:46:36 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer su... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supported ...................................................................... sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supported It seems like modern gengetopt no longer supports 'unsigned int' argument types, and we need to use 'int' instead. tested with 2.22.6 Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e --- M sgsnemu/cmdline.ggo 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index ee5e55d..6559f55 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -40,8 +40,8 @@ option "ipdown" - "Script to run after link-down" string no option "pinghost" - "Ping remote host" string no -option "pingrate" - "Number of ping req per second" unsigned int default="1" no -option "pingsize" - "Number of ping data bytes" unsigned int default="56" no -option "pingcount" - "Number of ping req to send" unsigned int default="0" no +option "pingrate" - "Number of ping req per second" int default="1" no +option "pingsize" - "Number of ping data bytes" int default="56" no +option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off -- To view, visit https://gerrit.osmocom.org/4019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:49:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:49:00 +0000 Subject: [PATCH] openggsn[master]: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer su... Message-ID: Review at https://gerrit.osmocom.org/4025 sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supported It seems like modern gengetopt no longer supports 'unsigned int' argument types, and we need to use 'int' instead. tested with 2.22.6 Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e --- M sgsnemu/cmdline.ggo 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/25/4025/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0c1b06c..a000748 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -40,8 +40,8 @@ option "ipdown" - "Script to run after link-down" string no option "pinghost" - "Ping remote host" string no -option "pingrate" - "Number of ping req per second" unsigned int default="1" no -option "pingsize" - "Number of ping data bytes" unsigned int default="56" no -option "pingcount" - "Number of ping req to send" unsigned int default="0" no +option "pingrate" - "Number of ping req per second" int default="1" no +option "pingsize" - "Number of ping data bytes" int default="56" no +option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off -- To view, visit https://gerrit.osmocom.org/4025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:49:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:49:01 +0000 Subject: [PATCH] openggsn[master]: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 Message-ID: Review at https://gerrit.osmocom.org/4026 sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In commit 11a398fbc3ad9b655d8ba947bea7012f7ce81604 we introduced the --qose{1,2,3,4} command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 --- M sgsnemu/cmdline.ggo 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/26/4026/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index a000748..da71037 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -28,7 +28,11 @@ option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -option "qos" q "Requested quality of service" int default="0x0b921f" no +option "qos" q "Requested quality of service" int default="0x000b921f" no +option "qose1" - "Requested quality of service Extension 1" int default="0x9396404074f9ffff" no +option "qose2" - "Requested quality of service Extension 2" int default="0x11" no +option "qose3" - "Requested quality of service Extension 3" int default="0x0101" no +option "qose4" - "Requested quality of service Extension 4" int default="0x4040" no option "charging" - "Charging characteristics" int default="0x0800" no option "uid" u "Login user ID" string default="mig" no option "pwd" p "Login password" string default="hemmelig" no -- To view, visit https://gerrit.osmocom.org/4026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:49:02 +0000 Subject: [PATCH] openggsn[master]: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, i... Message-ID: Review at https://gerrit.osmocom.org/4027 sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisv In commit 944dce3e66f3bc5b74f24dfbbee2370a231a39a9 we introduced various command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a --- M sgsnemu/cmdline.ggo 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/27/4027/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index da71037..3d12b91 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -25,6 +25,10 @@ option "gtpversion" - "GTP version to use" int default="1" no option "apn" a "Access point name" string default="internet" no option "selmode" - "Selection mode" int default="0x01" no +option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" +option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" +option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:49:02 +0000 Subject: [PATCH] openggsn[master]: sgsnemu: Fix up gengetopt file for RAI Message-ID: Review at https://gerrit.osmocom.org/4028 sgsnemu: Fix up gengetopt file for RAI In commit 41af5691ef08fb70e2c65aba03c8b9e6c20983a6 we introduced the --rai command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/28/4028/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 3d12b91..e917fb5 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -27,6 +27,7 @@ option "selmode" - "Selection mode" int default="0x01" no option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no -- To view, visit https://gerrit.osmocom.org/4028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:49:02 +0000 Subject: [PATCH] openggsn[master]: sgsnemu: Fix up gengetopt file for --norecovery Message-ID: Review at https://gerrit.osmocom.org/4029 sgsnemu: Fix up gengetopt file for --norecovery In commit 3a4c67b4bf0067c4949a60bc750d01e0576c5e08 we introduced the --norecovery command line option, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/29/4029/1 diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index e917fb5..620ae7a 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -30,6 +30,7 @@ option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no +option "norecovery" - "Do not send recovery" flag off option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:49:02 +0000 Subject: [PATCH] openggsn[master]: sgsnemu: Re-generate cmdline.[ch] using gengetopt Message-ID: Review at https://gerrit.osmocom.org/4030 sgsnemu: Re-generate cmdline.[ch] using gengetopt This will replace the manual additions to cmdline.[ch] with auto-generated code from gengetopt. We need to fix-up the RAT Type in sgsnemu.c as the manually-added code diverged from what gengetopt generates. Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 1,492 insertions(+), 1,473 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/30/4030/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 1ff1a59..88210d7 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -1,5 +1,5 @@ /* - File autogenerated by gengetopt version 2.17 + File autogenerated by gengetopt version 2.22.6 generated with the following command: gengetopt --conf-parser @@ -17,7 +17,11 @@ #include #include -#include "getopt.h" +#ifndef FIX_UNUSED +#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ +#endif + +#include #include "cmdline.h" @@ -26,50 +30,57 @@ const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_versiontext = ""; + +const char *gengetopt_args_info_description = ""; + const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file", - " --pidfile=STRING Filename of process id file (default=`./sgsnemu.pid')", - " --statedir=STRING Directory of nonvolatile data (default=`./')", - " --dns=STRING DNS Server to use", - " -l, --listen=STRING Local interface", - " -r, --remote=STRING Remote host", - " --contexts=INT Number of contexts (default=`1')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " --gtpversion=INT GTP version to use (default=`1')", - " -a, --apn=STRING Access point name (default=`internet')", - " --selmode=INT Selection mode (default=`0x01')", - " --rattype=INT Radio Access Technology Type (optional-1to5)", - " --userloc=STRING User Location Information (optional-type.MCC.MNC.LAC.CIorSACorRAC)", - " --rai=STRING Routing Area Information (optional-MCC.MNC.LAC.RAC)", - " --mstz=STRING MS Time Zone (optional- sign.NbQuartersOfAnHour.DSTAdjustment)", - " --imeisv=STRING IMEI(SV) International Mobile Equipment Identity (and Software Version) (optional,16 digits)", - " -i, --imsi=STRING IMSI (default=`240010123456789')", - " --nsapi=INT NSAPI (default=`0')", - " -m, --msisdn=STRING Mobile Station ISDN number (default=`46702123456')", - " -q, --qos=INT Requested quality of service (default=`0x000b921f')", - " --qose1=INT Requested quality of service Extension 1 (example=`0x9396404074f9ffff')", - " --qose2=INT Requested quality of service Extension 2 (example=`0x11')", - " --qose3=INT Requested quality of service Extension 3 (example=`0x0101')", - " --qose4=INT Requested quality of service Extension 4 (example=`0x4040')", - " --charging=INT Charging characteristics (default=`0x0800')", - " -u, --uid=STRING Login user ID (default=`mig')", - " -p, --pwd=STRING Login password (default=`hemmelig')", - " --createif Create local network interface (default=off)", - " -n, --net=STRING Network address for local interface", - " --defaultroute Create default route (default=off)", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --pinghost=STRING Ping remote host", - " --pingrate=INT Number of ping req per second (default=`1')", - " --pingsize=INT Number of ping data bytes (default=`56')", - " --pingcount=INT Number of ping req to send (default=`0')", - " --pingquiet Do not print ping packet info (default=off)", - " --norecovery Do not send recovery (default=off)", + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -d, --debug Run in debug mode (default=off)", + " -c, --conf=STRING Read configuration file", + " --pidfile=STRING Filename of process id file\n (default=`./sgsnemu.pid')", + " --statedir=STRING Directory of nonvolatile data (default=`./')", + " --dns=STRING DNS Server to use", + " -l, --listen=STRING Local interface", + " -r, --remote=STRING Remote host", + " --contexts=INT Number of contexts (default=`1')", + " --timelimit=INT Exit after timelimit seconds (default=`0')", + " --gtpversion=INT GTP version to use (default=`1')", + " -a, --apn=STRING Access point name (default=`internet')", + " --selmode=INT Selection mode (default=`0x01')", + " --rattype=1..5 Radio Access Technology Type (default=`1')", + " --userloc=type.MCC.MNC.LAC.CIorSACorRAC\n User Location Information\n (default=`02509946241207')", + " --rai=MCC.MNC.LAC.RAC Routing Area Information\n (default=`02509946241207')", + " --mstz=sign.NbQuartersOfAnHour.DSTAdjustment\n MS Time Zone (default=`0')", + " --imeisv=STRING IMEI(SV) International Mobile Equipment\n Identity (and Software Version)\n (default=`2143658709214365')", + " --norecovery Do not send recovery (default=off)", + " -i, --imsi=STRING IMSI (default=`240010123456789')", + " --nsapi=INT NSAPI (default=`0')", + " -m, --msisdn=STRING Mobile Station ISDN number\n (default=`46702123456')", + " -q, --qos=INT Requested quality of service\n (default=`0x000b921f')", + " --qose1=INT Requested quality of service Extension 1\n (default=`0x9396404074f9ffff')", + " --qose2=INT Requested quality of service Extension 2\n (default=`0x11')", + " --qose3=INT Requested quality of service Extension 3\n (default=`0x0101')", + " --qose4=INT Requested quality of service Extension 4\n (default=`0x4040')", + " --charging=INT Charging characteristics (default=`0x0800')", + " -u, --uid=STRING Login user ID (default=`mig')", + " -p, --pwd=STRING Login password (default=`hemmelig')", + " --createif Create local network interface (default=off)", + " -n, --net=STRING Network address for local interface", + " --defaultroute Create default route (default=off)", + " --ipup=STRING Script to run after link-up", + " --ipdown=STRING Script to run after link-down", + " --pinghost=STRING Ping remote host", + " --pingrate=INT Number of ping req per second (default=`1')", + " --pingsize=INT Number of ping data bytes (default=`56')", + " --pingcount=INT Number of ping req to send (default=`0')", + " --pingquiet Do not print ping packet info (default=off)", 0 }; + +typedef enum { ARG_NO, ARG_FLAG, ARG_STRING, ARG_INT +} cmdline_parser_arg_type; static void clear_given(struct gengetopt_args_info *args_info); @@ -77,9 +88,9 @@ void clear_args(struct gengetopt_args_info *args_info); static int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error); struct line_list { @@ -127,6 +138,7 @@ args_info->rai_given = 0; args_info->mstz_given = 0; args_info->imeisv_given = 0; + args_info->norecovery_given = 0; args_info->imsi_given = 0; args_info->nsapi_given = 0; args_info->msisdn_given = 0; @@ -148,12 +160,12 @@ args_info->pingsize_given = 0; args_info->pingcount_given = 0; args_info->pingquiet_given = 0; - args_info->norecovery_given = 0; } static void clear_args(struct gengetopt_args_info *args_info) { + FIX_UNUSED(args_info); args_info->debug_flag = 0; args_info->conf_arg = NULL; args_info->conf_orig = NULL; @@ -177,16 +189,17 @@ args_info->apn_orig = NULL; args_info->selmode_arg = 0x01; args_info->selmode_orig = NULL; - args_info->rattype_arg = "1"; + args_info->rattype_arg = 1; args_info->rattype_orig = NULL; - args_info->userloc_arg = strdup("02509946241207"); + args_info->userloc_arg = gengetopt_strdup("02509946241207"); args_info->userloc_orig = NULL; - args_info->rai_arg = strdup("02509946241207"); + args_info->rai_arg = gengetopt_strdup("02509946241207"); args_info->rai_orig = NULL; - args_info->mstz_arg = strdup("0"); + args_info->mstz_arg = gengetopt_strdup("0"); args_info->mstz_orig = NULL; - args_info->imeisv_arg = strdup("2143658709214365"); + args_info->imeisv_arg = gengetopt_strdup("2143658709214365"); args_info->imeisv_orig = NULL; + args_info->norecovery_flag = 0; args_info->imsi_arg = gengetopt_strdup("240010123456789"); args_info->imsi_orig = NULL; args_info->nsapi_arg = 0; @@ -226,13 +239,13 @@ args_info->pingcount_arg = 0; args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; - args_info->norecovery_flag = 0; } static void init_args_info(struct gengetopt_args_info *args_info) { + args_info->help_help = gengetopt_args_info_help[0]; args_info->version_help = gengetopt_args_info_help[1]; args_info->debug_help = gengetopt_args_info_help[2]; @@ -247,41 +260,67 @@ args_info->gtpversion_help = gengetopt_args_info_help[11]; args_info->apn_help = gengetopt_args_info_help[12]; args_info->selmode_help = gengetopt_args_info_help[13]; - args_info->imsi_help = gengetopt_args_info_help[14]; - args_info->nsapi_help = gengetopt_args_info_help[15]; - args_info->msisdn_help = gengetopt_args_info_help[16]; - args_info->qos_help = gengetopt_args_info_help[17]; - args_info->charging_help = gengetopt_args_info_help[18]; - args_info->uid_help = gengetopt_args_info_help[19]; - args_info->pwd_help = gengetopt_args_info_help[20]; - args_info->createif_help = gengetopt_args_info_help[21]; - args_info->net_help = gengetopt_args_info_help[22]; - args_info->defaultroute_help = gengetopt_args_info_help[23]; - args_info->ipup_help = gengetopt_args_info_help[24]; - args_info->ipdown_help = gengetopt_args_info_help[25]; - args_info->pinghost_help = gengetopt_args_info_help[26]; - args_info->pingrate_help = gengetopt_args_info_help[27]; - args_info->pingsize_help = gengetopt_args_info_help[28]; - args_info->pingcount_help = gengetopt_args_info_help[29]; - args_info->pingquiet_help = gengetopt_args_info_help[30]; - args_info->norecovery_help = gengetopt_args_info_help[31]; + args_info->rattype_help = gengetopt_args_info_help[14]; + args_info->userloc_help = gengetopt_args_info_help[15]; + args_info->rai_help = gengetopt_args_info_help[16]; + args_info->mstz_help = gengetopt_args_info_help[17]; + args_info->imeisv_help = gengetopt_args_info_help[18]; + args_info->norecovery_help = gengetopt_args_info_help[19]; + args_info->imsi_help = gengetopt_args_info_help[20]; + args_info->nsapi_help = gengetopt_args_info_help[21]; + args_info->msisdn_help = gengetopt_args_info_help[22]; + args_info->qos_help = gengetopt_args_info_help[23]; + args_info->qose1_help = gengetopt_args_info_help[24]; + args_info->qose2_help = gengetopt_args_info_help[25]; + args_info->qose3_help = gengetopt_args_info_help[26]; + args_info->qose4_help = gengetopt_args_info_help[27]; + args_info->charging_help = gengetopt_args_info_help[28]; + args_info->uid_help = gengetopt_args_info_help[29]; + args_info->pwd_help = gengetopt_args_info_help[30]; + args_info->createif_help = gengetopt_args_info_help[31]; + args_info->net_help = gengetopt_args_info_help[32]; + args_info->defaultroute_help = gengetopt_args_info_help[33]; + args_info->ipup_help = gengetopt_args_info_help[34]; + args_info->ipdown_help = gengetopt_args_info_help[35]; + args_info->pinghost_help = gengetopt_args_info_help[36]; + args_info->pingrate_help = gengetopt_args_info_help[37]; + args_info->pingsize_help = gengetopt_args_info_help[38]; + args_info->pingcount_help = gengetopt_args_info_help[39]; + args_info->pingquiet_help = gengetopt_args_info_help[40]; } void cmdline_parser_print_version(void) { - printf("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); + printf("%s %s\n", + (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? + CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), + CMDLINE_PARSER_VERSION); + + if (strlen(gengetopt_args_info_versiontext) > 0) + printf("\n%s\n", gengetopt_args_info_versiontext); } -void cmdline_parser_print_help(void) +static void print_help_common(void) { - int i = 0; cmdline_parser_print_version(); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); - printf("\n%s\n\n", gengetopt_args_info_usage); + if (strlen(gengetopt_args_info_usage) > 0) + printf("\n%s\n", gengetopt_args_info_usage); + + printf("\n"); + + if (strlen(gengetopt_args_info_description) > 0) + printf("%s\n\n", gengetopt_args_info_description); +} + +void cmdline_parser_print_help(void) +{ + int i = 0; + print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } @@ -293,171 +332,210 @@ init_args_info(args_info); } +void cmdline_parser_params_init(struct cmdline_parser_params *params) +{ + if (params) { + params->override = 0; + params->initialize = 1; + params->check_required = 1; + params->check_ambiguity = 0; + params->print_errors = 1; + } +} + +struct cmdline_parser_params *cmdline_parser_params_create(void) +{ + struct cmdline_parser_params *params = + (struct cmdline_parser_params *) + malloc(sizeof(struct cmdline_parser_params)); + cmdline_parser_params_init(params); + return params; +} + +static void free_string_field(char **s) +{ + if (*s) { + free(*s); + *s = 0; + } +} + static void cmdline_parser_release(struct gengetopt_args_info *args_info) { - if (args_info->conf_arg) { - free(args_info->conf_arg); /* free previous argument */ - args_info->conf_arg = 0; - } - if (args_info->conf_orig) { - free(args_info->conf_orig); /* free previous argument */ - args_info->conf_orig = 0; - } - if (args_info->pidfile_arg) { - free(args_info->pidfile_arg); /* free previous argument */ - args_info->pidfile_arg = 0; - } - if (args_info->pidfile_orig) { - free(args_info->pidfile_orig); /* free previous argument */ - args_info->pidfile_orig = 0; - } - if (args_info->statedir_arg) { - free(args_info->statedir_arg); /* free previous argument */ - args_info->statedir_arg = 0; - } - if (args_info->statedir_orig) { - free(args_info->statedir_orig); /* free previous argument */ - args_info->statedir_orig = 0; - } - if (args_info->dns_arg) { - free(args_info->dns_arg); /* free previous argument */ - args_info->dns_arg = 0; - } - if (args_info->dns_orig) { - free(args_info->dns_orig); /* free previous argument */ - args_info->dns_orig = 0; - } - if (args_info->listen_arg) { - free(args_info->listen_arg); /* free previous argument */ - args_info->listen_arg = 0; - } - if (args_info->listen_orig) { - free(args_info->listen_orig); /* free previous argument */ - args_info->listen_orig = 0; - } - if (args_info->remote_arg) { - free(args_info->remote_arg); /* free previous argument */ - args_info->remote_arg = 0; - } - if (args_info->remote_orig) { - free(args_info->remote_orig); /* free previous argument */ - args_info->remote_orig = 0; - } - if (args_info->contexts_orig) { - free(args_info->contexts_orig); /* free previous argument */ - args_info->contexts_orig = 0; - } - if (args_info->timelimit_orig) { - free(args_info->timelimit_orig); /* free previous argument */ - args_info->timelimit_orig = 0; - } - if (args_info->gtpversion_orig) { - free(args_info->gtpversion_orig); /* free previous argument */ - args_info->gtpversion_orig = 0; - } - if (args_info->apn_arg) { - free(args_info->apn_arg); /* free previous argument */ - args_info->apn_arg = 0; - } - if (args_info->apn_orig) { - free(args_info->apn_orig); /* free previous argument */ - args_info->apn_orig = 0; - } - if (args_info->selmode_orig) { - free(args_info->selmode_orig); /* free previous argument */ - args_info->selmode_orig = 0; - } - if (args_info->imsi_arg) { - free(args_info->imsi_arg); /* free previous argument */ - args_info->imsi_arg = 0; - } - if (args_info->imsi_orig) { - free(args_info->imsi_orig); /* free previous argument */ - args_info->imsi_orig = 0; - } - if (args_info->nsapi_orig) { - free(args_info->nsapi_orig); /* free previous argument */ - args_info->nsapi_orig = 0; - } - if (args_info->msisdn_arg) { - free(args_info->msisdn_arg); /* free previous argument */ - args_info->msisdn_arg = 0; - } - if (args_info->msisdn_orig) { - free(args_info->msisdn_orig); /* free previous argument */ - args_info->msisdn_orig = 0; - } - if (args_info->qos_orig) { - free(args_info->qos_orig); /* free previous argument */ - args_info->qos_orig = 0; - } - if (args_info->charging_orig) { - free(args_info->charging_orig); /* free previous argument */ - args_info->charging_orig = 0; - } - if (args_info->uid_arg) { - free(args_info->uid_arg); /* free previous argument */ - args_info->uid_arg = 0; - } - if (args_info->uid_orig) { - free(args_info->uid_orig); /* free previous argument */ - args_info->uid_orig = 0; - } - if (args_info->pwd_arg) { - free(args_info->pwd_arg); /* free previous argument */ - args_info->pwd_arg = 0; - } - if (args_info->pwd_orig) { - free(args_info->pwd_orig); /* free previous argument */ - args_info->pwd_orig = 0; - } - if (args_info->net_arg) { - free(args_info->net_arg); /* free previous argument */ - args_info->net_arg = 0; - } - if (args_info->net_orig) { - free(args_info->net_orig); /* free previous argument */ - args_info->net_orig = 0; - } - if (args_info->ipup_arg) { - free(args_info->ipup_arg); /* free previous argument */ - args_info->ipup_arg = 0; - } - if (args_info->ipup_orig) { - free(args_info->ipup_orig); /* free previous argument */ - args_info->ipup_orig = 0; - } - if (args_info->ipdown_arg) { - free(args_info->ipdown_arg); /* free previous argument */ - args_info->ipdown_arg = 0; - } - if (args_info->ipdown_orig) { - free(args_info->ipdown_orig); /* free previous argument */ - args_info->ipdown_orig = 0; - } - if (args_info->pinghost_arg) { - free(args_info->pinghost_arg); /* free previous argument */ - args_info->pinghost_arg = 0; - } - if (args_info->pinghost_orig) { - free(args_info->pinghost_orig); /* free previous argument */ - args_info->pinghost_orig = 0; - } - if (args_info->pingrate_orig) { - free(args_info->pingrate_orig); /* free previous argument */ - args_info->pingrate_orig = 0; - } - if (args_info->pingsize_orig) { - free(args_info->pingsize_orig); /* free previous argument */ - args_info->pingsize_orig = 0; - } - if (args_info->pingcount_orig) { - free(args_info->pingcount_orig); /* free previous argument */ - args_info->pingcount_orig = 0; - } + free_string_field(&(args_info->conf_arg)); + free_string_field(&(args_info->conf_orig)); + free_string_field(&(args_info->pidfile_arg)); + free_string_field(&(args_info->pidfile_orig)); + free_string_field(&(args_info->statedir_arg)); + free_string_field(&(args_info->statedir_orig)); + free_string_field(&(args_info->dns_arg)); + free_string_field(&(args_info->dns_orig)); + free_string_field(&(args_info->listen_arg)); + free_string_field(&(args_info->listen_orig)); + free_string_field(&(args_info->remote_arg)); + free_string_field(&(args_info->remote_orig)); + free_string_field(&(args_info->contexts_orig)); + free_string_field(&(args_info->timelimit_orig)); + free_string_field(&(args_info->gtpversion_orig)); + free_string_field(&(args_info->apn_arg)); + free_string_field(&(args_info->apn_orig)); + free_string_field(&(args_info->selmode_orig)); + free_string_field(&(args_info->rattype_orig)); + free_string_field(&(args_info->userloc_arg)); + free_string_field(&(args_info->userloc_orig)); + free_string_field(&(args_info->rai_arg)); + free_string_field(&(args_info->rai_orig)); + free_string_field(&(args_info->mstz_arg)); + free_string_field(&(args_info->mstz_orig)); + free_string_field(&(args_info->imeisv_arg)); + free_string_field(&(args_info->imeisv_orig)); + free_string_field(&(args_info->imsi_arg)); + free_string_field(&(args_info->imsi_orig)); + free_string_field(&(args_info->nsapi_orig)); + free_string_field(&(args_info->msisdn_arg)); + free_string_field(&(args_info->msisdn_orig)); + free_string_field(&(args_info->qos_orig)); + free_string_field(&(args_info->qose1_orig)); + free_string_field(&(args_info->qose2_orig)); + free_string_field(&(args_info->qose3_orig)); + free_string_field(&(args_info->qose4_orig)); + free_string_field(&(args_info->charging_orig)); + free_string_field(&(args_info->uid_arg)); + free_string_field(&(args_info->uid_orig)); + free_string_field(&(args_info->pwd_arg)); + free_string_field(&(args_info->pwd_orig)); + free_string_field(&(args_info->net_arg)); + free_string_field(&(args_info->net_orig)); + free_string_field(&(args_info->ipup_arg)); + free_string_field(&(args_info->ipup_orig)); + free_string_field(&(args_info->ipdown_arg)); + free_string_field(&(args_info->ipdown_orig)); + free_string_field(&(args_info->pinghost_arg)); + free_string_field(&(args_info->pinghost_orig)); + free_string_field(&(args_info->pingrate_orig)); + free_string_field(&(args_info->pingsize_orig)); + free_string_field(&(args_info->pingcount_orig)); clear_given(args_info); +} + +static void +write_into_file(FILE * outfile, const char *opt, const char *arg, + const char *values[]) +{ + FIX_UNUSED(values); + if (arg) { + fprintf(outfile, "%s=\"%s\"\n", opt, arg); + } else { + fprintf(outfile, "%s\n", opt); + } +} + +int cmdline_parser_dump(FILE * outfile, struct gengetopt_args_info *args_info) +{ + int i = 0; + + if (!outfile) { + fprintf(stderr, "%s: cannot dump options to stream\n", + CMDLINE_PARSER_PACKAGE); + return EXIT_FAILURE; + } + + if (args_info->help_given) + write_into_file(outfile, "help", 0, 0); + if (args_info->version_given) + write_into_file(outfile, "version", 0, 0); + if (args_info->debug_given) + write_into_file(outfile, "debug", 0, 0); + if (args_info->conf_given) + write_into_file(outfile, "conf", args_info->conf_orig, 0); + if (args_info->pidfile_given) + write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); + if (args_info->statedir_given) + write_into_file(outfile, "statedir", args_info->statedir_orig, + 0); + if (args_info->dns_given) + write_into_file(outfile, "dns", args_info->dns_orig, 0); + if (args_info->listen_given) + write_into_file(outfile, "listen", args_info->listen_orig, 0); + if (args_info->remote_given) + write_into_file(outfile, "remote", args_info->remote_orig, 0); + if (args_info->contexts_given) + write_into_file(outfile, "contexts", args_info->contexts_orig, + 0); + if (args_info->timelimit_given) + write_into_file(outfile, "timelimit", args_info->timelimit_orig, + 0); + if (args_info->gtpversion_given) + write_into_file(outfile, "gtpversion", + args_info->gtpversion_orig, 0); + if (args_info->apn_given) + write_into_file(outfile, "apn", args_info->apn_orig, 0); + if (args_info->selmode_given) + write_into_file(outfile, "selmode", args_info->selmode_orig, 0); + if (args_info->rattype_given) + write_into_file(outfile, "rattype", args_info->rattype_orig, 0); + if (args_info->userloc_given) + write_into_file(outfile, "userloc", args_info->userloc_orig, 0); + if (args_info->rai_given) + write_into_file(outfile, "rai", args_info->rai_orig, 0); + if (args_info->mstz_given) + write_into_file(outfile, "mstz", args_info->mstz_orig, 0); + if (args_info->imeisv_given) + write_into_file(outfile, "imeisv", args_info->imeisv_orig, 0); + if (args_info->norecovery_given) + write_into_file(outfile, "norecovery", 0, 0); + if (args_info->imsi_given) + write_into_file(outfile, "imsi", args_info->imsi_orig, 0); + if (args_info->nsapi_given) + write_into_file(outfile, "nsapi", args_info->nsapi_orig, 0); + if (args_info->msisdn_given) + write_into_file(outfile, "msisdn", args_info->msisdn_orig, 0); + if (args_info->qos_given) + write_into_file(outfile, "qos", args_info->qos_orig, 0); + if (args_info->qose1_given) + write_into_file(outfile, "qose1", args_info->qose1_orig, 0); + if (args_info->qose2_given) + write_into_file(outfile, "qose2", args_info->qose2_orig, 0); + if (args_info->qose3_given) + write_into_file(outfile, "qose3", args_info->qose3_orig, 0); + if (args_info->qose4_given) + write_into_file(outfile, "qose4", args_info->qose4_orig, 0); + if (args_info->charging_given) + write_into_file(outfile, "charging", args_info->charging_orig, + 0); + if (args_info->uid_given) + write_into_file(outfile, "uid", args_info->uid_orig, 0); + if (args_info->pwd_given) + write_into_file(outfile, "pwd", args_info->pwd_orig, 0); + if (args_info->createif_given) + write_into_file(outfile, "createif", 0, 0); + if (args_info->net_given) + write_into_file(outfile, "net", args_info->net_orig, 0); + if (args_info->defaultroute_given) + write_into_file(outfile, "defaultroute", 0, 0); + if (args_info->ipup_given) + write_into_file(outfile, "ipup", args_info->ipup_orig, 0); + if (args_info->ipdown_given) + write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); + if (args_info->pinghost_given) + write_into_file(outfile, "pinghost", args_info->pinghost_orig, + 0); + if (args_info->pingrate_given) + write_into_file(outfile, "pingrate", args_info->pingrate_orig, + 0); + if (args_info->pingsize_given) + write_into_file(outfile, "pingsize", args_info->pingsize_orig, + 0); + if (args_info->pingcount_given) + write_into_file(outfile, "pingcount", args_info->pingcount_orig, + 0); + if (args_info->pingquiet_given) + write_into_file(outfile, "pingquiet", 0, 0); + + i = EXIT_SUCCESS; + return i; } int @@ -475,231 +553,9 @@ return EXIT_FAILURE; } - if (args_info->help_given) { - fprintf(outfile, "%s\n", "help"); - } - if (args_info->version_given) { - fprintf(outfile, "%s\n", "version"); - } - if (args_info->debug_given) { - fprintf(outfile, "%s\n", "debug"); - } - if (args_info->conf_given) { - if (args_info->conf_orig) { - fprintf(outfile, "%s=\"%s\"\n", "conf", - args_info->conf_orig); - } else { - fprintf(outfile, "%s\n", "conf"); - } - } - if (args_info->pidfile_given) { - if (args_info->pidfile_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pidfile", - args_info->pidfile_orig); - } else { - fprintf(outfile, "%s\n", "pidfile"); - } - } - if (args_info->statedir_given) { - if (args_info->statedir_orig) { - fprintf(outfile, "%s=\"%s\"\n", "statedir", - args_info->statedir_orig); - } else { - fprintf(outfile, "%s\n", "statedir"); - } - } - if (args_info->dns_given) { - if (args_info->dns_orig) { - fprintf(outfile, "%s=\"%s\"\n", "dns", - args_info->dns_orig); - } else { - fprintf(outfile, "%s\n", "dns"); - } - } - if (args_info->listen_given) { - if (args_info->listen_orig) { - fprintf(outfile, "%s=\"%s\"\n", "listen", - args_info->listen_orig); - } else { - fprintf(outfile, "%s\n", "listen"); - } - } - if (args_info->remote_given) { - if (args_info->remote_orig) { - fprintf(outfile, "%s=\"%s\"\n", "remote", - args_info->remote_orig); - } else { - fprintf(outfile, "%s\n", "remote"); - } - } - if (args_info->contexts_given) { - if (args_info->contexts_orig) { - fprintf(outfile, "%s=\"%s\"\n", "contexts", - args_info->contexts_orig); - } else { - fprintf(outfile, "%s\n", "contexts"); - } - } - if (args_info->timelimit_given) { - if (args_info->timelimit_orig) { - fprintf(outfile, "%s=\"%s\"\n", "timelimit", - args_info->timelimit_orig); - } else { - fprintf(outfile, "%s\n", "timelimit"); - } - } - if (args_info->gtpversion_given) { - if (args_info->gtpversion_orig) { - fprintf(outfile, "%s=\"%s\"\n", "gtpversion", - args_info->gtpversion_orig); - } else { - fprintf(outfile, "%s\n", "gtpversion"); - } - } - if (args_info->apn_given) { - if (args_info->apn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "apn", - args_info->apn_orig); - } else { - fprintf(outfile, "%s\n", "apn"); - } - } - if (args_info->selmode_given) { - if (args_info->selmode_orig) { - fprintf(outfile, "%s=\"%s\"\n", "selmode", - args_info->selmode_orig); - } else { - fprintf(outfile, "%s\n", "selmode"); - } - } - if (args_info->imsi_given) { - if (args_info->imsi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "imsi", - args_info->imsi_orig); - } else { - fprintf(outfile, "%s\n", "imsi"); - } - } - if (args_info->nsapi_given) { - if (args_info->nsapi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "nsapi", - args_info->nsapi_orig); - } else { - fprintf(outfile, "%s\n", "nsapi"); - } - } - if (args_info->msisdn_given) { - if (args_info->msisdn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "msisdn", - args_info->msisdn_orig); - } else { - fprintf(outfile, "%s\n", "msisdn"); - } - } - if (args_info->qos_given) { - if (args_info->qos_orig) { - fprintf(outfile, "%s=\"%s\"\n", "qos", - args_info->qos_orig); - } else { - fprintf(outfile, "%s\n", "qos"); - } - } - if (args_info->charging_given) { - if (args_info->charging_orig) { - fprintf(outfile, "%s=\"%s\"\n", "charging", - args_info->charging_orig); - } else { - fprintf(outfile, "%s\n", "charging"); - } - } - if (args_info->uid_given) { - if (args_info->uid_orig) { - fprintf(outfile, "%s=\"%s\"\n", "uid", - args_info->uid_orig); - } else { - fprintf(outfile, "%s\n", "uid"); - } - } - if (args_info->pwd_given) { - if (args_info->pwd_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pwd", - args_info->pwd_orig); - } else { - fprintf(outfile, "%s\n", "pwd"); - } - } - if (args_info->createif_given) { - fprintf(outfile, "%s\n", "createif"); - } - if (args_info->net_given) { - if (args_info->net_orig) { - fprintf(outfile, "%s=\"%s\"\n", "net", - args_info->net_orig); - } else { - fprintf(outfile, "%s\n", "net"); - } - } - if (args_info->defaultroute_given) { - fprintf(outfile, "%s\n", "defaultroute"); - } - if (args_info->ipup_given) { - if (args_info->ipup_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipup", - args_info->ipup_orig); - } else { - fprintf(outfile, "%s\n", "ipup"); - } - } - if (args_info->ipdown_given) { - if (args_info->ipdown_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipdown", - args_info->ipdown_orig); - } else { - fprintf(outfile, "%s\n", "ipdown"); - } - } - if (args_info->pinghost_given) { - if (args_info->pinghost_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pinghost", - args_info->pinghost_orig); - } else { - fprintf(outfile, "%s\n", "pinghost"); - } - } - if (args_info->pingrate_given) { - if (args_info->pingrate_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingrate", - args_info->pingrate_orig); - } else { - fprintf(outfile, "%s\n", "pingrate"); - } - } - if (args_info->pingsize_given) { - if (args_info->pingsize_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingsize", - args_info->pingsize_orig); - } else { - fprintf(outfile, "%s\n", "pingsize"); - } - } - if (args_info->pingcount_given) { - if (args_info->pingcount_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingcount", - args_info->pingcount_orig); - } else { - fprintf(outfile, "%s\n", "pingcount"); - } - } - if (args_info->pingquiet_given) { - fprintf(outfile, "%s\n", "pingquiet"); - } - if (args_info->norecovery_given) { - fprintf(outfile, "%s\n", "norecovery"); - } - + i = cmdline_parser_dump(outfile, args_info); fclose(outfile); - i = EXIT_SUCCESS; return i; } @@ -708,11 +564,10 @@ cmdline_parser_release(args_info); } -/* gengetopt_strdup() */ -/* strdup.c replacement of strdup, which is not standard */ +/** @brief replacement of strdup, which is not standard */ char *gengetopt_strdup(const char *s) { - char *result = NULL; + char *result = 0; if (!s) return result; @@ -723,23 +578,40 @@ return result; } -int -cmdline_parser(int argc, char *const *argv, - struct gengetopt_args_info *args_info) +int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2(argc, argv, args_info, 0, 1, 1); } int -cmdline_parser2(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) { int result; + result = cmdline_parser_internal(argc, argv, args_info, params, 0); - result = - cmdline_parser_internal(argc, argv, args_info, override, initialize, - check_required, NULL); + if (result == EXIT_FAILURE) { + cmdline_parser_free(args_info); + exit(EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + int result; + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + result = cmdline_parser_internal(argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free(args_info); @@ -753,19 +625,152 @@ cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name) { + FIX_UNUSED(args_info); + FIX_UNUSED(prog_name); return EXIT_SUCCESS; } +static char *package_name = 0; + +/** + * @brief updates an option + * @param field the generic pointer to the field to update + * @param orig_field the pointer to the orig field + * @param field_given the pointer to the number of occurrence of this option + * @param prev_given the pointer to the number of occurrence already seen + * @param value the argument for this option (if null no arg was specified) + * @param possible_values the possible values for this option (if specified) + * @param default_value the default value (in case the option only accepts fixed values) + * @param arg_type the type of this option + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity + * @param override @see cmdline_parser_params.override + * @param no_free whether to free a possible previous value + * @param multiple_option whether this is a multiple option + * @param long_opt the corresponding long option + * @param short_opt the corresponding short option (or '-' if none) + * @param additional_error possible further error specification + */ +static +int update_arg(void *field, char **orig_field, + unsigned int *field_given, unsigned int *prev_given, + char *value, const char *possible_values[], + const char *default_value, + cmdline_parser_arg_type arg_type, + int check_ambiguity, int override, + int no_free, int multiple_option, + const char *long_opt, char short_opt, + const char *additional_error) +{ + char *stop_char = 0; + const char *val = value; + int found; + char **string_field; + FIX_UNUSED(field); + + stop_char = 0; + found = 0; + + if (!multiple_option && prev_given + && (*prev_given || (check_ambiguity && *field_given))) { + if (short_opt != '-') + fprintf(stderr, + "%s: `--%s' (`-%c') option given more than once%s\n", + package_name, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf(stderr, + "%s: `--%s' option given more than once%s\n", + package_name, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + FIX_UNUSED(default_value); + + if (field_given && *field_given && !override) + return 0; + if (prev_given) + (*prev_given)++; + if (field_given) + (*field_given)++; + if (possible_values) + val = possible_values[found]; + + switch (arg_type) { + case ARG_FLAG: + *((int *)field) = !*((int *)field); + break; + case ARG_INT: + if (val) + *((int *)field) = strtol(val, &stop_char, 0); + break; + case ARG_STRING: + if (val) { + string_field = (char **)field; + if (!no_free && *string_field) + free(*string_field); /* free previous string */ + *string_field = gengetopt_strdup(val); + } + break; + default: + break; + }; + + /* check numeric conversion */ + switch (arg_type) { + case ARG_INT: + if (val && !(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", + package_name, val); + return 1; /* failure */ + } + break; + default: + ; + }; + + /* store the original value */ + switch (arg_type) { + case ARG_NO: + case ARG_FLAG: + break; + default: + if (value && orig_field) { + if (no_free) { + *orig_field = value; + } else { + if (*orig_field) + free(*orig_field); /* free previous string */ + *orig_field = gengetopt_strdup(value); + } + } + }; + + return 0; /* OK */ +} + int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ - int error = 0; + int error_occurred = 0; struct gengetopt_args_info local_args_info; + + int override; + int initialize; + int check_required; + int check_ambiguity; + + package_name = argv[0]; + + override = params->override; + initialize = params->initialize; + check_required = params->check_required; + check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init(args_info); @@ -774,12 +779,11 @@ optarg = 0; optind = 0; - opterr = 1; + opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; - char *stop_char; static struct option long_options[] = { {"help", 0, NULL, 'h'}, @@ -801,6 +805,7 @@ {"rai", 1, NULL, 0}, {"mstz", 1, NULL, 0}, {"imeisv", 1, NULL, 0}, + {"norecovery", 0, NULL, 0}, {"imsi", 1, NULL, 'i'}, {"nsapi", 1, NULL, 0}, {"msisdn", 1, NULL, 'm'}, @@ -822,11 +827,9 @@ {"pingsize", 1, NULL, 0}, {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, - {"norecovery", 0, NULL, 0}, - {NULL, 0, NULL, 0} + {0, 0, 0, 0} }; - stop_char = 0; c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:", long_options, &option_index); @@ -845,884 +848,559 @@ exit(EXIT_SUCCESS); case 'd': /* Run in debug mode. */ - if (local_args_info.debug_given) { - fprintf(stderr, - "%s: `--debug' (`-d') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->debug_given && !override) - continue; - local_args_info.debug_given = 1; - args_info->debug_given = 1; - args_info->debug_flag = !(args_info->debug_flag); - break; + if (update_arg + ((void *)&(args_info->debug_flag), 0, + &(args_info->debug_given), + &(local_args_info.debug_given), optarg, 0, 0, + ARG_FLAG, check_ambiguity, override, 1, 0, "debug", + 'd', additional_error)) + goto failure; + + break; case 'c': /* Read configuration file. */ - if (local_args_info.conf_given) { - fprintf(stderr, - "%s: `--conf' (`-c') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->conf_given && !override) - continue; - local_args_info.conf_given = 1; - args_info->conf_given = 1; - if (args_info->conf_arg) - free(args_info->conf_arg); /* free previous string */ - args_info->conf_arg = gengetopt_strdup(optarg); - if (args_info->conf_orig) - free(args_info->conf_orig); /* free previous string */ - args_info->conf_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->conf_arg), + &(args_info->conf_orig), + &(args_info->conf_given), + &(local_args_info.conf_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "conf", 'c', additional_error)) + goto failure; + + break; case 'l': /* Local interface. */ - if (local_args_info.listen_given) { - fprintf(stderr, - "%s: `--listen' (`-l') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->listen_given && !override) - continue; - local_args_info.listen_given = 1; - args_info->listen_given = 1; - if (args_info->listen_arg) - free(args_info->listen_arg); /* free previous string */ - args_info->listen_arg = gengetopt_strdup(optarg); - if (args_info->listen_orig) - free(args_info->listen_orig); /* free previous string */ - args_info->listen_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->listen_arg), + &(args_info->listen_orig), + &(args_info->listen_given), + &(local_args_info.listen_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "listen", 'l', + additional_error)) + goto failure; + + break; case 'r': /* Remote host. */ - if (local_args_info.remote_given) { - fprintf(stderr, - "%s: `--remote' (`-r') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->remote_given && !override) - continue; - local_args_info.remote_given = 1; - args_info->remote_given = 1; - if (args_info->remote_arg) - free(args_info->remote_arg); /* free previous string */ - args_info->remote_arg = gengetopt_strdup(optarg); - if (args_info->remote_orig) - free(args_info->remote_orig); /* free previous string */ - args_info->remote_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->remote_arg), + &(args_info->remote_orig), + &(args_info->remote_given), + &(local_args_info.remote_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "remote", 'r', + additional_error)) + goto failure; + + break; case 'a': /* Access point name. */ - if (local_args_info.apn_given) { - fprintf(stderr, - "%s: `--apn' (`-a') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->apn_given && !override) - continue; - local_args_info.apn_given = 1; - args_info->apn_given = 1; - if (args_info->apn_arg) - free(args_info->apn_arg); /* free previous string */ - args_info->apn_arg = gengetopt_strdup(optarg); - if (args_info->apn_orig) - free(args_info->apn_orig); /* free previous string */ - args_info->apn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->apn_arg), + &(args_info->apn_orig), + &(args_info->apn_given), + &(local_args_info.apn_given), optarg, 0, + "internet", ARG_STRING, check_ambiguity, + override, 0, 0, "apn", 'a', + additional_error)) + goto failure; + + break; case 'i': /* IMSI. */ - if (local_args_info.imsi_given) { - fprintf(stderr, - "%s: `--imsi' (`-i') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->imsi_given && !override) - continue; - local_args_info.imsi_given = 1; - args_info->imsi_given = 1; - if (args_info->imsi_arg) - free(args_info->imsi_arg); /* free previous string */ - args_info->imsi_arg = gengetopt_strdup(optarg); - if (args_info->imsi_orig) - free(args_info->imsi_orig); /* free previous string */ - args_info->imsi_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->imsi_arg), + &(args_info->imsi_orig), + &(args_info->imsi_given), + &(local_args_info.imsi_given), optarg, 0, + "240010123456789", ARG_STRING, + check_ambiguity, override, 0, 0, "imsi", + 'i', additional_error)) + goto failure; + + break; case 'm': /* Mobile Station ISDN number. */ - if (local_args_info.msisdn_given) { - fprintf(stderr, - "%s: `--msisdn' (`-m') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->msisdn_given && !override) - continue; - local_args_info.msisdn_given = 1; - args_info->msisdn_given = 1; - if (args_info->msisdn_arg) - free(args_info->msisdn_arg); /* free previous string */ - args_info->msisdn_arg = gengetopt_strdup(optarg); - if (args_info->msisdn_orig) - free(args_info->msisdn_orig); /* free previous string */ - args_info->msisdn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->msisdn_arg), + &(args_info->msisdn_orig), + &(args_info->msisdn_given), + &(local_args_info.msisdn_given), optarg, + 0, "46702123456", ARG_STRING, + check_ambiguity, override, 0, 0, + "msisdn", 'm', additional_error)) + goto failure; + + break; case 'q': /* Requested quality of service. */ - if (local_args_info.qos_given) { - fprintf(stderr, - "%s: `--qos' (`-q') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->qos_given && !override) - continue; - local_args_info.qos_given = 1; - args_info->qos_given = 1; - args_info->qos_arg = strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qos_orig) - free(args_info->qos_orig); /* free previous string */ - args_info->qos_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->qos_arg), + &(args_info->qos_orig), + &(args_info->qos_given), + &(local_args_info.qos_given), optarg, 0, + "0x000b921f", ARG_INT, check_ambiguity, + override, 0, 0, "qos", 'q', + additional_error)) + goto failure; + + break; case 'u': /* Login user ID. */ - if (local_args_info.uid_given) { - fprintf(stderr, - "%s: `--uid' (`-u') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->uid_given && !override) - continue; - local_args_info.uid_given = 1; - args_info->uid_given = 1; - if (args_info->uid_arg) - free(args_info->uid_arg); /* free previous string */ - args_info->uid_arg = gengetopt_strdup(optarg); - if (args_info->uid_orig) - free(args_info->uid_orig); /* free previous string */ - args_info->uid_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->uid_arg), + &(args_info->uid_orig), + &(args_info->uid_given), + &(local_args_info.uid_given), optarg, 0, + "mig", ARG_STRING, check_ambiguity, + override, 0, 0, "uid", 'u', + additional_error)) + goto failure; + + break; case 'p': /* Login password. */ - if (local_args_info.pwd_given) { - fprintf(stderr, - "%s: `--pwd' (`-p') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->pwd_given && !override) - continue; - local_args_info.pwd_given = 1; - args_info->pwd_given = 1; - if (args_info->pwd_arg) - free(args_info->pwd_arg); /* free previous string */ - args_info->pwd_arg = gengetopt_strdup(optarg); - if (args_info->pwd_orig) - free(args_info->pwd_orig); /* free previous string */ - args_info->pwd_orig = gengetopt_strdup(optarg); - break; - case 'n': /* Network address for local interface. */ - if (local_args_info.net_given) { - fprintf(stderr, - "%s: `--net' (`-n') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); + if (update_arg((void *)&(args_info->pwd_arg), + &(args_info->pwd_orig), + &(args_info->pwd_given), + &(local_args_info.pwd_given), optarg, 0, + "hemmelig", ARG_STRING, check_ambiguity, + override, 0, 0, "pwd", 'p', + additional_error)) goto failure; - } - if (args_info->net_given && !override) - continue; - local_args_info.net_given = 1; - args_info->net_given = 1; - if (args_info->net_arg) - free(args_info->net_arg); /* free previous string */ - args_info->net_arg = gengetopt_strdup(optarg); - if (args_info->net_orig) - free(args_info->net_orig); /* free previous string */ - args_info->net_orig = gengetopt_strdup(optarg); + + break; + case 'n': /* Network address for local interface. */ + + if (update_arg((void *)&(args_info->net_arg), + &(args_info->net_orig), + &(args_info->net_given), + &(local_args_info.net_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "net", 'n', additional_error)) + goto failure; + break; case 0: /* Long option with no short option */ /* Filename of process id file. */ if (strcmp(long_options[option_index].name, "pidfile") == 0) { - if (local_args_info.pidfile_given) { - fprintf(stderr, - "%s: `--pidfile' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->pidfile_arg), + &(args_info->pidfile_orig), + &(args_info->pidfile_given), + &(local_args_info.pidfile_given), optarg, + 0, "./sgsnemu.pid", ARG_STRING, + check_ambiguity, override, 0, 0, "pidfile", + '-', additional_error)) goto failure; - } - if (args_info->pidfile_given && !override) - continue; - local_args_info.pidfile_given = 1; - args_info->pidfile_given = 1; - if (args_info->pidfile_arg) - free(args_info->pidfile_arg); /* free previous string */ - args_info->pidfile_arg = - gengetopt_strdup(optarg); - if (args_info->pidfile_orig) - free(args_info->pidfile_orig); /* free previous string */ - args_info->pidfile_orig = - gengetopt_strdup(optarg); + } /* Directory of nonvolatile data. */ else if (strcmp (long_options[option_index].name, "statedir") == 0) { - if (local_args_info.statedir_given) { - fprintf(stderr, - "%s: `--statedir' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->statedir_arg), + &(args_info->statedir_orig), + &(args_info->statedir_given), + &(local_args_info.statedir_given), optarg, + 0, "./", ARG_STRING, check_ambiguity, + override, 0, 0, "statedir", '-', + additional_error)) goto failure; - } - if (args_info->statedir_given && !override) - continue; - local_args_info.statedir_given = 1; - args_info->statedir_given = 1; - if (args_info->statedir_arg) - free(args_info->statedir_arg); /* free previous string */ - args_info->statedir_arg = - gengetopt_strdup(optarg); - if (args_info->statedir_orig) - free(args_info->statedir_orig); /* free previous string */ - args_info->statedir_orig = - gengetopt_strdup(optarg); + } /* DNS Server to use. */ else if (strcmp(long_options[option_index].name, "dns") == 0) { - if (local_args_info.dns_given) { - fprintf(stderr, - "%s: `--dns' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->dns_arg), + &(args_info->dns_orig), + &(args_info->dns_given), + &(local_args_info.dns_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "dns", '-', additional_error)) goto failure; - } - if (args_info->dns_given && !override) - continue; - local_args_info.dns_given = 1; - args_info->dns_given = 1; - if (args_info->dns_arg) - free(args_info->dns_arg); /* free previous string */ - args_info->dns_arg = gengetopt_strdup(optarg); - if (args_info->dns_orig) - free(args_info->dns_orig); /* free previous string */ - args_info->dns_orig = gengetopt_strdup(optarg); + } /* Number of contexts. */ else if (strcmp (long_options[option_index].name, "contexts") == 0) { - if (local_args_info.contexts_given) { - fprintf(stderr, - "%s: `--contexts' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->contexts_arg), + &(args_info->contexts_orig), + &(args_info->contexts_given), + &(local_args_info.contexts_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "contexts", '-', additional_error)) goto failure; - } - if (args_info->contexts_given && !override) - continue; - local_args_info.contexts_given = 1; - args_info->contexts_given = 1; - args_info->contexts_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->contexts_orig) - free(args_info->contexts_orig); /* free previous string */ - args_info->contexts_orig = - gengetopt_strdup(optarg); + } /* Exit after timelimit seconds. */ else if (strcmp (long_options[option_index].name, "timelimit") == 0) { - if (local_args_info.timelimit_given) { - fprintf(stderr, - "%s: `--timelimit' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->timelimit_arg), + &(args_info->timelimit_orig), + &(args_info->timelimit_given), + &(local_args_info.timelimit_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "timelimit", '-', additional_error)) goto failure; - } - if (args_info->timelimit_given && !override) - continue; - local_args_info.timelimit_given = 1; - args_info->timelimit_given = 1; - args_info->timelimit_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->timelimit_orig) - free(args_info->timelimit_orig); /* free previous string */ - args_info->timelimit_orig = - gengetopt_strdup(optarg); + } /* GTP version to use. */ else if (strcmp (long_options[option_index].name, "gtpversion") == 0) { - if (local_args_info.gtpversion_given) { - fprintf(stderr, - "%s: `--gtpversion' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->gtpversion_arg), + &(args_info->gtpversion_orig), + &(args_info->gtpversion_given), + &(local_args_info.gtpversion_given), + optarg, 0, "1", ARG_INT, check_ambiguity, + override, 0, 0, "gtpversion", '-', + additional_error)) goto failure; - } - if (args_info->gtpversion_given && !override) - continue; - local_args_info.gtpversion_given = 1; - args_info->gtpversion_given = 1; - args_info->gtpversion_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->gtpversion_orig) - free(args_info->gtpversion_orig); /* free previous string */ - args_info->gtpversion_orig = - gengetopt_strdup(optarg); + } /* Selection mode. */ else if (strcmp (long_options[option_index].name, "selmode") == 0) { - if (local_args_info.selmode_given) { - fprintf(stderr, - "%s: `--selmode' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->selmode_arg), + &(args_info->selmode_orig), + &(args_info->selmode_given), + &(local_args_info.selmode_given), optarg, + 0, "0x01", ARG_INT, check_ambiguity, + override, 0, 0, "selmode", '-', + additional_error)) goto failure; - } - if (args_info->selmode_given && !override) - continue; - local_args_info.selmode_given = 1; - args_info->selmode_given = 1; - args_info->selmode_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->selmode_orig) - free(args_info->selmode_orig); /* free previous string */ - args_info->selmode_orig = - gengetopt_strdup(optarg); - } - /* QoS Extension 1. */ - else if (strcmp - (long_options[option_index].name, - "qose1") == 0) { - if (args_info->qose1_given) { - fprintf(stderr, - "%s: `--qose1' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose1_given = 1; - args_info->qose1_arg = - strtoull(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose1_orig) - free(args_info->qose1_orig); /* free previous string */ - args_info->qose1_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 2. */ - else if (strcmp - (long_options[option_index].name, - "qose2") == 0) { - if (args_info->qose2_given) { - fprintf(stderr, - "%s: `--qose2' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose2_given = 1; - args_info->qose2_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose2_orig) - free(args_info->qose2_orig); /* free previous string */ - args_info->qose2_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 3. */ - else if (strcmp - (long_options[option_index].name, - "qose3") == 0) { - if (args_info->qose3_given) { - fprintf(stderr, - "%s: `--qose3' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose3_given = 1; - args_info->qose3_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose3_orig) - free(args_info->qose3_orig); /* free previous string */ - args_info->qose3_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 4. */ - else if (strcmp - (long_options[option_index].name, - "qose4") == 0) { - if (args_info->qose4_given) { - fprintf(stderr, - "%s: `--qose4' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose4_given = 1; - args_info->qose4_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose4_orig) - free(args_info->qose4_orig); /* free previous string */ - args_info->qose4_orig = - gengetopt_strdup(optarg); - break; + } /* Radio Access Technology Type. */ else if (strcmp (long_options[option_index].name, "rattype") == 0) { - if (args_info->rattype_given) { - fprintf(stderr, - "%s: `--rattype' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rattype_given = 1; - /* args_info->rattype_arg = strtol (optarg,&stop_char,0); */ - args_info->rattype_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->rattype_arg), + &(args_info->rattype_orig), + &(args_info->rattype_given), + &(local_args_info.rattype_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "rattype", '-', additional_error)) + goto failure; + } /* User Location Information. */ else if (strcmp (long_options[option_index].name, "userloc") == 0) { - if (args_info->userloc_given) { - fprintf(stderr, - "%s: `--userloc' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->userloc_given = 1; - args_info->userloc_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->userloc_arg), + &(args_info->userloc_orig), + &(args_info->userloc_given), + &(local_args_info.userloc_given), optarg, + 0, "02509946241207", ARG_STRING, + check_ambiguity, override, 0, 0, "userloc", + '-', additional_error)) + goto failure; + } /* Routing Area Information. */ else if (strcmp(long_options[option_index].name, "rai") == 0) { - if (args_info->rai_given) { - fprintf(stderr, - "%s: `--rai' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rai_given = 1; - args_info->rai_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->rai_arg), + &(args_info->rai_orig), + &(args_info->rai_given), + &(local_args_info.rai_given), + optarg, 0, "02509946241207", + ARG_STRING, check_ambiguity, + override, 0, 0, "rai", '-', + additional_error)) + goto failure; + } - /* MS Time Zone */ + /* MS Time Zone. */ else if (strcmp(long_options[option_index].name, "mstz") == 0) { - if (args_info->mstz_given) { - fprintf(stderr, - "%s: `--mstz' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->mstz_given = 1; - args_info->mstz_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->mstz_arg), + &(args_info->mstz_orig), + &(args_info->mstz_given), + &(local_args_info.mstz_given), + optarg, 0, "0", ARG_STRING, + check_ambiguity, override, 0, 0, + "mstz", '-', additional_error)) + goto failure; + } - /* IMEI(SV) */ + /* IMEI(SV) International Mobile Equipment Identity (and Software Version). */ else if (strcmp (long_options[option_index].name, "imeisv") == 0) { - if (args_info->imeisv_given) { - fprintf(stderr, - "%s: `--imeisv' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->imeisv_given = 1; - args_info->imeisv_arg = strdup(optarg); - break; - } - /* NSAPI. */ - else if (strcmp - (long_options[option_index].name, - "nsapi") == 0) { - if (local_args_info.nsapi_given) { - fprintf(stderr, - "%s: `--nsapi' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->imeisv_arg), + &(args_info->imeisv_orig), + &(args_info->imeisv_given), + &(local_args_info.imeisv_given), + optarg, 0, "2143658709214365", + ARG_STRING, check_ambiguity, + override, 0, 0, "imeisv", '-', + additional_error)) goto failure; - } - if (args_info->nsapi_given && !override) - continue; - local_args_info.nsapi_given = 1; - args_info->nsapi_given = 1; - args_info->nsapi_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->nsapi_orig) - free(args_info->nsapi_orig); /* free previous string */ - args_info->nsapi_orig = - gengetopt_strdup(optarg); - } - /* Charging characteristics. */ - else if (strcmp - (long_options[option_index].name, - "charging") == 0) { - if (local_args_info.charging_given) { - fprintf(stderr, - "%s: `--charging' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->charging_given && !override) - continue; - local_args_info.charging_given = 1; - args_info->charging_given = 1; - args_info->charging_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->charging_orig) - free(args_info->charging_orig); /* free previous string */ - args_info->charging_orig = - gengetopt_strdup(optarg); - } - /* Create local network interface. */ - else if (strcmp - (long_options[option_index].name, - "createif") == 0) { - if (local_args_info.createif_given) { - fprintf(stderr, - "%s: `--createif' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->createif_given && !override) - continue; - local_args_info.createif_given = 1; - args_info->createif_given = 1; - args_info->createif_flag = - !(args_info->createif_flag); - } - /* Create default route. */ - else if (strcmp - (long_options[option_index].name, - "defaultroute") == 0) { - if (local_args_info.defaultroute_given) { - fprintf(stderr, - "%s: `--defaultroute' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->defaultroute_given && !override) - continue; - local_args_info.defaultroute_given = 1; - args_info->defaultroute_given = 1; - args_info->defaultroute_flag = - !(args_info->defaultroute_flag); - } - /* Script to run after link-up. */ - else if (strcmp(long_options[option_index].name, "ipup") - == 0) { - if (local_args_info.ipup_given) { - fprintf(stderr, - "%s: `--ipup' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipup_given && !override) - continue; - local_args_info.ipup_given = 1; - args_info->ipup_given = 1; - if (args_info->ipup_arg) - free(args_info->ipup_arg); /* free previous string */ - args_info->ipup_arg = gengetopt_strdup(optarg); - if (args_info->ipup_orig) - free(args_info->ipup_orig); /* free previous string */ - args_info->ipup_orig = gengetopt_strdup(optarg); - } - /* Script to run after link-down. */ - else if (strcmp - (long_options[option_index].name, - "ipdown") == 0) { - if (local_args_info.ipdown_given) { - fprintf(stderr, - "%s: `--ipdown' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipdown_given && !override) - continue; - local_args_info.ipdown_given = 1; - args_info->ipdown_given = 1; - if (args_info->ipdown_arg) - free(args_info->ipdown_arg); /* free previous string */ - args_info->ipdown_arg = - gengetopt_strdup(optarg); - if (args_info->ipdown_orig) - free(args_info->ipdown_orig); /* free previous string */ - args_info->ipdown_orig = - gengetopt_strdup(optarg); - } - /* Ping remote host. */ - else if (strcmp - (long_options[option_index].name, - "pinghost") == 0) { - if (local_args_info.pinghost_given) { - fprintf(stderr, - "%s: `--pinghost' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pinghost_given && !override) - continue; - local_args_info.pinghost_given = 1; - args_info->pinghost_given = 1; - if (args_info->pinghost_arg) - free(args_info->pinghost_arg); /* free previous string */ - args_info->pinghost_arg = - gengetopt_strdup(optarg); - if (args_info->pinghost_orig) - free(args_info->pinghost_orig); /* free previous string */ - args_info->pinghost_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req per second. */ - else if (strcmp - (long_options[option_index].name, - "pingrate") == 0) { - if (local_args_info.pingrate_given) { - fprintf(stderr, - "%s: `--pingrate' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingrate_given && !override) - continue; - local_args_info.pingrate_given = 1; - args_info->pingrate_given = 1; - args_info->pingrate_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingrate_orig) - free(args_info->pingrate_orig); /* free previous string */ - args_info->pingrate_orig = - gengetopt_strdup(optarg); - } - /* Number of ping data bytes. */ - else if (strcmp - (long_options[option_index].name, - "pingsize") == 0) { - if (local_args_info.pingsize_given) { - fprintf(stderr, - "%s: `--pingsize' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingsize_given && !override) - continue; - local_args_info.pingsize_given = 1; - args_info->pingsize_given = 1; - args_info->pingsize_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingsize_orig) - free(args_info->pingsize_orig); /* free previous string */ - args_info->pingsize_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req to send. */ - else if (strcmp - (long_options[option_index].name, - "pingcount") == 0) { - if (local_args_info.pingcount_given) { - fprintf(stderr, - "%s: `--pingcount' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingcount_given && !override) - continue; - local_args_info.pingcount_given = 1; - args_info->pingcount_given = 1; - args_info->pingcount_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingcount_orig) - free(args_info->pingcount_orig); /* free previous string */ - args_info->pingcount_orig = - gengetopt_strdup(optarg); - } - /* Do not print ping packet info. */ - else if (strcmp - (long_options[option_index].name, - "pingquiet") == 0) { - if (local_args_info.pingquiet_given) { - fprintf(stderr, - "%s: `--pingquiet' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingquiet_given && !override) - continue; - local_args_info.pingquiet_given = 1; - args_info->pingquiet_given = 1; - args_info->pingquiet_flag = - !(args_info->pingquiet_flag); + } /* Do not send recovery. */ else if (strcmp (long_options[option_index].name, "norecovery") == 0) { - if (local_args_info.norecovery_given) { - fprintf(stderr, - "%s: `--norecovery' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->norecovery_flag), 0, + &(args_info->norecovery_given), + &(local_args_info.norecovery_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "norecovery", '-', + additional_error)) goto failure; - } - if (args_info->norecovery_given && !override) - continue; - local_args_info.norecovery_given = 1; - args_info->norecovery_given = 1; - args_info->norecovery_flag = - !(args_info->norecovery_flag); + + } + /* NSAPI. */ + else if (strcmp + (long_options[option_index].name, + "nsapi") == 0) { + + if (update_arg((void *)&(args_info->nsapi_arg), + &(args_info->nsapi_orig), + &(args_info->nsapi_given), + &(local_args_info.nsapi_given), + optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "nsapi", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 1. */ + else if (strcmp + (long_options[option_index].name, + "qose1") == 0) { + + if (update_arg((void *)&(args_info->qose1_arg), + &(args_info->qose1_orig), + &(args_info->qose1_given), + &(local_args_info.qose1_given), + optarg, 0, "0x9396404074f9ffff", + ARG_INT, check_ambiguity, + override, 0, 0, "qose1", '-', + additional_error)) + goto failure; + + } + /* Requested quality of service Extension 2. */ + else if (strcmp + (long_options[option_index].name, + "qose2") == 0) { + + if (update_arg((void *)&(args_info->qose2_arg), + &(args_info->qose2_orig), + &(args_info->qose2_given), + &(local_args_info.qose2_given), + optarg, 0, "0x11", ARG_INT, + check_ambiguity, override, 0, 0, + "qose2", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 3. */ + else if (strcmp + (long_options[option_index].name, + "qose3") == 0) { + + if (update_arg((void *)&(args_info->qose3_arg), + &(args_info->qose3_orig), + &(args_info->qose3_given), + &(local_args_info.qose3_given), + optarg, 0, "0x0101", ARG_INT, + check_ambiguity, override, 0, 0, + "qose3", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 4. */ + else if (strcmp + (long_options[option_index].name, + "qose4") == 0) { + + if (update_arg((void *)&(args_info->qose4_arg), + &(args_info->qose4_orig), + &(args_info->qose4_given), + &(local_args_info.qose4_given), + optarg, 0, "0x4040", ARG_INT, + check_ambiguity, override, 0, 0, + "qose4", '-', additional_error)) + goto failure; + + } + /* Charging characteristics. */ + else if (strcmp + (long_options[option_index].name, + "charging") == 0) { + + if (update_arg + ((void *)&(args_info->charging_arg), + &(args_info->charging_orig), + &(args_info->charging_given), + &(local_args_info.charging_given), optarg, + 0, "0x0800", ARG_INT, check_ambiguity, + override, 0, 0, "charging", '-', + additional_error)) + goto failure; + + } + /* Create local network interface. */ + else if (strcmp + (long_options[option_index].name, + "createif") == 0) { + + if (update_arg + ((void *)&(args_info->createif_flag), 0, + &(args_info->createif_given), + &(local_args_info.createif_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "createif", '-', additional_error)) + goto failure; + + } + /* Create default route. */ + else if (strcmp + (long_options[option_index].name, + "defaultroute") == 0) { + + if (update_arg + ((void *)&(args_info->defaultroute_flag), 0, + &(args_info->defaultroute_given), + &(local_args_info.defaultroute_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "defaultroute", '-', + additional_error)) + goto failure; + + } + /* Script to run after link-up. */ + else if (strcmp(long_options[option_index].name, "ipup") + == 0) { + + if (update_arg((void *)&(args_info->ipup_arg), + &(args_info->ipup_orig), + &(args_info->ipup_given), + &(local_args_info.ipup_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipup", '-', additional_error)) + goto failure; + + } + /* Script to run after link-down. */ + else if (strcmp + (long_options[option_index].name, + "ipdown") == 0) { + + if (update_arg((void *)&(args_info->ipdown_arg), + &(args_info->ipdown_orig), + &(args_info->ipdown_given), + &(local_args_info.ipdown_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipdown", '-', additional_error)) + goto failure; + + } + /* Ping remote host. */ + else if (strcmp + (long_options[option_index].name, + "pinghost") == 0) { + + if (update_arg + ((void *)&(args_info->pinghost_arg), + &(args_info->pinghost_orig), + &(args_info->pinghost_given), + &(local_args_info.pinghost_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "pinghost", '-', + additional_error)) + goto failure; + + } + /* Number of ping req per second. */ + else if (strcmp + (long_options[option_index].name, + "pingrate") == 0) { + + if (update_arg + ((void *)&(args_info->pingrate_arg), + &(args_info->pingrate_orig), + &(args_info->pingrate_given), + &(local_args_info.pingrate_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "pingrate", '-', additional_error)) + goto failure; + + } + /* Number of ping data bytes. */ + else if (strcmp + (long_options[option_index].name, + "pingsize") == 0) { + + if (update_arg + ((void *)&(args_info->pingsize_arg), + &(args_info->pingsize_orig), + &(args_info->pingsize_given), + &(local_args_info.pingsize_given), optarg, + 0, "56", ARG_INT, check_ambiguity, + override, 0, 0, "pingsize", '-', + additional_error)) + goto failure; + + } + /* Number of ping req to send. */ + else if (strcmp + (long_options[option_index].name, + "pingcount") == 0) { + + if (update_arg + ((void *)&(args_info->pingcount_arg), + &(args_info->pingcount_orig), + &(args_info->pingcount_given), + &(local_args_info.pingcount_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "pingcount", '-', additional_error)) + goto failure; + + } + /* Do not print ping packet info. */ + else if (strcmp + (long_options[option_index].name, + "pingquiet") == 0) { + + if (update_arg + ((void *)&(args_info->pingquiet_flag), 0, + &(args_info->pingquiet_given), + &(local_args_info.pingquiet_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "pingquiet", '-', additional_error)) + goto failure; + } break; @@ -1740,7 +1418,7 @@ cmdline_parser_release(&local_args_info); - if (error) + if (error_occurred) return (EXIT_FAILURE); return 0; @@ -1759,40 +1437,25 @@ #define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) /* 3 is for "--" and "=" */ -char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; - -int -cmdline_parser_configfile(char *const filename, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +static int _cmdline_parser_configfile(const char *filename, int *my_argc) { FILE *file; + char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; char linebuf[CONFIG_FILE_LINE_SIZE]; int line_num = 0; - int i, result, equal; + int result = 0, equal; char *fopt, *farg; char *str_index; size_t len, next_token; char delimiter; - int my_argc = 0; - char **my_argv_arg; - char *additional_error; - /* store the program name */ - cmd_line_list_tmp = - (struct line_list *)malloc(sizeof(struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); - - if ((file = fopen(filename, "r")) == NULL) { + if ((file = fopen(filename, "r")) == 0) { fprintf(stderr, "%s: Error opening configuration file '%s'\n", CMDLINE_PARSER_PACKAGE, filename); - result = EXIT_FAILURE; - goto conf_failure; + return EXIT_FAILURE; } - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != NULL) { + while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) { ++line_num; my_argv[0] = '\0'; len = strlen(linebuf); @@ -1801,7 +1464,7 @@ "%s:%s:%d: Line too long in configuration file\n", CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } /* find first non-whitespace character in the line */ @@ -1817,7 +1480,7 @@ next_token = strcspn(fopt, " \t\r\n="); if (fopt[next_token] == '\0') { /* the line is over */ - farg = NULL; + farg = 0; equal = 0; goto noarg; } @@ -1828,6 +1491,7 @@ /* advance pointers to the next token after the end of fopt */ next_token += strspn(fopt + next_token, " \t\r\n"); + /* check for the presence of equal sign, and if so, skip it */ if (!equal) if ((equal = (fopt[next_token] == '='))) { @@ -1848,7 +1512,7 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } else { /* read up the remaining part up to a delimiter */ next_token = strcspn(farg, " \t\r\n#\'\""); @@ -1868,20 +1532,31 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } noarg: - ++my_argc; + if (!strcmp(fopt, "include")) { + if (farg && *farg) { + result = + _cmdline_parser_configfile(farg, my_argc); + } else { + fprintf(stderr, + "%s:%s:%d: include requires a filename argument.\n", + CMDLINE_PARSER_PACKAGE, filename, + line_num); + } + continue; + } len = strlen(fopt); - strcat(my_argv, len > 1 ? "--" : "-"); strcat(my_argv, fopt); if (len > 1 && ((farg && *farg) || equal)) strcat(my_argv, "="); if (farg && *farg) strcat(my_argv, farg); + ++(*my_argc); cmd_line_list_tmp = (struct line_list *)malloc(sizeof(struct line_list)); @@ -1890,30 +1565,69 @@ cmd_line_list->string_arg = gengetopt_strdup(my_argv); } /* while */ - ++my_argc; /* for program name */ - my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - my_argv_arg[my_argc] = 0; - - additional_error = - (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy(additional_error, ADDITIONAL_ERROR); - strcat(additional_error, filename); - result = - cmdline_parser_internal(my_argc, my_argv_arg, args_info, override, - initialize, check_required, - additional_error); - - free(additional_error); - free(my_argv_arg); - -conf_failure: if (file) fclose(file); + return result; +} + +int +cmdline_parser_configfile(const char *filename, + struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + return cmdline_parser_config_file(filename, args_info, ¶ms); +} + +int +cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) +{ + int i, result; + int my_argc = 1; + char **my_argv_arg; + char *additional_error; + + /* store the program name */ + cmd_line_list_tmp = + (struct line_list *)malloc(sizeof(struct line_list)); + cmd_line_list_tmp->next = cmd_line_list; + cmd_line_list = cmd_line_list_tmp; + cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); + + result = _cmdline_parser_configfile(filename, &my_argc); + + if (result != EXIT_FAILURE) { + my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); + cmd_line_list_tmp = cmd_line_list; + + for (i = my_argc - 1; i >= 0; --i) { + my_argv_arg[i] = cmd_line_list_tmp->string_arg; + cmd_line_list_tmp = cmd_line_list_tmp->next; + } + + my_argv_arg[my_argc] = 0; + + additional_error = + (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + + 1); + strcpy(additional_error, ADDITIONAL_ERROR); + strcat(additional_error, filename); + result = + cmdline_parser_internal(my_argc, my_argv_arg, args_info, + params, additional_error); + + free(additional_error); + free(my_argv_arg); + } free_cmd_list(); if (result == EXIT_FAILURE) { diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 620ae7a..540cd8e 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -6,7 +6,11 @@ # notice and this permission notice is included in all copies or # substantial portions of the software. # -# Use "gengetopt --conf-parser < cmdline.ggo" +# Use +# gengetopt --conf-parser < cmdline.ggo +# linux-2.6/scripts/Lindent cmdline.c +# linux-2.6/scripts/Lindent cmdline.h +# sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h option "debug" d "Run in debug mode" flag off diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 17f7c18..248384e 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -1,6 +1,9 @@ -/* cmdline.h */ - -/* File autogenerated by gengetopt version 2.17 */ +/** @file cmdline.h + * @brief The header file for the command line option parser + * generated by GNU Gengetopt version 2.22.6 + * http://www.gnu.org/software/gengetopt. + * DO NOT modify this file, since it can be overwritten + * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H @@ -10,197 +13,495 @@ #include "config.h" #endif +#include /* for FILE */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE +/** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE PACKAGE #endif +#ifndef CMDLINE_PARSER_PACKAGE_NAME +/** @brief the complete program name (used for help and version) */ +#ifdef PACKAGE_NAME +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME +#else +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE +#endif +#endif + #ifndef CMDLINE_PARSER_VERSION +/** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif +/** @brief Where the command line options are stored */ struct gengetopt_args_info { - const char *help_help; /* Print help and exit help description. */ - const char *version_help; /* Print version and exit help description. */ - int debug_flag; /* Run in debug mode (default=off). */ - const char *debug_help; /* Run in debug mode help description. */ - char *conf_arg; /* Read configuration file. */ - char *conf_orig; /* Read configuration file original value given at command line. */ - const char *conf_help; /* Read configuration file help description. */ - char *pidfile_arg; /* Filename of process id file (default='./sgsnemu.pid'). */ - char *pidfile_orig; /* Filename of process id file original value given at command line. */ - const char *pidfile_help; /* Filename of process id file help description. */ - char *statedir_arg; /* Directory of nonvolatile data (default='./'). */ - char *statedir_orig; /* Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /* Directory of nonvolatile data help description. */ - char *dns_arg; /* DNS Server to use. */ - char *dns_orig; /* DNS Server to use original value given at command line. */ - const char *dns_help; /* DNS Server to use help description. */ - char *listen_arg; /* Local interface. */ - char *listen_orig; /* Local interface original value given at command line. */ - const char *listen_help; /* Local interface help description. */ - char *remote_arg; /* Remote host. */ - char *remote_orig; /* Remote host original value given at command line. */ - const char *remote_help; /* Remote host help description. */ - int contexts_arg; /* Number of contexts (default='1'). */ - char *contexts_orig; /* Number of contexts original value given at command line. */ - const char *contexts_help; /* Number of contexts help description. */ - int timelimit_arg; /* Exit after timelimit seconds (default='0'). */ - char *timelimit_orig; /* Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /* Exit after timelimit seconds help description. */ - int gtpversion_arg; /* GTP version to use (default='1'). */ - char *gtpversion_orig; /* GTP version to use original value given at command line. */ - const char *gtpversion_help; /* GTP version to use help description. */ - char *apn_arg; /* Access point name (default='internet'). */ - char *apn_orig; /* Access point name original value given at command line. */ - const char *apn_help; /* Access point name help description. */ - int selmode_arg; /* Selection mode (default='0x01'). */ - char *selmode_orig; /* Selection mode original value given at command line. */ - const char *selmode_help; /* Selection mode help description. */ - char *rattype_arg; /* Radio Access Technology Type (optional). */ + const char *help_help; + /**< @brief Print help and exit help description. */ + const char *version_help; + /**< @brief Print version and exit help description. */ + int debug_flag; + /**< @brief Run in debug mode (default=off). */ + const char *debug_help; + /**< @brief Run in debug mode help description. */ + char *conf_arg; + /**< @brief Read configuration file. */ + char *conf_orig; + /**< @brief Read configuration file original value given at command line. */ + const char *conf_help; + /**< @brief Read configuration file help description. */ + char *pidfile_arg; + /**< @brief Filename of process id file (default='./sgsnemu.pid'). */ + char *pidfile_orig; + /**< @brief Filename of process id file original value given at command line. */ + const char *pidfile_help; + /**< @brief Filename of process id file help description. */ + char *statedir_arg; + /**< @brief Directory of nonvolatile data (default='./'). */ + char *statedir_orig; + /**< @brief Directory of nonvolatile data original value given at command line. */ + const char *statedir_help; + /**< @brief Directory of nonvolatile data help description. */ + char *dns_arg; + /**< @brief DNS Server to use. */ + char *dns_orig; + /**< @brief DNS Server to use original value given at command line. */ + const char *dns_help; + /**< @brief DNS Server to use help description. */ + char *listen_arg; + /**< @brief Local interface. */ + char *listen_orig; + /**< @brief Local interface original value given at command line. */ + const char *listen_help; + /**< @brief Local interface help description. */ + char *remote_arg; + /**< @brief Remote host. */ + char *remote_orig; + /**< @brief Remote host original value given at command line. */ + const char *remote_help; + /**< @brief Remote host help description. */ + int contexts_arg; + /**< @brief Number of contexts (default='1'). */ + char *contexts_orig; + /**< @brief Number of contexts original value given at command line. */ + const char *contexts_help; + /**< @brief Number of contexts help description. */ + int timelimit_arg; + /**< @brief Exit after timelimit seconds (default='0'). */ + char *timelimit_orig; + /**< @brief Exit after timelimit seconds original value given at command line. */ + const char *timelimit_help; + /**< @brief Exit after timelimit seconds help description. */ + int gtpversion_arg; + /**< @brief GTP version to use (default='1'). */ + char *gtpversion_orig; + /**< @brief GTP version to use original value given at command line. */ + const char *gtpversion_help; + /**< @brief GTP version to use help description. */ + char *apn_arg; + /**< @brief Access point name (default='internet'). */ + char *apn_orig; + /**< @brief Access point name original value given at command line. */ + const char *apn_help; + /**< @brief Access point name help description. */ + int selmode_arg; + /**< @brief Selection mode (default='0x01'). */ + char *selmode_orig; + /**< @brief Selection mode original value given at command line. */ + const char *selmode_help; + /**< @brief Selection mode help description. */ + int rattype_arg; + /**< @brief Radio Access Technology Type (default='1'). */ char *rattype_orig; - char *rattype_help; - char *userloc_arg; /* User Location Information (optional). */ + /**< @brief Radio Access Technology Type original value given at command line. */ + const char *rattype_help; + /**< @brief Radio Access Technology Type help description. */ + char *userloc_arg; + /**< @brief User Location Information (default='02509946241207'). */ char *userloc_orig; - char *userloc_help; - char *rai_arg; /* Routing Area Information (optional). */ + /**< @brief User Location Information original value given at command line. */ + const char *userloc_help; + /**< @brief User Location Information help description. */ + char *rai_arg; + /**< @brief Routing Area Information (default='02509946241207'). */ char *rai_orig; - char *rai_help; - char *mstz_arg; /* MS Time Zone (optional). */ + /**< @brief Routing Area Information original value given at command line. */ + const char *rai_help; + /**< @brief Routing Area Information help description. */ + char *mstz_arg; + /**< @brief MS Time Zone (default='0'). */ char *mstz_orig; - char *mstz_help; - char *imeisv_arg; /* IMEI(SV) (optional). */ + /**< @brief MS Time Zone original value given at command line. */ + const char *mstz_help; + /**< @brief MS Time Zone help description. */ + char *imeisv_arg; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) (default='2143658709214365'). */ char *imeisv_orig; - char *imeisv_help; - char *imsi_arg; /* IMSI (default='240010123456789'). */ - char *imsi_orig; /* IMSI original value given at command line. */ - const char *imsi_help; /* IMSI help description. */ - int nsapi_arg; /* NSAPI (default='0'). */ - char *nsapi_orig; /* NSAPI original value given at command line. */ - const char *nsapi_help; /* NSAPI help description. */ - char *msisdn_arg; /* Mobile Station ISDN number (default='46702123456'). */ - char *msisdn_orig; /* Mobile Station ISDN number original value given at command line. */ - const char *msisdn_help; /* Mobile Station ISDN number help description. */ - int qos_arg; /* Requested quality of service (default='0x0b921f'). */ - char *qos_orig; /* Requested quality of service original value given at command line. */ - const char *qos_help; /* Requested quality of service help description. */ - unsigned long long int qose1_arg; /* Requested quality of service Extension 1 */ - char *qose1_orig; /* Requested quality of service Extension 1 original value given at command line. */ - int qose2_arg; /* Requested quality of service Extension 2 */ - char *qose2_orig; /* Requested quality of service Extension 2 original value given at command line. */ - int qose3_arg; /* Requested quality of service Extension 3 */ - char *qose3_orig; /* Requested quality of service Extension 3 original value given at command line. */ - int qose4_arg; /* Requested quality of service Extension 4 */ - char *qose4_orig; /* Requested quality of service Extension 4 original value given at command line. */ - int charging_arg; /* Charging characteristics (default='0x0800'). */ - char *charging_orig; /* Charging characteristics original value given at command line. */ - const char *charging_help; /* Charging characteristics help description. */ - char *uid_arg; /* Login user ID (default='mig'). */ - char *uid_orig; /* Login user ID original value given at command line. */ - const char *uid_help; /* Login user ID help description. */ - char *pwd_arg; /* Login password (default='hemmelig'). */ - char *pwd_orig; /* Login password original value given at command line. */ - const char *pwd_help; /* Login password help description. */ - int createif_flag; /* Create local network interface (default=off). */ - const char *createif_help; /* Create local network interface help description. */ - char *net_arg; /* Network address for local interface. */ - char *net_orig; /* Network address for local interface original value given at command line. */ - const char *net_help; /* Network address for local interface help description. */ - int defaultroute_flag; /* Create default route (default=off). */ - const char *defaultroute_help; /* Create default route help description. */ - char *ipup_arg; /* Script to run after link-up. */ - char *ipup_orig; /* Script to run after link-up original value given at command line. */ - const char *ipup_help; /* Script to run after link-up help description. */ - char *ipdown_arg; /* Script to run after link-down. */ - char *ipdown_orig; /* Script to run after link-down original value given at command line. */ - const char *ipdown_help; /* Script to run after link-down help description. */ - char *pinghost_arg; /* Ping remote host. */ - char *pinghost_orig; /* Ping remote host original value given at command line. */ - const char *pinghost_help; /* Ping remote host help description. */ - int pingrate_arg; /* Number of ping req per second (default='1'). */ - char *pingrate_orig; /* Number of ping req per second original value given at command line. */ - const char *pingrate_help; /* Number of ping req per second help description. */ - int pingsize_arg; /* Number of ping data bytes (default='56'). */ - char *pingsize_orig; /* Number of ping data bytes original value given at command line. */ - const char *pingsize_help; /* Number of ping data bytes help description. */ - int pingcount_arg; /* Number of ping req to send (default='0'). */ - char *pingcount_orig; /* Number of ping req to send original value given at command line. */ - const char *pingcount_help; /* Number of ping req to send help description. */ - int pingquiet_flag; /* Do not print ping packet info (default=off). */ - const char *pingquiet_help; /* Do not print ping packet info help description. */ - int norecovery_flag; /* Do not print ping packet info (default=off). */ - const char *norecovery_help; /* Do not print ping packet info help description. */ + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) original value given at command line. */ + const char *imeisv_help; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) help description. */ + int norecovery_flag; + /**< @brief Do not send recovery (default=off). */ + const char *norecovery_help; + /**< @brief Do not send recovery help description. */ + char *imsi_arg; + /**< @brief IMSI (default='240010123456789'). */ + char *imsi_orig; + /**< @brief IMSI original value given at command line. */ + const char *imsi_help; + /**< @brief IMSI help description. */ + int nsapi_arg; + /**< @brief NSAPI (default='0'). */ + char *nsapi_orig; + /**< @brief NSAPI original value given at command line. */ + const char *nsapi_help; + /**< @brief NSAPI help description. */ + char *msisdn_arg; + /**< @brief Mobile Station ISDN number (default='46702123456'). */ + char *msisdn_orig; + /**< @brief Mobile Station ISDN number original value given at command line. */ + const char *msisdn_help; + /**< @brief Mobile Station ISDN number help description. */ + int qos_arg; + /**< @brief Requested quality of service (default='0x000b921f'). */ + char *qos_orig; + /**< @brief Requested quality of service original value given at command line. */ + const char *qos_help; + /**< @brief Requested quality of service help description. */ + unsigned long long int qose1_arg; + /**< @brief Requested quality of service Extension 1 (default='0x9396404074f9ffff'). */ + char *qose1_orig; + /**< @brief Requested quality of service Extension 1 original value given at command line. */ + const char *qose1_help; + /**< @brief Requested quality of service Extension 1 help description. */ + int qose2_arg; + /**< @brief Requested quality of service Extension 2 (default='0x11'). */ + char *qose2_orig; + /**< @brief Requested quality of service Extension 2 original value given at command line. */ + const char *qose2_help; + /**< @brief Requested quality of service Extension 2 help description. */ + int qose3_arg; + /**< @brief Requested quality of service Extension 3 (default='0x0101'). */ + char *qose3_orig; + /**< @brief Requested quality of service Extension 3 original value given at command line. */ + const char *qose3_help; + /**< @brief Requested quality of service Extension 3 help description. */ + int qose4_arg; + /**< @brief Requested quality of service Extension 4 (default='0x4040'). */ + char *qose4_orig; + /**< @brief Requested quality of service Extension 4 original value given at command line. */ + const char *qose4_help; + /**< @brief Requested quality of service Extension 4 help description. */ + int charging_arg; + /**< @brief Charging characteristics (default='0x0800'). */ + char *charging_orig; + /**< @brief Charging characteristics original value given at command line. */ + const char *charging_help; + /**< @brief Charging characteristics help description. */ + char *uid_arg; + /**< @brief Login user ID (default='mig'). */ + char *uid_orig; + /**< @brief Login user ID original value given at command line. */ + const char *uid_help; + /**< @brief Login user ID help description. */ + char *pwd_arg; + /**< @brief Login password (default='hemmelig'). */ + char *pwd_orig; + /**< @brief Login password original value given at command line. */ + const char *pwd_help; + /**< @brief Login password help description. */ + int createif_flag; + /**< @brief Create local network interface (default=off). */ + const char *createif_help; + /**< @brief Create local network interface help description. */ + char *net_arg; + /**< @brief Network address for local interface. */ + char *net_orig; + /**< @brief Network address for local interface original value given at command line. */ + const char *net_help; + /**< @brief Network address for local interface help description. */ + int defaultroute_flag; + /**< @brief Create default route (default=off). */ + const char *defaultroute_help; + /**< @brief Create default route help description. */ + char *ipup_arg; + /**< @brief Script to run after link-up. */ + char *ipup_orig; + /**< @brief Script to run after link-up original value given at command line. */ + const char *ipup_help; + /**< @brief Script to run after link-up help description. */ + char *ipdown_arg; + /**< @brief Script to run after link-down. */ + char *ipdown_orig; + /**< @brief Script to run after link-down original value given at command line. */ + const char *ipdown_help; + /**< @brief Script to run after link-down help description. */ + char *pinghost_arg; + /**< @brief Ping remote host. */ + char *pinghost_orig; + /**< @brief Ping remote host original value given at command line. */ + const char *pinghost_help; + /**< @brief Ping remote host help description. */ + int pingrate_arg; + /**< @brief Number of ping req per second (default='1'). */ + char *pingrate_orig; + /**< @brief Number of ping req per second original value given at command line. */ + const char *pingrate_help; + /**< @brief Number of ping req per second help description. */ + int pingsize_arg; + /**< @brief Number of ping data bytes (default='56'). */ + char *pingsize_orig; + /**< @brief Number of ping data bytes original value given at command line. */ + const char *pingsize_help; + /**< @brief Number of ping data bytes help description. */ + int pingcount_arg; + /**< @brief Number of ping req to send (default='0'). */ + char *pingcount_orig; + /**< @brief Number of ping req to send original value given at command line. */ + const char *pingcount_help; + /**< @brief Number of ping req to send help description. */ + int pingquiet_flag; + /**< @brief Do not print ping packet info (default=off). */ + const char *pingquiet_help; + /**< @brief Do not print ping packet info help description. */ - int help_given; /* Whether help was given. */ - int version_given; /* Whether version was given. */ - int debug_given; /* Whether debug was given. */ - int conf_given; /* Whether conf was given. */ - int pidfile_given; /* Whether pidfile was given. */ - int statedir_given; /* Whether statedir was given. */ - int dns_given; /* Whether dns was given. */ - int listen_given; /* Whether listen was given. */ - int remote_given; /* Whether remote was given. */ - int contexts_given; /* Whether contexts was given. */ - int timelimit_given; /* Whether timelimit was given. */ - int gtpversion_given; /* Whether gtpversion was given. */ - int apn_given; /* Whether apn was given. */ - int selmode_given; /* Whether selmode was given. */ - int rattype_given; /* Whether rattype was given. */ - int userloc_given; /* Whether userloc was given. */ - int rai_given; /* Whether RAI was given. */ - int mstz_given; /* Whether mstz was given. */ - int imeisv_given; /* Whether imeisv was given. */ - int imsi_given; /* Whether imsi was given. */ - int nsapi_given; /* Whether nsapi was given. */ - int msisdn_given; /* Whether msisdn was given. */ - int qos_given; /* Whether qos was given. */ - int qose1_given; /* Whether qos Extension 1 was given. */ - int qose2_given; /* Whether qos Extension 2 was given. */ - int qose3_given; /* Whether qos Extension 3 was given. */ - int qose4_given; /* Whether qos Extension 4 was given. */ - int charging_given; /* Whether charging was given. */ - int uid_given; /* Whether uid was given. */ - int pwd_given; /* Whether pwd was given. */ - int createif_given; /* Whether createif was given. */ - int net_given; /* Whether net was given. */ - int defaultroute_given; /* Whether defaultroute was given. */ - int ipup_given; /* Whether ipup was given. */ - int ipdown_given; /* Whether ipdown was given. */ - int pinghost_given; /* Whether pinghost was given. */ - int pingrate_given; /* Whether pingrate was given. */ - int pingsize_given; /* Whether pingsize was given. */ - int pingcount_given; /* Whether pingcount was given. */ - int pingquiet_given; /* Whether pingquiet was given. */ - int norecovery_given; /* Whether norecovery was given. */ + unsigned int help_given; + /**< @brief Whether help was given. */ + unsigned int version_given; + /**< @brief Whether version was given. */ + unsigned int debug_given; + /**< @brief Whether debug was given. */ + unsigned int conf_given; + /**< @brief Whether conf was given. */ + unsigned int pidfile_given; + /**< @brief Whether pidfile was given. */ + unsigned int statedir_given; + /**< @brief Whether statedir was given. */ + unsigned int dns_given; + /**< @brief Whether dns was given. */ + unsigned int listen_given; + /**< @brief Whether listen was given. */ + unsigned int remote_given; + /**< @brief Whether remote was given. */ + unsigned int contexts_given; + /**< @brief Whether contexts was given. */ + unsigned int timelimit_given; + /**< @brief Whether timelimit was given. */ + unsigned int gtpversion_given; + /**< @brief Whether gtpversion was given. */ + unsigned int apn_given; + /**< @brief Whether apn was given. */ + unsigned int selmode_given; + /**< @brief Whether selmode was given. */ + unsigned int rattype_given; + /**< @brief Whether rattype was given. */ + unsigned int userloc_given; + /**< @brief Whether userloc was given. */ + unsigned int rai_given; + /**< @brief Whether rai was given. */ + unsigned int mstz_given; + /**< @brief Whether mstz was given. */ + unsigned int imeisv_given; + /**< @brief Whether imeisv was given. */ + unsigned int norecovery_given; + /**< @brief Whether norecovery was given. */ + unsigned int imsi_given; + /**< @brief Whether imsi was given. */ + unsigned int nsapi_given; + /**< @brief Whether nsapi was given. */ + unsigned int msisdn_given; + /**< @brief Whether msisdn was given. */ + unsigned int qos_given; + /**< @brief Whether qos was given. */ + unsigned int qose1_given; + /**< @brief Whether qose1 was given. */ + unsigned int qose2_given; + /**< @brief Whether qose2 was given. */ + unsigned int qose3_given; + /**< @brief Whether qose3 was given. */ + unsigned int qose4_given; + /**< @brief Whether qose4 was given. */ + unsigned int charging_given; + /**< @brief Whether charging was given. */ + unsigned int uid_given; + /**< @brief Whether uid was given. */ + unsigned int pwd_given; + /**< @brief Whether pwd was given. */ + unsigned int createif_given; + /**< @brief Whether createif was given. */ + unsigned int net_given; + /**< @brief Whether net was given. */ + unsigned int defaultroute_given; + /**< @brief Whether defaultroute was given. */ + unsigned int ipup_given; + /**< @brief Whether ipup was given. */ + unsigned int ipdown_given; + /**< @brief Whether ipdown was given. */ + unsigned int pinghost_given; + /**< @brief Whether pinghost was given. */ + unsigned int pingrate_given; + /**< @brief Whether pingrate was given. */ + unsigned int pingsize_given; + /**< @brief Whether pingsize was given. */ + unsigned int pingcount_given; + /**< @brief Whether pingcount was given. */ + unsigned int pingquiet_given; + /**< @brief Whether pingquiet was given. */ }; +/** @brief The additional parameters to pass to parser functions */ + struct cmdline_parser_params { + int override; + /**< @brief whether to override possibly already present options (default 0) */ + int initialize; + /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ + int check_required; + /**< @brief whether to check that all required options were provided (default 1) */ + int check_ambiguity; + /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ + int print_errors; + /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ + }; + +/** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; +/** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; +/** @brief the description string of the program */ + extern const char *gengetopt_args_info_description; +/** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; - int cmdline_parser(int argc, char *const *argv, +/** + * The command line parser + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info); - int cmdline_parser2(int argc, char *const *argv, + +/** + * The command line parser (version with additional parameters - deprecated) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_ext() instead + */ + int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); + +/** + * The command line parser (version with additional parameters) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_ext(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Save the contents of the option struct into an already open FILE stream. + * @param outfile the stream where to dump options + * @param args_info the option struct to dump + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_dump(FILE * outfile, + struct gengetopt_args_info *args_info); + +/** + * Save the contents of the option struct into a (text) file. + * This file can be read by the config file parser (if generated by gengetopt) + * @param filename the file where to save + * @param args_info the option struct to save + * @return 0 if everything went fine, NON 0 if an error took place + */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); +/** + * Print the help + */ void cmdline_parser_print_help(void); +/** + * Print the version + */ void cmdline_parser_print_version(void); +/** + * Initializes all the fields a cmdline_parser_params structure + * to their default values + * @param params the structure to initialize + */ + void cmdline_parser_params_init(struct cmdline_parser_params *params); + +/** + * Allocates dynamically a cmdline_parser_params structure and initializes + * all its fields to their default values + * @return the created and initialized cmdline_parser_params structure + */ + struct cmdline_parser_params *cmdline_parser_params_create(void); + +/** + * Initializes the passed gengetopt_args_info structure's fields + * (also set default values for options that have a default) + * @param args_info the structure to initialize + */ void cmdline_parser_init(struct gengetopt_args_info *args_info); +/** + * Deallocates the string fields of the gengetopt_args_info structure + * (but does not deallocate the structure itself) + * @param args_info the structure to deallocate + */ void cmdline_parser_free(struct gengetopt_args_info *args_info); - int cmdline_parser_configfile(char *const filename, +/** + * The config file parser (deprecated version) + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_config_file() instead + */ + int cmdline_parser_configfile(const char *filename, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); +/** + * The config file parser + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Checks that all the required options were specified + * @param args_info the structure to check + * @param prog_name the name of the program that will be used to print + * possible errors + * @return + */ int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1f0b3f9..beb5f12 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -565,9 +565,9 @@ /* rattype */ if (args_info.rattype_given == 1) { options.rattype_given = 1; - options.rattype.l = strlen(args_info.rattype_arg); - options.rattype.v[0] = atoi(args_info.rattype_arg); - printf("Using RAT Type: %s\n", args_info.rattype_arg); + options.rattype.l = 1; + options.rattype.v[0] = args_info.rattype_arg; + printf("Using RAT Type: %d\n", args_info.rattype_arg); } /* userloc */ -- To view, visit https://gerrit.osmocom.org/4030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:55:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:55:12 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Fix gengetopt package name Message-ID: Review at https://gerrit.osmocom.org/4031 sgsnemu: Fix gengetopt package name gengetopt by default picks the program name from PACKAGE (autotools), which is osmo-ggsn and is obviously wrong in case of sgsnemu. After this patch, "sgsnemu --help" no longer shows "osmo-ggsn" but "sgsnemu" at the top of the help text. Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h 3 files changed, 5 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/31/4031/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 88210d7..d7be13a 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -27,8 +27,7 @@ const char *gengetopt_args_info_purpose = ""; -const char *gengetopt_args_info_usage = - "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_usage = "Usage: sgsnemu [OPTIONS]..."; const char *gengetopt_args_info_versiontext = ""; diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0184775..4fcc64a 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -13,6 +13,8 @@ # sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h +package "sgsnemu" + option "debug" d "Run in debug mode" flag off option "conf" c "Read configuration file" string no diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 248384e..b93fa0b 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -21,16 +21,12 @@ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE +#define CMDLINE_PARSER_PACKAGE "sgsnemu" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif +#define CMDLINE_PARSER_PACKAGE_NAME "sgsnemu" #endif #ifndef CMDLINE_PARSER_VERSION -- To view, visit https://gerrit.osmocom.org/4031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:57:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:57:12 +0000 Subject: [PATCH] openggsn[master]: sgsnemu: Fix gengetopt package name Message-ID: Review at https://gerrit.osmocom.org/4032 sgsnemu: Fix gengetopt package name gengetopt by default picks the program name from PACKAGE (autotools), which is openggsn and is obviously wrong in case of sgsnemu. After this patch, "sgsnemu --help" no longer shows "openggsn" but "sgsnemu" at the top of the help text. Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h 3 files changed, 5 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/32/4032/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 88210d7..d7be13a 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -27,8 +27,7 @@ const char *gengetopt_args_info_purpose = ""; -const char *gengetopt_args_info_usage = - "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_usage = "Usage: sgsnemu [OPTIONS]..."; const char *gengetopt_args_info_versiontext = ""; diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 540cd8e..4196d80 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -13,6 +13,8 @@ # sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h +package "sgsnemu" + option "debug" d "Run in debug mode" flag off option "conf" c "Read configuration file" string no diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 248384e..b93fa0b 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -21,16 +21,12 @@ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE +#define CMDLINE_PARSER_PACKAGE "sgsnemu" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif +#define CMDLINE_PARSER_PACKAGE_NAME "sgsnemu" #endif #ifndef CMDLINE_PARSER_VERSION -- To view, visit https://gerrit.osmocom.org/4032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:58:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:58:16 +0000 Subject: osmo-ggsn[master]: sgsnemu: Fix gengetopt package name In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:58:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:58:19 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Fix gengetopt package name In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix gengetopt package name ...................................................................... sgsnemu: Fix gengetopt package name gengetopt by default picks the program name from PACKAGE (autotools), which is osmo-ggsn and is obviously wrong in case of sgsnemu. After this patch, "sgsnemu --help" no longer shows "osmo-ggsn" but "sgsnemu" at the top of the help text. Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h 3 files changed, 5 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 88210d7..d7be13a 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -27,8 +27,7 @@ const char *gengetopt_args_info_purpose = ""; -const char *gengetopt_args_info_usage = - "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_usage = "Usage: sgsnemu [OPTIONS]..."; const char *gengetopt_args_info_versiontext = ""; diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0184775..4fcc64a 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -13,6 +13,8 @@ # sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h +package "sgsnemu" + option "debug" d "Run in debug mode" flag off option "conf" c "Read configuration file" string no diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 248384e..b93fa0b 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -21,16 +21,12 @@ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE +#define CMDLINE_PARSER_PACKAGE "sgsnemu" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif +#define CMDLINE_PARSER_PACKAGE_NAME "sgsnemu" #endif #ifndef CMDLINE_PARSER_VERSION -- To view, visit https://gerrit.osmocom.org/4031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:58:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:58:24 +0000 Subject: openggsn[master]: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer su... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:58:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:58:43 +0000 Subject: openggsn[master]: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:58:48 +0000 Subject: openggsn[master]: sgsnemu: Re-generate cmdline.[ch] using gengetopt In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:58:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:58:59 +0000 Subject: openggsn[master]: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, i... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:03 +0000 Subject: openggsn[master]: sgsnemu: Fix up gengetopt file for RAI In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:07 +0000 Subject: openggsn[master]: sgsnemu: Fix up gengetopt file for --norecovery In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:16 +0000 Subject: openggsn[master]: sgsnemu: Fix gengetopt package name In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:20 +0000 Subject: [MERGED] openggsn[master]: sgsnemu: Fix gengetopt package name In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix gengetopt package name ...................................................................... sgsnemu: Fix gengetopt package name gengetopt by default picks the program name from PACKAGE (autotools), which is openggsn and is obviously wrong in case of sgsnemu. After this patch, "sgsnemu --help" no longer shows "openggsn" but "sgsnemu" at the top of the help text. Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h 3 files changed, 5 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 88210d7..d7be13a 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -27,8 +27,7 @@ const char *gengetopt_args_info_purpose = ""; -const char *gengetopt_args_info_usage = - "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_usage = "Usage: sgsnemu [OPTIONS]..."; const char *gengetopt_args_info_versiontext = ""; diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 540cd8e..4196d80 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -13,6 +13,8 @@ # sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h +package "sgsnemu" + option "debug" d "Run in debug mode" flag off option "conf" c "Read configuration file" string no diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 248384e..b93fa0b 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -21,16 +21,12 @@ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ -#define CMDLINE_PARSER_PACKAGE PACKAGE +#define CMDLINE_PARSER_PACKAGE "sgsnemu" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ -#ifdef PACKAGE_NAME -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME -#else -#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE -#endif +#define CMDLINE_PARSER_PACKAGE_NAME "sgsnemu" #endif #ifndef CMDLINE_PARSER_VERSION -- To view, visit https://gerrit.osmocom.org/4032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:20 +0000 Subject: [MERGED] openggsn[master]: sgsnemu: Fix up gengetopt file for --norecovery In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for --norecovery ...................................................................... sgsnemu: Fix up gengetopt file for --norecovery In commit 3a4c67b4bf0067c4949a60bc750d01e0576c5e08 we introduced the --norecovery command line option, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index e917fb5..620ae7a 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -30,6 +30,7 @@ option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no +option "norecovery" - "Do not send recovery" flag off option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1698280a699b17cea65651c3736ef149aba7e432 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:20 +0000 Subject: [MERGED] openggsn[master]: sgsnemu: Fix up gengetopt file for RAI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for RAI ...................................................................... sgsnemu: Fix up gengetopt file for RAI In commit 41af5691ef08fb70e2c65aba03c8b9e6c20983a6 we introduced the --rai command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 --- M sgsnemu/cmdline.ggo 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 3d12b91..e917fb5 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -27,6 +27,7 @@ option "selmode" - "Selection mode" int default="0x01" no option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "rai" - "Routing Area Information" string default="02509946241207" no typestr="MCC.MNC.LAC.RAC" option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no -- To view, visit https://gerrit.osmocom.org/4028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:21 +0000 Subject: [MERGED] openggsn[master]: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, i... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisv ...................................................................... sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisv In commit 944dce3e66f3bc5b74f24dfbbee2370a231a39a9 we introduced various command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a --- M sgsnemu/cmdline.ggo 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index da71037..3d12b91 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -25,6 +25,10 @@ option "gtpversion" - "GTP version to use" int default="1" no option "apn" a "Access point name" string default="internet" no option "selmode" - "Selection mode" int default="0x01" no +option "rattype" - "Radio Access Technology Type" int default="1" no typestr="1..5" +option "userloc" - "User Location Information" string default="02509946241207" no typestr="type.MCC.MNC.LAC.CIorSACorRAC" +option "mstz" - "MS Time Zone" string default="0" no typestr="sign.NbQuartersOfAnHour.DSTAdjustment" +option "imeisv" - "IMEI(SV) International Mobile Equipment Identity (and Software Version)" string default="2143658709214365" no option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -- To view, visit https://gerrit.osmocom.org/4027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:21 +0000 Subject: [MERGED] openggsn[master]: sgsnemu: Re-generate cmdline.[ch] using gengetopt In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Re-generate cmdline.[ch] using gengetopt ...................................................................... sgsnemu: Re-generate cmdline.[ch] using gengetopt This will replace the manual additions to cmdline.[ch] with auto-generated code from gengetopt. We need to fix-up the RAT Type in sgsnemu.c as the manually-added code diverged from what gengetopt generates. Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 1,492 insertions(+), 1,473 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 1ff1a59..88210d7 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -1,5 +1,5 @@ /* - File autogenerated by gengetopt version 2.17 + File autogenerated by gengetopt version 2.22.6 generated with the following command: gengetopt --conf-parser @@ -17,7 +17,11 @@ #include #include -#include "getopt.h" +#ifndef FIX_UNUSED +#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ +#endif + +#include #include "cmdline.h" @@ -26,50 +30,57 @@ const char *gengetopt_args_info_usage = "Usage: " CMDLINE_PARSER_PACKAGE " [OPTIONS]..."; +const char *gengetopt_args_info_versiontext = ""; + +const char *gengetopt_args_info_description = ""; + const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -d, --debug Run in debug mode (default=off)", - " -c, --conf=STRING Read configuration file", - " --pidfile=STRING Filename of process id file (default=`./sgsnemu.pid')", - " --statedir=STRING Directory of nonvolatile data (default=`./')", - " --dns=STRING DNS Server to use", - " -l, --listen=STRING Local interface", - " -r, --remote=STRING Remote host", - " --contexts=INT Number of contexts (default=`1')", - " --timelimit=INT Exit after timelimit seconds (default=`0')", - " --gtpversion=INT GTP version to use (default=`1')", - " -a, --apn=STRING Access point name (default=`internet')", - " --selmode=INT Selection mode (default=`0x01')", - " --rattype=INT Radio Access Technology Type (optional-1to5)", - " --userloc=STRING User Location Information (optional-type.MCC.MNC.LAC.CIorSACorRAC)", - " --rai=STRING Routing Area Information (optional-MCC.MNC.LAC.RAC)", - " --mstz=STRING MS Time Zone (optional- sign.NbQuartersOfAnHour.DSTAdjustment)", - " --imeisv=STRING IMEI(SV) International Mobile Equipment Identity (and Software Version) (optional,16 digits)", - " -i, --imsi=STRING IMSI (default=`240010123456789')", - " --nsapi=INT NSAPI (default=`0')", - " -m, --msisdn=STRING Mobile Station ISDN number (default=`46702123456')", - " -q, --qos=INT Requested quality of service (default=`0x000b921f')", - " --qose1=INT Requested quality of service Extension 1 (example=`0x9396404074f9ffff')", - " --qose2=INT Requested quality of service Extension 2 (example=`0x11')", - " --qose3=INT Requested quality of service Extension 3 (example=`0x0101')", - " --qose4=INT Requested quality of service Extension 4 (example=`0x4040')", - " --charging=INT Charging characteristics (default=`0x0800')", - " -u, --uid=STRING Login user ID (default=`mig')", - " -p, --pwd=STRING Login password (default=`hemmelig')", - " --createif Create local network interface (default=off)", - " -n, --net=STRING Network address for local interface", - " --defaultroute Create default route (default=off)", - " --ipup=STRING Script to run after link-up", - " --ipdown=STRING Script to run after link-down", - " --pinghost=STRING Ping remote host", - " --pingrate=INT Number of ping req per second (default=`1')", - " --pingsize=INT Number of ping data bytes (default=`56')", - " --pingcount=INT Number of ping req to send (default=`0')", - " --pingquiet Do not print ping packet info (default=off)", - " --norecovery Do not send recovery (default=off)", + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -d, --debug Run in debug mode (default=off)", + " -c, --conf=STRING Read configuration file", + " --pidfile=STRING Filename of process id file\n (default=`./sgsnemu.pid')", + " --statedir=STRING Directory of nonvolatile data (default=`./')", + " --dns=STRING DNS Server to use", + " -l, --listen=STRING Local interface", + " -r, --remote=STRING Remote host", + " --contexts=INT Number of contexts (default=`1')", + " --timelimit=INT Exit after timelimit seconds (default=`0')", + " --gtpversion=INT GTP version to use (default=`1')", + " -a, --apn=STRING Access point name (default=`internet')", + " --selmode=INT Selection mode (default=`0x01')", + " --rattype=1..5 Radio Access Technology Type (default=`1')", + " --userloc=type.MCC.MNC.LAC.CIorSACorRAC\n User Location Information\n (default=`02509946241207')", + " --rai=MCC.MNC.LAC.RAC Routing Area Information\n (default=`02509946241207')", + " --mstz=sign.NbQuartersOfAnHour.DSTAdjustment\n MS Time Zone (default=`0')", + " --imeisv=STRING IMEI(SV) International Mobile Equipment\n Identity (and Software Version)\n (default=`2143658709214365')", + " --norecovery Do not send recovery (default=off)", + " -i, --imsi=STRING IMSI (default=`240010123456789')", + " --nsapi=INT NSAPI (default=`0')", + " -m, --msisdn=STRING Mobile Station ISDN number\n (default=`46702123456')", + " -q, --qos=INT Requested quality of service\n (default=`0x000b921f')", + " --qose1=INT Requested quality of service Extension 1\n (default=`0x9396404074f9ffff')", + " --qose2=INT Requested quality of service Extension 2\n (default=`0x11')", + " --qose3=INT Requested quality of service Extension 3\n (default=`0x0101')", + " --qose4=INT Requested quality of service Extension 4\n (default=`0x4040')", + " --charging=INT Charging characteristics (default=`0x0800')", + " -u, --uid=STRING Login user ID (default=`mig')", + " -p, --pwd=STRING Login password (default=`hemmelig')", + " --createif Create local network interface (default=off)", + " -n, --net=STRING Network address for local interface", + " --defaultroute Create default route (default=off)", + " --ipup=STRING Script to run after link-up", + " --ipdown=STRING Script to run after link-down", + " --pinghost=STRING Ping remote host", + " --pingrate=INT Number of ping req per second (default=`1')", + " --pingsize=INT Number of ping data bytes (default=`56')", + " --pingcount=INT Number of ping req to send (default=`0')", + " --pingquiet Do not print ping packet info (default=off)", 0 }; + +typedef enum { ARG_NO, ARG_FLAG, ARG_STRING, ARG_INT +} cmdline_parser_arg_type; static void clear_given(struct gengetopt_args_info *args_info); @@ -77,9 +88,9 @@ void clear_args(struct gengetopt_args_info *args_info); static int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error); struct line_list { @@ -127,6 +138,7 @@ args_info->rai_given = 0; args_info->mstz_given = 0; args_info->imeisv_given = 0; + args_info->norecovery_given = 0; args_info->imsi_given = 0; args_info->nsapi_given = 0; args_info->msisdn_given = 0; @@ -148,12 +160,12 @@ args_info->pingsize_given = 0; args_info->pingcount_given = 0; args_info->pingquiet_given = 0; - args_info->norecovery_given = 0; } static void clear_args(struct gengetopt_args_info *args_info) { + FIX_UNUSED(args_info); args_info->debug_flag = 0; args_info->conf_arg = NULL; args_info->conf_orig = NULL; @@ -177,16 +189,17 @@ args_info->apn_orig = NULL; args_info->selmode_arg = 0x01; args_info->selmode_orig = NULL; - args_info->rattype_arg = "1"; + args_info->rattype_arg = 1; args_info->rattype_orig = NULL; - args_info->userloc_arg = strdup("02509946241207"); + args_info->userloc_arg = gengetopt_strdup("02509946241207"); args_info->userloc_orig = NULL; - args_info->rai_arg = strdup("02509946241207"); + args_info->rai_arg = gengetopt_strdup("02509946241207"); args_info->rai_orig = NULL; - args_info->mstz_arg = strdup("0"); + args_info->mstz_arg = gengetopt_strdup("0"); args_info->mstz_orig = NULL; - args_info->imeisv_arg = strdup("2143658709214365"); + args_info->imeisv_arg = gengetopt_strdup("2143658709214365"); args_info->imeisv_orig = NULL; + args_info->norecovery_flag = 0; args_info->imsi_arg = gengetopt_strdup("240010123456789"); args_info->imsi_orig = NULL; args_info->nsapi_arg = 0; @@ -226,13 +239,13 @@ args_info->pingcount_arg = 0; args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; - args_info->norecovery_flag = 0; } static void init_args_info(struct gengetopt_args_info *args_info) { + args_info->help_help = gengetopt_args_info_help[0]; args_info->version_help = gengetopt_args_info_help[1]; args_info->debug_help = gengetopt_args_info_help[2]; @@ -247,41 +260,67 @@ args_info->gtpversion_help = gengetopt_args_info_help[11]; args_info->apn_help = gengetopt_args_info_help[12]; args_info->selmode_help = gengetopt_args_info_help[13]; - args_info->imsi_help = gengetopt_args_info_help[14]; - args_info->nsapi_help = gengetopt_args_info_help[15]; - args_info->msisdn_help = gengetopt_args_info_help[16]; - args_info->qos_help = gengetopt_args_info_help[17]; - args_info->charging_help = gengetopt_args_info_help[18]; - args_info->uid_help = gengetopt_args_info_help[19]; - args_info->pwd_help = gengetopt_args_info_help[20]; - args_info->createif_help = gengetopt_args_info_help[21]; - args_info->net_help = gengetopt_args_info_help[22]; - args_info->defaultroute_help = gengetopt_args_info_help[23]; - args_info->ipup_help = gengetopt_args_info_help[24]; - args_info->ipdown_help = gengetopt_args_info_help[25]; - args_info->pinghost_help = gengetopt_args_info_help[26]; - args_info->pingrate_help = gengetopt_args_info_help[27]; - args_info->pingsize_help = gengetopt_args_info_help[28]; - args_info->pingcount_help = gengetopt_args_info_help[29]; - args_info->pingquiet_help = gengetopt_args_info_help[30]; - args_info->norecovery_help = gengetopt_args_info_help[31]; + args_info->rattype_help = gengetopt_args_info_help[14]; + args_info->userloc_help = gengetopt_args_info_help[15]; + args_info->rai_help = gengetopt_args_info_help[16]; + args_info->mstz_help = gengetopt_args_info_help[17]; + args_info->imeisv_help = gengetopt_args_info_help[18]; + args_info->norecovery_help = gengetopt_args_info_help[19]; + args_info->imsi_help = gengetopt_args_info_help[20]; + args_info->nsapi_help = gengetopt_args_info_help[21]; + args_info->msisdn_help = gengetopt_args_info_help[22]; + args_info->qos_help = gengetopt_args_info_help[23]; + args_info->qose1_help = gengetopt_args_info_help[24]; + args_info->qose2_help = gengetopt_args_info_help[25]; + args_info->qose3_help = gengetopt_args_info_help[26]; + args_info->qose4_help = gengetopt_args_info_help[27]; + args_info->charging_help = gengetopt_args_info_help[28]; + args_info->uid_help = gengetopt_args_info_help[29]; + args_info->pwd_help = gengetopt_args_info_help[30]; + args_info->createif_help = gengetopt_args_info_help[31]; + args_info->net_help = gengetopt_args_info_help[32]; + args_info->defaultroute_help = gengetopt_args_info_help[33]; + args_info->ipup_help = gengetopt_args_info_help[34]; + args_info->ipdown_help = gengetopt_args_info_help[35]; + args_info->pinghost_help = gengetopt_args_info_help[36]; + args_info->pingrate_help = gengetopt_args_info_help[37]; + args_info->pingsize_help = gengetopt_args_info_help[38]; + args_info->pingcount_help = gengetopt_args_info_help[39]; + args_info->pingquiet_help = gengetopt_args_info_help[40]; } void cmdline_parser_print_version(void) { - printf("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); + printf("%s %s\n", + (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? + CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), + CMDLINE_PARSER_VERSION); + + if (strlen(gengetopt_args_info_versiontext) > 0) + printf("\n%s\n", gengetopt_args_info_versiontext); } -void cmdline_parser_print_help(void) +static void print_help_common(void) { - int i = 0; cmdline_parser_print_version(); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); - printf("\n%s\n\n", gengetopt_args_info_usage); + if (strlen(gengetopt_args_info_usage) > 0) + printf("\n%s\n", gengetopt_args_info_usage); + + printf("\n"); + + if (strlen(gengetopt_args_info_description) > 0) + printf("%s\n\n", gengetopt_args_info_description); +} + +void cmdline_parser_print_help(void) +{ + int i = 0; + print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } @@ -293,171 +332,210 @@ init_args_info(args_info); } +void cmdline_parser_params_init(struct cmdline_parser_params *params) +{ + if (params) { + params->override = 0; + params->initialize = 1; + params->check_required = 1; + params->check_ambiguity = 0; + params->print_errors = 1; + } +} + +struct cmdline_parser_params *cmdline_parser_params_create(void) +{ + struct cmdline_parser_params *params = + (struct cmdline_parser_params *) + malloc(sizeof(struct cmdline_parser_params)); + cmdline_parser_params_init(params); + return params; +} + +static void free_string_field(char **s) +{ + if (*s) { + free(*s); + *s = 0; + } +} + static void cmdline_parser_release(struct gengetopt_args_info *args_info) { - if (args_info->conf_arg) { - free(args_info->conf_arg); /* free previous argument */ - args_info->conf_arg = 0; - } - if (args_info->conf_orig) { - free(args_info->conf_orig); /* free previous argument */ - args_info->conf_orig = 0; - } - if (args_info->pidfile_arg) { - free(args_info->pidfile_arg); /* free previous argument */ - args_info->pidfile_arg = 0; - } - if (args_info->pidfile_orig) { - free(args_info->pidfile_orig); /* free previous argument */ - args_info->pidfile_orig = 0; - } - if (args_info->statedir_arg) { - free(args_info->statedir_arg); /* free previous argument */ - args_info->statedir_arg = 0; - } - if (args_info->statedir_orig) { - free(args_info->statedir_orig); /* free previous argument */ - args_info->statedir_orig = 0; - } - if (args_info->dns_arg) { - free(args_info->dns_arg); /* free previous argument */ - args_info->dns_arg = 0; - } - if (args_info->dns_orig) { - free(args_info->dns_orig); /* free previous argument */ - args_info->dns_orig = 0; - } - if (args_info->listen_arg) { - free(args_info->listen_arg); /* free previous argument */ - args_info->listen_arg = 0; - } - if (args_info->listen_orig) { - free(args_info->listen_orig); /* free previous argument */ - args_info->listen_orig = 0; - } - if (args_info->remote_arg) { - free(args_info->remote_arg); /* free previous argument */ - args_info->remote_arg = 0; - } - if (args_info->remote_orig) { - free(args_info->remote_orig); /* free previous argument */ - args_info->remote_orig = 0; - } - if (args_info->contexts_orig) { - free(args_info->contexts_orig); /* free previous argument */ - args_info->contexts_orig = 0; - } - if (args_info->timelimit_orig) { - free(args_info->timelimit_orig); /* free previous argument */ - args_info->timelimit_orig = 0; - } - if (args_info->gtpversion_orig) { - free(args_info->gtpversion_orig); /* free previous argument */ - args_info->gtpversion_orig = 0; - } - if (args_info->apn_arg) { - free(args_info->apn_arg); /* free previous argument */ - args_info->apn_arg = 0; - } - if (args_info->apn_orig) { - free(args_info->apn_orig); /* free previous argument */ - args_info->apn_orig = 0; - } - if (args_info->selmode_orig) { - free(args_info->selmode_orig); /* free previous argument */ - args_info->selmode_orig = 0; - } - if (args_info->imsi_arg) { - free(args_info->imsi_arg); /* free previous argument */ - args_info->imsi_arg = 0; - } - if (args_info->imsi_orig) { - free(args_info->imsi_orig); /* free previous argument */ - args_info->imsi_orig = 0; - } - if (args_info->nsapi_orig) { - free(args_info->nsapi_orig); /* free previous argument */ - args_info->nsapi_orig = 0; - } - if (args_info->msisdn_arg) { - free(args_info->msisdn_arg); /* free previous argument */ - args_info->msisdn_arg = 0; - } - if (args_info->msisdn_orig) { - free(args_info->msisdn_orig); /* free previous argument */ - args_info->msisdn_orig = 0; - } - if (args_info->qos_orig) { - free(args_info->qos_orig); /* free previous argument */ - args_info->qos_orig = 0; - } - if (args_info->charging_orig) { - free(args_info->charging_orig); /* free previous argument */ - args_info->charging_orig = 0; - } - if (args_info->uid_arg) { - free(args_info->uid_arg); /* free previous argument */ - args_info->uid_arg = 0; - } - if (args_info->uid_orig) { - free(args_info->uid_orig); /* free previous argument */ - args_info->uid_orig = 0; - } - if (args_info->pwd_arg) { - free(args_info->pwd_arg); /* free previous argument */ - args_info->pwd_arg = 0; - } - if (args_info->pwd_orig) { - free(args_info->pwd_orig); /* free previous argument */ - args_info->pwd_orig = 0; - } - if (args_info->net_arg) { - free(args_info->net_arg); /* free previous argument */ - args_info->net_arg = 0; - } - if (args_info->net_orig) { - free(args_info->net_orig); /* free previous argument */ - args_info->net_orig = 0; - } - if (args_info->ipup_arg) { - free(args_info->ipup_arg); /* free previous argument */ - args_info->ipup_arg = 0; - } - if (args_info->ipup_orig) { - free(args_info->ipup_orig); /* free previous argument */ - args_info->ipup_orig = 0; - } - if (args_info->ipdown_arg) { - free(args_info->ipdown_arg); /* free previous argument */ - args_info->ipdown_arg = 0; - } - if (args_info->ipdown_orig) { - free(args_info->ipdown_orig); /* free previous argument */ - args_info->ipdown_orig = 0; - } - if (args_info->pinghost_arg) { - free(args_info->pinghost_arg); /* free previous argument */ - args_info->pinghost_arg = 0; - } - if (args_info->pinghost_orig) { - free(args_info->pinghost_orig); /* free previous argument */ - args_info->pinghost_orig = 0; - } - if (args_info->pingrate_orig) { - free(args_info->pingrate_orig); /* free previous argument */ - args_info->pingrate_orig = 0; - } - if (args_info->pingsize_orig) { - free(args_info->pingsize_orig); /* free previous argument */ - args_info->pingsize_orig = 0; - } - if (args_info->pingcount_orig) { - free(args_info->pingcount_orig); /* free previous argument */ - args_info->pingcount_orig = 0; - } + free_string_field(&(args_info->conf_arg)); + free_string_field(&(args_info->conf_orig)); + free_string_field(&(args_info->pidfile_arg)); + free_string_field(&(args_info->pidfile_orig)); + free_string_field(&(args_info->statedir_arg)); + free_string_field(&(args_info->statedir_orig)); + free_string_field(&(args_info->dns_arg)); + free_string_field(&(args_info->dns_orig)); + free_string_field(&(args_info->listen_arg)); + free_string_field(&(args_info->listen_orig)); + free_string_field(&(args_info->remote_arg)); + free_string_field(&(args_info->remote_orig)); + free_string_field(&(args_info->contexts_orig)); + free_string_field(&(args_info->timelimit_orig)); + free_string_field(&(args_info->gtpversion_orig)); + free_string_field(&(args_info->apn_arg)); + free_string_field(&(args_info->apn_orig)); + free_string_field(&(args_info->selmode_orig)); + free_string_field(&(args_info->rattype_orig)); + free_string_field(&(args_info->userloc_arg)); + free_string_field(&(args_info->userloc_orig)); + free_string_field(&(args_info->rai_arg)); + free_string_field(&(args_info->rai_orig)); + free_string_field(&(args_info->mstz_arg)); + free_string_field(&(args_info->mstz_orig)); + free_string_field(&(args_info->imeisv_arg)); + free_string_field(&(args_info->imeisv_orig)); + free_string_field(&(args_info->imsi_arg)); + free_string_field(&(args_info->imsi_orig)); + free_string_field(&(args_info->nsapi_orig)); + free_string_field(&(args_info->msisdn_arg)); + free_string_field(&(args_info->msisdn_orig)); + free_string_field(&(args_info->qos_orig)); + free_string_field(&(args_info->qose1_orig)); + free_string_field(&(args_info->qose2_orig)); + free_string_field(&(args_info->qose3_orig)); + free_string_field(&(args_info->qose4_orig)); + free_string_field(&(args_info->charging_orig)); + free_string_field(&(args_info->uid_arg)); + free_string_field(&(args_info->uid_orig)); + free_string_field(&(args_info->pwd_arg)); + free_string_field(&(args_info->pwd_orig)); + free_string_field(&(args_info->net_arg)); + free_string_field(&(args_info->net_orig)); + free_string_field(&(args_info->ipup_arg)); + free_string_field(&(args_info->ipup_orig)); + free_string_field(&(args_info->ipdown_arg)); + free_string_field(&(args_info->ipdown_orig)); + free_string_field(&(args_info->pinghost_arg)); + free_string_field(&(args_info->pinghost_orig)); + free_string_field(&(args_info->pingrate_orig)); + free_string_field(&(args_info->pingsize_orig)); + free_string_field(&(args_info->pingcount_orig)); clear_given(args_info); +} + +static void +write_into_file(FILE * outfile, const char *opt, const char *arg, + const char *values[]) +{ + FIX_UNUSED(values); + if (arg) { + fprintf(outfile, "%s=\"%s\"\n", opt, arg); + } else { + fprintf(outfile, "%s\n", opt); + } +} + +int cmdline_parser_dump(FILE * outfile, struct gengetopt_args_info *args_info) +{ + int i = 0; + + if (!outfile) { + fprintf(stderr, "%s: cannot dump options to stream\n", + CMDLINE_PARSER_PACKAGE); + return EXIT_FAILURE; + } + + if (args_info->help_given) + write_into_file(outfile, "help", 0, 0); + if (args_info->version_given) + write_into_file(outfile, "version", 0, 0); + if (args_info->debug_given) + write_into_file(outfile, "debug", 0, 0); + if (args_info->conf_given) + write_into_file(outfile, "conf", args_info->conf_orig, 0); + if (args_info->pidfile_given) + write_into_file(outfile, "pidfile", args_info->pidfile_orig, 0); + if (args_info->statedir_given) + write_into_file(outfile, "statedir", args_info->statedir_orig, + 0); + if (args_info->dns_given) + write_into_file(outfile, "dns", args_info->dns_orig, 0); + if (args_info->listen_given) + write_into_file(outfile, "listen", args_info->listen_orig, 0); + if (args_info->remote_given) + write_into_file(outfile, "remote", args_info->remote_orig, 0); + if (args_info->contexts_given) + write_into_file(outfile, "contexts", args_info->contexts_orig, + 0); + if (args_info->timelimit_given) + write_into_file(outfile, "timelimit", args_info->timelimit_orig, + 0); + if (args_info->gtpversion_given) + write_into_file(outfile, "gtpversion", + args_info->gtpversion_orig, 0); + if (args_info->apn_given) + write_into_file(outfile, "apn", args_info->apn_orig, 0); + if (args_info->selmode_given) + write_into_file(outfile, "selmode", args_info->selmode_orig, 0); + if (args_info->rattype_given) + write_into_file(outfile, "rattype", args_info->rattype_orig, 0); + if (args_info->userloc_given) + write_into_file(outfile, "userloc", args_info->userloc_orig, 0); + if (args_info->rai_given) + write_into_file(outfile, "rai", args_info->rai_orig, 0); + if (args_info->mstz_given) + write_into_file(outfile, "mstz", args_info->mstz_orig, 0); + if (args_info->imeisv_given) + write_into_file(outfile, "imeisv", args_info->imeisv_orig, 0); + if (args_info->norecovery_given) + write_into_file(outfile, "norecovery", 0, 0); + if (args_info->imsi_given) + write_into_file(outfile, "imsi", args_info->imsi_orig, 0); + if (args_info->nsapi_given) + write_into_file(outfile, "nsapi", args_info->nsapi_orig, 0); + if (args_info->msisdn_given) + write_into_file(outfile, "msisdn", args_info->msisdn_orig, 0); + if (args_info->qos_given) + write_into_file(outfile, "qos", args_info->qos_orig, 0); + if (args_info->qose1_given) + write_into_file(outfile, "qose1", args_info->qose1_orig, 0); + if (args_info->qose2_given) + write_into_file(outfile, "qose2", args_info->qose2_orig, 0); + if (args_info->qose3_given) + write_into_file(outfile, "qose3", args_info->qose3_orig, 0); + if (args_info->qose4_given) + write_into_file(outfile, "qose4", args_info->qose4_orig, 0); + if (args_info->charging_given) + write_into_file(outfile, "charging", args_info->charging_orig, + 0); + if (args_info->uid_given) + write_into_file(outfile, "uid", args_info->uid_orig, 0); + if (args_info->pwd_given) + write_into_file(outfile, "pwd", args_info->pwd_orig, 0); + if (args_info->createif_given) + write_into_file(outfile, "createif", 0, 0); + if (args_info->net_given) + write_into_file(outfile, "net", args_info->net_orig, 0); + if (args_info->defaultroute_given) + write_into_file(outfile, "defaultroute", 0, 0); + if (args_info->ipup_given) + write_into_file(outfile, "ipup", args_info->ipup_orig, 0); + if (args_info->ipdown_given) + write_into_file(outfile, "ipdown", args_info->ipdown_orig, 0); + if (args_info->pinghost_given) + write_into_file(outfile, "pinghost", args_info->pinghost_orig, + 0); + if (args_info->pingrate_given) + write_into_file(outfile, "pingrate", args_info->pingrate_orig, + 0); + if (args_info->pingsize_given) + write_into_file(outfile, "pingsize", args_info->pingsize_orig, + 0); + if (args_info->pingcount_given) + write_into_file(outfile, "pingcount", args_info->pingcount_orig, + 0); + if (args_info->pingquiet_given) + write_into_file(outfile, "pingquiet", 0, 0); + + i = EXIT_SUCCESS; + return i; } int @@ -475,231 +553,9 @@ return EXIT_FAILURE; } - if (args_info->help_given) { - fprintf(outfile, "%s\n", "help"); - } - if (args_info->version_given) { - fprintf(outfile, "%s\n", "version"); - } - if (args_info->debug_given) { - fprintf(outfile, "%s\n", "debug"); - } - if (args_info->conf_given) { - if (args_info->conf_orig) { - fprintf(outfile, "%s=\"%s\"\n", "conf", - args_info->conf_orig); - } else { - fprintf(outfile, "%s\n", "conf"); - } - } - if (args_info->pidfile_given) { - if (args_info->pidfile_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pidfile", - args_info->pidfile_orig); - } else { - fprintf(outfile, "%s\n", "pidfile"); - } - } - if (args_info->statedir_given) { - if (args_info->statedir_orig) { - fprintf(outfile, "%s=\"%s\"\n", "statedir", - args_info->statedir_orig); - } else { - fprintf(outfile, "%s\n", "statedir"); - } - } - if (args_info->dns_given) { - if (args_info->dns_orig) { - fprintf(outfile, "%s=\"%s\"\n", "dns", - args_info->dns_orig); - } else { - fprintf(outfile, "%s\n", "dns"); - } - } - if (args_info->listen_given) { - if (args_info->listen_orig) { - fprintf(outfile, "%s=\"%s\"\n", "listen", - args_info->listen_orig); - } else { - fprintf(outfile, "%s\n", "listen"); - } - } - if (args_info->remote_given) { - if (args_info->remote_orig) { - fprintf(outfile, "%s=\"%s\"\n", "remote", - args_info->remote_orig); - } else { - fprintf(outfile, "%s\n", "remote"); - } - } - if (args_info->contexts_given) { - if (args_info->contexts_orig) { - fprintf(outfile, "%s=\"%s\"\n", "contexts", - args_info->contexts_orig); - } else { - fprintf(outfile, "%s\n", "contexts"); - } - } - if (args_info->timelimit_given) { - if (args_info->timelimit_orig) { - fprintf(outfile, "%s=\"%s\"\n", "timelimit", - args_info->timelimit_orig); - } else { - fprintf(outfile, "%s\n", "timelimit"); - } - } - if (args_info->gtpversion_given) { - if (args_info->gtpversion_orig) { - fprintf(outfile, "%s=\"%s\"\n", "gtpversion", - args_info->gtpversion_orig); - } else { - fprintf(outfile, "%s\n", "gtpversion"); - } - } - if (args_info->apn_given) { - if (args_info->apn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "apn", - args_info->apn_orig); - } else { - fprintf(outfile, "%s\n", "apn"); - } - } - if (args_info->selmode_given) { - if (args_info->selmode_orig) { - fprintf(outfile, "%s=\"%s\"\n", "selmode", - args_info->selmode_orig); - } else { - fprintf(outfile, "%s\n", "selmode"); - } - } - if (args_info->imsi_given) { - if (args_info->imsi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "imsi", - args_info->imsi_orig); - } else { - fprintf(outfile, "%s\n", "imsi"); - } - } - if (args_info->nsapi_given) { - if (args_info->nsapi_orig) { - fprintf(outfile, "%s=\"%s\"\n", "nsapi", - args_info->nsapi_orig); - } else { - fprintf(outfile, "%s\n", "nsapi"); - } - } - if (args_info->msisdn_given) { - if (args_info->msisdn_orig) { - fprintf(outfile, "%s=\"%s\"\n", "msisdn", - args_info->msisdn_orig); - } else { - fprintf(outfile, "%s\n", "msisdn"); - } - } - if (args_info->qos_given) { - if (args_info->qos_orig) { - fprintf(outfile, "%s=\"%s\"\n", "qos", - args_info->qos_orig); - } else { - fprintf(outfile, "%s\n", "qos"); - } - } - if (args_info->charging_given) { - if (args_info->charging_orig) { - fprintf(outfile, "%s=\"%s\"\n", "charging", - args_info->charging_orig); - } else { - fprintf(outfile, "%s\n", "charging"); - } - } - if (args_info->uid_given) { - if (args_info->uid_orig) { - fprintf(outfile, "%s=\"%s\"\n", "uid", - args_info->uid_orig); - } else { - fprintf(outfile, "%s\n", "uid"); - } - } - if (args_info->pwd_given) { - if (args_info->pwd_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pwd", - args_info->pwd_orig); - } else { - fprintf(outfile, "%s\n", "pwd"); - } - } - if (args_info->createif_given) { - fprintf(outfile, "%s\n", "createif"); - } - if (args_info->net_given) { - if (args_info->net_orig) { - fprintf(outfile, "%s=\"%s\"\n", "net", - args_info->net_orig); - } else { - fprintf(outfile, "%s\n", "net"); - } - } - if (args_info->defaultroute_given) { - fprintf(outfile, "%s\n", "defaultroute"); - } - if (args_info->ipup_given) { - if (args_info->ipup_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipup", - args_info->ipup_orig); - } else { - fprintf(outfile, "%s\n", "ipup"); - } - } - if (args_info->ipdown_given) { - if (args_info->ipdown_orig) { - fprintf(outfile, "%s=\"%s\"\n", "ipdown", - args_info->ipdown_orig); - } else { - fprintf(outfile, "%s\n", "ipdown"); - } - } - if (args_info->pinghost_given) { - if (args_info->pinghost_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pinghost", - args_info->pinghost_orig); - } else { - fprintf(outfile, "%s\n", "pinghost"); - } - } - if (args_info->pingrate_given) { - if (args_info->pingrate_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingrate", - args_info->pingrate_orig); - } else { - fprintf(outfile, "%s\n", "pingrate"); - } - } - if (args_info->pingsize_given) { - if (args_info->pingsize_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingsize", - args_info->pingsize_orig); - } else { - fprintf(outfile, "%s\n", "pingsize"); - } - } - if (args_info->pingcount_given) { - if (args_info->pingcount_orig) { - fprintf(outfile, "%s=\"%s\"\n", "pingcount", - args_info->pingcount_orig); - } else { - fprintf(outfile, "%s\n", "pingcount"); - } - } - if (args_info->pingquiet_given) { - fprintf(outfile, "%s\n", "pingquiet"); - } - if (args_info->norecovery_given) { - fprintf(outfile, "%s\n", "norecovery"); - } - + i = cmdline_parser_dump(outfile, args_info); fclose(outfile); - i = EXIT_SUCCESS; return i; } @@ -708,11 +564,10 @@ cmdline_parser_release(args_info); } -/* gengetopt_strdup() */ -/* strdup.c replacement of strdup, which is not standard */ +/** @brief replacement of strdup, which is not standard */ char *gengetopt_strdup(const char *s) { - char *result = NULL; + char *result = 0; if (!s) return result; @@ -723,23 +578,40 @@ return result; } -int -cmdline_parser(int argc, char *const *argv, - struct gengetopt_args_info *args_info) +int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2(argc, argv, args_info, 0, 1, 1); } int -cmdline_parser2(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) { int result; + result = cmdline_parser_internal(argc, argv, args_info, params, 0); - result = - cmdline_parser_internal(argc, argv, args_info, override, initialize, - check_required, NULL); + if (result == EXIT_FAILURE) { + cmdline_parser_free(args_info); + exit(EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + int result; + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + result = cmdline_parser_internal(argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free(args_info); @@ -753,19 +625,152 @@ cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name) { + FIX_UNUSED(args_info); + FIX_UNUSED(prog_name); return EXIT_SUCCESS; } +static char *package_name = 0; + +/** + * @brief updates an option + * @param field the generic pointer to the field to update + * @param orig_field the pointer to the orig field + * @param field_given the pointer to the number of occurrence of this option + * @param prev_given the pointer to the number of occurrence already seen + * @param value the argument for this option (if null no arg was specified) + * @param possible_values the possible values for this option (if specified) + * @param default_value the default value (in case the option only accepts fixed values) + * @param arg_type the type of this option + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity + * @param override @see cmdline_parser_params.override + * @param no_free whether to free a possible previous value + * @param multiple_option whether this is a multiple option + * @param long_opt the corresponding long option + * @param short_opt the corresponding short option (or '-' if none) + * @param additional_error possible further error specification + */ +static +int update_arg(void *field, char **orig_field, + unsigned int *field_given, unsigned int *prev_given, + char *value, const char *possible_values[], + const char *default_value, + cmdline_parser_arg_type arg_type, + int check_ambiguity, int override, + int no_free, int multiple_option, + const char *long_opt, char short_opt, + const char *additional_error) +{ + char *stop_char = 0; + const char *val = value; + int found; + char **string_field; + FIX_UNUSED(field); + + stop_char = 0; + found = 0; + + if (!multiple_option && prev_given + && (*prev_given || (check_ambiguity && *field_given))) { + if (short_opt != '-') + fprintf(stderr, + "%s: `--%s' (`-%c') option given more than once%s\n", + package_name, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf(stderr, + "%s: `--%s' option given more than once%s\n", + package_name, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + FIX_UNUSED(default_value); + + if (field_given && *field_given && !override) + return 0; + if (prev_given) + (*prev_given)++; + if (field_given) + (*field_given)++; + if (possible_values) + val = possible_values[found]; + + switch (arg_type) { + case ARG_FLAG: + *((int *)field) = !*((int *)field); + break; + case ARG_INT: + if (val) + *((int *)field) = strtol(val, &stop_char, 0); + break; + case ARG_STRING: + if (val) { + string_field = (char **)field; + if (!no_free && *string_field) + free(*string_field); /* free previous string */ + *string_field = gengetopt_strdup(val); + } + break; + default: + break; + }; + + /* check numeric conversion */ + switch (arg_type) { + case ARG_INT: + if (val && !(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", + package_name, val); + return 1; /* failure */ + } + break; + default: + ; + }; + + /* store the original value */ + switch (arg_type) { + case ARG_NO: + case ARG_FLAG: + break; + default: + if (value && orig_field) { + if (no_free) { + *orig_field = value; + } else { + if (*orig_field) + free(*orig_field); /* free previous string */ + *orig_field = gengetopt_strdup(value); + } + } + }; + + return 0; /* OK */ +} + int -cmdline_parser_internal(int argc, char *const *argv, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required, +cmdline_parser_internal(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ - int error = 0; + int error_occurred = 0; struct gengetopt_args_info local_args_info; + + int override; + int initialize; + int check_required; + int check_ambiguity; + + package_name = argv[0]; + + override = params->override; + initialize = params->initialize; + check_required = params->check_required; + check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init(args_info); @@ -774,12 +779,11 @@ optarg = 0; optind = 0; - opterr = 1; + opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; - char *stop_char; static struct option long_options[] = { {"help", 0, NULL, 'h'}, @@ -801,6 +805,7 @@ {"rai", 1, NULL, 0}, {"mstz", 1, NULL, 0}, {"imeisv", 1, NULL, 0}, + {"norecovery", 0, NULL, 0}, {"imsi", 1, NULL, 'i'}, {"nsapi", 1, NULL, 0}, {"msisdn", 1, NULL, 'm'}, @@ -822,11 +827,9 @@ {"pingsize", 1, NULL, 0}, {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, - {"norecovery", 0, NULL, 0}, - {NULL, 0, NULL, 0} + {0, 0, 0, 0} }; - stop_char = 0; c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:", long_options, &option_index); @@ -845,884 +848,559 @@ exit(EXIT_SUCCESS); case 'd': /* Run in debug mode. */ - if (local_args_info.debug_given) { - fprintf(stderr, - "%s: `--debug' (`-d') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->debug_given && !override) - continue; - local_args_info.debug_given = 1; - args_info->debug_given = 1; - args_info->debug_flag = !(args_info->debug_flag); - break; + if (update_arg + ((void *)&(args_info->debug_flag), 0, + &(args_info->debug_given), + &(local_args_info.debug_given), optarg, 0, 0, + ARG_FLAG, check_ambiguity, override, 1, 0, "debug", + 'd', additional_error)) + goto failure; + + break; case 'c': /* Read configuration file. */ - if (local_args_info.conf_given) { - fprintf(stderr, - "%s: `--conf' (`-c') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->conf_given && !override) - continue; - local_args_info.conf_given = 1; - args_info->conf_given = 1; - if (args_info->conf_arg) - free(args_info->conf_arg); /* free previous string */ - args_info->conf_arg = gengetopt_strdup(optarg); - if (args_info->conf_orig) - free(args_info->conf_orig); /* free previous string */ - args_info->conf_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->conf_arg), + &(args_info->conf_orig), + &(args_info->conf_given), + &(local_args_info.conf_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "conf", 'c', additional_error)) + goto failure; + + break; case 'l': /* Local interface. */ - if (local_args_info.listen_given) { - fprintf(stderr, - "%s: `--listen' (`-l') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->listen_given && !override) - continue; - local_args_info.listen_given = 1; - args_info->listen_given = 1; - if (args_info->listen_arg) - free(args_info->listen_arg); /* free previous string */ - args_info->listen_arg = gengetopt_strdup(optarg); - if (args_info->listen_orig) - free(args_info->listen_orig); /* free previous string */ - args_info->listen_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->listen_arg), + &(args_info->listen_orig), + &(args_info->listen_given), + &(local_args_info.listen_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "listen", 'l', + additional_error)) + goto failure; + + break; case 'r': /* Remote host. */ - if (local_args_info.remote_given) { - fprintf(stderr, - "%s: `--remote' (`-r') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->remote_given && !override) - continue; - local_args_info.remote_given = 1; - args_info->remote_given = 1; - if (args_info->remote_arg) - free(args_info->remote_arg); /* free previous string */ - args_info->remote_arg = gengetopt_strdup(optarg); - if (args_info->remote_orig) - free(args_info->remote_orig); /* free previous string */ - args_info->remote_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->remote_arg), + &(args_info->remote_orig), + &(args_info->remote_given), + &(local_args_info.remote_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "remote", 'r', + additional_error)) + goto failure; + + break; case 'a': /* Access point name. */ - if (local_args_info.apn_given) { - fprintf(stderr, - "%s: `--apn' (`-a') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->apn_given && !override) - continue; - local_args_info.apn_given = 1; - args_info->apn_given = 1; - if (args_info->apn_arg) - free(args_info->apn_arg); /* free previous string */ - args_info->apn_arg = gengetopt_strdup(optarg); - if (args_info->apn_orig) - free(args_info->apn_orig); /* free previous string */ - args_info->apn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->apn_arg), + &(args_info->apn_orig), + &(args_info->apn_given), + &(local_args_info.apn_given), optarg, 0, + "internet", ARG_STRING, check_ambiguity, + override, 0, 0, "apn", 'a', + additional_error)) + goto failure; + + break; case 'i': /* IMSI. */ - if (local_args_info.imsi_given) { - fprintf(stderr, - "%s: `--imsi' (`-i') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->imsi_given && !override) - continue; - local_args_info.imsi_given = 1; - args_info->imsi_given = 1; - if (args_info->imsi_arg) - free(args_info->imsi_arg); /* free previous string */ - args_info->imsi_arg = gengetopt_strdup(optarg); - if (args_info->imsi_orig) - free(args_info->imsi_orig); /* free previous string */ - args_info->imsi_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->imsi_arg), + &(args_info->imsi_orig), + &(args_info->imsi_given), + &(local_args_info.imsi_given), optarg, 0, + "240010123456789", ARG_STRING, + check_ambiguity, override, 0, 0, "imsi", + 'i', additional_error)) + goto failure; + + break; case 'm': /* Mobile Station ISDN number. */ - if (local_args_info.msisdn_given) { - fprintf(stderr, - "%s: `--msisdn' (`-m') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->msisdn_given && !override) - continue; - local_args_info.msisdn_given = 1; - args_info->msisdn_given = 1; - if (args_info->msisdn_arg) - free(args_info->msisdn_arg); /* free previous string */ - args_info->msisdn_arg = gengetopt_strdup(optarg); - if (args_info->msisdn_orig) - free(args_info->msisdn_orig); /* free previous string */ - args_info->msisdn_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->msisdn_arg), + &(args_info->msisdn_orig), + &(args_info->msisdn_given), + &(local_args_info.msisdn_given), optarg, + 0, "46702123456", ARG_STRING, + check_ambiguity, override, 0, 0, + "msisdn", 'm', additional_error)) + goto failure; + + break; case 'q': /* Requested quality of service. */ - if (local_args_info.qos_given) { - fprintf(stderr, - "%s: `--qos' (`-q') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->qos_given && !override) - continue; - local_args_info.qos_given = 1; - args_info->qos_given = 1; - args_info->qos_arg = strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qos_orig) - free(args_info->qos_orig); /* free previous string */ - args_info->qos_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->qos_arg), + &(args_info->qos_orig), + &(args_info->qos_given), + &(local_args_info.qos_given), optarg, 0, + "0x000b921f", ARG_INT, check_ambiguity, + override, 0, 0, "qos", 'q', + additional_error)) + goto failure; + + break; case 'u': /* Login user ID. */ - if (local_args_info.uid_given) { - fprintf(stderr, - "%s: `--uid' (`-u') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->uid_given && !override) - continue; - local_args_info.uid_given = 1; - args_info->uid_given = 1; - if (args_info->uid_arg) - free(args_info->uid_arg); /* free previous string */ - args_info->uid_arg = gengetopt_strdup(optarg); - if (args_info->uid_orig) - free(args_info->uid_orig); /* free previous string */ - args_info->uid_orig = gengetopt_strdup(optarg); - break; + if (update_arg((void *)&(args_info->uid_arg), + &(args_info->uid_orig), + &(args_info->uid_given), + &(local_args_info.uid_given), optarg, 0, + "mig", ARG_STRING, check_ambiguity, + override, 0, 0, "uid", 'u', + additional_error)) + goto failure; + + break; case 'p': /* Login password. */ - if (local_args_info.pwd_given) { - fprintf(stderr, - "%s: `--pwd' (`-p') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); - goto failure; - } - if (args_info->pwd_given && !override) - continue; - local_args_info.pwd_given = 1; - args_info->pwd_given = 1; - if (args_info->pwd_arg) - free(args_info->pwd_arg); /* free previous string */ - args_info->pwd_arg = gengetopt_strdup(optarg); - if (args_info->pwd_orig) - free(args_info->pwd_orig); /* free previous string */ - args_info->pwd_orig = gengetopt_strdup(optarg); - break; - case 'n': /* Network address for local interface. */ - if (local_args_info.net_given) { - fprintf(stderr, - "%s: `--net' (`-n') option given more than once%s\n", - argv[0], - (additional_error ? additional_error : - "")); + if (update_arg((void *)&(args_info->pwd_arg), + &(args_info->pwd_orig), + &(args_info->pwd_given), + &(local_args_info.pwd_given), optarg, 0, + "hemmelig", ARG_STRING, check_ambiguity, + override, 0, 0, "pwd", 'p', + additional_error)) goto failure; - } - if (args_info->net_given && !override) - continue; - local_args_info.net_given = 1; - args_info->net_given = 1; - if (args_info->net_arg) - free(args_info->net_arg); /* free previous string */ - args_info->net_arg = gengetopt_strdup(optarg); - if (args_info->net_orig) - free(args_info->net_orig); /* free previous string */ - args_info->net_orig = gengetopt_strdup(optarg); + + break; + case 'n': /* Network address for local interface. */ + + if (update_arg((void *)&(args_info->net_arg), + &(args_info->net_orig), + &(args_info->net_given), + &(local_args_info.net_given), optarg, 0, + 0, ARG_STRING, check_ambiguity, override, + 0, 0, "net", 'n', additional_error)) + goto failure; + break; case 0: /* Long option with no short option */ /* Filename of process id file. */ if (strcmp(long_options[option_index].name, "pidfile") == 0) { - if (local_args_info.pidfile_given) { - fprintf(stderr, - "%s: `--pidfile' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->pidfile_arg), + &(args_info->pidfile_orig), + &(args_info->pidfile_given), + &(local_args_info.pidfile_given), optarg, + 0, "./sgsnemu.pid", ARG_STRING, + check_ambiguity, override, 0, 0, "pidfile", + '-', additional_error)) goto failure; - } - if (args_info->pidfile_given && !override) - continue; - local_args_info.pidfile_given = 1; - args_info->pidfile_given = 1; - if (args_info->pidfile_arg) - free(args_info->pidfile_arg); /* free previous string */ - args_info->pidfile_arg = - gengetopt_strdup(optarg); - if (args_info->pidfile_orig) - free(args_info->pidfile_orig); /* free previous string */ - args_info->pidfile_orig = - gengetopt_strdup(optarg); + } /* Directory of nonvolatile data. */ else if (strcmp (long_options[option_index].name, "statedir") == 0) { - if (local_args_info.statedir_given) { - fprintf(stderr, - "%s: `--statedir' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->statedir_arg), + &(args_info->statedir_orig), + &(args_info->statedir_given), + &(local_args_info.statedir_given), optarg, + 0, "./", ARG_STRING, check_ambiguity, + override, 0, 0, "statedir", '-', + additional_error)) goto failure; - } - if (args_info->statedir_given && !override) - continue; - local_args_info.statedir_given = 1; - args_info->statedir_given = 1; - if (args_info->statedir_arg) - free(args_info->statedir_arg); /* free previous string */ - args_info->statedir_arg = - gengetopt_strdup(optarg); - if (args_info->statedir_orig) - free(args_info->statedir_orig); /* free previous string */ - args_info->statedir_orig = - gengetopt_strdup(optarg); + } /* DNS Server to use. */ else if (strcmp(long_options[option_index].name, "dns") == 0) { - if (local_args_info.dns_given) { - fprintf(stderr, - "%s: `--dns' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->dns_arg), + &(args_info->dns_orig), + &(args_info->dns_given), + &(local_args_info.dns_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "dns", '-', additional_error)) goto failure; - } - if (args_info->dns_given && !override) - continue; - local_args_info.dns_given = 1; - args_info->dns_given = 1; - if (args_info->dns_arg) - free(args_info->dns_arg); /* free previous string */ - args_info->dns_arg = gengetopt_strdup(optarg); - if (args_info->dns_orig) - free(args_info->dns_orig); /* free previous string */ - args_info->dns_orig = gengetopt_strdup(optarg); + } /* Number of contexts. */ else if (strcmp (long_options[option_index].name, "contexts") == 0) { - if (local_args_info.contexts_given) { - fprintf(stderr, - "%s: `--contexts' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->contexts_arg), + &(args_info->contexts_orig), + &(args_info->contexts_given), + &(local_args_info.contexts_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "contexts", '-', additional_error)) goto failure; - } - if (args_info->contexts_given && !override) - continue; - local_args_info.contexts_given = 1; - args_info->contexts_given = 1; - args_info->contexts_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->contexts_orig) - free(args_info->contexts_orig); /* free previous string */ - args_info->contexts_orig = - gengetopt_strdup(optarg); + } /* Exit after timelimit seconds. */ else if (strcmp (long_options[option_index].name, "timelimit") == 0) { - if (local_args_info.timelimit_given) { - fprintf(stderr, - "%s: `--timelimit' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->timelimit_arg), + &(args_info->timelimit_orig), + &(args_info->timelimit_given), + &(local_args_info.timelimit_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "timelimit", '-', additional_error)) goto failure; - } - if (args_info->timelimit_given && !override) - continue; - local_args_info.timelimit_given = 1; - args_info->timelimit_given = 1; - args_info->timelimit_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->timelimit_orig) - free(args_info->timelimit_orig); /* free previous string */ - args_info->timelimit_orig = - gengetopt_strdup(optarg); + } /* GTP version to use. */ else if (strcmp (long_options[option_index].name, "gtpversion") == 0) { - if (local_args_info.gtpversion_given) { - fprintf(stderr, - "%s: `--gtpversion' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->gtpversion_arg), + &(args_info->gtpversion_orig), + &(args_info->gtpversion_given), + &(local_args_info.gtpversion_given), + optarg, 0, "1", ARG_INT, check_ambiguity, + override, 0, 0, "gtpversion", '-', + additional_error)) goto failure; - } - if (args_info->gtpversion_given && !override) - continue; - local_args_info.gtpversion_given = 1; - args_info->gtpversion_given = 1; - args_info->gtpversion_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->gtpversion_orig) - free(args_info->gtpversion_orig); /* free previous string */ - args_info->gtpversion_orig = - gengetopt_strdup(optarg); + } /* Selection mode. */ else if (strcmp (long_options[option_index].name, "selmode") == 0) { - if (local_args_info.selmode_given) { - fprintf(stderr, - "%s: `--selmode' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->selmode_arg), + &(args_info->selmode_orig), + &(args_info->selmode_given), + &(local_args_info.selmode_given), optarg, + 0, "0x01", ARG_INT, check_ambiguity, + override, 0, 0, "selmode", '-', + additional_error)) goto failure; - } - if (args_info->selmode_given && !override) - continue; - local_args_info.selmode_given = 1; - args_info->selmode_given = 1; - args_info->selmode_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->selmode_orig) - free(args_info->selmode_orig); /* free previous string */ - args_info->selmode_orig = - gengetopt_strdup(optarg); - } - /* QoS Extension 1. */ - else if (strcmp - (long_options[option_index].name, - "qose1") == 0) { - if (args_info->qose1_given) { - fprintf(stderr, - "%s: `--qose1' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose1_given = 1; - args_info->qose1_arg = - strtoull(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose1_orig) - free(args_info->qose1_orig); /* free previous string */ - args_info->qose1_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 2. */ - else if (strcmp - (long_options[option_index].name, - "qose2") == 0) { - if (args_info->qose2_given) { - fprintf(stderr, - "%s: `--qose2' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose2_given = 1; - args_info->qose2_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose2_orig) - free(args_info->qose2_orig); /* free previous string */ - args_info->qose2_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 3. */ - else if (strcmp - (long_options[option_index].name, - "qose3") == 0) { - if (args_info->qose3_given) { - fprintf(stderr, - "%s: `--qose3' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose3_given = 1; - args_info->qose3_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose3_orig) - free(args_info->qose3_orig); /* free previous string */ - args_info->qose3_orig = - gengetopt_strdup(optarg); - break; - } - /* QoS Extension 4. */ - else if (strcmp - (long_options[option_index].name, - "qose4") == 0) { - if (args_info->qose4_given) { - fprintf(stderr, - "%s: `--qose4' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->qose4_given = 1; - args_info->qose4_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->qose4_orig) - free(args_info->qose4_orig); /* free previous string */ - args_info->qose4_orig = - gengetopt_strdup(optarg); - break; + } /* Radio Access Technology Type. */ else if (strcmp (long_options[option_index].name, "rattype") == 0) { - if (args_info->rattype_given) { - fprintf(stderr, - "%s: `--rattype' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rattype_given = 1; - /* args_info->rattype_arg = strtol (optarg,&stop_char,0); */ - args_info->rattype_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->rattype_arg), + &(args_info->rattype_orig), + &(args_info->rattype_given), + &(local_args_info.rattype_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "rattype", '-', additional_error)) + goto failure; + } /* User Location Information. */ else if (strcmp (long_options[option_index].name, "userloc") == 0) { - if (args_info->userloc_given) { - fprintf(stderr, - "%s: `--userloc' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->userloc_given = 1; - args_info->userloc_arg = strdup(optarg); - break; + + if (update_arg + ((void *)&(args_info->userloc_arg), + &(args_info->userloc_orig), + &(args_info->userloc_given), + &(local_args_info.userloc_given), optarg, + 0, "02509946241207", ARG_STRING, + check_ambiguity, override, 0, 0, "userloc", + '-', additional_error)) + goto failure; + } /* Routing Area Information. */ else if (strcmp(long_options[option_index].name, "rai") == 0) { - if (args_info->rai_given) { - fprintf(stderr, - "%s: `--rai' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->rai_given = 1; - args_info->rai_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->rai_arg), + &(args_info->rai_orig), + &(args_info->rai_given), + &(local_args_info.rai_given), + optarg, 0, "02509946241207", + ARG_STRING, check_ambiguity, + override, 0, 0, "rai", '-', + additional_error)) + goto failure; + } - /* MS Time Zone */ + /* MS Time Zone. */ else if (strcmp(long_options[option_index].name, "mstz") == 0) { - if (args_info->mstz_given) { - fprintf(stderr, - "%s: `--mstz' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->mstz_given = 1; - args_info->mstz_arg = strdup(optarg); - break; + + if (update_arg((void *)&(args_info->mstz_arg), + &(args_info->mstz_orig), + &(args_info->mstz_given), + &(local_args_info.mstz_given), + optarg, 0, "0", ARG_STRING, + check_ambiguity, override, 0, 0, + "mstz", '-', additional_error)) + goto failure; + } - /* IMEI(SV) */ + /* IMEI(SV) International Mobile Equipment Identity (and Software Version). */ else if (strcmp (long_options[option_index].name, "imeisv") == 0) { - if (args_info->imeisv_given) { - fprintf(stderr, - "%s: `--imeisv' option given more than once\n", - PACKAGE); - exit(EXIT_FAILURE); - } - args_info->imeisv_given = 1; - args_info->imeisv_arg = strdup(optarg); - break; - } - /* NSAPI. */ - else if (strcmp - (long_options[option_index].name, - "nsapi") == 0) { - if (local_args_info.nsapi_given) { - fprintf(stderr, - "%s: `--nsapi' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg((void *)&(args_info->imeisv_arg), + &(args_info->imeisv_orig), + &(args_info->imeisv_given), + &(local_args_info.imeisv_given), + optarg, 0, "2143658709214365", + ARG_STRING, check_ambiguity, + override, 0, 0, "imeisv", '-', + additional_error)) goto failure; - } - if (args_info->nsapi_given && !override) - continue; - local_args_info.nsapi_given = 1; - args_info->nsapi_given = 1; - args_info->nsapi_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->nsapi_orig) - free(args_info->nsapi_orig); /* free previous string */ - args_info->nsapi_orig = - gengetopt_strdup(optarg); - } - /* Charging characteristics. */ - else if (strcmp - (long_options[option_index].name, - "charging") == 0) { - if (local_args_info.charging_given) { - fprintf(stderr, - "%s: `--charging' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->charging_given && !override) - continue; - local_args_info.charging_given = 1; - args_info->charging_given = 1; - args_info->charging_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->charging_orig) - free(args_info->charging_orig); /* free previous string */ - args_info->charging_orig = - gengetopt_strdup(optarg); - } - /* Create local network interface. */ - else if (strcmp - (long_options[option_index].name, - "createif") == 0) { - if (local_args_info.createif_given) { - fprintf(stderr, - "%s: `--createif' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->createif_given && !override) - continue; - local_args_info.createif_given = 1; - args_info->createif_given = 1; - args_info->createif_flag = - !(args_info->createif_flag); - } - /* Create default route. */ - else if (strcmp - (long_options[option_index].name, - "defaultroute") == 0) { - if (local_args_info.defaultroute_given) { - fprintf(stderr, - "%s: `--defaultroute' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->defaultroute_given && !override) - continue; - local_args_info.defaultroute_given = 1; - args_info->defaultroute_given = 1; - args_info->defaultroute_flag = - !(args_info->defaultroute_flag); - } - /* Script to run after link-up. */ - else if (strcmp(long_options[option_index].name, "ipup") - == 0) { - if (local_args_info.ipup_given) { - fprintf(stderr, - "%s: `--ipup' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipup_given && !override) - continue; - local_args_info.ipup_given = 1; - args_info->ipup_given = 1; - if (args_info->ipup_arg) - free(args_info->ipup_arg); /* free previous string */ - args_info->ipup_arg = gengetopt_strdup(optarg); - if (args_info->ipup_orig) - free(args_info->ipup_orig); /* free previous string */ - args_info->ipup_orig = gengetopt_strdup(optarg); - } - /* Script to run after link-down. */ - else if (strcmp - (long_options[option_index].name, - "ipdown") == 0) { - if (local_args_info.ipdown_given) { - fprintf(stderr, - "%s: `--ipdown' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->ipdown_given && !override) - continue; - local_args_info.ipdown_given = 1; - args_info->ipdown_given = 1; - if (args_info->ipdown_arg) - free(args_info->ipdown_arg); /* free previous string */ - args_info->ipdown_arg = - gengetopt_strdup(optarg); - if (args_info->ipdown_orig) - free(args_info->ipdown_orig); /* free previous string */ - args_info->ipdown_orig = - gengetopt_strdup(optarg); - } - /* Ping remote host. */ - else if (strcmp - (long_options[option_index].name, - "pinghost") == 0) { - if (local_args_info.pinghost_given) { - fprintf(stderr, - "%s: `--pinghost' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pinghost_given && !override) - continue; - local_args_info.pinghost_given = 1; - args_info->pinghost_given = 1; - if (args_info->pinghost_arg) - free(args_info->pinghost_arg); /* free previous string */ - args_info->pinghost_arg = - gengetopt_strdup(optarg); - if (args_info->pinghost_orig) - free(args_info->pinghost_orig); /* free previous string */ - args_info->pinghost_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req per second. */ - else if (strcmp - (long_options[option_index].name, - "pingrate") == 0) { - if (local_args_info.pingrate_given) { - fprintf(stderr, - "%s: `--pingrate' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingrate_given && !override) - continue; - local_args_info.pingrate_given = 1; - args_info->pingrate_given = 1; - args_info->pingrate_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingrate_orig) - free(args_info->pingrate_orig); /* free previous string */ - args_info->pingrate_orig = - gengetopt_strdup(optarg); - } - /* Number of ping data bytes. */ - else if (strcmp - (long_options[option_index].name, - "pingsize") == 0) { - if (local_args_info.pingsize_given) { - fprintf(stderr, - "%s: `--pingsize' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingsize_given && !override) - continue; - local_args_info.pingsize_given = 1; - args_info->pingsize_given = 1; - args_info->pingsize_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingsize_orig) - free(args_info->pingsize_orig); /* free previous string */ - args_info->pingsize_orig = - gengetopt_strdup(optarg); - } - /* Number of ping req to send. */ - else if (strcmp - (long_options[option_index].name, - "pingcount") == 0) { - if (local_args_info.pingcount_given) { - fprintf(stderr, - "%s: `--pingcount' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingcount_given && !override) - continue; - local_args_info.pingcount_given = 1; - args_info->pingcount_given = 1; - args_info->pingcount_arg = - strtol(optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, - "%s: invalid numeric value: %s\n", - argv[0], optarg); - goto failure; - } - if (args_info->pingcount_orig) - free(args_info->pingcount_orig); /* free previous string */ - args_info->pingcount_orig = - gengetopt_strdup(optarg); - } - /* Do not print ping packet info. */ - else if (strcmp - (long_options[option_index].name, - "pingquiet") == 0) { - if (local_args_info.pingquiet_given) { - fprintf(stderr, - "%s: `--pingquiet' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); - goto failure; - } - if (args_info->pingquiet_given && !override) - continue; - local_args_info.pingquiet_given = 1; - args_info->pingquiet_given = 1; - args_info->pingquiet_flag = - !(args_info->pingquiet_flag); + } /* Do not send recovery. */ else if (strcmp (long_options[option_index].name, "norecovery") == 0) { - if (local_args_info.norecovery_given) { - fprintf(stderr, - "%s: `--norecovery' option given more than once%s\n", - argv[0], - (additional_error ? - additional_error : "")); + + if (update_arg + ((void *)&(args_info->norecovery_flag), 0, + &(args_info->norecovery_given), + &(local_args_info.norecovery_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "norecovery", '-', + additional_error)) goto failure; - } - if (args_info->norecovery_given && !override) - continue; - local_args_info.norecovery_given = 1; - args_info->norecovery_given = 1; - args_info->norecovery_flag = - !(args_info->norecovery_flag); + + } + /* NSAPI. */ + else if (strcmp + (long_options[option_index].name, + "nsapi") == 0) { + + if (update_arg((void *)&(args_info->nsapi_arg), + &(args_info->nsapi_orig), + &(args_info->nsapi_given), + &(local_args_info.nsapi_given), + optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "nsapi", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 1. */ + else if (strcmp + (long_options[option_index].name, + "qose1") == 0) { + + if (update_arg((void *)&(args_info->qose1_arg), + &(args_info->qose1_orig), + &(args_info->qose1_given), + &(local_args_info.qose1_given), + optarg, 0, "0x9396404074f9ffff", + ARG_INT, check_ambiguity, + override, 0, 0, "qose1", '-', + additional_error)) + goto failure; + + } + /* Requested quality of service Extension 2. */ + else if (strcmp + (long_options[option_index].name, + "qose2") == 0) { + + if (update_arg((void *)&(args_info->qose2_arg), + &(args_info->qose2_orig), + &(args_info->qose2_given), + &(local_args_info.qose2_given), + optarg, 0, "0x11", ARG_INT, + check_ambiguity, override, 0, 0, + "qose2", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 3. */ + else if (strcmp + (long_options[option_index].name, + "qose3") == 0) { + + if (update_arg((void *)&(args_info->qose3_arg), + &(args_info->qose3_orig), + &(args_info->qose3_given), + &(local_args_info.qose3_given), + optarg, 0, "0x0101", ARG_INT, + check_ambiguity, override, 0, 0, + "qose3", '-', additional_error)) + goto failure; + + } + /* Requested quality of service Extension 4. */ + else if (strcmp + (long_options[option_index].name, + "qose4") == 0) { + + if (update_arg((void *)&(args_info->qose4_arg), + &(args_info->qose4_orig), + &(args_info->qose4_given), + &(local_args_info.qose4_given), + optarg, 0, "0x4040", ARG_INT, + check_ambiguity, override, 0, 0, + "qose4", '-', additional_error)) + goto failure; + + } + /* Charging characteristics. */ + else if (strcmp + (long_options[option_index].name, + "charging") == 0) { + + if (update_arg + ((void *)&(args_info->charging_arg), + &(args_info->charging_orig), + &(args_info->charging_given), + &(local_args_info.charging_given), optarg, + 0, "0x0800", ARG_INT, check_ambiguity, + override, 0, 0, "charging", '-', + additional_error)) + goto failure; + + } + /* Create local network interface. */ + else if (strcmp + (long_options[option_index].name, + "createif") == 0) { + + if (update_arg + ((void *)&(args_info->createif_flag), 0, + &(args_info->createif_given), + &(local_args_info.createif_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "createif", '-', additional_error)) + goto failure; + + } + /* Create default route. */ + else if (strcmp + (long_options[option_index].name, + "defaultroute") == 0) { + + if (update_arg + ((void *)&(args_info->defaultroute_flag), 0, + &(args_info->defaultroute_given), + &(local_args_info.defaultroute_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "defaultroute", '-', + additional_error)) + goto failure; + + } + /* Script to run after link-up. */ + else if (strcmp(long_options[option_index].name, "ipup") + == 0) { + + if (update_arg((void *)&(args_info->ipup_arg), + &(args_info->ipup_orig), + &(args_info->ipup_given), + &(local_args_info.ipup_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipup", '-', additional_error)) + goto failure; + + } + /* Script to run after link-down. */ + else if (strcmp + (long_options[option_index].name, + "ipdown") == 0) { + + if (update_arg((void *)&(args_info->ipdown_arg), + &(args_info->ipdown_orig), + &(args_info->ipdown_given), + &(local_args_info.ipdown_given), + optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "ipdown", '-', additional_error)) + goto failure; + + } + /* Ping remote host. */ + else if (strcmp + (long_options[option_index].name, + "pinghost") == 0) { + + if (update_arg + ((void *)&(args_info->pinghost_arg), + &(args_info->pinghost_orig), + &(args_info->pinghost_given), + &(local_args_info.pinghost_given), optarg, + 0, 0, ARG_STRING, check_ambiguity, + override, 0, 0, "pinghost", '-', + additional_error)) + goto failure; + + } + /* Number of ping req per second. */ + else if (strcmp + (long_options[option_index].name, + "pingrate") == 0) { + + if (update_arg + ((void *)&(args_info->pingrate_arg), + &(args_info->pingrate_orig), + &(args_info->pingrate_given), + &(local_args_info.pingrate_given), optarg, + 0, "1", ARG_INT, check_ambiguity, override, + 0, 0, "pingrate", '-', additional_error)) + goto failure; + + } + /* Number of ping data bytes. */ + else if (strcmp + (long_options[option_index].name, + "pingsize") == 0) { + + if (update_arg + ((void *)&(args_info->pingsize_arg), + &(args_info->pingsize_orig), + &(args_info->pingsize_given), + &(local_args_info.pingsize_given), optarg, + 0, "56", ARG_INT, check_ambiguity, + override, 0, 0, "pingsize", '-', + additional_error)) + goto failure; + + } + /* Number of ping req to send. */ + else if (strcmp + (long_options[option_index].name, + "pingcount") == 0) { + + if (update_arg + ((void *)&(args_info->pingcount_arg), + &(args_info->pingcount_orig), + &(args_info->pingcount_given), + &(local_args_info.pingcount_given), optarg, + 0, "0", ARG_INT, check_ambiguity, override, + 0, 0, "pingcount", '-', additional_error)) + goto failure; + + } + /* Do not print ping packet info. */ + else if (strcmp + (long_options[option_index].name, + "pingquiet") == 0) { + + if (update_arg + ((void *)&(args_info->pingquiet_flag), 0, + &(args_info->pingquiet_given), + &(local_args_info.pingquiet_given), optarg, + 0, 0, ARG_FLAG, check_ambiguity, override, + 1, 0, "pingquiet", '-', additional_error)) + goto failure; + } break; @@ -1740,7 +1418,7 @@ cmdline_parser_release(&local_args_info); - if (error) + if (error_occurred) return (EXIT_FAILURE); return 0; @@ -1759,40 +1437,25 @@ #define CONFIG_FILE_LINE_BUFFER_SIZE (CONFIG_FILE_LINE_SIZE+3) /* 3 is for "--" and "=" */ -char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; - -int -cmdline_parser_configfile(char *const filename, - struct gengetopt_args_info *args_info, int override, - int initialize, int check_required) +static int _cmdline_parser_configfile(const char *filename, int *my_argc) { FILE *file; + char my_argv[CONFIG_FILE_LINE_BUFFER_SIZE + 1]; char linebuf[CONFIG_FILE_LINE_SIZE]; int line_num = 0; - int i, result, equal; + int result = 0, equal; char *fopt, *farg; char *str_index; size_t len, next_token; char delimiter; - int my_argc = 0; - char **my_argv_arg; - char *additional_error; - /* store the program name */ - cmd_line_list_tmp = - (struct line_list *)malloc(sizeof(struct line_list)); - cmd_line_list_tmp->next = cmd_line_list; - cmd_line_list = cmd_line_list_tmp; - cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); - - if ((file = fopen(filename, "r")) == NULL) { + if ((file = fopen(filename, "r")) == 0) { fprintf(stderr, "%s: Error opening configuration file '%s'\n", CMDLINE_PARSER_PACKAGE, filename); - result = EXIT_FAILURE; - goto conf_failure; + return EXIT_FAILURE; } - while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != NULL) { + while ((fgets(linebuf, CONFIG_FILE_LINE_SIZE, file)) != 0) { ++line_num; my_argv[0] = '\0'; len = strlen(linebuf); @@ -1801,7 +1464,7 @@ "%s:%s:%d: Line too long in configuration file\n", CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } /* find first non-whitespace character in the line */ @@ -1817,7 +1480,7 @@ next_token = strcspn(fopt, " \t\r\n="); if (fopt[next_token] == '\0') { /* the line is over */ - farg = NULL; + farg = 0; equal = 0; goto noarg; } @@ -1828,6 +1491,7 @@ /* advance pointers to the next token after the end of fopt */ next_token += strspn(fopt + next_token, " \t\r\n"); + /* check for the presence of equal sign, and if so, skip it */ if (!equal) if ((equal = (fopt[next_token] == '='))) { @@ -1848,7 +1512,7 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } else { /* read up the remaining part up to a delimiter */ next_token = strcspn(farg, " \t\r\n#\'\""); @@ -1868,20 +1532,31 @@ CMDLINE_PARSER_PACKAGE, filename, line_num); result = EXIT_FAILURE; - goto conf_failure; + break; } } noarg: - ++my_argc; + if (!strcmp(fopt, "include")) { + if (farg && *farg) { + result = + _cmdline_parser_configfile(farg, my_argc); + } else { + fprintf(stderr, + "%s:%s:%d: include requires a filename argument.\n", + CMDLINE_PARSER_PACKAGE, filename, + line_num); + } + continue; + } len = strlen(fopt); - strcat(my_argv, len > 1 ? "--" : "-"); strcat(my_argv, fopt); if (len > 1 && ((farg && *farg) || equal)) strcat(my_argv, "="); if (farg && *farg) strcat(my_argv, farg); + ++(*my_argc); cmd_line_list_tmp = (struct line_list *)malloc(sizeof(struct line_list)); @@ -1890,30 +1565,69 @@ cmd_line_list->string_arg = gengetopt_strdup(my_argv); } /* while */ - ++my_argc; /* for program name */ - my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); - cmd_line_list_tmp = cmd_line_list; - for (i = my_argc - 1; i >= 0; --i) { - my_argv_arg[i] = cmd_line_list_tmp->string_arg; - cmd_line_list_tmp = cmd_line_list_tmp->next; - } - my_argv_arg[my_argc] = 0; - - additional_error = - (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + 1); - strcpy(additional_error, ADDITIONAL_ERROR); - strcat(additional_error, filename); - result = - cmdline_parser_internal(my_argc, my_argv_arg, args_info, override, - initialize, check_required, - additional_error); - - free(additional_error); - free(my_argv_arg); - -conf_failure: if (file) fclose(file); + return result; +} + +int +cmdline_parser_configfile(const char *filename, + struct gengetopt_args_info *args_info, + int override, int initialize, int check_required) +{ + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + return cmdline_parser_config_file(filename, args_info, ¶ms); +} + +int +cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) +{ + int i, result; + int my_argc = 1; + char **my_argv_arg; + char *additional_error; + + /* store the program name */ + cmd_line_list_tmp = + (struct line_list *)malloc(sizeof(struct line_list)); + cmd_line_list_tmp->next = cmd_line_list; + cmd_line_list = cmd_line_list_tmp; + cmd_line_list->string_arg = gengetopt_strdup(CMDLINE_PARSER_PACKAGE); + + result = _cmdline_parser_configfile(filename, &my_argc); + + if (result != EXIT_FAILURE) { + my_argv_arg = (char **)malloc((my_argc + 1) * sizeof(char *)); + cmd_line_list_tmp = cmd_line_list; + + for (i = my_argc - 1; i >= 0; --i) { + my_argv_arg[i] = cmd_line_list_tmp->string_arg; + cmd_line_list_tmp = cmd_line_list_tmp->next; + } + + my_argv_arg[my_argc] = 0; + + additional_error = + (char *)malloc(strlen(filename) + strlen(ADDITIONAL_ERROR) + + 1); + strcpy(additional_error, ADDITIONAL_ERROR); + strcat(additional_error, filename); + result = + cmdline_parser_internal(my_argc, my_argv_arg, args_info, + params, additional_error); + + free(additional_error); + free(my_argv_arg); + } free_cmd_list(); if (result == EXIT_FAILURE) { diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 620ae7a..540cd8e 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -6,7 +6,11 @@ # notice and this permission notice is included in all copies or # substantial portions of the software. # -# Use "gengetopt --conf-parser < cmdline.ggo" +# Use +# gengetopt --conf-parser < cmdline.ggo +# linux-2.6/scripts/Lindent cmdline.c +# linux-2.6/scripts/Lindent cmdline.h +# sed -i -e 's/int qose1_arg;/unsigned long long int qose1_arg;/' cmdline.h # to generate cmdline.c and cmdline.h option "debug" d "Run in debug mode" flag off diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 17f7c18..248384e 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -1,6 +1,9 @@ -/* cmdline.h */ - -/* File autogenerated by gengetopt version 2.17 */ +/** @file cmdline.h + * @brief The header file for the command line option parser + * generated by GNU Gengetopt version 2.22.6 + * http://www.gnu.org/software/gengetopt. + * DO NOT modify this file, since it can be overwritten + * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H @@ -10,197 +13,495 @@ #include "config.h" #endif +#include /* for FILE */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE +/** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE PACKAGE #endif +#ifndef CMDLINE_PARSER_PACKAGE_NAME +/** @brief the complete program name (used for help and version) */ +#ifdef PACKAGE_NAME +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME +#else +#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE +#endif +#endif + #ifndef CMDLINE_PARSER_VERSION +/** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif +/** @brief Where the command line options are stored */ struct gengetopt_args_info { - const char *help_help; /* Print help and exit help description. */ - const char *version_help; /* Print version and exit help description. */ - int debug_flag; /* Run in debug mode (default=off). */ - const char *debug_help; /* Run in debug mode help description. */ - char *conf_arg; /* Read configuration file. */ - char *conf_orig; /* Read configuration file original value given at command line. */ - const char *conf_help; /* Read configuration file help description. */ - char *pidfile_arg; /* Filename of process id file (default='./sgsnemu.pid'). */ - char *pidfile_orig; /* Filename of process id file original value given at command line. */ - const char *pidfile_help; /* Filename of process id file help description. */ - char *statedir_arg; /* Directory of nonvolatile data (default='./'). */ - char *statedir_orig; /* Directory of nonvolatile data original value given at command line. */ - const char *statedir_help; /* Directory of nonvolatile data help description. */ - char *dns_arg; /* DNS Server to use. */ - char *dns_orig; /* DNS Server to use original value given at command line. */ - const char *dns_help; /* DNS Server to use help description. */ - char *listen_arg; /* Local interface. */ - char *listen_orig; /* Local interface original value given at command line. */ - const char *listen_help; /* Local interface help description. */ - char *remote_arg; /* Remote host. */ - char *remote_orig; /* Remote host original value given at command line. */ - const char *remote_help; /* Remote host help description. */ - int contexts_arg; /* Number of contexts (default='1'). */ - char *contexts_orig; /* Number of contexts original value given at command line. */ - const char *contexts_help; /* Number of contexts help description. */ - int timelimit_arg; /* Exit after timelimit seconds (default='0'). */ - char *timelimit_orig; /* Exit after timelimit seconds original value given at command line. */ - const char *timelimit_help; /* Exit after timelimit seconds help description. */ - int gtpversion_arg; /* GTP version to use (default='1'). */ - char *gtpversion_orig; /* GTP version to use original value given at command line. */ - const char *gtpversion_help; /* GTP version to use help description. */ - char *apn_arg; /* Access point name (default='internet'). */ - char *apn_orig; /* Access point name original value given at command line. */ - const char *apn_help; /* Access point name help description. */ - int selmode_arg; /* Selection mode (default='0x01'). */ - char *selmode_orig; /* Selection mode original value given at command line. */ - const char *selmode_help; /* Selection mode help description. */ - char *rattype_arg; /* Radio Access Technology Type (optional). */ + const char *help_help; + /**< @brief Print help and exit help description. */ + const char *version_help; + /**< @brief Print version and exit help description. */ + int debug_flag; + /**< @brief Run in debug mode (default=off). */ + const char *debug_help; + /**< @brief Run in debug mode help description. */ + char *conf_arg; + /**< @brief Read configuration file. */ + char *conf_orig; + /**< @brief Read configuration file original value given at command line. */ + const char *conf_help; + /**< @brief Read configuration file help description. */ + char *pidfile_arg; + /**< @brief Filename of process id file (default='./sgsnemu.pid'). */ + char *pidfile_orig; + /**< @brief Filename of process id file original value given at command line. */ + const char *pidfile_help; + /**< @brief Filename of process id file help description. */ + char *statedir_arg; + /**< @brief Directory of nonvolatile data (default='./'). */ + char *statedir_orig; + /**< @brief Directory of nonvolatile data original value given at command line. */ + const char *statedir_help; + /**< @brief Directory of nonvolatile data help description. */ + char *dns_arg; + /**< @brief DNS Server to use. */ + char *dns_orig; + /**< @brief DNS Server to use original value given at command line. */ + const char *dns_help; + /**< @brief DNS Server to use help description. */ + char *listen_arg; + /**< @brief Local interface. */ + char *listen_orig; + /**< @brief Local interface original value given at command line. */ + const char *listen_help; + /**< @brief Local interface help description. */ + char *remote_arg; + /**< @brief Remote host. */ + char *remote_orig; + /**< @brief Remote host original value given at command line. */ + const char *remote_help; + /**< @brief Remote host help description. */ + int contexts_arg; + /**< @brief Number of contexts (default='1'). */ + char *contexts_orig; + /**< @brief Number of contexts original value given at command line. */ + const char *contexts_help; + /**< @brief Number of contexts help description. */ + int timelimit_arg; + /**< @brief Exit after timelimit seconds (default='0'). */ + char *timelimit_orig; + /**< @brief Exit after timelimit seconds original value given at command line. */ + const char *timelimit_help; + /**< @brief Exit after timelimit seconds help description. */ + int gtpversion_arg; + /**< @brief GTP version to use (default='1'). */ + char *gtpversion_orig; + /**< @brief GTP version to use original value given at command line. */ + const char *gtpversion_help; + /**< @brief GTP version to use help description. */ + char *apn_arg; + /**< @brief Access point name (default='internet'). */ + char *apn_orig; + /**< @brief Access point name original value given at command line. */ + const char *apn_help; + /**< @brief Access point name help description. */ + int selmode_arg; + /**< @brief Selection mode (default='0x01'). */ + char *selmode_orig; + /**< @brief Selection mode original value given at command line. */ + const char *selmode_help; + /**< @brief Selection mode help description. */ + int rattype_arg; + /**< @brief Radio Access Technology Type (default='1'). */ char *rattype_orig; - char *rattype_help; - char *userloc_arg; /* User Location Information (optional). */ + /**< @brief Radio Access Technology Type original value given at command line. */ + const char *rattype_help; + /**< @brief Radio Access Technology Type help description. */ + char *userloc_arg; + /**< @brief User Location Information (default='02509946241207'). */ char *userloc_orig; - char *userloc_help; - char *rai_arg; /* Routing Area Information (optional). */ + /**< @brief User Location Information original value given at command line. */ + const char *userloc_help; + /**< @brief User Location Information help description. */ + char *rai_arg; + /**< @brief Routing Area Information (default='02509946241207'). */ char *rai_orig; - char *rai_help; - char *mstz_arg; /* MS Time Zone (optional). */ + /**< @brief Routing Area Information original value given at command line. */ + const char *rai_help; + /**< @brief Routing Area Information help description. */ + char *mstz_arg; + /**< @brief MS Time Zone (default='0'). */ char *mstz_orig; - char *mstz_help; - char *imeisv_arg; /* IMEI(SV) (optional). */ + /**< @brief MS Time Zone original value given at command line. */ + const char *mstz_help; + /**< @brief MS Time Zone help description. */ + char *imeisv_arg; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) (default='2143658709214365'). */ char *imeisv_orig; - char *imeisv_help; - char *imsi_arg; /* IMSI (default='240010123456789'). */ - char *imsi_orig; /* IMSI original value given at command line. */ - const char *imsi_help; /* IMSI help description. */ - int nsapi_arg; /* NSAPI (default='0'). */ - char *nsapi_orig; /* NSAPI original value given at command line. */ - const char *nsapi_help; /* NSAPI help description. */ - char *msisdn_arg; /* Mobile Station ISDN number (default='46702123456'). */ - char *msisdn_orig; /* Mobile Station ISDN number original value given at command line. */ - const char *msisdn_help; /* Mobile Station ISDN number help description. */ - int qos_arg; /* Requested quality of service (default='0x0b921f'). */ - char *qos_orig; /* Requested quality of service original value given at command line. */ - const char *qos_help; /* Requested quality of service help description. */ - unsigned long long int qose1_arg; /* Requested quality of service Extension 1 */ - char *qose1_orig; /* Requested quality of service Extension 1 original value given at command line. */ - int qose2_arg; /* Requested quality of service Extension 2 */ - char *qose2_orig; /* Requested quality of service Extension 2 original value given at command line. */ - int qose3_arg; /* Requested quality of service Extension 3 */ - char *qose3_orig; /* Requested quality of service Extension 3 original value given at command line. */ - int qose4_arg; /* Requested quality of service Extension 4 */ - char *qose4_orig; /* Requested quality of service Extension 4 original value given at command line. */ - int charging_arg; /* Charging characteristics (default='0x0800'). */ - char *charging_orig; /* Charging characteristics original value given at command line. */ - const char *charging_help; /* Charging characteristics help description. */ - char *uid_arg; /* Login user ID (default='mig'). */ - char *uid_orig; /* Login user ID original value given at command line. */ - const char *uid_help; /* Login user ID help description. */ - char *pwd_arg; /* Login password (default='hemmelig'). */ - char *pwd_orig; /* Login password original value given at command line. */ - const char *pwd_help; /* Login password help description. */ - int createif_flag; /* Create local network interface (default=off). */ - const char *createif_help; /* Create local network interface help description. */ - char *net_arg; /* Network address for local interface. */ - char *net_orig; /* Network address for local interface original value given at command line. */ - const char *net_help; /* Network address for local interface help description. */ - int defaultroute_flag; /* Create default route (default=off). */ - const char *defaultroute_help; /* Create default route help description. */ - char *ipup_arg; /* Script to run after link-up. */ - char *ipup_orig; /* Script to run after link-up original value given at command line. */ - const char *ipup_help; /* Script to run after link-up help description. */ - char *ipdown_arg; /* Script to run after link-down. */ - char *ipdown_orig; /* Script to run after link-down original value given at command line. */ - const char *ipdown_help; /* Script to run after link-down help description. */ - char *pinghost_arg; /* Ping remote host. */ - char *pinghost_orig; /* Ping remote host original value given at command line. */ - const char *pinghost_help; /* Ping remote host help description. */ - int pingrate_arg; /* Number of ping req per second (default='1'). */ - char *pingrate_orig; /* Number of ping req per second original value given at command line. */ - const char *pingrate_help; /* Number of ping req per second help description. */ - int pingsize_arg; /* Number of ping data bytes (default='56'). */ - char *pingsize_orig; /* Number of ping data bytes original value given at command line. */ - const char *pingsize_help; /* Number of ping data bytes help description. */ - int pingcount_arg; /* Number of ping req to send (default='0'). */ - char *pingcount_orig; /* Number of ping req to send original value given at command line. */ - const char *pingcount_help; /* Number of ping req to send help description. */ - int pingquiet_flag; /* Do not print ping packet info (default=off). */ - const char *pingquiet_help; /* Do not print ping packet info help description. */ - int norecovery_flag; /* Do not print ping packet info (default=off). */ - const char *norecovery_help; /* Do not print ping packet info help description. */ + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) original value given at command line. */ + const char *imeisv_help; + /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) help description. */ + int norecovery_flag; + /**< @brief Do not send recovery (default=off). */ + const char *norecovery_help; + /**< @brief Do not send recovery help description. */ + char *imsi_arg; + /**< @brief IMSI (default='240010123456789'). */ + char *imsi_orig; + /**< @brief IMSI original value given at command line. */ + const char *imsi_help; + /**< @brief IMSI help description. */ + int nsapi_arg; + /**< @brief NSAPI (default='0'). */ + char *nsapi_orig; + /**< @brief NSAPI original value given at command line. */ + const char *nsapi_help; + /**< @brief NSAPI help description. */ + char *msisdn_arg; + /**< @brief Mobile Station ISDN number (default='46702123456'). */ + char *msisdn_orig; + /**< @brief Mobile Station ISDN number original value given at command line. */ + const char *msisdn_help; + /**< @brief Mobile Station ISDN number help description. */ + int qos_arg; + /**< @brief Requested quality of service (default='0x000b921f'). */ + char *qos_orig; + /**< @brief Requested quality of service original value given at command line. */ + const char *qos_help; + /**< @brief Requested quality of service help description. */ + unsigned long long int qose1_arg; + /**< @brief Requested quality of service Extension 1 (default='0x9396404074f9ffff'). */ + char *qose1_orig; + /**< @brief Requested quality of service Extension 1 original value given at command line. */ + const char *qose1_help; + /**< @brief Requested quality of service Extension 1 help description. */ + int qose2_arg; + /**< @brief Requested quality of service Extension 2 (default='0x11'). */ + char *qose2_orig; + /**< @brief Requested quality of service Extension 2 original value given at command line. */ + const char *qose2_help; + /**< @brief Requested quality of service Extension 2 help description. */ + int qose3_arg; + /**< @brief Requested quality of service Extension 3 (default='0x0101'). */ + char *qose3_orig; + /**< @brief Requested quality of service Extension 3 original value given at command line. */ + const char *qose3_help; + /**< @brief Requested quality of service Extension 3 help description. */ + int qose4_arg; + /**< @brief Requested quality of service Extension 4 (default='0x4040'). */ + char *qose4_orig; + /**< @brief Requested quality of service Extension 4 original value given at command line. */ + const char *qose4_help; + /**< @brief Requested quality of service Extension 4 help description. */ + int charging_arg; + /**< @brief Charging characteristics (default='0x0800'). */ + char *charging_orig; + /**< @brief Charging characteristics original value given at command line. */ + const char *charging_help; + /**< @brief Charging characteristics help description. */ + char *uid_arg; + /**< @brief Login user ID (default='mig'). */ + char *uid_orig; + /**< @brief Login user ID original value given at command line. */ + const char *uid_help; + /**< @brief Login user ID help description. */ + char *pwd_arg; + /**< @brief Login password (default='hemmelig'). */ + char *pwd_orig; + /**< @brief Login password original value given at command line. */ + const char *pwd_help; + /**< @brief Login password help description. */ + int createif_flag; + /**< @brief Create local network interface (default=off). */ + const char *createif_help; + /**< @brief Create local network interface help description. */ + char *net_arg; + /**< @brief Network address for local interface. */ + char *net_orig; + /**< @brief Network address for local interface original value given at command line. */ + const char *net_help; + /**< @brief Network address for local interface help description. */ + int defaultroute_flag; + /**< @brief Create default route (default=off). */ + const char *defaultroute_help; + /**< @brief Create default route help description. */ + char *ipup_arg; + /**< @brief Script to run after link-up. */ + char *ipup_orig; + /**< @brief Script to run after link-up original value given at command line. */ + const char *ipup_help; + /**< @brief Script to run after link-up help description. */ + char *ipdown_arg; + /**< @brief Script to run after link-down. */ + char *ipdown_orig; + /**< @brief Script to run after link-down original value given at command line. */ + const char *ipdown_help; + /**< @brief Script to run after link-down help description. */ + char *pinghost_arg; + /**< @brief Ping remote host. */ + char *pinghost_orig; + /**< @brief Ping remote host original value given at command line. */ + const char *pinghost_help; + /**< @brief Ping remote host help description. */ + int pingrate_arg; + /**< @brief Number of ping req per second (default='1'). */ + char *pingrate_orig; + /**< @brief Number of ping req per second original value given at command line. */ + const char *pingrate_help; + /**< @brief Number of ping req per second help description. */ + int pingsize_arg; + /**< @brief Number of ping data bytes (default='56'). */ + char *pingsize_orig; + /**< @brief Number of ping data bytes original value given at command line. */ + const char *pingsize_help; + /**< @brief Number of ping data bytes help description. */ + int pingcount_arg; + /**< @brief Number of ping req to send (default='0'). */ + char *pingcount_orig; + /**< @brief Number of ping req to send original value given at command line. */ + const char *pingcount_help; + /**< @brief Number of ping req to send help description. */ + int pingquiet_flag; + /**< @brief Do not print ping packet info (default=off). */ + const char *pingquiet_help; + /**< @brief Do not print ping packet info help description. */ - int help_given; /* Whether help was given. */ - int version_given; /* Whether version was given. */ - int debug_given; /* Whether debug was given. */ - int conf_given; /* Whether conf was given. */ - int pidfile_given; /* Whether pidfile was given. */ - int statedir_given; /* Whether statedir was given. */ - int dns_given; /* Whether dns was given. */ - int listen_given; /* Whether listen was given. */ - int remote_given; /* Whether remote was given. */ - int contexts_given; /* Whether contexts was given. */ - int timelimit_given; /* Whether timelimit was given. */ - int gtpversion_given; /* Whether gtpversion was given. */ - int apn_given; /* Whether apn was given. */ - int selmode_given; /* Whether selmode was given. */ - int rattype_given; /* Whether rattype was given. */ - int userloc_given; /* Whether userloc was given. */ - int rai_given; /* Whether RAI was given. */ - int mstz_given; /* Whether mstz was given. */ - int imeisv_given; /* Whether imeisv was given. */ - int imsi_given; /* Whether imsi was given. */ - int nsapi_given; /* Whether nsapi was given. */ - int msisdn_given; /* Whether msisdn was given. */ - int qos_given; /* Whether qos was given. */ - int qose1_given; /* Whether qos Extension 1 was given. */ - int qose2_given; /* Whether qos Extension 2 was given. */ - int qose3_given; /* Whether qos Extension 3 was given. */ - int qose4_given; /* Whether qos Extension 4 was given. */ - int charging_given; /* Whether charging was given. */ - int uid_given; /* Whether uid was given. */ - int pwd_given; /* Whether pwd was given. */ - int createif_given; /* Whether createif was given. */ - int net_given; /* Whether net was given. */ - int defaultroute_given; /* Whether defaultroute was given. */ - int ipup_given; /* Whether ipup was given. */ - int ipdown_given; /* Whether ipdown was given. */ - int pinghost_given; /* Whether pinghost was given. */ - int pingrate_given; /* Whether pingrate was given. */ - int pingsize_given; /* Whether pingsize was given. */ - int pingcount_given; /* Whether pingcount was given. */ - int pingquiet_given; /* Whether pingquiet was given. */ - int norecovery_given; /* Whether norecovery was given. */ + unsigned int help_given; + /**< @brief Whether help was given. */ + unsigned int version_given; + /**< @brief Whether version was given. */ + unsigned int debug_given; + /**< @brief Whether debug was given. */ + unsigned int conf_given; + /**< @brief Whether conf was given. */ + unsigned int pidfile_given; + /**< @brief Whether pidfile was given. */ + unsigned int statedir_given; + /**< @brief Whether statedir was given. */ + unsigned int dns_given; + /**< @brief Whether dns was given. */ + unsigned int listen_given; + /**< @brief Whether listen was given. */ + unsigned int remote_given; + /**< @brief Whether remote was given. */ + unsigned int contexts_given; + /**< @brief Whether contexts was given. */ + unsigned int timelimit_given; + /**< @brief Whether timelimit was given. */ + unsigned int gtpversion_given; + /**< @brief Whether gtpversion was given. */ + unsigned int apn_given; + /**< @brief Whether apn was given. */ + unsigned int selmode_given; + /**< @brief Whether selmode was given. */ + unsigned int rattype_given; + /**< @brief Whether rattype was given. */ + unsigned int userloc_given; + /**< @brief Whether userloc was given. */ + unsigned int rai_given; + /**< @brief Whether rai was given. */ + unsigned int mstz_given; + /**< @brief Whether mstz was given. */ + unsigned int imeisv_given; + /**< @brief Whether imeisv was given. */ + unsigned int norecovery_given; + /**< @brief Whether norecovery was given. */ + unsigned int imsi_given; + /**< @brief Whether imsi was given. */ + unsigned int nsapi_given; + /**< @brief Whether nsapi was given. */ + unsigned int msisdn_given; + /**< @brief Whether msisdn was given. */ + unsigned int qos_given; + /**< @brief Whether qos was given. */ + unsigned int qose1_given; + /**< @brief Whether qose1 was given. */ + unsigned int qose2_given; + /**< @brief Whether qose2 was given. */ + unsigned int qose3_given; + /**< @brief Whether qose3 was given. */ + unsigned int qose4_given; + /**< @brief Whether qose4 was given. */ + unsigned int charging_given; + /**< @brief Whether charging was given. */ + unsigned int uid_given; + /**< @brief Whether uid was given. */ + unsigned int pwd_given; + /**< @brief Whether pwd was given. */ + unsigned int createif_given; + /**< @brief Whether createif was given. */ + unsigned int net_given; + /**< @brief Whether net was given. */ + unsigned int defaultroute_given; + /**< @brief Whether defaultroute was given. */ + unsigned int ipup_given; + /**< @brief Whether ipup was given. */ + unsigned int ipdown_given; + /**< @brief Whether ipdown was given. */ + unsigned int pinghost_given; + /**< @brief Whether pinghost was given. */ + unsigned int pingrate_given; + /**< @brief Whether pingrate was given. */ + unsigned int pingsize_given; + /**< @brief Whether pingsize was given. */ + unsigned int pingcount_given; + /**< @brief Whether pingcount was given. */ + unsigned int pingquiet_given; + /**< @brief Whether pingquiet was given. */ }; +/** @brief The additional parameters to pass to parser functions */ + struct cmdline_parser_params { + int override; + /**< @brief whether to override possibly already present options (default 0) */ + int initialize; + /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ + int check_required; + /**< @brief whether to check that all required options were provided (default 1) */ + int check_ambiguity; + /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ + int print_errors; + /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ + }; + +/** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; +/** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; +/** @brief the description string of the program */ + extern const char *gengetopt_args_info_description; +/** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; - int cmdline_parser(int argc, char *const *argv, +/** + * The command line parser + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info); - int cmdline_parser2(int argc, char *const *argv, + +/** + * The command line parser (version with additional parameters - deprecated) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_ext() instead + */ + int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); + +/** + * The command line parser (version with additional parameters) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_ext(int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Save the contents of the option struct into an already open FILE stream. + * @param outfile the stream where to dump options + * @param args_info the option struct to dump + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_dump(FILE * outfile, + struct gengetopt_args_info *args_info); + +/** + * Save the contents of the option struct into a (text) file. + * This file can be read by the config file parser (if generated by gengetopt) + * @param filename the file where to save + * @param args_info the option struct to save + * @return 0 if everything went fine, NON 0 if an error took place + */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); +/** + * Print the help + */ void cmdline_parser_print_help(void); +/** + * Print the version + */ void cmdline_parser_print_version(void); +/** + * Initializes all the fields a cmdline_parser_params structure + * to their default values + * @param params the structure to initialize + */ + void cmdline_parser_params_init(struct cmdline_parser_params *params); + +/** + * Allocates dynamically a cmdline_parser_params structure and initializes + * all its fields to their default values + * @return the created and initialized cmdline_parser_params structure + */ + struct cmdline_parser_params *cmdline_parser_params_create(void); + +/** + * Initializes the passed gengetopt_args_info structure's fields + * (also set default values for options that have a default) + * @param args_info the structure to initialize + */ void cmdline_parser_init(struct gengetopt_args_info *args_info); +/** + * Deallocates the string fields of the gengetopt_args_info structure + * (but does not deallocate the structure itself) + * @param args_info the structure to deallocate + */ void cmdline_parser_free(struct gengetopt_args_info *args_info); - int cmdline_parser_configfile(char *const filename, +/** + * The config file parser (deprecated version) + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_config_file() instead + */ + int cmdline_parser_configfile(const char *filename, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); +/** + * The config file parser + * @param filename the name of the config file + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ + int cmdline_parser_config_file(const char *filename, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Checks that all the required options were specified + * @param args_info the structure to check + * @param prog_name the name of the program that will be used to print + * possible errors + * @return + */ int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1f0b3f9..beb5f12 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -565,9 +565,9 @@ /* rattype */ if (args_info.rattype_given == 1) { options.rattype_given = 1; - options.rattype.l = strlen(args_info.rattype_arg); - options.rattype.v[0] = atoi(args_info.rattype_arg); - printf("Using RAT Type: %s\n", args_info.rattype_arg); + options.rattype.l = 1; + options.rattype.v[0] = args_info.rattype_arg; + printf("Using RAT Type: %d\n", args_info.rattype_arg); } /* userloc */ -- To view, visit https://gerrit.osmocom.org/4030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:21 +0000 Subject: [MERGED] openggsn[master]: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 ...................................................................... sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008 In commit 11a398fbc3ad9b655d8ba947bea7012f7ce81604 we introduced the --qose{1,2,3,4} command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 --- M sgsnemu/cmdline.ggo 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index a000748..da71037 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -28,7 +28,11 @@ option "imsi" i "IMSI" string default="240010123456789" no option "nsapi" - "NSAPI" int default="0" no option "msisdn" m "Mobile Station ISDN number" string default="46702123456" no -option "qos" q "Requested quality of service" int default="0x0b921f" no +option "qos" q "Requested quality of service" int default="0x000b921f" no +option "qose1" - "Requested quality of service Extension 1" int default="0x9396404074f9ffff" no +option "qose2" - "Requested quality of service Extension 2" int default="0x11" no +option "qose3" - "Requested quality of service Extension 3" int default="0x0101" no +option "qose4" - "Requested quality of service Extension 4" int default="0x4040" no option "charging" - "Charging characteristics" int default="0x0800" no option "uid" u "Login user ID" string default="mig" no option "pwd" p "Login password" string default="hemmelig" no -- To view, visit https://gerrit.osmocom.org/4026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 02:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 02:59:21 +0000 Subject: [MERGED] openggsn[master]: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer su... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supported ...................................................................... sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supported It seems like modern gengetopt no longer supports 'unsigned int' argument types, and we need to use 'int' instead. tested with 2.22.6 Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e --- M sgsnemu/cmdline.ggo 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 0c1b06c..a000748 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -40,8 +40,8 @@ option "ipdown" - "Script to run after link-down" string no option "pinghost" - "Ping remote host" string no -option "pingrate" - "Number of ping req per second" unsigned int default="1" no -option "pingsize" - "Number of ping data bytes" unsigned int default="56" no -option "pingcount" - "Number of ping req to send" unsigned int default="0" no +option "pingrate" - "Number of ping req per second" int default="1" no +option "pingsize" - "Number of ping data bytes" int default="56" no +option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off -- To view, visit https://gerrit.osmocom.org/4025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 03:04:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 03:04:30 +0000 Subject: openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 Should be done using "clock_gettime(CLOCK_MONOTONIC, &tp);" as any date/time adjustment between "oml up" and "show" time could result in a wrong result or even a signed underflow (as you're casting a possibly negative double to an unsigned long type). -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 03:05:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 03:05:00 +0000 Subject: openbsc[master]: CTRL: cleanup write-only command functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I719b75b6ca1e9372ea11e7e9ff7896021f357035 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 03:05:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 03:05:05 +0000 Subject: osmo-bsc[master]: CTRL: cleanup write-only command functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10d6d18663aed87324d60472a0fc3bd1d0961dea Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 03:05:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 03:05:33 +0000 Subject: osmo-ggsn[master]: Move extended PDP logging macro to header In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 03:06:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 03:06:09 +0000 Subject: osmo-gsm-manuals[master]: Expand OsmoGGSN manual In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 03:07:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 03:07:15 +0000 Subject: osmo-bsc[master]: Further cleanup leftovers from BSC/MSC split In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I986904864741995910b6ba92173b9f7b1b03e2f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 03:07:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 03:07:32 +0000 Subject: osmo-sgsn[master]: gbproxy: ensure peer allocation result In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 08:53:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 08:53:36 +0000 Subject: [PATCH] osmo-ggsn[master]: libgtp: Avoid extra memcpy() in gtp_data_req() by using send... Message-ID: Review at https://gerrit.osmocom.org/4033 libgtp: Avoid extra memcpy() in gtp_data_req() by using sendmsg() Adresses two "TODO Should be avoided" comments about an extra memcpy() before sendto() that can be replaced by a single sendmsg() call with an iovec array: 1 record for the GTP header + 1 record for the user payload. Change-Id: Ie332a6b15972330fcf540753898eb84ecb84fe24 --- M gtp/gtp.c 1 file changed, 20 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/33/4033/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 27a07b1..e41e692 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3146,20 +3146,34 @@ { union gtp_packet packet; struct sockaddr_in addr; + struct msghdr msgh; + struct iovec iov[2]; int fd; - int length; + /* prepare destination address */ memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; #if defined(__FreeBSD__) || defined(__APPLE__) addr.sin_len = sizeof(addr); #endif - memcpy(&addr.sin_addr, pdp->gsnru.v, pdp->gsnru.l); /* TODO range check */ + + /* prepare msghdr */ + memset(&msgh, 0, sizeof(msgh)); + msgh.msg_name = &addr; + msgh.msg_namelen = sizeof(addr); + msgh.msg_iov = iov; + msgh.msg_iovlen = ARRAY_SIZE(iov); + + /* prepare iovectors */ + iov[0].iov_base = &packet; + /* iov[0].iov_len is not known here yet */ + iov[1].iov_base = pack; + iov[1].iov_len = len; if (pdp->version == 0) { - length = GTP0_HEADER_SIZE + len; + iov[0].iov_len = GTP0_HEADER_SIZE; addr.sin_port = htons(GTP0_PORT); fd = gsn->fd0; @@ -3168,19 +3182,9 @@ packet.gtp0.h.seq = hton16(pdp->gtpsntx++); packet.gtp0.h.flow = hton16(pdp->flru); packet.gtp0.h.tid = htobe64(pdp_gettid(pdp->imsi, pdp->nsapi)); - - if (len > sizeof(union gtp_packet) - sizeof(struct gtp0_header)) { - gsn->err_memcpy++; - LOGP(DLGTP, LOGL_ERROR, - "Memcpy failed: %u > %zu\n", len, - sizeof(union gtp_packet) - - sizeof(struct gtp0_header)); - return EOF; - } - memcpy(packet.gtp0.p, pack, len); /* TODO Should be avoided! */ } else if (pdp->version == 1) { - length = GTP1_HEADER_SIZE_LONG + len; + iov[0].iov_len = GTP1_HEADER_SIZE_LONG; addr.sin_port = htons(GTP1U_PORT); fd = gsn->fd1u; @@ -3189,18 +3193,6 @@ GTP1_HEADER_SIZE_LONG); packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); packet.gtp1l.h.tei = hton32(pdp->teid_gn); - - if (len > - sizeof(union gtp_packet) - - sizeof(struct gtp1_header_long)) { - gsn->err_memcpy++; - LOGP(DLGTP, LOGL_ERROR, - "Memcpy failed: %u > %zu\n", len, - sizeof(union gtp_packet) - - sizeof(struct gtp0_header)); - return EOF; - } - memcpy(packet.gtp1l.p, pack, len); /* TODO Should be avoided! */ } else { LOGP(DLGTP, LOGL_ERROR, "Unknown version: %d\n", pdp->version); return EOF; @@ -3211,11 +3203,10 @@ return -1; } - if (sendto(fd, &packet, length, 0, - (struct sockaddr *)&addr, sizeof(addr)) < 0) { + if (sendmsg(fd, &msgh, 0) < 0) { gsn->err_sendto++; LOGP(DLGTP, LOGL_ERROR, - "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, + "sendmsg(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, (unsigned long)&packet, GTP0_HEADER_SIZE + len, strerror(errno)); return EOF; -- To view, visit https://gerrit.osmocom.org/4033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie332a6b15972330fcf540753898eb84ecb84fe24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 08:53:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 08:53:37 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp: Avoid magic numbers when operating on GTP header flags Message-ID: Review at https://gerrit.osmocom.org/4034 gtp: Avoid magic numbers when operating on GTP header flags Let's introduce a couple of #defines that make the code much more readable. Change-Id: I3635d679fd54507274b46e99a02bdbbe41d7684e --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 40 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/34/4034/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index e41e692..ebbad91 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -192,7 +192,8 @@ /* set to 1 */ /* Currently extension headers are not supported */ memset(gtp1_default, 0, sizeof(struct gtp1_header_long)); - gtp1_default->flags = 0x32; /* No extension, enable sequence, no N-PDU */ + /* No extension, enable sequence, no N-PDU */ + gtp1_default->flags = GTPHDR_F_VER(1) | GTP1HDR_F_GTP1 | GTP1HDR_F_SEQ; gtp1_default->type = hton8(type); return GTP1_HEADER_SIZE_LONG; default: @@ -210,10 +211,11 @@ static uint16_t get_seq(void *pack) { union gtp_packet *packet = (union gtp_packet *)pack; + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { return ntoh16(packet->gtp0.h.seq); - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ return ntoh16(packet->gtp1l.h.seq); } else { return 0; @@ -229,7 +231,7 @@ { union gtp_packet *packet = (union gtp_packet *)pack; - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (GTPHDR_F_GET_VER(packet->flags) == 0) { /* Version 0 */ return be64toh(packet->gtp0.h.tid); } return 0; @@ -243,13 +245,14 @@ static uint16_t get_hlen(void *pack) { union gtp_packet *packet = (union gtp_packet *)pack; + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ return GTP0_HEADER_SIZE; - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ - return GTP1_HEADER_SIZE_LONG; - } else if ((packet->flags & 0xe7) == 0x20) { /* Short version 1 */ + } else if (ver == 1 && (packet->flags & 0x07) == 0) { /* Short version 1 */ return GTP1_HEADER_SIZE_SHORT; + } else if (ver == 1) { /* Version 1 with seq/n-pdu/ext */ + return GTP1_HEADER_SIZE_LONG; } else { LOGP(DLGTP, LOGL_ERROR, "Unknown packet flags: 0x%02x\n", packet->flags); return 0; @@ -264,10 +267,11 @@ static uint32_t get_tei(void *pack) { union gtp_packet *packet = (union gtp_packet *)pack; + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ return ntoh16(packet->gtp0.h.flow); - } else if ((packet->flags & 0xe0) == 0x20) { /* Version 1 */ + } else if (ver == 1) { /* Version 1 */ return ntoh32(packet->gtp1l.h.tei); } else { LOGP(DLGTP, LOGL_ERROR, "Unknown packet flags: 0x%02x\n", packet->flags); @@ -357,6 +361,7 @@ union gtp_packet *packet, int len, struct in_addr *inetaddr, void *cbp) { + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); struct sockaddr_in addr; struct qmsg_t *qmsg; int fd; @@ -368,7 +373,7 @@ addr.sin_len = sizeof(addr); #endif - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ addr.sin_port = htons(GTP0_PORT); packet->gtp0.h.length = hton16(len - GTP0_HEADER_SIZE); packet->gtp0.h.seq = hton16(gsn->seq_next); @@ -382,7 +387,7 @@ else if (pdp) packet->gtp0.h.flow = hton16(pdp->flrc); fd = gsn->fd0; - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ addr.sin_port = htons(GTP1C_PORT); packet->gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT); packet->gtp1l.h.seq = hton16(gsn->seq_next); @@ -430,12 +435,12 @@ int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { - + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); uint16_t seq; - if ((packet->gtp0.h.flags & 0xe0) == 0x00) + if (ver == 0) seq = ntoh16(packet->gtp0.h.seq); - else if ((packet->gtp1l.h.flags & 0xe2) == 0x22) + else if (ver == 1 && (packet->gtp1l.h.flags & GTP1HDR_F_SEQ)) seq = ntoh16(packet->gtp1l.h.seq); else { GTP_LOGPKG(LOGL_ERROR, peer, packet, len, @@ -522,9 +527,10 @@ union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq, uint64_t tid) { + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); struct qmsg_t *qmsg; - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ packet->gtp0.h.length = hton16(len - GTP0_HEADER_SIZE); packet->gtp0.h.seq = hton16(seq); packet->gtp0.h.tid = htobe64(tid); @@ -533,7 +539,7 @@ packet->gtp0.h.flow = hton16(pdp->flru); else if (pdp) packet->gtp0.h.flow = hton16(pdp->flrc); - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ packet->gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT); packet->gtp1l.h.seq = hton16(seq); if (pdp && (fd == gsn->fd1u)) @@ -580,6 +586,7 @@ struct sockaddr_in *peer, int fd, uint16_t seq) { + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); struct sockaddr_in addr; memcpy(&addr, peer, sizeof(addr)); @@ -592,10 +599,10 @@ else if (fd == gsn->fd1u) addr.sin_port = htons(GTP1C_PORT); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ packet->gtp0.h.length = hton16(len - GTP0_HEADER_SIZE); packet->gtp0.h.seq = hton16(seq); - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ packet->gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT); packet->gtp1l.h.seq = hton16(seq); } else { @@ -2740,7 +2747,7 @@ /* GTP 0 messages. If other version message is received we reply that we */ /* only support version 0, implying that this is the only version */ /* supported on this port */ - if (((pheader->flags & 0xe0) > 0x00)) { + if (GTPHDR_F_GET_VER(pheader->flags) > 0) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2881,7 +2888,7 @@ pheader = (struct gtp1_header_short *)(buffer); /* Version must be no larger than GTP 1 */ - if (((pheader->flags & 0xe0) > 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2894,7 +2901,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (((pheader->flags & 0xe0) < 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2930,7 +2937,7 @@ /* Check for extension headers */ /* TODO: We really should cycle through the headers and determine */ /* if any have the comprehension required flag set */ - if (((pheader->flags & 0x04) != 0x00)) { + if (((pheader->flags & GTP1HDR_F_EXT) != 0x00)) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported extension header\n"); @@ -3057,7 +3064,7 @@ pheader = (struct gtp1_header_short *)(buffer); /* Version must be no larger than GTP 1 */ - if (((pheader->flags & 0xe0) > 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3069,7 +3076,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (((pheader->flags & 0xe0) < 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3105,7 +3112,7 @@ /* Check for extension headers */ /* TODO: We really should cycle through the headers and determine */ /* if any have the comprehension required flag set */ - if (((pheader->flags & 0x04) != 0x00)) { + if (((pheader->flags & GTP1HDR_F_EXT) != 0x00)) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported extension header\n"); diff --git a/gtp/gtp.h b/gtp/gtp.h index b40c6df..d189ded 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -162,6 +162,13 @@ uint64_t tid; /* 13 Tunnel ID */ } __attribute__((packed)); /* 20 */ +#define GTP1HDR_F_NPDU 0x01 +#define GTP1HDR_F_SEQ 0x02 +#define GTP1HDR_F_EXT 0x04 +#define GTP1HDR_F_GTP1 0x10 +#define GTPHDR_F_VER(n) ((n) << 5) +#define GTPHDR_F_GET_VER(flags) ((flags)>>5) + struct gtp1_header_short { /* Descriptions from 3GPP 29060 */ uint8_t flags; /* 01 bitfield, with typical values */ /* 001..... Version: 1 */ -- To view, visit https://gerrit.osmocom.org/4034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3635d679fd54507274b46e99a02bdbbe41d7684e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 08:54:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 08:54:43 +0000 Subject: [PATCH] osmo-ggsn[master]: libgtp: Allow each PDP context to specify if it transmits G-... Message-ID: Review at https://gerrit.osmocom.org/4041 libgtp: Allow each PDP context to specify if it transmits G-PDU sequence numbers GTP sequence numbers on GTP-U are optional for G-PDU type messages (i.e. user-ip messages). Let's allow the user to specify this behavior by a new pdu_t.tx_gpdu_seq flag. The flag is enabled by default to stay compatible with the prior behaviour. Related: OS#2519 Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6 --- M TODO-RELEASE M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h 4 files changed, 23 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/41/4041/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..e38e18c 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libgtp pdp.h Addition of new tx_gpdu_seq struct member member diff --git a/gtp/gtp.c b/gtp/gtp.c index ebbad91..fee49b5 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3186,20 +3186,30 @@ get_default_gtp(0, GTP_GPDU, &packet); packet.gtp0.h.length = hton16(len); - packet.gtp0.h.seq = hton16(pdp->gtpsntx++); + if (pdp->tx_gpdu_seq) + packet.gtp0.h.seq = hton16(pdp->gtpsntx++); + else + packet.gtp0.h.seq = 0; packet.gtp0.h.flow = hton16(pdp->flru); packet.gtp0.h.tid = htobe64(pdp_gettid(pdp->imsi, pdp->nsapi)); } else if (pdp->version == 1) { - iov[0].iov_len = GTP1_HEADER_SIZE_LONG; addr.sin_port = htons(GTP1U_PORT); fd = gsn->fd1u; get_default_gtp(1, GTP_GPDU, &packet); - packet.gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT + - GTP1_HEADER_SIZE_LONG); - packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); - packet.gtp1l.h.tei = hton32(pdp->teid_gn); + if (pdp->tx_gpdu_seq) { + packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); + packet.gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT + + GTP1_HEADER_SIZE_LONG); + packet.gtp1l.h.tei = hton32(pdp->teid_gn); + iov[0].iov_len = GTP1_HEADER_SIZE_LONG; + } else { + packet.gtp1s.h.flags &= ~GTP1HDR_F_SEQ; + packet.gtp1s.h.length = hton16(len); + packet.gtp1s.h.tei = hton32(pdp->teid_gn); + iov[0].iov_len = GTP1_HEADER_SIZE_SHORT; + } } else { LOGP(DLGTP, LOGL_ERROR, "Unknown version: %d\n", pdp->version); return EOF; diff --git a/gtp/pdp.c b/gtp/pdp.c index ff9c681..d3e9232 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -149,6 +149,8 @@ 1].secondary_tei[(*pdp)->nsapi & 0x0f] = (*pdp)->teid_own; } + /* Default: Generate G-PDU sequence numbers on Tx */ + (*pdp)->tx_gpdu_seq = true; return 0; } diff --git a/gtp/pdp.h b/gtp/pdp.h index cb98920..f8b0df8 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -13,6 +13,8 @@ #ifndef _PDP_H #define _PDP_H +#include + struct gsn_t; #define PDP_MAX 1024 /* Max number of PDP contexts */ @@ -226,6 +228,8 @@ void *priv; struct gsn_t *gsn; + + bool tx_gpdu_seq; /* Transmit (true) or suppress G-PDU sequence numbers */ }; /* functions related to pdp_t management */ -- To view, visit https://gerrit.osmocom.org/4041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 08:54:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 08:54:43 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Add per-APN VTY configuration option on G-PDU sequence... Message-ID: Review at https://gerrit.osmocom.org/4042 ggsn: Add per-APN VTY configuration option on G-PDU sequence numbers This per-APN vty option determines if we are transmitting GTP sequence numbers in downlink G-PDU messages. This behavior is optional as per GTP spec. The default behavior is "true", like before this change. Related: OS#2519 Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/42/4042/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 46850a6..6ee6628 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -507,6 +507,9 @@ process_pco(apn, pdp); + /* Transmit G-PDU sequence numbers (only) if configured in APN */ + pdp->tx_gpdu_seq = apn->cfg.tx_gpdu_seq; + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 2dd963c..2788da4 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -63,6 +63,8 @@ enum apn_gtpu_mode gtpu_mode; /* administratively shut-down (true) or not (false) */ bool shutdown; + /* transmit G-PDU sequeence numbers (true) or not (false) */ + bool tx_gpdu_seq; } cfg; /* corresponding tun device */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index d7bd9a7..d56f857 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -103,6 +103,7 @@ apn->ggsn = ggsn; apn->cfg.name = talloc_strdup(apn, name); apn->cfg.shutdown = true; + apn->cfg.tx_gpdu_seq = true; INIT_LLIST_HEAD(&apn->cfg.name_list); llist_add_tail(&apn->list, &ggsn->apn_list); @@ -558,6 +559,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_apn_gpdu_seq, cfg_apn_gpdu_seq_cmd, + "g-pdu tx-sequence-numbers", + "G-PDU Configuration\n" "Enable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_gpdu_seq, cfg_apn_no_gpdu_seq_cmd, + "no g-pdu tx-sequence-numbers", + NO_STR "G-PDU Configuration\n" "Disable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = false; + return CMD_SUCCESS; +} + DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, "shutdown", "Put the APN in administrative shut-down\n") @@ -620,6 +639,9 @@ vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), VTY_NEWLINE); } + + if (!apn->cfg.tx_gpdu_seq) + vty_out(vty, " no g-pdu tx-sequence-numbers"); /* IPv4 prefixes + DNS */ if (apn->v4.cfg.static_prefix.addr.len) @@ -870,6 +892,8 @@ install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_gpdu_seq_cmd); + install_element(APN_NODE, &cfg_apn_no_gpdu_seq_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/4042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 08:54:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 08:54:43 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Add --no-tx-gpdu-seq option to suppress transmissio... Message-ID: Review at https://gerrit.osmocom.org/4043 sgsnemu: Add --no-tx-gpdu-seq option to suppress transmission of G-PDU sequence numbers Related: OS#2519 Change-Id: Idc650d896f0f72329090b56a37d9c16359294860 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/43/4043/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index d7be13a..6df8fc1 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -75,6 +75,7 @@ " --pingsize=INT Number of ping data bytes (default=`56')", " --pingcount=INT Number of ping req to send (default=`0')", " --pingquiet Do not print ping packet info (default=off)", + " --no-tx-gpdu-seq Don't transmit G-PDU sequence nums\n (default=off)", 0 }; @@ -159,6 +160,7 @@ args_info->pingsize_given = 0; args_info->pingcount_given = 0; args_info->pingquiet_given = 0; + args_info->no_tx_gpdu_seq_given = 0; } static @@ -238,6 +240,7 @@ args_info->pingcount_arg = 0; args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; + args_info->no_tx_gpdu_seq_flag = 0; } @@ -286,6 +289,7 @@ args_info->pingsize_help = gengetopt_args_info_help[38]; args_info->pingcount_help = gengetopt_args_info_help[39]; args_info->pingquiet_help = gengetopt_args_info_help[40]; + args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[41]; } @@ -532,6 +536,8 @@ 0); if (args_info->pingquiet_given) write_into_file(outfile, "pingquiet", 0, 0); + if (args_info->no_tx_gpdu_seq_given) + write_into_file(outfile, "no-tx-gpdu-seq", 0, 0); i = EXIT_SUCCESS; return i; @@ -826,6 +832,7 @@ {"pingsize", 1, NULL, 0}, {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, + {"no-tx-gpdu-seq", 0, NULL, 0}, {0, 0, 0, 0} }; @@ -1401,6 +1408,21 @@ goto failure; } + /* Don't transmit G-PDU sequence nums. */ + else if (strcmp + (long_options[option_index].name, + "no-tx-gpdu-seq") == 0) { + + if (update_arg + ((void *)&(args_info->no_tx_gpdu_seq_flag), + 0, &(args_info->no_tx_gpdu_seq_given), + &(local_args_info.no_tx_gpdu_seq_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "no-tx-gpdu-seq", '-', + additional_error)) + goto failure; + + } break; case '?': /* Invalid option. */ diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 4fcc64a..a2681f1 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -60,4 +60,4 @@ option "pingsize" - "Number of ping data bytes" int default="56" no option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off - +option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index b93fa0b..38db7da 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -264,6 +264,10 @@ /**< @brief Do not print ping packet info (default=off). */ const char *pingquiet_help; /**< @brief Do not print ping packet info help description. */ + int no_tx_gpdu_seq_flag; + /**< @brief Don't transmit G-PDU sequence nums (default=off). */ + const char *no_tx_gpdu_seq_help; + /**< @brief Don't transmit G-PDU sequence nums help description. */ unsigned int help_given; /**< @brief Whether help was given. */ @@ -347,6 +351,8 @@ /**< @brief Whether pingcount was given. */ unsigned int pingquiet_given; /**< @brief Whether pingquiet was given. */ + unsigned int no_tx_gpdu_seq_given; + /**< @brief Whether no-tx-gpdu-seq was given. */ }; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 2bfe801..4cc2021 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -117,6 +117,7 @@ int imeisv_given; struct ul16_t msisdn; int norecovery_given; + int tx_gpdu_seq; } options; /* Definitions to use for PING. Most of the ping code was derived from */ @@ -297,6 +298,7 @@ printf("pingcount: %d\n", args_info.pingcount_arg); printf("pingquiet: %d\n", args_info.pingquiet_flag); printf("norecovery: %d\n", args_info.norecovery_flag); + printf("no-tx-gpdu-seq: %d\n", args_info.no_tx_gpdu_seq_flag); } /* Try out our new parser */ @@ -354,6 +356,7 @@ printf("pingcount: %d\n", args_info.pingcount_arg); printf("pingquiet: %d\n", args_info.pingquiet_flag); printf("norecovery: %d\n", args_info.norecovery_flag); + printf("no-tx-gpdu-seq: %d\n", args_info.no_tx_gpdu_seq_flag); } } @@ -917,6 +920,11 @@ /* norecovery */ options.norecovery_given = args_info.norecovery_flag; + + if (args_info.no_tx_gpdu_seq_flag) + options.tx_gpdu_seq = 0; + else + options.tx_gpdu_seq = 1; return 0; @@ -1591,6 +1599,8 @@ pdp->cch_pdp = options.cch; /* 2048 = Normal, 1024 = Prepaid, 512 = Flat rate, 256 = Hot billing */ + pdp->tx_gpdu_seq = options.tx_gpdu_seq; + /* Create context */ /* We send this of once. Retransmissions are handled by gtplib */ gtp_create_context_req(gsn, pdp, &iparr[n]); -- To view, visit https://gerrit.osmocom.org/4043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc650d896f0f72329090b56a37d9c16359294860 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 11:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 11:28:08 +0000 Subject: osmo-ggsn[master]: libgtp: Avoid extra memcpy() in gtp_data_req() by using send... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie332a6b15972330fcf540753898eb84ecb84fe24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 11:28:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 11:28:22 +0000 Subject: osmo-ggsn[master]: gtp: Avoid magic numbers when operating on GTP header flags In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3635d679fd54507274b46e99a02bdbbe41d7684e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 11:28:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 11:28:26 +0000 Subject: osmo-ggsn[master]: libgtp: Allow each PDP context to specify if it transmits G-... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 11:28:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 11:28:32 +0000 Subject: osmo-ggsn[master]: sgsnemu: Add --no-tx-gpdu-seq option to suppress transmissio... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idc650d896f0f72329090b56a37d9c16359294860 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 12:52:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 12:52:53 +0000 Subject: [PATCH] osmo-ggsn[master]: ICMPv6: Send router advertisement from own link-local address Message-ID: Review at https://gerrit.osmocom.org/4044 ICMPv6: Send router advertisement from own link-local address I'm not quite sure how I ended up doing this, but for some strange reason the code before this commit is sending the ICMPv6 Router Advertisements from some weird non-standard source address. This is a violation of RFC4861 which clearly states that the source address of router advertisements "MUST be the link-local address assigned to the interface from which this message is sent." Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/icmpv6.c M ggsn/icmpv6.h M lib/tun.c M lib/tun.h 6 files changed, 59 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/44/4044/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 46850a6..d521e57 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -202,6 +202,16 @@ apn->tun.cfg.ipup_script); tun_runscript(apn->tun.tun, apn->tun.cfg.ipup_script); } + + if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) { + if (tun_ipv6_linklocal_get(apn->tun.tun, &apn->v6_lladdr) < 0) { + LOGPAPN(LOGL_ERROR, apn, "Cannot obtain IPv6 link-local address of " + "interface: %s\n", strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + /* set back-pointer from TUN device to APN */ apn->tun.tun->priv = apn; break; @@ -573,6 +583,11 @@ { struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + struct tun_t *tun = (struct tun_t *)pdp->ipif; + struct apn_ctx *apn = tun->priv; + + OSMO_ASSERT(tun); + OSMO_ASSERT(apn); LOGPPDP(LOGL_DEBUG, pdp, "Packet received: forwarding to tun\n"); @@ -580,7 +595,7 @@ case 6: /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(pdp->gsn, pdp, pack, len); + return handle_router_mcast(pdp->gsn, pdp, &apn->v6_lladdr, pack, len); break; case 4: break; diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 2dd963c..42f8e1c 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -78,6 +78,9 @@ struct osmo_fd fd; } tun; + /* ipv6 link-local address */ + struct in6_addr v6_lladdr; + struct apn_ctx_ip v4; struct apn_ctx_ip v6; }; diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c index ac51bb1..11ced24 100644 --- a/ggsn/icmpv6.c +++ b/ggsn/icmpv6.c @@ -179,13 +179,9 @@ return true; } -/* RFC3307 link-local scope multicast address */ -static const struct in6_addr my_local_addr = { - .s6_addr = { 0x01,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0xff } -}; - /* handle incoming packets to the all-routers multicast address */ -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len) +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, + const uint8_t *pack, unsigned len) { struct ippoolm_t *member = pdp->peer; const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; @@ -222,10 +218,10 @@ osmo_hexdump(pack, len)); return -1; } - /* FIXME: Send router advertisement from GGSN link-local + /* Send router advertisement from GGSN link-local * address to MS link-local address, including prefix * allocated to this PDP context */ - msg = icmpv6_construct_ra(&my_local_addr, &ip6h->ip6_src, &member->addr.v6); + msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, &member->addr.v6); /* Send the constructed RA to the MS */ gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); msgb_free(msg); diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h index ebff04e..b6eec63 100644 --- a/ggsn/icmpv6.h +++ b/ggsn/icmpv6.h @@ -3,4 +3,5 @@ #include "../gtp/gtp.h" #include "../gtp/pdp.h" -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len); +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, + const uint8_t *pack, unsigned len); diff --git a/lib/tun.c b/lib/tun.c index 76ac379..32a8d2d 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -748,3 +748,35 @@ } return 0; } + +#include + +/* obtain the link-local address of the tun device */ +int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) +{ + struct ifaddrs *ifaddr, *ifa; + static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + + if (getifaddrs(&ifaddr) == -1) { + return -1; + } + + for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; + if (ifa->ifa_addr == NULL) + continue; + + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + + if (strcmp(ifa->ifa_name, tun->devname)) + continue; + + if (memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) + continue; + + *ia = sin6->sin6_addr; + return 0; + } + return -1; +} diff --git a/lib/tun.h b/lib/tun.h index 50ac806..95fff26 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -85,4 +85,6 @@ extern int tun_runscript(struct tun_t *tun, char *script); +int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia); + #endif /* !_TUN_H */ -- To view, visit https://gerrit.osmocom.org/4044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 12:55:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 12:55:10 +0000 Subject: osmo-ggsn[master]: ICMPv6: Send router advertisement from own link-local address In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 12:55:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 12:55:25 +0000 Subject: [MERGED] osmo-ggsn[master]: ICMPv6: Send router advertisement from own link-local address In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ICMPv6: Send router advertisement from own link-local address ...................................................................... ICMPv6: Send router advertisement from own link-local address I'm not quite sure how I ended up doing this, but for some strange reason the code before this commit is sending the ICMPv6 Router Advertisements from some weird non-standard source address. This is a violation of RFC4861 which clearly states that the source address of router advertisements "MUST be the link-local address assigned to the interface from which this message is sent." Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/icmpv6.c M ggsn/icmpv6.h M lib/tun.c M lib/tun.h 6 files changed, 59 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 46850a6..d521e57 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -202,6 +202,16 @@ apn->tun.cfg.ipup_script); tun_runscript(apn->tun.tun, apn->tun.cfg.ipup_script); } + + if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) { + if (tun_ipv6_linklocal_get(apn->tun.tun, &apn->v6_lladdr) < 0) { + LOGPAPN(LOGL_ERROR, apn, "Cannot obtain IPv6 link-local address of " + "interface: %s\n", strerror(errno)); + apn_stop(apn, false); + return -1; + } + } + /* set back-pointer from TUN device to APN */ apn->tun.tun->priv = apn; break; @@ -573,6 +583,11 @@ { struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + struct tun_t *tun = (struct tun_t *)pdp->ipif; + struct apn_ctx *apn = tun->priv; + + OSMO_ASSERT(tun); + OSMO_ASSERT(apn); LOGPPDP(LOGL_DEBUG, pdp, "Packet received: forwarding to tun\n"); @@ -580,7 +595,7 @@ case 6: /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(pdp->gsn, pdp, pack, len); + return handle_router_mcast(pdp->gsn, pdp, &apn->v6_lladdr, pack, len); break; case 4: break; diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 2dd963c..42f8e1c 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -78,6 +78,9 @@ struct osmo_fd fd; } tun; + /* ipv6 link-local address */ + struct in6_addr v6_lladdr; + struct apn_ctx_ip v4; struct apn_ctx_ip v6; }; diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c index ac51bb1..11ced24 100644 --- a/ggsn/icmpv6.c +++ b/ggsn/icmpv6.c @@ -179,13 +179,9 @@ return true; } -/* RFC3307 link-local scope multicast address */ -static const struct in6_addr my_local_addr = { - .s6_addr = { 0x01,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0xff } -}; - /* handle incoming packets to the all-routers multicast address */ -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len) +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, + const uint8_t *pack, unsigned len) { struct ippoolm_t *member = pdp->peer; const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; @@ -222,10 +218,10 @@ osmo_hexdump(pack, len)); return -1; } - /* FIXME: Send router advertisement from GGSN link-local + /* Send router advertisement from GGSN link-local * address to MS link-local address, including prefix * allocated to this PDP context */ - msg = icmpv6_construct_ra(&my_local_addr, &ip6h->ip6_src, &member->addr.v6); + msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, &member->addr.v6); /* Send the constructed RA to the MS */ gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); msgb_free(msg); diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h index ebff04e..b6eec63 100644 --- a/ggsn/icmpv6.h +++ b/ggsn/icmpv6.h @@ -3,4 +3,5 @@ #include "../gtp/gtp.h" #include "../gtp/pdp.h" -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len); +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, + const uint8_t *pack, unsigned len); diff --git a/lib/tun.c b/lib/tun.c index 76ac379..32a8d2d 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -748,3 +748,35 @@ } return 0; } + +#include + +/* obtain the link-local address of the tun device */ +int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) +{ + struct ifaddrs *ifaddr, *ifa; + static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + + if (getifaddrs(&ifaddr) == -1) { + return -1; + } + + for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; + if (ifa->ifa_addr == NULL) + continue; + + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + + if (strcmp(ifa->ifa_name, tun->devname)) + continue; + + if (memcmp(sin6->sin6_addr.s6_addr, ll_prefix, sizeof(ll_prefix))) + continue; + + *ia = sin6->sin6_addr; + return 0; + } + return -1; +} diff --git a/lib/tun.h b/lib/tun.h index 50ac806..95fff26 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -85,4 +85,6 @@ extern int tun_runscript(struct tun_t *tun, char *script); +int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia); + #endif /* !_TUN_H */ -- To view, visit https://gerrit.osmocom.org/4044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 12:55:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 12:55:25 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp: Avoid magic numbers when operating on GTP header flags In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp: Avoid magic numbers when operating on GTP header flags ...................................................................... gtp: Avoid magic numbers when operating on GTP header flags Let's introduce a couple of #defines that make the code much more readable. Change-Id: I3635d679fd54507274b46e99a02bdbbe41d7684e --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 40 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index e41e692..ebbad91 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -192,7 +192,8 @@ /* set to 1 */ /* Currently extension headers are not supported */ memset(gtp1_default, 0, sizeof(struct gtp1_header_long)); - gtp1_default->flags = 0x32; /* No extension, enable sequence, no N-PDU */ + /* No extension, enable sequence, no N-PDU */ + gtp1_default->flags = GTPHDR_F_VER(1) | GTP1HDR_F_GTP1 | GTP1HDR_F_SEQ; gtp1_default->type = hton8(type); return GTP1_HEADER_SIZE_LONG; default: @@ -210,10 +211,11 @@ static uint16_t get_seq(void *pack) { union gtp_packet *packet = (union gtp_packet *)pack; + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { return ntoh16(packet->gtp0.h.seq); - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ return ntoh16(packet->gtp1l.h.seq); } else { return 0; @@ -229,7 +231,7 @@ { union gtp_packet *packet = (union gtp_packet *)pack; - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (GTPHDR_F_GET_VER(packet->flags) == 0) { /* Version 0 */ return be64toh(packet->gtp0.h.tid); } return 0; @@ -243,13 +245,14 @@ static uint16_t get_hlen(void *pack) { union gtp_packet *packet = (union gtp_packet *)pack; + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ return GTP0_HEADER_SIZE; - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ - return GTP1_HEADER_SIZE_LONG; - } else if ((packet->flags & 0xe7) == 0x20) { /* Short version 1 */ + } else if (ver == 1 && (packet->flags & 0x07) == 0) { /* Short version 1 */ return GTP1_HEADER_SIZE_SHORT; + } else if (ver == 1) { /* Version 1 with seq/n-pdu/ext */ + return GTP1_HEADER_SIZE_LONG; } else { LOGP(DLGTP, LOGL_ERROR, "Unknown packet flags: 0x%02x\n", packet->flags); return 0; @@ -264,10 +267,11 @@ static uint32_t get_tei(void *pack) { union gtp_packet *packet = (union gtp_packet *)pack; + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ return ntoh16(packet->gtp0.h.flow); - } else if ((packet->flags & 0xe0) == 0x20) { /* Version 1 */ + } else if (ver == 1) { /* Version 1 */ return ntoh32(packet->gtp1l.h.tei); } else { LOGP(DLGTP, LOGL_ERROR, "Unknown packet flags: 0x%02x\n", packet->flags); @@ -357,6 +361,7 @@ union gtp_packet *packet, int len, struct in_addr *inetaddr, void *cbp) { + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); struct sockaddr_in addr; struct qmsg_t *qmsg; int fd; @@ -368,7 +373,7 @@ addr.sin_len = sizeof(addr); #endif - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ addr.sin_port = htons(GTP0_PORT); packet->gtp0.h.length = hton16(len - GTP0_HEADER_SIZE); packet->gtp0.h.seq = hton16(gsn->seq_next); @@ -382,7 +387,7 @@ else if (pdp) packet->gtp0.h.flow = hton16(pdp->flrc); fd = gsn->fd0; - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ addr.sin_port = htons(GTP1C_PORT); packet->gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT); packet->gtp1l.h.seq = hton16(gsn->seq_next); @@ -430,12 +435,12 @@ int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { - + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); uint16_t seq; - if ((packet->gtp0.h.flags & 0xe0) == 0x00) + if (ver == 0) seq = ntoh16(packet->gtp0.h.seq); - else if ((packet->gtp1l.h.flags & 0xe2) == 0x22) + else if (ver == 1 && (packet->gtp1l.h.flags & GTP1HDR_F_SEQ)) seq = ntoh16(packet->gtp1l.h.seq); else { GTP_LOGPKG(LOGL_ERROR, peer, packet, len, @@ -522,9 +527,10 @@ union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq, uint64_t tid) { + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); struct qmsg_t *qmsg; - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ packet->gtp0.h.length = hton16(len - GTP0_HEADER_SIZE); packet->gtp0.h.seq = hton16(seq); packet->gtp0.h.tid = htobe64(tid); @@ -533,7 +539,7 @@ packet->gtp0.h.flow = hton16(pdp->flru); else if (pdp) packet->gtp0.h.flow = hton16(pdp->flrc); - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ packet->gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT); packet->gtp1l.h.seq = hton16(seq); if (pdp && (fd == gsn->fd1u)) @@ -580,6 +586,7 @@ struct sockaddr_in *peer, int fd, uint16_t seq) { + uint8_t ver = GTPHDR_F_GET_VER(packet->flags); struct sockaddr_in addr; memcpy(&addr, peer, sizeof(addr)); @@ -592,10 +599,10 @@ else if (fd == gsn->fd1u) addr.sin_port = htons(GTP1C_PORT); - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ + if (ver == 0) { /* Version 0 */ packet->gtp0.h.length = hton16(len - GTP0_HEADER_SIZE); packet->gtp0.h.seq = hton16(seq); - } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ + } else if (ver == 1 && (packet->flags & GTP1HDR_F_SEQ)) { /* Version 1 with seq */ packet->gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT); packet->gtp1l.h.seq = hton16(seq); } else { @@ -2740,7 +2747,7 @@ /* GTP 0 messages. If other version message is received we reply that we */ /* only support version 0, implying that this is the only version */ /* supported on this port */ - if (((pheader->flags & 0xe0) > 0x00)) { + if (GTPHDR_F_GET_VER(pheader->flags) > 0) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2881,7 +2888,7 @@ pheader = (struct gtp1_header_short *)(buffer); /* Version must be no larger than GTP 1 */ - if (((pheader->flags & 0xe0) > 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2894,7 +2901,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (((pheader->flags & 0xe0) < 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2930,7 +2937,7 @@ /* Check for extension headers */ /* TODO: We really should cycle through the headers and determine */ /* if any have the comprehension required flag set */ - if (((pheader->flags & 0x04) != 0x00)) { + if (((pheader->flags & GTP1HDR_F_EXT) != 0x00)) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported extension header\n"); @@ -3057,7 +3064,7 @@ pheader = (struct gtp1_header_short *)(buffer); /* Version must be no larger than GTP 1 */ - if (((pheader->flags & 0xe0) > 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3069,7 +3076,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (((pheader->flags & 0xe0) < 0x20)) { + if (GTPHDR_F_GET_VER(pheader->flags) < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3105,7 +3112,7 @@ /* Check for extension headers */ /* TODO: We really should cycle through the headers and determine */ /* if any have the comprehension required flag set */ - if (((pheader->flags & 0x04) != 0x00)) { + if (((pheader->flags & GTP1HDR_F_EXT) != 0x00)) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported extension header\n"); diff --git a/gtp/gtp.h b/gtp/gtp.h index b40c6df..d189ded 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -162,6 +162,13 @@ uint64_t tid; /* 13 Tunnel ID */ } __attribute__((packed)); /* 20 */ +#define GTP1HDR_F_NPDU 0x01 +#define GTP1HDR_F_SEQ 0x02 +#define GTP1HDR_F_EXT 0x04 +#define GTP1HDR_F_GTP1 0x10 +#define GTPHDR_F_VER(n) ((n) << 5) +#define GTPHDR_F_GET_VER(flags) ((flags)>>5) + struct gtp1_header_short { /* Descriptions from 3GPP 29060 */ uint8_t flags; /* 01 bitfield, with typical values */ /* 001..... Version: 1 */ -- To view, visit https://gerrit.osmocom.org/4034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3635d679fd54507274b46e99a02bdbbe41d7684e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 12:55:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 12:55:25 +0000 Subject: [MERGED] osmo-ggsn[master]: libgtp: Avoid extra memcpy() in gtp_data_req() by using send... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: Avoid extra memcpy() in gtp_data_req() by using sendmsg() ...................................................................... libgtp: Avoid extra memcpy() in gtp_data_req() by using sendmsg() Adresses two "TODO Should be avoided" comments about an extra memcpy() before sendto() that can be replaced by a single sendmsg() call with an iovec array: 1 record for the GTP header + 1 record for the user payload. Change-Id: Ie332a6b15972330fcf540753898eb84ecb84fe24 --- M gtp/gtp.c 1 file changed, 20 insertions(+), 29 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 27a07b1..e41e692 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3146,20 +3146,34 @@ { union gtp_packet packet; struct sockaddr_in addr; + struct msghdr msgh; + struct iovec iov[2]; int fd; - int length; + /* prepare destination address */ memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; #if defined(__FreeBSD__) || defined(__APPLE__) addr.sin_len = sizeof(addr); #endif - memcpy(&addr.sin_addr, pdp->gsnru.v, pdp->gsnru.l); /* TODO range check */ + + /* prepare msghdr */ + memset(&msgh, 0, sizeof(msgh)); + msgh.msg_name = &addr; + msgh.msg_namelen = sizeof(addr); + msgh.msg_iov = iov; + msgh.msg_iovlen = ARRAY_SIZE(iov); + + /* prepare iovectors */ + iov[0].iov_base = &packet; + /* iov[0].iov_len is not known here yet */ + iov[1].iov_base = pack; + iov[1].iov_len = len; if (pdp->version == 0) { - length = GTP0_HEADER_SIZE + len; + iov[0].iov_len = GTP0_HEADER_SIZE; addr.sin_port = htons(GTP0_PORT); fd = gsn->fd0; @@ -3168,19 +3182,9 @@ packet.gtp0.h.seq = hton16(pdp->gtpsntx++); packet.gtp0.h.flow = hton16(pdp->flru); packet.gtp0.h.tid = htobe64(pdp_gettid(pdp->imsi, pdp->nsapi)); - - if (len > sizeof(union gtp_packet) - sizeof(struct gtp0_header)) { - gsn->err_memcpy++; - LOGP(DLGTP, LOGL_ERROR, - "Memcpy failed: %u > %zu\n", len, - sizeof(union gtp_packet) - - sizeof(struct gtp0_header)); - return EOF; - } - memcpy(packet.gtp0.p, pack, len); /* TODO Should be avoided! */ } else if (pdp->version == 1) { - length = GTP1_HEADER_SIZE_LONG + len; + iov[0].iov_len = GTP1_HEADER_SIZE_LONG; addr.sin_port = htons(GTP1U_PORT); fd = gsn->fd1u; @@ -3189,18 +3193,6 @@ GTP1_HEADER_SIZE_LONG); packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); packet.gtp1l.h.tei = hton32(pdp->teid_gn); - - if (len > - sizeof(union gtp_packet) - - sizeof(struct gtp1_header_long)) { - gsn->err_memcpy++; - LOGP(DLGTP, LOGL_ERROR, - "Memcpy failed: %u > %zu\n", len, - sizeof(union gtp_packet) - - sizeof(struct gtp0_header)); - return EOF; - } - memcpy(packet.gtp1l.p, pack, len); /* TODO Should be avoided! */ } else { LOGP(DLGTP, LOGL_ERROR, "Unknown version: %d\n", pdp->version); return EOF; @@ -3211,11 +3203,10 @@ return -1; } - if (sendto(fd, &packet, length, 0, - (struct sockaddr *)&addr, sizeof(addr)) < 0) { + if (sendmsg(fd, &msgh, 0) < 0) { gsn->err_sendto++; LOGP(DLGTP, LOGL_ERROR, - "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, + "sendmsg(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, (unsigned long)&packet, GTP0_HEADER_SIZE + len, strerror(errno)); return EOF; -- To view, visit https://gerrit.osmocom.org/4033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie332a6b15972330fcf540753898eb84ecb84fe24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:28:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:28:56 +0000 Subject: [PATCH] osmo-ggsn[master]: Replace EUA magic nmbers for IETF, IPv4 and IPv6 with #defines Message-ID: Review at https://gerrit.osmocom.org/4045 Replace EUA magic nmbers for IETF, IPv4 and IPv6 with #defines Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739 --- M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h M lib/in46_addr.c 4 files changed, 17 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/45/4045/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index fee49b5..3051aaa 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3259,8 +3259,8 @@ int ipv42eua(struct ul66_t *eua, struct in_addr *src) { - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; if (src) { eua->l = 6; memcpy(&eua->v[2], src, 4); @@ -3272,7 +3272,7 @@ int eua2ipv4(struct in_addr *dst, struct ul66_t *eua) { - if ((eua->l != 6) || (eua->v[0] != 0xf1) || (eua->v[1] = 0x21)) + if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) return -1; /* Not IPv4 address */ memcpy(dst, &eua->v[2], 4); return 0; diff --git a/gtp/pdp.c b/gtp/pdp.c index d3e9232..b1e1ff3 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -367,15 +367,15 @@ int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua) { eua->l = 6; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; memcpy(&eua->v[2], src, 4); /* Copy a 4 byte address */ return 0; } int pdp_euaton(struct ul66_t *eua, struct in_addr *dst) { - if ((eua->l != 6) || (eua->v[0] != 0xf1) || (eua->v[1] != 0x21)) { + if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) { return EOF; } memcpy(dst, &eua->v[2], 4); /* Copy a 4 byte address */ diff --git a/gtp/pdp.h b/gtp/pdp.h index f8b0df8..54f2e0c 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -20,6 +20,10 @@ #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ +#define PDP_EUA_ORG_IETF 0xF1 +#define PDP_EUA_TYPE_v4 0x21 +#define PDP_EUA_TYPE_v6 0x57 + /* GTP Information elements from 29.060 v3.9.0 7.7 Information Elements */ /* Also covers version 0. Note that version 0 6: QOS Profile was superceded * * by 135: QOS Profile in version 1 */ diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 4b5fd64..f78a40b 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -10,6 +10,7 @@ */ #include "../lib/in46_addr.h" +#include "../gtp/pdp.h" #include @@ -201,15 +202,15 @@ switch (src->len) { case 4: eua->l = 6; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ break; case 8: case 16: eua->l = 18; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x57; /* IPv6 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v6; memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ break; default: @@ -230,14 +231,14 @@ return -1; switch (eua->v[1]) { - case 0x21: + case PDP_EUA_TYPE_v4: dst->len = 4; if (eua->l >= 6) memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ else dst->v4.s_addr = 0; break; - case 0x57: + case PDP_EUA_TYPE_v6: dst->len = 16; if (eua->l >= 18) memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ -- To view, visit https://gerrit.osmocom.org/4045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:28:57 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6 Message-ID: Review at https://gerrit.osmocom.org/4046 sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6 This just adds the capability to sgsnemu to request a certain PDP EUA type. It doesn't mean it actually handles anything beyond the existing IPv4 yet. Change-Id: I157f9157a7ff2ea56c37a4a902d4706de4c7d35d --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 44 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/46/4046/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 6df8fc1..60c0a25 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -76,6 +76,7 @@ " --pingcount=INT Number of ping req to send (default=`0')", " --pingquiet Do not print ping packet info (default=off)", " --no-tx-gpdu-seq Don't transmit G-PDU sequence nums\n (default=off)", + " -t, --pdp-type=(v4|v6) PDP Type (default=`v4')", 0 }; @@ -161,6 +162,7 @@ args_info->pingcount_given = 0; args_info->pingquiet_given = 0; args_info->no_tx_gpdu_seq_given = 0; + args_info->pdp_type_given = 0; } static @@ -241,6 +243,8 @@ args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; args_info->no_tx_gpdu_seq_flag = 0; + args_info->pdp_type_arg = gengetopt_strdup("v4"); + args_info->pdp_type_orig = NULL; } @@ -290,6 +294,7 @@ args_info->pingcount_help = gengetopt_args_info_help[39]; args_info->pingquiet_help = gengetopt_args_info_help[40]; args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[41]; + args_info->pdp_type_help = gengetopt_args_info_help[42]; } @@ -419,6 +424,8 @@ free_string_field(&(args_info->pingrate_orig)); free_string_field(&(args_info->pingsize_orig)); free_string_field(&(args_info->pingcount_orig)); + free_string_field(&(args_info->pdp_type_arg)); + free_string_field(&(args_info->pdp_type_orig)); clear_given(args_info); } @@ -538,6 +545,9 @@ write_into_file(outfile, "pingquiet", 0, 0); if (args_info->no_tx_gpdu_seq_given) write_into_file(outfile, "no-tx-gpdu-seq", 0, 0); + if (args_info->pdp_type_given) + write_into_file(outfile, "pdp-type", args_info->pdp_type_orig, + 0); i = EXIT_SUCCESS; return i; @@ -833,10 +843,11 @@ {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, {"no-tx-gpdu-seq", 0, NULL, 0}, + {"pdp-type", 1, NULL, 't'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:", + c = getopt_long(argc, argv, "hVdc:l:r:a:i:m:q:u:p:n:t:", long_options, &option_index); if (c == -1) @@ -982,6 +993,18 @@ goto failure; break; + case 't': /* PDP Type. */ + + if (update_arg((void *)&(args_info->pdp_type_arg), + &(args_info->pdp_type_orig), + &(args_info->pdp_type_given), + &(local_args_info.pdp_type_given), + optarg, 0, "v4", ARG_STRING, + check_ambiguity, override, 0, 0, + "pdp-type", 't', additional_error)) + goto failure; + + break; case 0: /* Long option with no short option */ /* Filename of process id file. */ diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index a2681f1..d8b3c26 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -61,3 +61,4 @@ option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off +option "pdp-type" t "PDP Type" string default="v4" no typestr="(v4|v6)" diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 38db7da..1accfd0 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -268,6 +268,12 @@ /**< @brief Don't transmit G-PDU sequence nums (default=off). */ const char *no_tx_gpdu_seq_help; /**< @brief Don't transmit G-PDU sequence nums help description. */ + char *pdp_type_arg; + /**< @brief PDP Type (default='v4'). */ + char *pdp_type_orig; + /**< @brief PDP Type original value given at command line. */ + const char *pdp_type_help; + /**< @brief PDP Type help description. */ unsigned int help_given; /**< @brief Whether help was given. */ @@ -353,6 +359,8 @@ /**< @brief Whether pingquiet was given. */ unsigned int no_tx_gpdu_seq_given; /**< @brief Whether no-tx-gpdu-seq was given. */ + unsigned int pdp_type_given; + /**< @brief Whether pdp-type was given. */ }; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 4cc2021..c181603 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -118,6 +118,7 @@ struct ul16_t msisdn; int norecovery_given; int tx_gpdu_seq; + uint8_t pdp_type; } options; /* Definitions to use for PING. Most of the ping code was derived from */ @@ -926,6 +927,12 @@ else options.tx_gpdu_seq = 1; + /* PDP Type */ + if (!strcmp(args_info.pdp_type_arg, "v6")) + options.pdp_type = PDP_EUA_TYPE_v6; + else + options.pdp_type = PDP_EUA_TYPE_v4; + return 0; } @@ -1580,7 +1587,10 @@ msisdn_add(&options.msisdn, &pdp->msisdn, n); } - ipv42eua(&pdp->eua, NULL); /* Request dynamic IP address */ + /* Request dynamic IP address */ + pdp->eua.v[0] = PDP_EUA_ORG_IETF; + pdp->eua.v[1] = options.pdp_type; + pdp->eua.l = 2; if (options.pco.l > sizeof(pdp->pco_req.v)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, -- To view, visit https://gerrit.osmocom.org/4046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I157f9157a7ff2ea56c37a4a902d4706de4c7d35d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:28:57 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Add IPv6 supprort via tun device and "-t v6 --creatif" Message-ID: Review at https://gerrit.osmocom.org/4047 sgsnemu: Add IPv6 supprort via tun device and "-t v6 --creatif" The idea is to only implement the GTP-C plane and configure the right link-local source address on the tun-device and let the regular (Linux) kernel take care of sending router solicitations and accepting/processing the related router advertisement. This avoids a lot of complexity in sgsnemu. For this to work, you must have /proc/sys/net/conf/$tun/accept_ra set to either 1 (works only if no IPv6 forwarding/routing configured on your sgsnemu-running system) or 2 (works even if forwarding/routing is configured). Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Closes: OS#2518 --- M sgsnemu/sgsnemu.c 1 file changed, 54 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/47/4047/1 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index c181603..f7509ad 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -933,6 +934,11 @@ else options.pdp_type = PDP_EUA_TYPE_v4; + if (options.pingcount && options.pdp_type != PDP_EUA_TYPE_v4) { + SYS_ERR(DSGSN, LOGL_ERROR, 0, "built-in ping only works with IPv4, use tun-device"); + return -1; + } + return 0; } @@ -1287,19 +1293,46 @@ return 0; } +/* Link-Local address prefix fe80::/64 */ +static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + /* Callback for receiving messages from tun */ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; struct in46_addr src; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - src.len = 4; - src.v4.s_addr = iph->saddr; + if (iph->version == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) { + printf("Dropping packet with too short IP header\n"); + return 0; + } + src.len = 4; + src.v4.s_addr = iph->saddr; + } else if (iph->version == 6) { + /* We only have a single entry in the hash table, and it consists of the link-local + * address "fe80::prefix". So we need to make sure to convert non-link-local source + * addresses to that format before looking up the hash table via ippool_getip() */ + src.len = 16; + if (!memcmp(ip6h->ip6_src.s6_addr, ll_prefix, sizeof(ll_prefix))) { + /* is a link-local address, we can do the hash lookup 1:1 */ + src.v6 = ip6h->ip6_src; + } else { + /* it is not a link-local address, so we must convert from the /64 prefix + * to the link-local format that's used in the hash table */ + memcpy(&src.v6.s6_addr[0], ll_prefix, sizeof(ll_prefix)); + memcpy(&src.v6.s6_addr[sizeof(ll_prefix)], ip6h->ip6_src.s6_addr, 16-sizeof(ll_prefix)); + } + } else { + printf("Dropping packet with invalid IP version %u\n", iph->version); + return 0; + } if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src.v4)); + in46a_ntoa(&src)); return 0; } @@ -1350,17 +1383,27 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr.v4)); + in46a_ntoa(&addr)); + + switch (addr.len) { + case 16: /* IPv6 */ + /* we have to enable the kernel to perform stateless autoconfiguration, + * i.e. send a router solicitation using the lover 64bits of the allocated + * EUA as interface identifier, as per 3GPP TS 29.061 Section 11.2.1.3.2 */ + memcpy(addr.v6.s6_addr, ll_prefix, sizeof(ll_prefix)); + printf("Derived IPv6 link-local address: %s\n", in46a_ntoa(&addr)); + break; + case 4: /* IPv4 */ + break; + } if ((options.createif) && (!options.net.s_addr)) { - struct in_addr m; -#ifdef HAVE_INET_ATON - inet_aton("255.255.255.255", &m); -#else - m.s_addr = -1; -#endif + size_t prefixlen = 32; + if (addr.len == 16) + prefixlen = 64; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr.v4, &addr.v4, &m); + /* FIXME: use tun_addattr() not tun_setaddr() */ + tun_setaddr(tun, &addr, &addr, prefixlen); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/4047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:50:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:50:57 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Add per-APN VTY configuration option on G-PDU sequence... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4042 to look at the new patch set (#3). ggsn: Add per-APN VTY configuration option on G-PDU sequence numbers This per-APN vty option determines if we are transmitting GTP sequence numbers in downlink G-PDU messages. This behavior is optional as per GTP spec. The default behavior is "true", like before this change. Related: OS#2519 Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/42/4042/3 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d521e57..780a0c2 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -517,6 +517,9 @@ process_pco(apn, pdp); + /* Transmit G-PDU sequence numbers (only) if configured in APN */ + pdp->tx_gpdu_seq = apn->cfg.tx_gpdu_seq; + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 42f8e1c..c0774c4 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -63,6 +63,8 @@ enum apn_gtpu_mode gtpu_mode; /* administratively shut-down (true) or not (false) */ bool shutdown; + /* transmit G-PDU sequeence numbers (true) or not (false) */ + bool tx_gpdu_seq; } cfg; /* corresponding tun device */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index c92d83e..4796b16 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -103,6 +103,7 @@ apn->ggsn = ggsn; apn->cfg.name = talloc_strdup(apn, name); apn->cfg.shutdown = true; + apn->cfg.tx_gpdu_seq = true; INIT_LLIST_HEAD(&apn->cfg.name_list); llist_add_tail(&apn->list, &ggsn->apn_list); @@ -558,6 +559,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_apn_gpdu_seq, cfg_apn_gpdu_seq_cmd, + "g-pdu tx-sequence-numbers", + "G-PDU Configuration\n" "Enable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_gpdu_seq, cfg_apn_no_gpdu_seq_cmd, + "no g-pdu tx-sequence-numbers", + NO_STR "G-PDU Configuration\n" "Disable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = false; + return CMD_SUCCESS; +} + DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, "shutdown", "Put the APN in administrative shut-down\n") @@ -620,6 +639,9 @@ vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), VTY_NEWLINE); } + + if (!apn->cfg.tx_gpdu_seq) + vty_out(vty, " no g-pdu tx-sequence-numbers%s", VTY_NEWLINE); /* IPv4 prefixes + DNS */ if (apn->v4.cfg.static_prefix.addr.len) @@ -870,6 +892,8 @@ install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_gpdu_seq_cmd); + install_element(APN_NODE, &cfg_apn_no_gpdu_seq_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/4042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:50:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:50:58 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Fix config file writing of IPv6 DNS settings Message-ID: Review at https://gerrit.osmocom.org/4048 ggsn: Fix config file writing of IPv6 DNS settings There was a copy+paste mistake that created syntax errors during the write of a config file that contained IPv6 DNS server settings. Change-Id: Ida40c32c72dba8155f8294b93484e46e8bd27739 --- M ggsn/ggsn_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/48/4048/1 diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index d7bd9a7..d9bbe3e 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -642,7 +642,7 @@ for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { if (!apn->v6.cfg.dns[i].len) continue; - vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); + vty_out(vty, " ipv6 dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); } if (apn->v6.cfg.ifconfig_prefix.addr.len) vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); -- To view, visit https://gerrit.osmocom.org/4048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida40c32c72dba8155f8294b93484e46e8bd27739 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:50:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:50:58 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Fix double whitespace in writing "ifconfig" lines Message-ID: Review at https://gerrit.osmocom.org/4049 ggsn: Fix double whitespace in writing "ifconfig" lines This is merely a cosmetic issue, no functional change. Change-Id: I8663ee633524eedeed5ddd45ddb65a06825052ac --- M ggsn/ggsn_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/49/4049/1 diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index d9bbe3e..c92d83e 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -632,7 +632,7 @@ vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v4.cfg.dns[i]), VTY_NEWLINE); } if (apn->v4.cfg.ifconfig_prefix.addr.len) - vty_dump_prefix(vty, " ip ifconfig ", &apn->v4.cfg.ifconfig_prefix); + vty_dump_prefix(vty, " ip ifconfig", &apn->v4.cfg.ifconfig_prefix); /* IPv6 prefixes + DNS */ if (apn->v6.cfg.static_prefix.addr.len) @@ -645,7 +645,7 @@ vty_out(vty, " ipv6 dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); } if (apn->v6.cfg.ifconfig_prefix.addr.len) - vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); + vty_dump_prefix(vty, " ipv6 ifconfig", &apn->v6.cfg.ifconfig_prefix); /* must be last */ vty_out(vty, " %sshutdown%s", apn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8663ee633524eedeed5ddd45ddb65a06825052ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:51:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:51:17 +0000 Subject: [PATCH] osmo-ggsn[master]: Replace EUA magic numbers for IETF, IPv4 and IPv6 with #defines In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4045 to look at the new patch set (#2). Replace EUA magic numbers for IETF, IPv4 and IPv6 with #defines Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739 --- M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h M lib/in46_addr.c 4 files changed, 17 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/45/4045/2 diff --git a/gtp/gtp.c b/gtp/gtp.c index fee49b5..3051aaa 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3259,8 +3259,8 @@ int ipv42eua(struct ul66_t *eua, struct in_addr *src) { - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; if (src) { eua->l = 6; memcpy(&eua->v[2], src, 4); @@ -3272,7 +3272,7 @@ int eua2ipv4(struct in_addr *dst, struct ul66_t *eua) { - if ((eua->l != 6) || (eua->v[0] != 0xf1) || (eua->v[1] = 0x21)) + if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) return -1; /* Not IPv4 address */ memcpy(dst, &eua->v[2], 4); return 0; diff --git a/gtp/pdp.c b/gtp/pdp.c index d3e9232..b1e1ff3 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -367,15 +367,15 @@ int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua) { eua->l = 6; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; memcpy(&eua->v[2], src, 4); /* Copy a 4 byte address */ return 0; } int pdp_euaton(struct ul66_t *eua, struct in_addr *dst) { - if ((eua->l != 6) || (eua->v[0] != 0xf1) || (eua->v[1] != 0x21)) { + if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) { return EOF; } memcpy(dst, &eua->v[2], 4); /* Copy a 4 byte address */ diff --git a/gtp/pdp.h b/gtp/pdp.h index f8b0df8..54f2e0c 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -20,6 +20,10 @@ #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ +#define PDP_EUA_ORG_IETF 0xF1 +#define PDP_EUA_TYPE_v4 0x21 +#define PDP_EUA_TYPE_v6 0x57 + /* GTP Information elements from 29.060 v3.9.0 7.7 Information Elements */ /* Also covers version 0. Note that version 0 6: QOS Profile was superceded * * by 135: QOS Profile in version 1 */ diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 4b5fd64..f78a40b 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -10,6 +10,7 @@ */ #include "../lib/in46_addr.h" +#include "../gtp/pdp.h" #include @@ -201,15 +202,15 @@ switch (src->len) { case 4: eua->l = 6; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x21; /* IPv4 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v4; memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ break; case 8: case 16: eua->l = 18; - eua->v[0] = 0xf1; /* IETF */ - eua->v[1] = 0x57; /* IPv6 */ + eua->v[0] = PDP_EUA_ORG_IETF; + eua->v[1] = PDP_EUA_TYPE_v6; memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ break; default: @@ -230,14 +231,14 @@ return -1; switch (eua->v[1]) { - case 0x21: + case PDP_EUA_TYPE_v4: dst->len = 4; if (eua->l >= 6) memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ else dst->v4.s_addr = 0; break; - case 0x57: + case PDP_EUA_TYPE_v6: dst->len = 16; if (eua->l >= 18) memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ -- To view, visit https://gerrit.osmocom.org/4045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:51:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:51:17 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4047 to look at the new patch set (#2). sgsnemu: Add IPv6 support via tun device and "-t v6 --createif" The idea is to only implement the GTP-C plane and configure the right link-local source address on the tun-device and let the regular (Linux) kernel take care of sending router solicitations and accepting/processing the related router advertisement. This avoids a lot of complexity in sgsnemu. For this to work, you must have /proc/sys/net/conf/$tun/accept_ra set to either 1 (works only if no IPv6 forwarding/routing configured on your sgsnemu-running system) or 2 (works even if forwarding/routing is configured). Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Closes: OS#2518 --- M sgsnemu/sgsnemu.c 1 file changed, 54 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/47/4047/2 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index c181603..f7509ad 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -933,6 +934,11 @@ else options.pdp_type = PDP_EUA_TYPE_v4; + if (options.pingcount && options.pdp_type != PDP_EUA_TYPE_v4) { + SYS_ERR(DSGSN, LOGL_ERROR, 0, "built-in ping only works with IPv4, use tun-device"); + return -1; + } + return 0; } @@ -1287,19 +1293,46 @@ return 0; } +/* Link-Local address prefix fe80::/64 */ +static const uint8_t ll_prefix[] = { 0xfe,0x80, 0,0, 0,0, 0,0 }; + /* Callback for receiving messages from tun */ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; struct in46_addr src; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; - src.len = 4; - src.v4.s_addr = iph->saddr; + if (iph->version == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) { + printf("Dropping packet with too short IP header\n"); + return 0; + } + src.len = 4; + src.v4.s_addr = iph->saddr; + } else if (iph->version == 6) { + /* We only have a single entry in the hash table, and it consists of the link-local + * address "fe80::prefix". So we need to make sure to convert non-link-local source + * addresses to that format before looking up the hash table via ippool_getip() */ + src.len = 16; + if (!memcmp(ip6h->ip6_src.s6_addr, ll_prefix, sizeof(ll_prefix))) { + /* is a link-local address, we can do the hash lookup 1:1 */ + src.v6 = ip6h->ip6_src; + } else { + /* it is not a link-local address, so we must convert from the /64 prefix + * to the link-local format that's used in the hash table */ + memcpy(&src.v6.s6_addr[0], ll_prefix, sizeof(ll_prefix)); + memcpy(&src.v6.s6_addr[sizeof(ll_prefix)], ip6h->ip6_src.s6_addr, 16-sizeof(ll_prefix)); + } + } else { + printf("Dropping packet with invalid IP version %u\n", iph->version); + return 0; + } if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src.v4)); + in46a_ntoa(&src)); return 0; } @@ -1350,17 +1383,27 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr.v4)); + in46a_ntoa(&addr)); + + switch (addr.len) { + case 16: /* IPv6 */ + /* we have to enable the kernel to perform stateless autoconfiguration, + * i.e. send a router solicitation using the lover 64bits of the allocated + * EUA as interface identifier, as per 3GPP TS 29.061 Section 11.2.1.3.2 */ + memcpy(addr.v6.s6_addr, ll_prefix, sizeof(ll_prefix)); + printf("Derived IPv6 link-local address: %s\n", in46a_ntoa(&addr)); + break; + case 4: /* IPv4 */ + break; + } if ((options.createif) && (!options.net.s_addr)) { - struct in_addr m; -#ifdef HAVE_INET_ATON - inet_aton("255.255.255.255", &m); -#else - m.s_addr = -1; -#endif + size_t prefixlen = 32; + if (addr.len == 16) + prefixlen = 64; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr.v4, &addr.v4, &m); + /* FIXME: use tun_addattr() not tun_setaddr() */ + tun_setaddr(tun, &addr, &addr, prefixlen); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/4047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:51:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:51:40 +0000 Subject: osmo-ggsn[master]: ggsn: Fix config file writing of IPv6 DNS settings In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida40c32c72dba8155f8294b93484e46e8bd27739 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:51:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:51:46 +0000 Subject: osmo-ggsn[master]: ggsn: Fix double whitespace in writing "ifconfig" lines In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8663ee633524eedeed5ddd45ddb65a06825052ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:58:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:58:50 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Fix double whitespace in writing "ifconfig" lines In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Fix double whitespace in writing "ifconfig" lines ...................................................................... ggsn: Fix double whitespace in writing "ifconfig" lines This is merely a cosmetic issue, no functional change. Change-Id: I8663ee633524eedeed5ddd45ddb65a06825052ac --- M ggsn/ggsn_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index d9bbe3e..c92d83e 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -632,7 +632,7 @@ vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v4.cfg.dns[i]), VTY_NEWLINE); } if (apn->v4.cfg.ifconfig_prefix.addr.len) - vty_dump_prefix(vty, " ip ifconfig ", &apn->v4.cfg.ifconfig_prefix); + vty_dump_prefix(vty, " ip ifconfig", &apn->v4.cfg.ifconfig_prefix); /* IPv6 prefixes + DNS */ if (apn->v6.cfg.static_prefix.addr.len) @@ -645,7 +645,7 @@ vty_out(vty, " ipv6 dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); } if (apn->v6.cfg.ifconfig_prefix.addr.len) - vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); + vty_dump_prefix(vty, " ipv6 ifconfig", &apn->v6.cfg.ifconfig_prefix); /* must be last */ vty_out(vty, " %sshutdown%s", apn->cfg.shutdown ? "" : "no ", VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/4049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8663ee633524eedeed5ddd45ddb65a06825052ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 14:58:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 14:58:51 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Fix config file writing of IPv6 DNS settings In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Fix config file writing of IPv6 DNS settings ...................................................................... ggsn: Fix config file writing of IPv6 DNS settings There was a copy+paste mistake that created syntax errors during the write of a config file that contained IPv6 DNS server settings. Change-Id: Ida40c32c72dba8155f8294b93484e46e8bd27739 --- M ggsn/ggsn_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index d7bd9a7..d9bbe3e 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -642,7 +642,7 @@ for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { if (!apn->v6.cfg.dns[i].len) continue; - vty_out(vty, " ip dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); + vty_out(vty, " ipv6 dns %u %s%s", i, in46a_ntoa(&apn->v6.cfg.dns[i]), VTY_NEWLINE); } if (apn->v6.cfg.ifconfig_prefix.addr.len) vty_dump_prefix(vty, " ipv6 ifconfig ", &apn->v6.cfg.ifconfig_prefix); -- To view, visit https://gerrit.osmocom.org/4048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida40c32c72dba8155f8294b93484e46e8bd27739 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 15:17:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 15:17:29 +0000 Subject: [PATCH] osmo-ggsn[master]: libgtp: Allow each PDP context to specify if it transmits G-... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4041 to look at the new patch set (#4). libgtp: Allow each PDP context to specify if it transmits G-PDU sequence numbers GTP sequence numbers on GTP-U are optional for G-PDU type messages (i.e. user-ip messages). Let's allow the user to specify this behavior by a new pdu_t.tx_gpdu_seq flag. The flag is enabled by default to stay compatible with the prior behaviour. Related: OS#2519 Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6 --- M TODO-RELEASE M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h 4 files changed, 23 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/41/4041/4 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..e38e18c 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libgtp pdp.h Addition of new tx_gpdu_seq struct member member diff --git a/gtp/gtp.c b/gtp/gtp.c index ebbad91..fee49b5 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3186,20 +3186,30 @@ get_default_gtp(0, GTP_GPDU, &packet); packet.gtp0.h.length = hton16(len); - packet.gtp0.h.seq = hton16(pdp->gtpsntx++); + if (pdp->tx_gpdu_seq) + packet.gtp0.h.seq = hton16(pdp->gtpsntx++); + else + packet.gtp0.h.seq = 0; packet.gtp0.h.flow = hton16(pdp->flru); packet.gtp0.h.tid = htobe64(pdp_gettid(pdp->imsi, pdp->nsapi)); } else if (pdp->version == 1) { - iov[0].iov_len = GTP1_HEADER_SIZE_LONG; addr.sin_port = htons(GTP1U_PORT); fd = gsn->fd1u; get_default_gtp(1, GTP_GPDU, &packet); - packet.gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT + - GTP1_HEADER_SIZE_LONG); - packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); - packet.gtp1l.h.tei = hton32(pdp->teid_gn); + if (pdp->tx_gpdu_seq) { + packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); + packet.gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT + + GTP1_HEADER_SIZE_LONG); + packet.gtp1l.h.tei = hton32(pdp->teid_gn); + iov[0].iov_len = GTP1_HEADER_SIZE_LONG; + } else { + packet.gtp1s.h.flags &= ~GTP1HDR_F_SEQ; + packet.gtp1s.h.length = hton16(len); + packet.gtp1s.h.tei = hton32(pdp->teid_gn); + iov[0].iov_len = GTP1_HEADER_SIZE_SHORT; + } } else { LOGP(DLGTP, LOGL_ERROR, "Unknown version: %d\n", pdp->version); return EOF; diff --git a/gtp/pdp.c b/gtp/pdp.c index ff9c681..d3e9232 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -149,6 +149,8 @@ 1].secondary_tei[(*pdp)->nsapi & 0x0f] = (*pdp)->teid_own; } + /* Default: Generate G-PDU sequence numbers on Tx */ + (*pdp)->tx_gpdu_seq = true; return 0; } diff --git a/gtp/pdp.h b/gtp/pdp.h index cb98920..f8b0df8 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -13,6 +13,8 @@ #ifndef _PDP_H #define _PDP_H +#include + struct gsn_t; #define PDP_MAX 1024 /* Max number of PDP contexts */ @@ -226,6 +228,8 @@ void *priv; struct gsn_t *gsn; + + bool tx_gpdu_seq; /* Transmit (true) or suppress G-PDU sequence numbers */ }; /* functions related to pdp_t management */ -- To view, visit https://gerrit.osmocom.org/4041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 15:17:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 15:17:29 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Add per-APN VTY configuration option on G-PDU sequence... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4042 to look at the new patch set (#4). ggsn: Add per-APN VTY configuration option on G-PDU sequence numbers This per-APN vty option determines if we are transmitting GTP sequence numbers in downlink G-PDU messages. This behavior is optional as per GTP spec. The default behavior is "true", like before this change. Related: OS#2519 Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/42/4042/4 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d521e57..780a0c2 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -517,6 +517,9 @@ process_pco(apn, pdp); + /* Transmit G-PDU sequence numbers (only) if configured in APN */ + pdp->tx_gpdu_seq = apn->cfg.tx_gpdu_seq; + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 42f8e1c..c0774c4 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -63,6 +63,8 @@ enum apn_gtpu_mode gtpu_mode; /* administratively shut-down (true) or not (false) */ bool shutdown; + /* transmit G-PDU sequeence numbers (true) or not (false) */ + bool tx_gpdu_seq; } cfg; /* corresponding tun device */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index c92d83e..9f343ec 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -103,6 +103,7 @@ apn->ggsn = ggsn; apn->cfg.name = talloc_strdup(apn, name); apn->cfg.shutdown = true; + apn->cfg.tx_gpdu_seq = true; INIT_LLIST_HEAD(&apn->cfg.name_list); llist_add_tail(&apn->list, &ggsn->apn_list); @@ -558,6 +559,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_apn_gpdu_seq, cfg_apn_gpdu_seq_cmd, + "g-pdu tx-sequence-numbers", + "G-PDU Configuration\n" "Enable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_gpdu_seq, cfg_apn_no_gpdu_seq_cmd, + "no g-pdu tx-sequence-numbers", + NO_STR "G-PDU Configuration\n" "Disable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = false; + return CMD_SUCCESS; +} + DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, "shutdown", "Put the APN in administrative shut-down\n") @@ -620,6 +639,9 @@ vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), VTY_NEWLINE); } + + if (!apn->cfg.tx_gpdu_seq) + vty_out(vty, " no g-pdu tx-sequence-numbers%s", VTY_NEWLINE); /* IPv4 prefixes + DNS */ if (apn->v4.cfg.static_prefix.addr.len) @@ -703,6 +725,8 @@ in46a_from_eua(&pdp->eua, &eua46); vty_out(vty, " End-User Address: %s%s", in46a_ntoa(&eua46), VTY_NEWLINE); + vty_out(vty, " Transmit GTP Sequence Number for G-PDU: %s%s", + pdp->tx_gpdu_seq ? "Yes" : "No", VTY_NEWLINE); } DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, @@ -870,6 +894,8 @@ install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_gpdu_seq_cmd); + install_element(APN_NODE, &cfg_apn_no_gpdu_seq_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/4042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 15:18:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 15:18:10 +0000 Subject: osmo-ggsn[master]: ggsn: Add per-APN VTY configuration option on G-PDU sequence... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 15:20:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 15:20:23 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Add per-APN VTY configuration option on G-PDU sequence... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Add per-APN VTY configuration option on G-PDU sequence numbers ...................................................................... ggsn: Add per-APN VTY configuration option on G-PDU sequence numbers This per-APN vty option determines if we are transmitting GTP sequence numbers in downlink G-PDU messages. This behavior is optional as per GTP spec. The default behavior is "true", like before this change. Related: OS#2519 Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 --- M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c 3 files changed, 31 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d521e57..780a0c2 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -517,6 +517,9 @@ process_pco(apn, pdp); + /* Transmit G-PDU sequence numbers (only) if configured in APN */ + pdp->tx_gpdu_seq = apn->cfg.tx_gpdu_seq; + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 42f8e1c..c0774c4 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -63,6 +63,8 @@ enum apn_gtpu_mode gtpu_mode; /* administratively shut-down (true) or not (false) */ bool shutdown; + /* transmit G-PDU sequeence numbers (true) or not (false) */ + bool tx_gpdu_seq; } cfg; /* corresponding tun device */ diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index c92d83e..9f343ec 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -103,6 +103,7 @@ apn->ggsn = ggsn; apn->cfg.name = talloc_strdup(apn, name); apn->cfg.shutdown = true; + apn->cfg.tx_gpdu_seq = true; INIT_LLIST_HEAD(&apn->cfg.name_list); llist_add_tail(&apn->list, &ggsn->apn_list); @@ -558,6 +559,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_apn_gpdu_seq, cfg_apn_gpdu_seq_cmd, + "g-pdu tx-sequence-numbers", + "G-PDU Configuration\n" "Enable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_apn_no_gpdu_seq, cfg_apn_no_gpdu_seq_cmd, + "no g-pdu tx-sequence-numbers", + NO_STR "G-PDU Configuration\n" "Disable transmission of G-PDU sequence numbers\n") +{ + struct apn_ctx *apn = (struct apn_ctx *) vty->index; + apn->cfg.tx_gpdu_seq = false; + return CMD_SUCCESS; +} + DEFUN(cfg_apn_shutdown, cfg_apn_shutdown_cmd, "shutdown", "Put the APN in administrative shut-down\n") @@ -620,6 +639,9 @@ vty_out(vty, " type-support %s%s", get_value_string(pdp_type_names, (1 << i)), VTY_NEWLINE); } + + if (!apn->cfg.tx_gpdu_seq) + vty_out(vty, " no g-pdu tx-sequence-numbers%s", VTY_NEWLINE); /* IPv4 prefixes + DNS */ if (apn->v4.cfg.static_prefix.addr.len) @@ -703,6 +725,8 @@ in46a_from_eua(&pdp->eua, &eua46); vty_out(vty, " End-User Address: %s%s", in46a_ntoa(&eua46), VTY_NEWLINE); + vty_out(vty, " Transmit GTP Sequence Number for G-PDU: %s%s", + pdp->tx_gpdu_seq ? "Yes" : "No", VTY_NEWLINE); } DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd, @@ -870,6 +894,8 @@ install_element(APN_NODE, &cfg_apn_no_ip_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_ipv6_ifconfig_cmd); install_element(APN_NODE, &cfg_apn_no_ipv6_ifconfig_cmd); + install_element(APN_NODE, &cfg_apn_gpdu_seq_cmd); + install_element(APN_NODE, &cfg_apn_no_gpdu_seq_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/4042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 15:20:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 15:20:24 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: Add --no-tx-gpdu-seq option to suppress transmissio... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: Add --no-tx-gpdu-seq option to suppress transmission of G-PDU sequence numbers ...................................................................... sgsnemu: Add --no-tx-gpdu-seq option to suppress transmission of G-PDU sequence numbers Related: OS#2519 Change-Id: Idc650d896f0f72329090b56a37d9c16359294860 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 39 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index d7be13a..6df8fc1 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -75,6 +75,7 @@ " --pingsize=INT Number of ping data bytes (default=`56')", " --pingcount=INT Number of ping req to send (default=`0')", " --pingquiet Do not print ping packet info (default=off)", + " --no-tx-gpdu-seq Don't transmit G-PDU sequence nums\n (default=off)", 0 }; @@ -159,6 +160,7 @@ args_info->pingsize_given = 0; args_info->pingcount_given = 0; args_info->pingquiet_given = 0; + args_info->no_tx_gpdu_seq_given = 0; } static @@ -238,6 +240,7 @@ args_info->pingcount_arg = 0; args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; + args_info->no_tx_gpdu_seq_flag = 0; } @@ -286,6 +289,7 @@ args_info->pingsize_help = gengetopt_args_info_help[38]; args_info->pingcount_help = gengetopt_args_info_help[39]; args_info->pingquiet_help = gengetopt_args_info_help[40]; + args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[41]; } @@ -532,6 +536,8 @@ 0); if (args_info->pingquiet_given) write_into_file(outfile, "pingquiet", 0, 0); + if (args_info->no_tx_gpdu_seq_given) + write_into_file(outfile, "no-tx-gpdu-seq", 0, 0); i = EXIT_SUCCESS; return i; @@ -826,6 +832,7 @@ {"pingsize", 1, NULL, 0}, {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, + {"no-tx-gpdu-seq", 0, NULL, 0}, {0, 0, 0, 0} }; @@ -1401,6 +1408,21 @@ goto failure; } + /* Don't transmit G-PDU sequence nums. */ + else if (strcmp + (long_options[option_index].name, + "no-tx-gpdu-seq") == 0) { + + if (update_arg + ((void *)&(args_info->no_tx_gpdu_seq_flag), + 0, &(args_info->no_tx_gpdu_seq_given), + &(local_args_info.no_tx_gpdu_seq_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "no-tx-gpdu-seq", '-', + additional_error)) + goto failure; + + } break; case '?': /* Invalid option. */ diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 4fcc64a..a2681f1 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -60,4 +60,4 @@ option "pingsize" - "Number of ping data bytes" int default="56" no option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off - +option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index b93fa0b..38db7da 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -264,6 +264,10 @@ /**< @brief Do not print ping packet info (default=off). */ const char *pingquiet_help; /**< @brief Do not print ping packet info help description. */ + int no_tx_gpdu_seq_flag; + /**< @brief Don't transmit G-PDU sequence nums (default=off). */ + const char *no_tx_gpdu_seq_help; + /**< @brief Don't transmit G-PDU sequence nums help description. */ unsigned int help_given; /**< @brief Whether help was given. */ @@ -347,6 +351,8 @@ /**< @brief Whether pingcount was given. */ unsigned int pingquiet_given; /**< @brief Whether pingquiet was given. */ + unsigned int no_tx_gpdu_seq_given; + /**< @brief Whether no-tx-gpdu-seq was given. */ }; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 2bfe801..4cc2021 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -117,6 +117,7 @@ int imeisv_given; struct ul16_t msisdn; int norecovery_given; + int tx_gpdu_seq; } options; /* Definitions to use for PING. Most of the ping code was derived from */ @@ -297,6 +298,7 @@ printf("pingcount: %d\n", args_info.pingcount_arg); printf("pingquiet: %d\n", args_info.pingquiet_flag); printf("norecovery: %d\n", args_info.norecovery_flag); + printf("no-tx-gpdu-seq: %d\n", args_info.no_tx_gpdu_seq_flag); } /* Try out our new parser */ @@ -354,6 +356,7 @@ printf("pingcount: %d\n", args_info.pingcount_arg); printf("pingquiet: %d\n", args_info.pingquiet_flag); printf("norecovery: %d\n", args_info.norecovery_flag); + printf("no-tx-gpdu-seq: %d\n", args_info.no_tx_gpdu_seq_flag); } } @@ -917,6 +920,11 @@ /* norecovery */ options.norecovery_given = args_info.norecovery_flag; + + if (args_info.no_tx_gpdu_seq_flag) + options.tx_gpdu_seq = 0; + else + options.tx_gpdu_seq = 1; return 0; @@ -1591,6 +1599,8 @@ pdp->cch_pdp = options.cch; /* 2048 = Normal, 1024 = Prepaid, 512 = Flat rate, 256 = Hot billing */ + pdp->tx_gpdu_seq = options.tx_gpdu_seq; + /* Create context */ /* We send this of once. Retransmissions are handled by gtplib */ gtp_create_context_req(gsn, pdp, &iparr[n]); -- To view, visit https://gerrit.osmocom.org/4043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc650d896f0f72329090b56a37d9c16359294860 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 15:20:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 24 Sep 2017 15:20:24 +0000 Subject: [MERGED] osmo-ggsn[master]: libgtp: Allow each PDP context to specify if it transmits G-... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: Allow each PDP context to specify if it transmits G-PDU sequence numbers ...................................................................... libgtp: Allow each PDP context to specify if it transmits G-PDU sequence numbers GTP sequence numbers on GTP-U are optional for G-PDU type messages (i.e. user-ip messages). Let's allow the user to specify this behavior by a new pdu_t.tx_gpdu_seq flag. The flag is enabled by default to stay compatible with the prior behaviour. Related: OS#2519 Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6 --- M TODO-RELEASE M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h 4 files changed, 23 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..e38e18c 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libgtp pdp.h Addition of new tx_gpdu_seq struct member member diff --git a/gtp/gtp.c b/gtp/gtp.c index ebbad91..fee49b5 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3186,20 +3186,30 @@ get_default_gtp(0, GTP_GPDU, &packet); packet.gtp0.h.length = hton16(len); - packet.gtp0.h.seq = hton16(pdp->gtpsntx++); + if (pdp->tx_gpdu_seq) + packet.gtp0.h.seq = hton16(pdp->gtpsntx++); + else + packet.gtp0.h.seq = 0; packet.gtp0.h.flow = hton16(pdp->flru); packet.gtp0.h.tid = htobe64(pdp_gettid(pdp->imsi, pdp->nsapi)); } else if (pdp->version == 1) { - iov[0].iov_len = GTP1_HEADER_SIZE_LONG; addr.sin_port = htons(GTP1U_PORT); fd = gsn->fd1u; get_default_gtp(1, GTP_GPDU, &packet); - packet.gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT + - GTP1_HEADER_SIZE_LONG); - packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); - packet.gtp1l.h.tei = hton32(pdp->teid_gn); + if (pdp->tx_gpdu_seq) { + packet.gtp1l.h.seq = hton16(pdp->gtpsntx++); + packet.gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT + + GTP1_HEADER_SIZE_LONG); + packet.gtp1l.h.tei = hton32(pdp->teid_gn); + iov[0].iov_len = GTP1_HEADER_SIZE_LONG; + } else { + packet.gtp1s.h.flags &= ~GTP1HDR_F_SEQ; + packet.gtp1s.h.length = hton16(len); + packet.gtp1s.h.tei = hton32(pdp->teid_gn); + iov[0].iov_len = GTP1_HEADER_SIZE_SHORT; + } } else { LOGP(DLGTP, LOGL_ERROR, "Unknown version: %d\n", pdp->version); return EOF; diff --git a/gtp/pdp.c b/gtp/pdp.c index ff9c681..d3e9232 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -149,6 +149,8 @@ 1].secondary_tei[(*pdp)->nsapi & 0x0f] = (*pdp)->teid_own; } + /* Default: Generate G-PDU sequence numbers on Tx */ + (*pdp)->tx_gpdu_seq = true; return 0; } diff --git a/gtp/pdp.h b/gtp/pdp.h index cb98920..f8b0df8 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -13,6 +13,8 @@ #ifndef _PDP_H #define _PDP_H +#include + struct gsn_t; #define PDP_MAX 1024 /* Max number of PDP contexts */ @@ -226,6 +228,8 @@ void *priv; struct gsn_t *gsn; + + bool tx_gpdu_seq; /* Transmit (true) or suppress G-PDU sequence numbers */ }; /* functions related to pdp_t management */ -- To view, visit https://gerrit.osmocom.org/4041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Sep 24 16:19:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 16:19:04 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 1: > +2 despite I'm somewhat worried of any possible fall-out I couldn't find any use of the vty that would be negatively affected. Also the somewhat mysterious root nodes (VIEW_NODE, ENABLE_NODE) exhibit the same behavior and command lists as before this patch. The vty tests examine some of that behavior and all still pass unchanged... So I'm fairly confident that this is fine and rather prevents fallout from missing vty_install_default() calls. -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 16:35:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 16:35:44 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 1: > So I'm fairly confident that this is fine and rather prevents > fallout from missing vty_install_default() calls. erm, of course though ... the deprecation warnings might clutter build output or even fail strict builds... -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 17:43:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 17:43:06 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4010/1/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: Line 27: //#include > why the commented out #include? ah thanks, a leftover from tests -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Sep 24 17:43:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 17:43:49 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4010 to look at the new patch set (#2). libosmo-mgcp-client: fix debian, make self-contained Add mgcp_common.h to libosmo-mgcp-client, to not need to share a header file with libosmo-legacy-mgcp (nor the upcoming libosmo-mgcp). Both libraries use the enum mgcp_connection_mode (and a for-loop macro and a string mangling function), so far declared in mgcp.h, and both mgcp-dev and mgcp-client-dev debian packages would require this header file to be installed. So far the mgcp-client-dev lacks this header file, which causes the osmo-msc debian package to fail building. Ways to solve: - If both -dev debian packages installed the same header file in the same place, they would conflict if ever installed at the same time. - mgcp-client-dev can depend on mgcp-dev, but it seems bad to keep such a large dependency for just one enum and two helpers. - Instead, this patch solves this by copying the few definitions to libosmo-mgcp-client. Once libosmo-mgcp-client has its own copy of those definitions, it is fully self-contained and depending builds (osmo-msc deb) will succeed. Copy the few actually common definitions to new header . The nature of this .h is that it may be shared with future libosmo-mgcp without causing linking problems. Remove libosmo-legacy-mgcp/mgcp_common.c file from the build of libosmo-mgcp-client, no longer needed. Add to new mgcp_common.h: - enum mgcp_connection_mode; - for_each_non_empty_line() macro. - mgcp_msg_terminate_nul() as static function. Its complexity is just above your average static inline, but being inline is a way to use it in both mgcp and mgcp_client without linking problems. Replace for_each_line() use in mgcp_client with for_each_non_empty_line() (for_each_non_empty_line() replaces for_each_line() and uses strtok_r() instead of a local reinvention). mgcp_connection_mode_strs are actually only used in libosmo-mgcp-client, so rename to mgcp_client_ prefix and move to mgcp_client.c. BTW, the future plan for upcoming libosmo-mgcp is to use the identical header file, and keep only one copy in the git source tree. The second copy may be generated during 'make', to avoid code dup while having two distinct headers. Related: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f --- M include/Makefile.am M include/osmocom/legacy_mgcp/mgcp.h M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_internal.h A include/osmocom/mgcp_client/mgcp_common.h M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_vty.c M tests/mgcp_client/mgcp_client_test.c 9 files changed, 94 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/10/4010/2 diff --git a/include/Makefile.am b/include/Makefile.am index 94d74bb..0027386 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,4 +7,5 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_common.h \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcp.h b/include/osmocom/legacy_mgcp/mgcp.h index c017faf..147a0d5 100644 --- a/include/osmocom/legacy_mgcp/mgcp.h +++ b/include/osmocom/legacy_mgcp/mgcp.h @@ -177,13 +177,6 @@ MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, }; -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} - struct mgcp_config { int source_port; char *local_ip; diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index df73811..efc1f76 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -2,6 +2,8 @@ #include +#include + #define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" #define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 #define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" @@ -71,3 +73,9 @@ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); + +extern const struct value_string mgcp_client_connection_mode_strs[]; +static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) +{ + return get_value_string(mgcp_client_connection_mode_strs, mode); +} diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 1b149e2..690a4af 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -1,5 +1,7 @@ #pragma once +#include + #define MSGB_CB_MGCP_TRANS_ID 0 struct mgcp_client { diff --git a/include/osmocom/mgcp_client/mgcp_common.h b/include/osmocom/mgcp_client/mgcp_common.h new file mode 100644 index 0000000..0eb1388 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_common.h @@ -0,0 +1,71 @@ +/* MGCP common implementations. + * These are used in libosmo-mgcp as well as libosmo-mgcp-client. + * To avoid interdependency, these are implemented in .h file only. */ + +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/* Two copies of this file are kept in osmocom/mgcp/ and osmocom/mgcp_client/. + * Since both are by definition identical, use the old header exclusion ifdefs + * instead of '#pragma once' to avoid including both of these files. + * Though at the time of writing there are no such users, this allows including + * both libosmo-mgcp and libosmo-mgcp-client headers in the same file. */ +#ifndef OSMO_MGCP_COMMON_H +#define OSMO_MGCP_COMMON_H + +#include +#include + +#include +#include + +#define for_each_non_empty_line(line, save) \ + for (line = strtok_r(NULL, "\r\n", &save); line; \ + line = strtok_r(NULL, "\r\n", &save)) + +enum mgcp_connection_mode { + MGCP_CONN_NONE = 0, + MGCP_CONN_RECV_ONLY = 1, + MGCP_CONN_SEND_ONLY = 2, + MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, + MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, +}; + +/* Ensure that the msg->l2h is NUL terminated. */ +static inline int mgcp_msg_terminate_nul(struct msgb *msg) +{ + unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ + if (tail[-1] == '\0') + /* nothing to do */; + else if (msgb_tailroom(msg) > 0) + tail[0] = '\0'; + else if (tail[-1] == '\r' || tail[-1] == '\n') + tail[-1] = '\0'; + else { + LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " + "Length: %d, Buffer size: %d\n", + msgb_l2len(msg), msg->data_len); + return -ENOTSUP; + } + return 0; +} + +#endif diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b17477a..a2eb2be 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -30,7 +30,6 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ - ../libosmo-legacy-mgcp/mgcp_common.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b72fc50..1cd37be 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,8 +24,6 @@ #include #include -#include -#include #include #include @@ -208,7 +206,7 @@ *data = '\0'; data ++; - for_each_line(line, data) { + for_each_non_empty_line(line, data) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -584,7 +582,7 @@ trans_id, rtp_endpoint, call_id, - mgcp_cmode_name(mode)); + mgcp_client_cmode_name(mode)); } struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, @@ -602,7 +600,7 @@ , trans_id, rtp_endpoint, - mgcp_cmode_name(mode), + mgcp_client_cmode_name(mode), rtp_conn_addr, rtp_port); } @@ -620,3 +618,12 @@ { return &mgcp->actual; } + +const struct value_string mgcp_client_connection_mode_strs[] = { + { MGCP_CONN_NONE, "none" }, + { MGCP_CONN_RECV_SEND, "sendrecv" }, + { MGCP_CONN_SEND_ONLY, "sendonly" }, + { MGCP_CONN_RECV_ONLY, "recvonly" }, + { MGCP_CONN_LOOPBACK, "loopback" }, + { 0, NULL } +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 1e8bba6..c52803f 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -27,7 +27,6 @@ #include #include -#include #include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 6045297..f2f0e0f 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -22,7 +22,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 17:50:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 17:50:29 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4010 to look at the new patch set (#3). libosmo-mgcp-client: fix debian, make self-contained Add mgcp_common.h to libosmo-mgcp-client, to not need to share a header file with libosmo-legacy-mgcp (nor the upcoming libosmo-mgcp). Both libraries use the enum mgcp_connection_mode (and a for-loop macro and a string mangling function), so far declared in mgcp.h, and both mgcp-dev and mgcp-client-dev debian packages would require this header file to be installed. So far the mgcp-client-dev lacks this header file, which causes the osmo-msc debian package to fail building. Ways to solve: - If both -dev debian packages installed the same header file in the same place, they would conflict if ever installed at the same time. - mgcp-client-dev can depend on mgcp-dev, but it seems bad to keep such a large dependency for just one enum and two helpers. - Instead, this patch solves this by copying the few definitions to libosmo-mgcp-client. Once libosmo-mgcp-client has its own copy of those definitions, it is fully self-contained and depending builds (osmo-msc deb) will succeed. Copy the few actually common definitions to new header . The nature of this .h is that it may be shared with future libosmo-mgcp without causing linking problems. Remove libosmo-legacy-mgcp/mgcp_common.c file from the build of libosmo-mgcp-client, no longer needed. Add to new mgcp_common.h: - enum mgcp_connection_mode; - for_each_non_empty_line() macro. - mgcp_msg_terminate_nul() as static function. Its complexity is just above your average static inline, but being inline is a way to use it in both mgcp and mgcp_client without linking problems. Replace for_each_line() use in mgcp_client with for_each_non_empty_line() (for_each_non_empty_line() replaces for_each_line() and uses strtok_r() instead of a local reinvention). mgcp_connection_mode_strs are actually only used in libosmo-mgcp-client, so rename to mgcp_client_ prefix and move to mgcp_client.c. BTW, the future plan for upcoming libosmo-mgcp is to use the identical header file, and keep only one copy in the git source tree. The second copy may be generated during 'make', to avoid code dup while having two distinct headers. Related: I8e3359bedf973077c0a038aa04f5371a00c48fa0 (fix osmo-msc after this), I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 (mgcp_common.h) Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f --- M include/Makefile.am M include/osmocom/legacy_mgcp/mgcp.h M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_internal.h A include/osmocom/mgcp_client/mgcp_common.h M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_vty.c M tests/mgcp_client/mgcp_client_test.c 9 files changed, 94 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/10/4010/3 diff --git a/include/Makefile.am b/include/Makefile.am index 94d74bb..0027386 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,4 +7,5 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_common.h \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcp.h b/include/osmocom/legacy_mgcp/mgcp.h index c017faf..147a0d5 100644 --- a/include/osmocom/legacy_mgcp/mgcp.h +++ b/include/osmocom/legacy_mgcp/mgcp.h @@ -177,13 +177,6 @@ MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, }; -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} - struct mgcp_config { int source_port; char *local_ip; diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index df73811..efc1f76 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -2,6 +2,8 @@ #include +#include + #define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" #define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 #define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" @@ -71,3 +73,9 @@ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); + +extern const struct value_string mgcp_client_connection_mode_strs[]; +static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) +{ + return get_value_string(mgcp_client_connection_mode_strs, mode); +} diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 1b149e2..690a4af 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -1,5 +1,7 @@ #pragma once +#include + #define MSGB_CB_MGCP_TRANS_ID 0 struct mgcp_client { diff --git a/include/osmocom/mgcp_client/mgcp_common.h b/include/osmocom/mgcp_client/mgcp_common.h new file mode 100644 index 0000000..0eb1388 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_common.h @@ -0,0 +1,71 @@ +/* MGCP common implementations. + * These are used in libosmo-mgcp as well as libosmo-mgcp-client. + * To avoid interdependency, these are implemented in .h file only. */ + +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/* Two copies of this file are kept in osmocom/mgcp/ and osmocom/mgcp_client/. + * Since both are by definition identical, use the old header exclusion ifdefs + * instead of '#pragma once' to avoid including both of these files. + * Though at the time of writing there are no such users, this allows including + * both libosmo-mgcp and libosmo-mgcp-client headers in the same file. */ +#ifndef OSMO_MGCP_COMMON_H +#define OSMO_MGCP_COMMON_H + +#include +#include + +#include +#include + +#define for_each_non_empty_line(line, save) \ + for (line = strtok_r(NULL, "\r\n", &save); line; \ + line = strtok_r(NULL, "\r\n", &save)) + +enum mgcp_connection_mode { + MGCP_CONN_NONE = 0, + MGCP_CONN_RECV_ONLY = 1, + MGCP_CONN_SEND_ONLY = 2, + MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, + MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, +}; + +/* Ensure that the msg->l2h is NUL terminated. */ +static inline int mgcp_msg_terminate_nul(struct msgb *msg) +{ + unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ + if (tail[-1] == '\0') + /* nothing to do */; + else if (msgb_tailroom(msg) > 0) + tail[0] = '\0'; + else if (tail[-1] == '\r' || tail[-1] == '\n') + tail[-1] = '\0'; + else { + LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " + "Length: %d, Buffer size: %d\n", + msgb_l2len(msg), msg->data_len); + return -ENOTSUP; + } + return 0; +} + +#endif diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b17477a..a2eb2be 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -30,7 +30,6 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ - ../libosmo-legacy-mgcp/mgcp_common.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b72fc50..1cd37be 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,8 +24,6 @@ #include #include -#include -#include #include #include @@ -208,7 +206,7 @@ *data = '\0'; data ++; - for_each_line(line, data) { + for_each_non_empty_line(line, data) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -584,7 +582,7 @@ trans_id, rtp_endpoint, call_id, - mgcp_cmode_name(mode)); + mgcp_client_cmode_name(mode)); } struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, @@ -602,7 +600,7 @@ , trans_id, rtp_endpoint, - mgcp_cmode_name(mode), + mgcp_client_cmode_name(mode), rtp_conn_addr, rtp_port); } @@ -620,3 +618,12 @@ { return &mgcp->actual; } + +const struct value_string mgcp_client_connection_mode_strs[] = { + { MGCP_CONN_NONE, "none" }, + { MGCP_CONN_RECV_SEND, "sendrecv" }, + { MGCP_CONN_SEND_ONLY, "sendonly" }, + { MGCP_CONN_RECV_ONLY, "recvonly" }, + { MGCP_CONN_LOOPBACK, "loopback" }, + { 0, NULL } +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 1e8bba6..c52803f 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -27,7 +27,6 @@ #include #include -#include #include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 6045297..f2f0e0f 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -22,7 +22,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 17:59:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 17:59:58 +0000 Subject: [PATCH] osmo-msc[master]: fix build: remove obsolete header legacy_mgcp/mgcp.h Message-ID: Review at https://gerrit.osmocom.org/4050 fix build: remove obsolete header legacy_mgcp/mgcp.h Since Ifb8f3fc2b399662a9dbba174e942352a1a21df3f libosmo-mgcp-client has its own definitions in mgcp_common.h, which conflict with legacy_mgcp/mgcp.h. This cross-inclusion to support libosmo-mgcp-client is no longer necessary. In the future, including libosmo-mgcp-client together with libosmo-mgcp will be made possible, but not with libosmo-legacy-mgcp (because we don't care enough). That is why including libosmo-legacy-mgcp headers would cause build failure. Depends: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Change-Id: I8e3359bedf973077c0a038aa04f5371a00c48fa0 --- M src/libmsc/msc_ifaces.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/50/4050/1 diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 1c8e5ef..e29fe0e 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/4050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e3359bedf973077c0a038aa04f5371a00c48fa0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:21:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:21:51 +0000 Subject: osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 re-add previous +2, just minor modifications -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:21:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:21:53 +0000 Subject: [MERGED] osmo-mgw[master]: libosmo-mgcp-client: fix debian, make self-contained In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libosmo-mgcp-client: fix debian, make self-contained ...................................................................... libosmo-mgcp-client: fix debian, make self-contained Add mgcp_common.h to libosmo-mgcp-client, to not need to share a header file with libosmo-legacy-mgcp (nor the upcoming libosmo-mgcp). Both libraries use the enum mgcp_connection_mode (and a for-loop macro and a string mangling function), so far declared in mgcp.h, and both mgcp-dev and mgcp-client-dev debian packages would require this header file to be installed. So far the mgcp-client-dev lacks this header file, which causes the osmo-msc debian package to fail building. Ways to solve: - If both -dev debian packages installed the same header file in the same place, they would conflict if ever installed at the same time. - mgcp-client-dev can depend on mgcp-dev, but it seems bad to keep such a large dependency for just one enum and two helpers. - Instead, this patch solves this by copying the few definitions to libosmo-mgcp-client. Once libosmo-mgcp-client has its own copy of those definitions, it is fully self-contained and depending builds (osmo-msc deb) will succeed. Copy the few actually common definitions to new header . The nature of this .h is that it may be shared with future libosmo-mgcp without causing linking problems. Remove libosmo-legacy-mgcp/mgcp_common.c file from the build of libosmo-mgcp-client, no longer needed. Add to new mgcp_common.h: - enum mgcp_connection_mode; - for_each_non_empty_line() macro. - mgcp_msg_terminate_nul() as static function. Its complexity is just above your average static inline, but being inline is a way to use it in both mgcp and mgcp_client without linking problems. Replace for_each_line() use in mgcp_client with for_each_non_empty_line() (for_each_non_empty_line() replaces for_each_line() and uses strtok_r() instead of a local reinvention). mgcp_connection_mode_strs are actually only used in libosmo-mgcp-client, so rename to mgcp_client_ prefix and move to mgcp_client.c. BTW, the future plan for upcoming libosmo-mgcp is to use the identical header file, and keep only one copy in the git source tree. The second copy may be generated during 'make', to avoid code dup while having two distinct headers. Related: I8e3359bedf973077c0a038aa04f5371a00c48fa0 (fix osmo-msc after this), I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 (mgcp_common.h) Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f --- M include/Makefile.am M include/osmocom/legacy_mgcp/mgcp.h M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_internal.h A include/osmocom/mgcp_client/mgcp_common.h M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_vty.c M tests/mgcp_client/mgcp_client_test.c 9 files changed, 94 insertions(+), 15 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index 94d74bb..0027386 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,4 +7,5 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_common.h \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcp.h b/include/osmocom/legacy_mgcp/mgcp.h index c017faf..147a0d5 100644 --- a/include/osmocom/legacy_mgcp/mgcp.h +++ b/include/osmocom/legacy_mgcp/mgcp.h @@ -177,13 +177,6 @@ MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, }; -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} - struct mgcp_config { int source_port; char *local_ip; diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index df73811..efc1f76 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -2,6 +2,8 @@ #include +#include + #define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" #define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 #define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" @@ -71,3 +73,9 @@ struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); + +extern const struct value_string mgcp_client_connection_mode_strs[]; +static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode mode) +{ + return get_value_string(mgcp_client_connection_mode_strs, mode); +} diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 1b149e2..690a4af 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -1,5 +1,7 @@ #pragma once +#include + #define MSGB_CB_MGCP_TRANS_ID 0 struct mgcp_client { diff --git a/include/osmocom/mgcp_client/mgcp_common.h b/include/osmocom/mgcp_client/mgcp_common.h new file mode 100644 index 0000000..0eb1388 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_common.h @@ -0,0 +1,71 @@ +/* MGCP common implementations. + * These are used in libosmo-mgcp as well as libosmo-mgcp-client. + * To avoid interdependency, these are implemented in .h file only. */ + +/* + * (C) 2017 by sysmocom s.f.m.c. GmbH + * (C) 2009-2012 by Holger Hans Peter Freyther + * (C) 2009-2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +/* Two copies of this file are kept in osmocom/mgcp/ and osmocom/mgcp_client/. + * Since both are by definition identical, use the old header exclusion ifdefs + * instead of '#pragma once' to avoid including both of these files. + * Though at the time of writing there are no such users, this allows including + * both libosmo-mgcp and libosmo-mgcp-client headers in the same file. */ +#ifndef OSMO_MGCP_COMMON_H +#define OSMO_MGCP_COMMON_H + +#include +#include + +#include +#include + +#define for_each_non_empty_line(line, save) \ + for (line = strtok_r(NULL, "\r\n", &save); line; \ + line = strtok_r(NULL, "\r\n", &save)) + +enum mgcp_connection_mode { + MGCP_CONN_NONE = 0, + MGCP_CONN_RECV_ONLY = 1, + MGCP_CONN_SEND_ONLY = 2, + MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, + MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, +}; + +/* Ensure that the msg->l2h is NUL terminated. */ +static inline int mgcp_msg_terminate_nul(struct msgb *msg) +{ + unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ + if (tail[-1] == '\0') + /* nothing to do */; + else if (msgb_tailroom(msg) > 0) + tail[0] = '\0'; + else if (tail[-1] == '\r' || tail[-1] == '\n') + tail[-1] = '\0'; + else { + LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " + "Length: %d, Buffer size: %d\n", + msgb_l2len(msg), msg->data_len); + return -ENOTSUP; + } + return 0; +} + +#endif diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index b17477a..a2eb2be 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -30,7 +30,6 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ - ../libosmo-legacy-mgcp/mgcp_common.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b72fc50..1cd37be 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,8 +24,6 @@ #include #include -#include -#include #include #include @@ -208,7 +206,7 @@ *data = '\0'; data ++; - for_each_line(line, data) { + for_each_non_empty_line(line, data) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -584,7 +582,7 @@ trans_id, rtp_endpoint, call_id, - mgcp_cmode_name(mode)); + mgcp_client_cmode_name(mode)); } struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp, @@ -602,7 +600,7 @@ , trans_id, rtp_endpoint, - mgcp_cmode_name(mode), + mgcp_client_cmode_name(mode), rtp_conn_addr, rtp_port); } @@ -620,3 +618,12 @@ { return &mgcp->actual; } + +const struct value_string mgcp_client_connection_mode_strs[] = { + { MGCP_CONN_NONE, "none" }, + { MGCP_CONN_RECV_SEND, "sendrecv" }, + { MGCP_CONN_SEND_ONLY, "sendonly" }, + { MGCP_CONN_RECV_ONLY, "recvonly" }, + { MGCP_CONN_LOOPBACK, "loopback" }, + { 0, NULL } +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 1e8bba6..c52803f 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -27,7 +27,6 @@ #include #include -#include #include #define MGCPGW_STR "MGCP gateway configuration for RTP streams\n" diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 6045297..f2f0e0f 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -22,7 +22,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:33:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:33:17 +0000 Subject: osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Patch Set 1: The differences between Osmo{NITB,MSC}/chapters/mncc.adoc are 32 occurences of the name OsmoNITB replaced with OsmoMSC, of the nature: The MNCC protocol of OsmoMSC has been created by the Osmocom community OsmoMSC can run in two different modes: When the internal MNCC handler is enabled, OsmoMSC will switch voice When the external MNCC handler is enabled, OsmoMSC will not perform any Those could be replaced with different phrasing like: The MNCC protocol has been created by the Osmocom community The MNCC can run in two different modes: When the internal MNCC handler is enabled, voice will be switched When the external MNCC handler is enabled, call switching will be Furthermore a reference to openbsc/mncc.h is changed to osmocom/msc/mncc.h. Could instead just drop the mismatching parent folder. see this colorized diff curl http://paste.lisp.org/display/356752/raw | less -R -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:53:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:53:17 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4012 to look at the new patch set (#2). add OsmoMSC manual Add OsmoMSC and OsmoHLR to bibliography (even though the OsmoHLR manual does not yet exist, a reference to it has been added in OsmoMSC's manual). Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee --- M Makefile A OsmoMSC/Makefile A OsmoMSC/chapters/control.adoc A OsmoMSC/chapters/mncc.adoc A OsmoMSC/chapters/net.adoc A OsmoMSC/chapters/overview.adoc A OsmoMSC/chapters/running.adoc A OsmoMSC/chapters/smpp.adoc A OsmoMSC/osmomsc-usermanual-docinfo.xml A OsmoMSC/osmomsc-usermanual.adoc A OsmoMSC/osmomsc-vty-reference.xml A OsmoMSC/vty/msc_vty_additions.xml A OsmoMSC/vty/msc_vty_reference.xml M common/chapters/bibliography.adoc 14 files changed, 4,031 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/12/4012/2 diff --git a/Makefile b/Makefile index c09dd58..ffa25de 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) + cd OsmoMSC; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -19,6 +20,7 @@ cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean + cd OsmoMSC; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -30,6 +32,7 @@ cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload + cd OsmoMSC; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -42,6 +45,7 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + cd OsmoMSC; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile new file mode 100644 index 0000000..febf7d1 --- /dev/null +++ b/OsmoMSC/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +msc_reference = $(topdir)/osmomsc-vty-reference.xml +manuals = $(msc_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmomsc-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmomsc-usermanual__*.svg + -rm osmomsc-usermanual__*.png + -rm osmomsc-usermanual.check + +generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/msc_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/msc_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging MSC VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting MSC VTY to DocBook) diff --git a/OsmoMSC/chapters/control.adoc b/OsmoMSC/chapters/control.adoc new file mode 100644 index 0000000..af03be7 --- /dev/null +++ b/OsmoMSC/chapters/control.adoc @@ -0,0 +1,31 @@ +[[control]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoMSC. + +.Variables available on OsmoMSC's Control interface +[options="header",width="100%",cols="20%,5%,5%,50%,20%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber-list-active-v1|RO|No||Return list of active subscribers. +|=== + +=== subscriber-list-active-v1 + +Return a list of subscribers that are successfully attached (including full +successful authentication and ciphering if those are enabled). + +The reply comprises of one subscriber per line, of the format + +---- +,\n[,\n[...]] +---- + +For example: + +---- +901700000015252,22801 +901700000015253,22802 +---- diff --git a/OsmoMSC/chapters/mncc.adoc b/OsmoMSC/chapters/mncc.adoc new file mode 100644 index 0000000..a2e7379 --- /dev/null +++ b/OsmoMSC/chapters/mncc.adoc @@ -0,0 +1,206 @@ +[[mncc]] +== MNCC for External Call Control + +The 3GPP GSM specifications define an interface point (service access +point) inside the MSC between the call-control part and the rest of the +system. This service access point is called the MNCC-SAP. It is +described in _3GPP TS 24.007_ <<3gpp-ts-24-007>> Chapter 7.1. + +However, like for all internal interfaces, 3GPP does not give any +specific encoding for the primitives passed at this SAP. + +The MNCC protocol of OsmoMSC has been created by the Osmocom community +and allows to control the call handling and audio processing by an +external application. The interface is currently exposed using Unix +Domain Sockets. The protocol is defined in the `mncc.h` header file. + +OsmoMSC can run in two different modes: + +. with internal MNCC handler +. with external MNCC handler + +=== Internal MNCC handler + +When the internal MNCC handler is enabled, OsmoMSC will switch voice +calls between GSM subscribers internally and automatically based on +the subscribers __extension__ number. No external software is required. + +NOTE: Internal MNCC is the default behavior. + +==== Internal MNCC Configuration + +The internal MNCC handler offers some configuration parameters under the +`mncc-int` VTY configuration node. + +===== `default-codec tch-f (fr|efr|amr)` + +Using this command, you can configure the default voice codec to be used +by voice calls on TCH/F channels. + +===== `default-codec tch-h (hr|amr)` + +Using this command, you can configure the default voice codec to be used +by voice calls on TCH/H channels. + +[[mncc-external]] +=== External MNCC handler + +When the external MNCC handler is enabled, OsmoMSC will not perform any +internal call switching, but delegate all call-control handling towards +the external MNCC program connected via the MNCC socket. + +If you intend to operate OsmoMSC with external MNCC handler, you have +to start it with the `-m` or `--mncc-sock` command line option. + +At the time of this writing, the only external application implementing +the MNCC interface compatible with the OsmoMSC MNCC socket was `lcr`, +the Linux Call Router. + +=== MNCC protocol description + +The protocol follows the primitives specified in 3GPP TS 04.07 Chapter 7.1. +The encoding of the primitives is provided in the `osmocom/msc/mncc.h` header +file, which uses some common definitions from `osmocom/gsm/mncc.h` (part of +libosmocore.git). + +However, OsmoMSC MNCC specifies a number of additional primitives +beyond those listed in the 3GPP specification. + +The different calls in the network are distinguished by their callref +(call reference), which is a unique unsigned 32bit integer. + +==== MNCC_HOLD_IND + +Direction: MSC -> Handler + +A 'CC HOLD' message was received from the MS. + +==== MNCC_HOLD_CNF + +Direction: Handler -> MSC + +Acknowledge a previously-received 'CC HOLD' message, causes the +transmission of a 'CC HOLD ACK' message to the MS. + +==== MNCC_HOLD_REJ + +Direction: Handler -> MSC + +Reject a previously-received 'CC HOLD' message, causes the +transmission of a 'CC HOLD REJ' message to the MS. + +==== MNCC_RETRIEVE_IND + +Direction: MSC -> Handler + +A 'CC RETRIEVE' message was received from the MS. + +==== MNCC_RETRIEVE_CNF + +Direction: Handler -> MSC + +Acknowledge a previously-received 'CC RETRIEVE' message, causes the +transmission of a 'CC RETRIEVE ACK' message to the MS. + +==== MNCC_RETRIEVE_REJ + +Direction: Handler -> MSC + +Reject a previously-received 'CC RETRIEVE' message, causes the +transmission of a 'CC RETRIEVE REJ' message to the MS. + +==== MNCC_USERINFO_REQ + +Direction: MSC -> Handler + +Causes a 'CC USER INFO' message to be sent to the MS. + +==== MNCC_USERINFO_IND + +Direction: MSC -> Handler + +Indicates that a 'CC USER-USER' message has been received from the MS. + +==== MNCC_BRIDGE + +Direction: Handler -> MSC + +Requests that the TCH (voice) channels of two calls shall be +inter-connected. This is the old-fashioned way of using MNCC, +primarily required for circuit-switched BTSs whose TRAU frames are +received via an E1 interface card on the MSC machine. + +==== MNCC_FRAME_RECV + +Direction: Handler -> MSC + +Enable the forwarding of TCHF voice frames via the MNCC interface in +MSC->Handler direction for the specified call. + +==== MNCC_FRAME_DROP + +Direction: Handler -> MSC + +Disable the forwarding of TCHF voice frames via the MNCC interface in +MSC->Handler direction for the specified call. + +==== MNCC_LCHAN_MODIFY + +Direction: Handler -> MSC + +Modify the current dedicated radio channel from signalling to voice, or +if it is a signalling-only channel (SDCCH), assign a TCH to the MS. + +==== MNCC_RTP_CREATE + +Direction: Handler -> MSC + +Create a RTP socket for this call at the BTS/TRAU that serves this BTS. + +==== MNCC_RTP_CONNECT + +Direction: Handler -> MSC + +Connect the RTP socket of this call to the given remote IP address and +port. + +==== MNCC_RTP_FREE + +Direction: Handler -> MSC + +Release a RTP connection for one given call. + +==== GSM_TCHF_FRAME + +Direction: both + +Transfer the payload of a GSM Full-Rate (FR) voice frame between the +MSC and an external MNCC handler. + +==== GSM_TCHF_FRAME_EFR + +Direction: both + +Transfer the payload of a GSM Enhanced Full-Rate (EFR) voice frame +between the MSC and an external MNCC handler. + +==== GSM_TCHH_FRAME + +Direction: both + +Transfer the payload of a GSM Half-Rate (HR) voice frame between the +MSC and an external MNCC handler. + +==== GSM_TCH_FRAE_AMR + +Direction: both + +Transfer the payload of a GSM Adaptive-Multi-Rate (AMR) voice frame +between the MSC and an external MNCC handler. + +==== GSM_BAD_FRAME + +Direction: MSC -> Handler + +Indicate that no valid voice frame, but a 'bad frame' was received over +the radio link from the MS. diff --git a/OsmoMSC/chapters/net.adoc b/OsmoMSC/chapters/net.adoc new file mode 100644 index 0000000..06be4ba --- /dev/null +++ b/OsmoMSC/chapters/net.adoc @@ -0,0 +1,154 @@ +[[net]] +== Configuring the Core Network + +The core network parameters are configured by the config file (as in `osmo-msc +-c osmo-msc.cfg`). The config file is parsed by the VTY, which is also +available via telnet in the running `osmo-msc` instance. Be aware that even +though you may be able to change these parameters without restarting +`osmo-msc`, some may not take immediate effect, and it is safest to use the +config file to have these parameters set at startup time. + +The core network parameters are found in the `config` / `network`. + +A full reference to the available commands can be found in the _OsmoMSC VTY +reference manual_ <>. This section describes only the most +commonly used settings. + +Here is an overview of the config items, described in more detail below: + +---- +network + network country code 262 + mobile network code 89 + mm info 1 + short name OsmoMSC + long name OsmoMSC + authentication required + encryption a5 3 +---- + +[TIP] +==== +Use the telnet VTY interface to query the current configuration of a running +`osmo-msc` process: + +---- +$ telnet localhost 4254 +OsmoMSC> enable +OsmoMSC# show running-config +---- + +Some parameters may be changed without restarting `osmo-msc`. To reach the +`network` node, enter: + +---- +OsmoMSC> enable +OsmoMSC# configure terminal +OsmoMSC(config)# network +OsmoMSC(config-net)# short name Example-Name +OsmoMSC(config-net)# exit +OsmoMSC(config)# +---- + +The telnet VTY features tab-completion as well as context sensitive help shown +when entering a `?` question mark. + +You can always use the `list` VTY command or enter `?` on the blank prompt to +get a list of all possible commands at the current node. +==== + + +=== MCC/MNC + +The key identities of every GSM PLMN is the Mobile Country Code and the Mobile +Network Code. They are identical over the entire network. In most cases, the +MCC/MNC will be allocated to the operator by the respective local regulatory +authority. For example, to set the MCC/MNC of 262-89, have this in your +osmo-msc.cfg: + +---- +network + network country code 262 + mobile network code 89 +---- + + +=== Configuring MM INFO + +The _MM INFO_ procedure can be used after a successful _LOCATION UPDATE_ in +order to transmit the human-readable network name as well as local time zone +information to the MS. By default, _MM INFO_ is not active, i.e. `0`. Set to `1` +to activate this feature: + +---- +network + mm info 1 + short name OsmoMSC + long name OsmoMSC +---- + +[NOTE] +==== +Not all phones support the MM INFO procedure. If a phone is not +factory-programmed to contain the name for your MCC/MNC, it will likely only +provide a numeric display of the network name, such as _262-89_, or show the +country code transformed into a letter, such as _D 89_. +==== + +The time information transmitted is determined by the local system time of the +operating system on which OsmoMSC is running. + + +=== Authentication + +Authorized subscribers must be entered in the HLR database, see the _OsmoHLR +reference manual_ <>. If authentication tokens (such as KI for +2G, or K and OP/OPC for UMTS) are present in the HLR, OsmoMSC will only attach +a subscriber after successful authentication. + +If no authentication keys are present in the HLR for a given subscriber, +OsmoMSC will attach the subscriber _without_ authentication. You can reject +subscribers that lack authentication info in the HLR with this setting: + +---- +network + authentication required +---- + +=== Ciphering + +To enable ciphering on the radio link, authentication must take place first: +the Kc resulting from authentication is the key used for ciphering. Hence, all +subscribers must have authentication tokens available in the HLR for ciphering. + +The MS, BTS and MSC must agree on a ciphering algorithm to use. + +- The MS sends its supported ciphering algorithms via Classmark IEs during + Location Updating. +- Typically the BSC needs to know which A5 ciphers are supported by connected + BTSes. +- Finally, OsmoMSC may impose that specific A5 ciphers shall not be considered. + +It is the responsibility of the BSC to then pick an A5 cipher that satisfies +all requirements. + +- In OsmoMSC, A5/0 means that ciphering is turned off. ++ +---- +network + encryption a5 0 +---- + +- A5/1 and A5/3 are currently supported by Osmocom. ++ +---- +network + encryption a5 3 +---- + +- Never use A5/2: it is an "export grade cipher" and has been deprecated for + its low ciphering strength. + +NOTE: At the time of writing, OsmoMSC supports setting only a single A5 cipher, +while it should be able to allow a set of ciphers. This is subject to ongoing +development. diff --git a/OsmoMSC/chapters/overview.adoc b/OsmoMSC/chapters/overview.adoc new file mode 100644 index 0000000..0bb47d7 --- /dev/null +++ b/OsmoMSC/chapters/overview.adoc @@ -0,0 +1,127 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoMSC. It will cover +aspects of configuring and running the OsmoMSC. + +[[intro_overview]] +=== About OsmoMSC + +OsmoMSC is the Osmocom implementation of a Mobile Switching Center (MSC) for 2G +and 3G GSM and UMTS mobile networks. Its interfaces are: + +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. + +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. +Before it was split off, OsmoMSC originated from libmsc of the old openbsc.git. +Since a true _A_ interface and IuCS for 3G support is available, OsmoMSC +exists only as a separate standalone entity. + +Key differences of the new OsmoMSC compared to the old OsmoNITB are: + +- The complete VLR implementation that communicates with the separate HLR + (OsmoHLR) for subscriber management. In contrast to the OsmoNITB, HLR queries + are fully asynchronous, and the separate HLR allows using centralized + subscriber management for both circuit-switched and packet-switched domains + (i.e. one OsmoHLR for both OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- Addition of a true _A_ interface for 2G voice services. Previously, OsmoBSC + had an SCCPlite based _A_ interface towards 3rd party MSC implementations. + OsmoMSC features a true SCCP/M3UA _A_ interface, which allows running OsmoBSC + against this Osmocom based MSC implementation. The new SCCP/M3UA SIGTRAN for + the _A_ interface is implemented in libosmo-sccp, which is used by OsmoMSC + and OsmoBSC (and others), to establish a link via an STP (e.g. OsmoSTP). + +- Addition of an _IuCS_ interface to allow operating 3G voice services, also + via SCCP/M3UA SIGTRAN, for example connecting via OsmoHNBGW to a 3G small + cell device. + +Find the OsmoMSC issue tracker and wiki online at + +- https://osmocom.org/projects/osmomsc +- https://osmocom.org/projects/osmomsc/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoMSC +[graphviz] +---- +digraph G { + rankdir=LR; + MS0 [label="MS"] + MS1 [label="MS"] + MS2 [label="MS"] + MS3 [label="MS"] + UE0 [label="UE"] + UE1 [label="UE"] + BTS0 [label="BTS"] + BTS1 [label="BTS"] + STP [label="STP\n(SCCP routing)"] + HLR [label="HLR+AUC+EIR"] + HNB [label="RNC or hNodeB"] + MGW + MS0->BTS0 [label="Um"] + MS1->BTS0 [label="Um"] + MS2->BTS1 [label="Um"] + MS3->BTS1 [label="Um"] + UE0->HNB + UE1->HNB + BTS0->BSC [label="Abis"] + BTS1->BSC [label="Abis"] + BSC->STP [label="A/SCCP/M3UA"] + STP->MSC [label="A/SCCP/M3UA"] + STP->MSC [label="IuCS/SCCP/M3UA"] + VLR->HLR [label="GSUP"] + HNB->HNBGW [label="Iuh"] + HNBGW->STP [label="IuCS/SCCP/M3UA"] + MSC->MGW [label="MGCP"] + BTS0->MGW [label="RTP"] + BTS1->MGW [label="RTP"] + subgraph cluster_msc { + label = "OsmoMSC"; + MSC->SMSC; + MSC->VLR + } +} +---- + + +=== Software Components + +This is a brief description of OsmoMSC's internal software components. + +==== SMSC + +A minimal store-and-forward server for SMS, supporting both MO and MT +SMS service, as well as multi-part messages. + +The built-in SMSC also supports an external SMSC interface. For more +information, see <>. + +==== MSC + +The MSC component implements the mobility management (MM) functions of the TS +04.08 and delegates to SMSC for SMS message handling and the VLR for subscriber +management. + +Furthermore, it can handle TS 04.08 Call Control (CC), either by use of +an internal MNCC handler, or by use of an external MNCC agent. For more +information see <>. + +==== VLR + +A fully featured Visitor Location Register handles the subscriber management +and authentication, and interfaces via GSUP to the external HLR. diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc new file mode 100644 index 0000000..3caa2a0 --- /dev/null +++ b/OsmoMSC/chapters/running.adoc @@ -0,0 +1,149 @@ +== Running OsmoMSC + +The OsmoMSC executable (`osmo-msc`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-msc* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] [-M 'SOCKETPATH'] [-C] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as HLR/AUC + storage +*-M, --mncc-sock-path*:: + Enable the MNCC socket for an external MNCC handler. See + <> for further information. +*-m, --mncc-sock*:: + Same as option -M (deprecated). +*-C, --no-dbcounter*:: + Disable the regular periodic synchronization of statistics + counters to the database. + + +=== Multiple instances + +Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, +CTRL) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different IP +addresses. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +If external SMPP is enabled, you may bind it to a different interface using: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 +---- + +More on SMPP configuration in <>. + +The external MNCC handler is configured by the `--mncc-sock` commandline +argument. Choose a different such socket path for each OsmoMSC instance running +on the same file system. See more in <>. + +For the following links, OsmoMSC acts as a client and does not listen/bind to a +specific interface, and will hence not encounter conflicts for multiple instances +running on the same interface: + +- The SCCP/M3UA links are established by OsmoMSC contacting an STP. +- The GSUP link is established by OsmoMSC contacting an HLR. + + +=== Configure primary links + +==== Configure SCCP/M3UA to accept _A_ and _IuCS_ links + +OsmoMSC will contact an STP instance to establish an SCCP/M3UA link. BSC and +HNBGW will then reach the MSC via this link. By default, an STP instance is +assumed to listen on the default M3UA port (2905) on the local host. + +Establishing an SCCP/M3UA link towards an STP instance not on the local host +can be configured as follows: + +---- +cs7 instance 0 + asp my-OsmoMSC 2905 0 m3ua + ! IP address of the remote STP: + remote-ip 10.23.24.1 +---- + +Note that _A_ and _IuCS_ may use different SCCP instances, if so desired: + +---- +cs7 instance 0 + asp my-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.42.1 +cs7 instance 1 + asp my-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.42.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 +---- + +A full configuration needs an `asp` on an `as` -- an Application Server Process +running on an Application Server -- as well as a local point code and routing +configuration. The SCCP VTY automatically creates those parts that are missing, +by assuming sane defaults. A complete configuration would look like this: + +---- +cs7 instance 0 + point-code 0.23.1 + asp my-OsmoMSC-A-Iu 2905 0 m3ua + remote-ip 127.0.0.1 + as my-as-for-OsmoMSC-A-Iu m3ua + asp my-OsmoMSC-A-Iu + routing-key 0 0.23.1 +---- + +==== Configure GSUP to reach the HLR + +OsmoMSC will assume a GSUP server (OsmoHLR) to run on the local host and the +default GSUP port (4222). Contacting an HLR at a different IP address can be +configured as follows: + +---- +hlr + ! IP address of the remote HLR: + remote-ip 10.23.42.1 + ! default port is 4222, optionally configurable by: + remote-port 1234 +---- diff --git a/OsmoMSC/chapters/smpp.adoc b/OsmoMSC/chapters/smpp.adoc new file mode 100644 index 0000000..aab5a2c --- /dev/null +++ b/OsmoMSC/chapters/smpp.adoc @@ -0,0 +1,147 @@ +[[smpp]] +== Short Message Peer to Peer (SMPP) + +In OsmoMSC, the _Short Message Peer to Peer_ (SMPP) Protocol <> +interface allows sending MT-SMS to an attached subscriber or receiving unrouted +MO-SMS. OsmoMSC implements version 3.4 of the protocol. + +NOTE: `osmo-msc` must have been compiled with the `--enable-smpp` configure +option to offer the SMPP interface. + +Multiple ESMEs (External SMS Entities) may interact with an SMSC (SMS Service +Center) via the SMPP protocol. Each entity is identified by its System Id, a +character string which is configured by the system administrator. + +OsmoMSC implements the SMSC side of SMPP and acts as a TCP server accepting +incoming connections from ESME client programs. + +Each ESME identifies itself to the SMSC with its system-id and an +optional shared password. + + +[[smpp-config-global]] +=== Global SMPP configuration + +Configure OsmoMSC's SMPP behavior at the top-level `smpp` VTY node, for +example: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 + system-id osmomsc123 + policy closed + no smpp-first +---- + +Use the `local-tcp-ip` command to define the TCP IP and port at which the +OsmoMSC internal SMSC should listen for incoming SMPP connections. The default +is to listen on all IPs (0.0.0.0) and the default port assigned to SMPP (2775). + +Use the `system-id` command to define the System ID of the SMSC. + +Use the `policy` parameter to define whether only explicitly configured +ESMEs are permitted to access the SMSC (`closed`), or whether any +ESME should be accepted (`accept-all`). + +Use the `smpp-first` command to define if SMPP routes have higher precedence +than MSISDNs contained in the HLR, or `no smpp-first` if only MSISDNs not +present in the HLR should be considered for routing to SMPP. + + +[[esme]] +=== ESME configuration + +Under the `smpp` vty node, you can add any number of `esme` nodes, one +for each ESME that you wish to configure. For example: + +---- +smpp + policy closed + no smpp-first + esme example1 + password s3cr3t + default-route + deliver-src-imsi + osmocom-extensions + esme example2 + password p4ssw0rd + deliver-src-imsi + osmocom-extensions + route prefix national isdn 2342 +---- + +Use the `esme NAME` command (where NAME corresponds to the system-id of +the ESME to be configured) under the SMPP vty node to enter the +configuration node for this given ESME. + +Use the `password` command to specify the password (if any) for the +ESME. + +Use the `default-route` command to indicate that any MO-SMS without a +more specific route should be routed to this ESME. + +Use the `deliver-src-imsi` command to indicate that the SMPP DELIVER +messages for MO SMS and the SMPP ALERT should state the IMSI (rather +than the MSISDN) as source address. + +Use the `osmocom-extensions` command to request that Osmocom specific +extension TLVs shall be included in the SMPP PDUs. Those extensions +include the ARFCN of the cell, the L1 transmit power of the MS, the +timing advance, the uplink and dwnlink RxLev and RxQual, as well as the +IMEI of the terminal at the time of generating the SMPP DELIVER PDU. + +Use the `dcs-transparent` command to transparently pass the DCS value +from the SMS Layer3 protocols to SMPP, instead of converting them to the +SMPP-specific values. + +Use the `route prefix` command to specify a route towards this ESME. +Using routes, you specify which destination MSISDNs should be routed +towards your ESME. + + +=== Osmocom SMPP protocol extensions + +Osmocom has implemented some extensions to the SMPP v3.4 protocol. + +These extensions can be enabled using the `osmocom-extensions` VTY +command at `esme` level, see <>. + +The TLV definitions can be found in the +`` header file provided by +libosmocore. + +==== RF channel measuremets + +When the Osmocom SMPP extensions are enabled, we add the following +TLVs to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length (Octets) | Purpose +| TLVID_osmo_arfcn | 0x2300 | 2 | GSM ARFCN of the radio interface +| TLVID_osmo_ta | 0x2301 | 1 | Timing Advance on the radio interface +| TLVID_osmo_ms_l1_txpwr | 0x2307 | 1 | Transmit Power of the MS in uplink direction +| TLVID_osmo_rxlev_ul | 0x2302 | 2 | Uplink receive level as measured by BTS in dBm (int16_t) +| TLVID_osmo_rxqual_ul | 0x2303 | 1 | Uplink RxQual value as measured by BTS +| TLVID_osmo_rxlev_dl | 0x2304 | 2 | Downlink receive level as measured by MS in dBm (int16_t) +| TLVID_osmo_rxqual_dl | 0x2305 | 1 | Downlink RxQual value as measured by MS +|=== + +All of the above values reflect the *last measurement report* as +recieved vi A-bis RSL from the BTS. It is thus a snapshot value (of +the average within one 480ms SACCH period), and not an average over +all the SACCH periods during which the channel was open or the SMS was +received. Not all measurement reports contain all the values. So you +might not get an TLVID_osmo_rxlev_dl IE, as that particular uplink +frame might habe benn lost for the given snapshot we report. + +==== Equipment IMEI + +If we know the IMEI of the subscribers phone, we add the following TLV +to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length | Purpose +| TLVID_osmo_imei | 0x2306 | variable | IMEI of the subscibers phone (ME) +|=== diff --git a/OsmoMSC/osmomsc-usermanual-docinfo.xml b/OsmoMSC/osmomsc-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc new file mode 100644 index 0000000..6c54065 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -0,0 +1,35 @@ +:gfdl-enabled: + +OsmoMSC User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/net.adoc[] + +include::chapters/smpp.adoc[] + +include::../common/chapters/mncc.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoMSC/osmomsc-vty-reference.xml b/OsmoMSC/osmomsc-vty-reference.xml new file mode 100644 index 0000000..a954b84 --- /dev/null +++ b/OsmoMSC/osmomsc-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoMSC VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoMSC/vty/msc_vty_additions.xml b/OsmoMSC/vty/msc_vty_additions.xml new file mode 100644 index 0000000..0d473bd --- /dev/null +++ b/OsmoMSC/vty/msc_vty_additions.xml @@ -0,0 +1,24 @@ + + + + MNCC Internal Configuration + This node allows to configure the default codecs for + the internal call control handling. + + + + SMPP Configuration + This node allows to configure the SMPP interface + for interfacing with external SMS applications. This section + contains generic/common SMPP related configuration, and no + per-ESME specific parameters. + + + + ESME Configuration + This node allows to configure one particular SMPP + ESME, which is an External SMS Entity such as a SMS based + application server. You can define any number of ESME within + the SMPP node of the OsmoNITB VTY. + + diff --git a/OsmoMSC/vty/msc_vty_reference.xml b/OsmoMSC/vty/msc_vty_reference.xml new file mode 100644 index 0000000..b7311ab --- /dev/null +++ b/OsmoMSC/vty/msc_vty_reference.xml @@ -0,0 +1,3019 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index a3c6436..e417d02 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -14,6 +14,14 @@ http://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf - [[[vty-ref-osmobsc]]] Osmocom Project: OsmoBSC VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf +- [[[userman-osmomsc]]] Osmocom Project: OsmoMSC User Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-usermanual.pdf +- [[[vty-ref-osmomsc]]] Osmocom Project: OsmoMSC VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-vty-reference.pdf +- [[[userman-osmohlr]]] Osmocom Project: OsmoHLR User Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-usermanual.pdf +- [[[vty-ref-osmohlr]]] Osmocom Project: OsmoHLR VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-vty-reference.pdf - [[[userman-osmopcu]]] Osmocom Project: OsmoPCU User Manual. http://ftp.osmocom.org/docs/latest/osmopcu-usermanual.pdf - [[[vty-ref-osmopcu]]] Osmocom Project: OsmoPCU VTY Reference Manual. -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:53:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:53:20 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: move mncc.adoc to common chapters Message-ID: Review at https://gerrit.osmocom.org/4051 move mncc.adoc to common chapters Upcoming OsmoMSC will reference the same, hence MNCC becomes a common chapter. Move the file and adjust various wording to include OsmoMSC. Change-Id: I404758ff7f1372e841ffe33c75455f513fff3caf --- M OsmoNITB/osmonitb-usermanual.adoc R common/chapters/mncc.adoc 2 files changed, 51 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/51/4051/1 diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 0d6fa7e..7d342c5 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -29,7 +29,7 @@ include::chapters/smpp.adoc[] -include::chapters/mncc.adoc[] +include::../common/chapters/mncc.adoc[] include::../common/chapters/control_if.adoc[] diff --git a/OsmoNITB/chapters/mncc.adoc b/common/chapters/mncc.adoc similarity index 65% rename from OsmoNITB/chapters/mncc.adoc rename to common/chapters/mncc.adoc index 504ce09..47dfcbe 100644 --- a/OsmoNITB/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -1,5 +1,5 @@ [[mncc]] -== MNCC for external Call Control +== MNCC for External Call Control The 3GPP GSM specifications define an interface point (service access point) inside the MSC between the call-control part and the rest of the @@ -9,21 +9,24 @@ However, like for all internal interfaces, 3GPP does not give any specific encoding for the primitives passed at this SAP. -The MNCC protocol of OsmoNITB has been created by the Osmocom community +The MNCC protocol has been created by the Osmocom community and allows to control the call handling and audio processing by an external application. The interface is currently exposed using Unix Domain Sockets. The protocol is defined in the `mncc.h` header file. -OsmoNITB can run in two different modes: +It is exposed by the Osmocom MSC layer (both in the old OsmoNITB as well as the +new OsmoMSC. + +Osmocom's MSCs can run in two different modes: . with internal MNCC handler . with external MNCC handler === Internal MNCC handler -When the internal MNCC handler is enabled, OsmoNITB will switch voice -calls between GSM subscribers internally and automatically based on -the subscribers __extension__ number. No external software is required. +When the internal MNCC handler is enabled, OsmoMSC/OsmoNITB will switch voice +calls between GSM subscribers internally and automatically based on the +subscribers __extension__ number. No external software is required. NOTE: Internal MNCC is the default behavior. @@ -42,131 +45,135 @@ Using this command, you can configure the default voice codec to be used by voice calls on TCH/H channels. +[[mncc-external]] === External MNCC handler -When the external MNCC handler is enabled, OsmoNITB will not perform any -internal call switching, but delegate all call-control handling towards -the external MNCC program connected via the MNCC socket. +When the external MNCC handler is enabled, OsmoMSC/OsmoNITB will not perform +any internal call switching, but delegate all call-control handling towards the +external MNCC program connected via the MNCC socket. -If you intend to operate OsmoNITB with external MNCC handler, you have +If you intend to operate with external MNCC handler, you have to start it with the `-m` or `--mncc-sock` command line option. -At the time of this writing, the only external application implementing -the MNCC interface compatible with the OsmoNITB MNCC socket was `lcr`, -the Linux Call Router. +At the time of this writing, the only external application implementing the +MNCC interface compatible with the Osmocom MNCC socket is `lcr`, the Linux Call +Router. More widespread integration of external call routing is available via +the OsmoSIPConnector. === MNCC protocol description -The protocol follows the primitives specified in 3GPP TS 04.07 Chapter -7.1. The encoding of the primitives is provided in the `openbsc/mncc.h` -header file, which uses some common definitions from -`osmocom/gsm/mncc.h` (part of libosmocore.git). +The protocol follows the primitives specified in 3GPP TS 04.07 Chapter 7.1. +The encoding of the primitives is provided in the `mncc.h` header file +(`osmocom/msc/mncc.h` in `osmo-msc.git` or `openbsc/mncc.h` in old +`openbsc.git`), which uses some common definitions from `osmocom/gsm/mncc.h` +(part of `libosmocore.git`). -However, OsmoNITB MNCC specifies a number of additional primitives -beyond those listed in the 3GPP specification. +However, Osmocom's MNCC specifies a number of additional primitives beyond +those listed in the 3GPP specification. The different calls in the network are distinguished by their callref (call reference), which is a unique unsigned 32bit integer. +NOTE: _MSC_ below refers to both OsmoMSC and _libmsc_ of the OsmoNITB. + ==== MNCC_HOLD_IND -Direction: NITB -> Handler +Direction: MSC -> Handler A 'CC HOLD' message was received from the MS. ==== MNCC_HOLD_CNF -Direction: Handler -> NITB +Direction: Handler -> MSC Acknowledge a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD ACK' message to the MS. ==== MNCC_HOLD_REJ -Direction: Handler -> NITB +Direction: Handler -> MSC Reject a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD REJ' message to the MS. ==== MNCC_RETRIEVE_IND -Direction: NITB -> Handler +Direction: MSC -> Handler A 'CC RETRIEVE' message was received from the MS. ==== MNCC_RETRIEVE_CNF -Direction: Handler -> NITB +Direction: Handler -> MSC Acknowledge a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE ACK' message to the MS. - ==== MNCC_RETRIEVE_REJ -Direction: Handler -> NITB +Direction: Handler -> MSC Reject a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE REJ' message to the MS. ==== MNCC_USERINFO_REQ -Direction: NITB -> Handler +Direction: MSC -> Handler Causes a 'CC USER INFO' message to be sent to the MS. ==== MNCC_USERINFO_IND -Direction: NITB -> Handler +Direction: MSC -> Handler Indicates that a 'CC USER-USER' message has been received from the MS. ==== MNCC_BRIDGE -Direction: Handler -> NITB +Direction: Handler -> MSC Requests that the TCH (voice) channels of two calls shall be inter-connected. This is the old-fashioned way of using MNCC, primarily required for circuit-switched BTSs whose TRAU frames are -received via an E1 interface card on the NITB machine. +received via an E1 interface card on the MSC machine. ==== MNCC_FRAME_RECV -Direction: Handler -> NITB +Direction: Handler -> MSC Enable the forwarding of TCHF voice frames via the MNCC interface in -NITB->Handler direction for the specified call. +MSC->Handler direction for the specified call. ==== MNCC_FRAME_DROP -Direction: Handler -> NITB +Direction: Handler -> MSC Disable the forwarding of TCHF voice frames via the MNCC interface in -NITB->Handler direction for the specified call. +MSC->Handler direction for the specified call. ==== MNCC_LCHAN_MODIFY -Direction: Handler -> NITB +Direction: Handler -> MSC Modify the current dedicated radio channel from signalling to voice, or if it is a signalling-only channel (SDCCH), assign a TCH to the MS. ==== MNCC_RTP_CREATE -Direction: Handler -> NITB +Direction: Handler -> MSC Create a RTP socket for this call at the BTS/TRAU that serves this BTS. ==== MNCC_RTP_CONNECT -Direction: Handler -> NITB +Direction: Handler -> MSC Connect the RTP socket of this call to the given remote IP address and port. ==== MNCC_RTP_FREE -Direction: Handler -> NITB +Direction: Handler -> MSC Release a RTP connection for one given call. @@ -175,32 +182,32 @@ Direction: both Transfer the payload of a GSM Full-Rate (FR) voice frame between the -NITB and an external MNCC handler. +MSC and an external MNCC handler. ==== GSM_TCHF_FRAME_EFR Direction: both Transfer the payload of a GSM Enhanced Full-Rate (EFR) voice frame -between the NITB and an external MNCC handler. +between the MSC and an external MNCC handler. ==== GSM_TCHH_FRAME Direction: both Transfer the payload of a GSM Half-Rate (HR) voice frame between the -NITB and an external MNCC handler. +MSC and an external MNCC handler. ==== GSM_TCH_FRAE_AMR Direction: both Transfer the payload of a GSM Adaptive-Multi-Rate (AMR) voice frame -between the NITB and an external MNCC handler. +between the MSC and an external MNCC handler. ==== GSM_BAD_FRAME -Direction: NITB -> Handler +Direction: MSC -> Handler Indicate that no valid voice frame, but a 'bad frame' was received over the radio link from the MS. -- To view, visit https://gerrit.osmocom.org/4051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I404758ff7f1372e841ffe33c75455f513fff3caf Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:54:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:54:08 +0000 Subject: osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Patch Set 2: ok, moved mncc.adoc to common in a separate patch to prepare this patch, G#4051 -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:54:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:54:27 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: fix various grammar and typos in: preface, cell-broadcast In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix various grammar and typos in: preface, cell-broadcast ...................................................................... fix various grammar and typos in: preface, cell-broadcast Change-Id: I0c61ad0e824b0d62bb9332f2208b247d3852dbb5 --- M common/chapters/cell-broadcast.adoc M common/chapters/preface.adoc 2 files changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/cell-broadcast.adoc b/common/chapters/cell-broadcast.adoc index d439128..a87efae 100644 --- a/common/chapters/cell-broadcast.adoc +++ b/common/chapters/cell-broadcast.adoc @@ -46,7 +46,7 @@ include::osmocom-cbs.msc[] ---- -==== What'a miaaing +==== What's missing What's missing (for production operation in larger networks) diff --git a/common/chapters/preface.adoc b/common/chapters/preface.adoc index 975dcca..d85e318 100644 --- a/common/chapters/preface.adoc +++ b/common/chapters/preface.adoc @@ -133,24 +133,24 @@ Some of the founders of the Osmocom project have established sysmocom as a company to provide products and services related to Osmocom. -sysmocom and its staff are the by far the largest developers and -contributors to the Osmocom mobile network infrastructure projects. +sysmocom and its staff have by far contributed the largest part of development +and maintenance to the Osmocom mobile network infrastructure projects. As part of this work, sysmocom has also created the manual you are reading. At sysmocom, we draw a clear line between what is the Osmocom FOSS project, and what is sysmocom as a commercial entity. Under no -circumstances requires participation in the FOSS projects any commercial +circumstances does participation in the FOSS projects require any commercial relationship with sysmocom as a company. === Corrections -We have prepared this manual in the hope it will guide you through the +We have prepared this manual in the hope that it will guide you through the process of installing, configuring and debugging your deployment of cellular network infrastructure elements using Osmocom software. If -you do find errors, mistakes and/or omissions, or have any suggestions +you do find errors, typos and/or omissions, or have any suggestions on missing topics, please do take the extra time and let us know. @@ -248,7 +248,7 @@ Osmocom software or those of traditional telecom suppliers. GSM knowledge has many different fields, from radio planning through -site installation through to core network configuration/administration. +site installation to core network configuration/administration. The detailed skills required will depend on the type of installation and/or deployment that you are planning, as well as its associated -- To view, visit https://gerrit.osmocom.org/4013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c61ad0e824b0d62bb9332f2208b247d3852dbb5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:54:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:54:39 +0000 Subject: osmo-msc[master]: fix build: remove obsolete header legacy_mgcp/mgcp.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e3359bedf973077c0a038aa04f5371a00c48fa0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:54:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:54:41 +0000 Subject: [MERGED] osmo-msc[master]: fix build: remove obsolete header legacy_mgcp/mgcp.h In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix build: remove obsolete header legacy_mgcp/mgcp.h ...................................................................... fix build: remove obsolete header legacy_mgcp/mgcp.h Since Ifb8f3fc2b399662a9dbba174e942352a1a21df3f libosmo-mgcp-client has its own definitions in mgcp_common.h, which conflict with legacy_mgcp/mgcp.h. This cross-inclusion to support libosmo-mgcp-client is no longer necessary. In the future, including libosmo-mgcp-client together with libosmo-mgcp will be made possible, but not with libosmo-legacy-mgcp (because we don't care enough). That is why including libosmo-legacy-mgcp headers would cause build failure. Depends: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f Change-Id: I8e3359bedf973077c0a038aa04f5371a00c48fa0 --- M src/libmsc/msc_ifaces.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 1c8e5ef..e29fe0e 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/4050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e3359bedf973077c0a038aa04f5371a00c48fa0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:56:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:56:05 +0000 Subject: python/osmo-python-tests[master]: osmodumpdoc: fix finding cfg when not calling from source tree In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/3974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:56:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:56:31 +0000 Subject: python/osmo-python-tests[master]: osmodumpdoc: print called commands and OSError messages In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/3975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib044cbb8a1b8e02cbe6852f785c75b5c7aae6174 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:56:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:56:49 +0000 Subject: python/osmo-python-tests[master]: osmodumpdoc: print generated path In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/3976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie39316f0b51ee518b9dce8d5f98b53f748db573b Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:56:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:56:50 +0000 Subject: [MERGED] python/osmo-python-tests[master]: osmodumpdoc: print generated path In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmodumpdoc: print generated path ...................................................................... osmodumpdoc: print generated path Change-Id: Ie39316f0b51ee518b9dce8d5f98b53f748db573b --- M osmopy/osmodumpdoc.py 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index 3d3f3b6..2464b05 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -21,6 +21,7 @@ out = open(filename, 'w') out.write(xml) out.close() + print 'generated %r' % filename """Dump the config of all the apps. -- To view, visit https://gerrit.osmocom.org/3976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie39316f0b51ee518b9dce8d5f98b53f748db573b Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:56:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:56:51 +0000 Subject: [MERGED] python/osmo-python-tests[master]: osmodumpdoc: print called commands and OSError messages In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmodumpdoc: print called commands and OSError messages ...................................................................... osmodumpdoc: print called commands and OSError messages Change-Id: Ib044cbb8a1b8e02cbe6852f785c75b5c7aae6174 --- M osmopy/osmodumpdoc.py 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index ce9fec4..3d3f3b6 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -42,9 +42,11 @@ print "Starting app for %s" % appname proc = None cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] + print 'cd', os.path.abspath(os.path.curdir), ';', ' '.join(cmd) try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) - except OSError: # Probably a missing binary + except OSError as e: # Probably a missing binary + print >> sys.stderr, e print >> sys.stderr, "Skipping app %s" % appname failures += 1 else: -- To view, visit https://gerrit.osmocom.org/3975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib044cbb8a1b8e02cbe6852f785c75b5c7aae6174 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:56:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:56:51 +0000 Subject: [MERGED] python/osmo-python-tests[master]: osmodumpdoc: fix finding cfg when not calling from source tree In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmodumpdoc: fix finding cfg when not calling from source tree ...................................................................... osmodumpdoc: fix finding cfg when not calling from source tree When the binary has not been built in the source tree, it was impossible to call osmodumpdoc.py despite the -p option. Look for config files in that config-path. Make sure a relative config-path is adjusted when changing to the workdir. Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c --- M osmopy/osmodumpdoc.py 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/osmodumpdoc.py b/osmopy/osmodumpdoc.py index 0ff1f6b..ce9fec4 100644 --- a/osmopy/osmodumpdoc.py +++ b/osmopy/osmodumpdoc.py @@ -28,7 +28,7 @@ Returns the number of apps configs could not be dumped for.""" -def dump_configs(apps, configs): +def dump_configs(apps, configs, confpath): failures = 0 successes = 0 @@ -41,7 +41,7 @@ appname = app[3] print "Starting app for %s" % appname proc = None - cmd = [app[1], "-c", configs[appname][0]] + cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) except OSError: # Probably a missing binary @@ -82,9 +82,10 @@ osmoappdesc = osmoutil.importappconf_or_quit( confpath, "osmoappdesc", args.p) + confpath = os.path.relpath(confpath, workdir) os.chdir(workdir) num_fails, num_sucs = dump_configs( - osmoappdesc.apps, osmoappdesc.app_configs) + osmoappdesc.apps, osmoappdesc.app_configs, confpath) if num_fails > 0: print >> sys.stderr, "Warning: Skipped %s apps" % num_fails if 0 == num_sucs: -- To view, visit https://gerrit.osmocom.org/3974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5427d354c289ec4602411c7059c8d80e2b451f7c Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:58:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:58:06 +0000 Subject: [PATCH] libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3998 to look at the new patch set (#2). vty: install 'exit', 'end',... commands on *all* nodes In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Deprecate both install_default() and vty_install_default() and make them no-ops so that users of the API may still call them without harm. Drop all invocations to the deprecated functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b --- M include/osmocom/vty/command.h M src/ctrl/control_vty.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c M src/vty/command.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/vty.c M tests/vty/vty_test.c 9 files changed, 31 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/3998/2 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 58f248f..8fbdb7b 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -27,6 +27,8 @@ #include #include "vector.h" +#include + /*! \defgroup command VTY Command * @{ * \file command.h */ @@ -363,9 +365,6 @@ void install_element_ve(struct cmd_element *cmd); void sort_node(void); -/* This is similar to install_default() but it also creates - * 'exit' and 'end' commands. - */ void vty_install_default(int node_type); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index 97f42de..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -82,7 +82,6 @@ ctrl_vty_ctx = ctx; install_element(CONFIG_NODE, &cfg_ctrl_cmd); install_node(&ctrl_node, config_write_ctrl); - vty_install_default(L_CTRL_NODE); install_element(L_CTRL_NODE, &cfg_ctrl_bind_addr_cmd); return 0; diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index 703d130..2953f88 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -211,7 +211,6 @@ install_element(CONFIG_NODE, &cfg_bssgp_cmd); install_node(&bssgp_node, config_write_bssgp); - install_default(L_BSSGP_NODE); install_element(L_BSSGP_NODE, &libgb_exit_cmd); install_element(L_BSSGP_NODE, &libgb_end_cmd); diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index e320ba2..547c9b8 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_ns_cmd); install_node(&ns_node, config_write_ns); - install_default(L_NS_NODE); install_element(L_NS_NODE, &libgb_exit_cmd); install_element(L_NS_NODE, &libgb_end_cmd); install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); diff --git a/src/vty/command.c b/src/vty/command.c index 8ad2e97..21b26b4 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -149,14 +149,23 @@ return name_buf; } -/*! Install top node of command vector. */ -void install_node(struct cmd_node *node, int (*func) (struct vty *)) +static void install_basic_node_commands(int node); + +/*! Install top node of command vector, without adding basic node commands. */ +static void install_node_bare(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); if (!*node->name) node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); +} + +/*! Install top node of command vector. */ +void install_node(struct cmd_node *node, int (*func) (struct vty *)) +{ + install_node_bare(node, func); + install_basic_node_commands(node->node); } /* Compare two command's string. Used in sort_node (). */ @@ -3599,7 +3608,22 @@ host.config = talloc_strdup(tall_vty_cmd_ctx, filename); } +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ void install_default(int node) +{ +} + +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ +void vty_install_default(int node) +{ +} + +/*! Install common commands like 'exit' and 'list'. */ +static void install_basic_node_commands(int node) { install_element(node, &config_help_cmd); install_element(node, &config_list_cmd); @@ -3609,11 +3633,6 @@ install_element(node, &config_write_memory_cmd); install_element(node, &config_write_cmd); install_element(node, &show_running_config_cmd); -} - -void vty_install_default(int node) -{ - install_default(node); install_element(node, &config_exit_cmd); @@ -3681,10 +3700,10 @@ host.motdfile = NULL; /* Install top nodes. */ - install_node(&view_node, NULL); + install_node_bare(&view_node, NULL); install_node(&enable_node, NULL); - install_node(&auth_node, NULL); - install_node(&auth_enable_node, NULL); + install_node_bare(&auth_node, NULL); + install_node_bare(&auth_enable_node, NULL); install_node(&config_node, config_write_host); /* Each node's basic commands. */ @@ -3701,7 +3720,6 @@ } if (terminal) { - vty_install_default(ENABLE_NODE); install_element(ENABLE_NODE, &config_disable_cmd); install_element(ENABLE_NODE, &config_terminal_cmd); install_element (ENABLE_NODE, ©_runningconfig_startupconfig_cmd); @@ -3714,8 +3732,6 @@ install_element(ENABLE_NODE, &config_terminal_length_cmd); install_element(ENABLE_NODE, &config_terminal_no_length_cmd); install_element(ENABLE_NODE, &echo_cmd); - - vty_install_default(CONFIG_NODE); } install_element(CONFIG_NODE, &hostname_cmd); diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 01480b1..0ab7686 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -776,7 +776,6 @@ install_element_ve(&show_alarms_cmd); install_node(&cfg_log_node, config_write_log); - vty_install_default(CFG_LOG_NODE); install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 57cdd30..a4c73fa 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_stats_interval_cmd); install_node(&cfg_stats_node, config_write_stats); - vty_install_default(CFG_STATS_NODE); install_element(CFG_STATS_NODE, &cfg_stats_reporter_local_ip_cmd); install_element(CFG_STATS_NODE, &cfg_no_stats_reporter_local_ip_cmd); diff --git a/src/vty/vty.c b/src/vty/vty.c index bd0d2c3..3d76b7a 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1798,7 +1798,6 @@ install_element(ENABLE_NODE, &terminal_monitor_cmd); install_element(ENABLE_NODE, &terminal_no_monitor_cmd); - vty_install_default(VTY_NODE); install_element(VTY_NODE, &vty_login_cmd); install_element(VTY_NODE, &no_vty_login_cmd); install_element(VTY_NODE, &vty_bind_cmd); diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index fe50e4c..2542baf 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -386,17 +386,14 @@ { install_element(CONFIG_NODE, &cfg_level1_cmd); install_node(&level1_node, NULL); - vty_install_default(LEVEL1_NODE); install_element(LEVEL1_NODE, &cfg_level1_child_cmd); install_element(LEVEL1_NODE, &cfg_level2_cmd); install_node(&level2_node, NULL); - vty_install_default(LEVEL2_NODE); install_element(LEVEL2_NODE, &cfg_level2_child_cmd); install_element(LEVEL2_NODE, &cfg_level3_cmd); install_node(&level3_node, NULL); - vty_install_default(LEVEL3_NODE); install_element(LEVEL3_NODE, &cfg_level3_child_cmd); } -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:58:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:58:10 +0000 Subject: [PATCH] libosmocore[master]: vty: deprecate now empty node commands Message-ID: Review at https://gerrit.osmocom.org/4052 vty: deprecate now empty node commands Following I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b a deprecation of vty_install_default() and install_default() commands is indicated. However, compiler warnings may clutter build output or even fail strict builds, hence I am submitting the deprecation in a separate patch. This reverts commit 71cc77858f50757ce5341111158202add10e5810. Change-Id: Icf5d83f641e838cebcccc635a043e94ba352abff --- M include/osmocom/vty/command.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/4052/1 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 8fbdb7b..13d6e89 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -360,12 +360,12 @@ /* Prototypes. */ void install_node(struct cmd_node *, int (*)(struct vty *)); -void install_default(int node_type); +void install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()"); void install_element(int node_type, struct cmd_element *); void install_element_ve(struct cmd_element *cmd); void sort_node(void); -void vty_install_default(int node_type); +void vty_install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()"); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated string with a space between each element (allocated using -- To view, visit https://gerrit.osmocom.org/4052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf5d83f641e838cebcccc635a043e94ba352abff Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:58:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:58:41 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 2: I have split the deprecation to a following patch, G#4052 -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 20:59:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 20:59:32 +0000 Subject: [PATCH] libosmocore[master]: vty: deprecate now empty node commands In-Reply-To: References: Message-ID: vty: deprecate now empty node commands Following I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b a deprecation of vty_install_default() and install_default() commands is indicated. However, compiler warnings may clutter build output or even fail strict builds, hence I am submitting the deprecation in a separate patch. Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Change-Id: Icf5d83f641e838cebcccc635a043e94ba352abff --- M include/osmocom/vty/command.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/4052/2 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 8fbdb7b..13d6e89 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -360,12 +360,12 @@ /* Prototypes. */ void install_node(struct cmd_node *, int (*)(struct vty *)); -void install_default(int node_type); +void install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()"); void install_element(int node_type, struct cmd_element *); void install_element_ve(struct cmd_element *cmd); void sort_node(void); -void vty_install_default(int node_type); +void vty_install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()"); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated string with a space between each element (allocated using -- To view, visit https://gerrit.osmocom.org/4052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf5d83f641e838cebcccc635a043e94ba352abff Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 21:01:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 21:01:51 +0000 Subject: [PATCH] libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3998 to look at the new patch set (#3). vty: install 'exit', 'end',... commands on *all* nodes In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Make both install_default() and vty_install_default() no-ops so that users of the API may still call them without harm. Do not yet deprecate yet, which follows in Icf5d83f641e838cebcccc635a043e94ba352abff. Drop all invocations to these two functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b --- M include/osmocom/vty/command.h M src/ctrl/control_vty.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c M src/vty/command.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/vty.c M tests/vty/vty_test.c 9 files changed, 31 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/3998/3 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 58f248f..8fbdb7b 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -27,6 +27,8 @@ #include #include "vector.h" +#include + /*! \defgroup command VTY Command * @{ * \file command.h */ @@ -363,9 +365,6 @@ void install_element_ve(struct cmd_element *cmd); void sort_node(void); -/* This is similar to install_default() but it also creates - * 'exit' and 'end' commands. - */ void vty_install_default(int node_type); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index 97f42de..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -82,7 +82,6 @@ ctrl_vty_ctx = ctx; install_element(CONFIG_NODE, &cfg_ctrl_cmd); install_node(&ctrl_node, config_write_ctrl); - vty_install_default(L_CTRL_NODE); install_element(L_CTRL_NODE, &cfg_ctrl_bind_addr_cmd); return 0; diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index 703d130..2953f88 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -211,7 +211,6 @@ install_element(CONFIG_NODE, &cfg_bssgp_cmd); install_node(&bssgp_node, config_write_bssgp); - install_default(L_BSSGP_NODE); install_element(L_BSSGP_NODE, &libgb_exit_cmd); install_element(L_BSSGP_NODE, &libgb_end_cmd); diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index e320ba2..547c9b8 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_ns_cmd); install_node(&ns_node, config_write_ns); - install_default(L_NS_NODE); install_element(L_NS_NODE, &libgb_exit_cmd); install_element(L_NS_NODE, &libgb_end_cmd); install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); diff --git a/src/vty/command.c b/src/vty/command.c index 8ad2e97..21b26b4 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -149,14 +149,23 @@ return name_buf; } -/*! Install top node of command vector. */ -void install_node(struct cmd_node *node, int (*func) (struct vty *)) +static void install_basic_node_commands(int node); + +/*! Install top node of command vector, without adding basic node commands. */ +static void install_node_bare(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); if (!*node->name) node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); +} + +/*! Install top node of command vector. */ +void install_node(struct cmd_node *node, int (*func) (struct vty *)) +{ + install_node_bare(node, func); + install_basic_node_commands(node->node); } /* Compare two command's string. Used in sort_node (). */ @@ -3599,7 +3608,22 @@ host.config = talloc_strdup(tall_vty_cmd_ctx, filename); } +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ void install_default(int node) +{ +} + +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ +void vty_install_default(int node) +{ +} + +/*! Install common commands like 'exit' and 'list'. */ +static void install_basic_node_commands(int node) { install_element(node, &config_help_cmd); install_element(node, &config_list_cmd); @@ -3609,11 +3633,6 @@ install_element(node, &config_write_memory_cmd); install_element(node, &config_write_cmd); install_element(node, &show_running_config_cmd); -} - -void vty_install_default(int node) -{ - install_default(node); install_element(node, &config_exit_cmd); @@ -3681,10 +3700,10 @@ host.motdfile = NULL; /* Install top nodes. */ - install_node(&view_node, NULL); + install_node_bare(&view_node, NULL); install_node(&enable_node, NULL); - install_node(&auth_node, NULL); - install_node(&auth_enable_node, NULL); + install_node_bare(&auth_node, NULL); + install_node_bare(&auth_enable_node, NULL); install_node(&config_node, config_write_host); /* Each node's basic commands. */ @@ -3701,7 +3720,6 @@ } if (terminal) { - vty_install_default(ENABLE_NODE); install_element(ENABLE_NODE, &config_disable_cmd); install_element(ENABLE_NODE, &config_terminal_cmd); install_element (ENABLE_NODE, ©_runningconfig_startupconfig_cmd); @@ -3714,8 +3732,6 @@ install_element(ENABLE_NODE, &config_terminal_length_cmd); install_element(ENABLE_NODE, &config_terminal_no_length_cmd); install_element(ENABLE_NODE, &echo_cmd); - - vty_install_default(CONFIG_NODE); } install_element(CONFIG_NODE, &hostname_cmd); diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 01480b1..0ab7686 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -776,7 +776,6 @@ install_element_ve(&show_alarms_cmd); install_node(&cfg_log_node, config_write_log); - vty_install_default(CFG_LOG_NODE); install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 57cdd30..a4c73fa 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_stats_interval_cmd); install_node(&cfg_stats_node, config_write_stats); - vty_install_default(CFG_STATS_NODE); install_element(CFG_STATS_NODE, &cfg_stats_reporter_local_ip_cmd); install_element(CFG_STATS_NODE, &cfg_no_stats_reporter_local_ip_cmd); diff --git a/src/vty/vty.c b/src/vty/vty.c index bd0d2c3..3d76b7a 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1798,7 +1798,6 @@ install_element(ENABLE_NODE, &terminal_monitor_cmd); install_element(ENABLE_NODE, &terminal_no_monitor_cmd); - vty_install_default(VTY_NODE); install_element(VTY_NODE, &vty_login_cmd); install_element(VTY_NODE, &no_vty_login_cmd); install_element(VTY_NODE, &vty_bind_cmd); diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index fe50e4c..2542baf 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -386,17 +386,14 @@ { install_element(CONFIG_NODE, &cfg_level1_cmd); install_node(&level1_node, NULL); - vty_install_default(LEVEL1_NODE); install_element(LEVEL1_NODE, &cfg_level1_child_cmd); install_element(LEVEL1_NODE, &cfg_level2_cmd); install_node(&level2_node, NULL); - vty_install_default(LEVEL2_NODE); install_element(LEVEL2_NODE, &cfg_level2_child_cmd); install_element(LEVEL2_NODE, &cfg_level3_cmd); install_node(&level3_node, NULL); - vty_install_default(LEVEL3_NODE); install_element(LEVEL3_NODE, &cfg_level3_child_cmd); } -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 21:03:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 21:03:09 +0000 Subject: osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Patch Set 3: what, the commit log was bounced back... sorry -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 21:07:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 21:07:02 +0000 Subject: osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Patch Set 3: ah, wasn't me :P ... resubmitting to bring the old commit log back -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 21:07:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 21:07:30 +0000 Subject: [PATCH] osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4001 to look at the new patch set (#4). debian: tweak .install: less wildcards With the upcoming addition of libosmo-mgcp, when we try the same scheme of wildcards there, it would also include all of the other libraries: *mgcp*.so.* There we will have to clarify that we mean exactly: libosmo-mgcp.so.* This is a cosmetic change to also be less ambiguous for the current libs: I prefer to state exactly which parts of the file names may vary, so that we have a firmer understanding of what is being installed. Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 --- M debian/libosmo-legacy-mgcp-dev.install M debian/libosmo-legacy-mgcp0.install M debian/libosmo-mgcp-client0.install 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/01/4001/4 diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install index 4184fef..a57cb50 100644 --- a/debian/libosmo-legacy-mgcp-dev.install +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -1,4 +1,4 @@ usr/include/osmocom/legacy_mgcp -usr/lib/*/*legacy-mgcp*.so -usr/lib/*/*legacy-mgcp*.a -usr/lib/*/pkgconfig/*legacy-mgcp*.pc +usr/lib/*/libosmo-legacy-mgcp.so +usr/lib/*/libosmo-legacy-mgcp.a +usr/lib/*/pkgconfig/libosmo-legacy-mgcp.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install index a47cc34..90ca89d 100644 --- a/debian/libosmo-legacy-mgcp0.install +++ b/debian/libosmo-legacy-mgcp0.install @@ -1 +1 @@ -usr/lib/*/*legacy-mgcp*.so.* +usr/lib/*/libosmo-legacy-mgcp.so.* diff --git a/debian/libosmo-mgcp-client0.install b/debian/libosmo-mgcp-client0.install index 4fc8bc6..7e86498 100644 --- a/debian/libosmo-mgcp-client0.install +++ b/debian/libosmo-mgcp-client0.install @@ -1 +1 @@ -usr/lib/*/*mgcp-client*.so.* +usr/lib/*/libosmo-mgcp-client.so.* -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Sun Sep 24 21:08:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 21:08:34 +0000 Subject: osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 only commit log changed back and forth, re-adding +2 -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 21:09:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 21:09:29 +0000 Subject: [MERGED] osmo-mgw[master]: debian: tweak .install: less wildcards In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debian: tweak .install: less wildcards ...................................................................... debian: tweak .install: less wildcards With the upcoming addition of libosmo-mgcp, when we try the same scheme of wildcards there, it would also include all of the other libraries: *mgcp*.so.* There we will have to clarify that we mean exactly: libosmo-mgcp.so.* This is a cosmetic change to also be less ambiguous for the current libs: I prefer to state exactly which parts of the file names may vary, so that we have a firmer understanding of what is being installed. Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 --- M debian/libosmo-legacy-mgcp-dev.install M debian/libosmo-legacy-mgcp0.install M debian/libosmo-mgcp-client0.install 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install index 4184fef..a57cb50 100644 --- a/debian/libosmo-legacy-mgcp-dev.install +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -1,4 +1,4 @@ usr/include/osmocom/legacy_mgcp -usr/lib/*/*legacy-mgcp*.so -usr/lib/*/*legacy-mgcp*.a -usr/lib/*/pkgconfig/*legacy-mgcp*.pc +usr/lib/*/libosmo-legacy-mgcp.so +usr/lib/*/libosmo-legacy-mgcp.a +usr/lib/*/pkgconfig/libosmo-legacy-mgcp.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install index a47cc34..90ca89d 100644 --- a/debian/libosmo-legacy-mgcp0.install +++ b/debian/libosmo-legacy-mgcp0.install @@ -1 +1 @@ -usr/lib/*/*legacy-mgcp*.so.* +usr/lib/*/libosmo-legacy-mgcp.so.* diff --git a/debian/libosmo-mgcp-client0.install b/debian/libosmo-mgcp-client0.install index 4fc8bc6..7e86498 100644 --- a/debian/libosmo-mgcp-client0.install +++ b/debian/libosmo-mgcp-client0.install @@ -1 +1 @@ -usr/lib/*/*mgcp-client*.so.* +usr/lib/*/libosmo-mgcp-client.so.* -- To view, visit https://gerrit.osmocom.org/4001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6a3f3b9efa08eb9c5cdca3e02f8fab4a96c28ad5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Sun Sep 24 22:14:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 22:14:13 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 Now I found some fallout, failing in osmo-sgsn: libosmocore gprs_bssgp_vty.c installs custom exit and end commands: /* Down vty node level. */ gDEFUN(libgb_exit, libgb_exit_cmd, "exit", "Exit current mode and down to previous mode\n") { switch (vty->node) { case L_NS_NODE: case L_BSSGP_NODE: vty->node = CONFIG_NODE; vty->index = NULL; break; default: break; } return CMD_SUCCESS; } /* End of configuration. */ gDEFUN(libgb_end, libgb_end_cmd, "end", "End current mode and change to enable mode.") { switch (vty->node) { case L_NS_NODE: case L_BSSGP_NODE: vty_config_unlock(vty); vty->node = ENABLE_NODE; vty->index = NULL; vty->index_sub = NULL; break; default: break; } return CMD_SUCCESS; } To me it looks like stuff that would usually happen in the go_parent_cb(). It was created in commit 4f5883bc6ef83e692625de05e1d7297a0772d4c7 Author: Harald Welte Date: Sat Jun 16 16:54:06 2012 +0800 Am I right to assume that it can be replaced by the way we exit nodes everywhere else? -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 22:58:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 22:58:44 +0000 Subject: [PATCH] libosmocore[master]: vty: fix style: bssgp node vty prompt Message-ID: Review at https://gerrit.osmocom.org/4053 vty: fix style: bssgp node vty prompt Add trailing space and 'config-' prefix to match our common VTY node prompt style. Change-Id: I88db128cad9fcc6e53326b4aed5d06ea9102f328 --- M src/gb/gprs_bssgp_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/4053/1 diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index 703d130..30ba603 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -58,7 +58,7 @@ static struct cmd_node bssgp_node = { L_BSSGP_NODE, - "%s(bssgp)#", + "%s(config-bssgp)# ", 1, }; -- To view, visit https://gerrit.osmocom.org/4053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88db128cad9fcc6e53326b4aed5d06ea9102f328 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 23:16:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 23:16:13 +0000 Subject: [PATCH] libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3998 to look at the new patch set (#4). vty: install 'exit', 'end',... commands on *all* nodes In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Make both install_default() and vty_install_default() no-ops so that users of the API may still call them without harm. Do not yet deprecate yet, which follows in Icf5d83f641e838cebcccc635a043e94ba352abff. Drop all invocations to these two functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b --- M include/osmocom/vty/command.h M src/ctrl/control_vty.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c M src/vty/command.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/vty.c M tests/vty/vty_test.c 9 files changed, 31 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/3998/4 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 58f248f..8fbdb7b 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -27,6 +27,8 @@ #include #include "vector.h" +#include + /*! \defgroup command VTY Command * @{ * \file command.h */ @@ -363,9 +365,6 @@ void install_element_ve(struct cmd_element *cmd); void sort_node(void); -/* This is similar to install_default() but it also creates - * 'exit' and 'end' commands. - */ void vty_install_default(int node_type); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index 97f42de..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -82,7 +82,6 @@ ctrl_vty_ctx = ctx; install_element(CONFIG_NODE, &cfg_ctrl_cmd); install_node(&ctrl_node, config_write_ctrl); - vty_install_default(L_CTRL_NODE); install_element(L_CTRL_NODE, &cfg_ctrl_bind_addr_cmd); return 0; diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index c4c5428..be781c2 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -211,7 +211,6 @@ install_element(CONFIG_NODE, &cfg_bssgp_cmd); install_node(&bssgp_node, config_write_bssgp); - vty_install_default(L_BSSGP_NODE); return 0; } diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 4bd5097..f94d9c2 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_ns_cmd); install_node(&ns_node, config_write_ns); - vty_install_default(L_NS_NODE); install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); install_element(L_NS_NODE, &cfg_nse_remoteip_cmd); install_element(L_NS_NODE, &cfg_nse_remoteport_cmd); diff --git a/src/vty/command.c b/src/vty/command.c index 8ad2e97..21b26b4 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -149,14 +149,23 @@ return name_buf; } -/*! Install top node of command vector. */ -void install_node(struct cmd_node *node, int (*func) (struct vty *)) +static void install_basic_node_commands(int node); + +/*! Install top node of command vector, without adding basic node commands. */ +static void install_node_bare(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); if (!*node->name) node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); +} + +/*! Install top node of command vector. */ +void install_node(struct cmd_node *node, int (*func) (struct vty *)) +{ + install_node_bare(node, func); + install_basic_node_commands(node->node); } /* Compare two command's string. Used in sort_node (). */ @@ -3599,7 +3608,22 @@ host.config = talloc_strdup(tall_vty_cmd_ctx, filename); } +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ void install_default(int node) +{ +} + +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ +void vty_install_default(int node) +{ +} + +/*! Install common commands like 'exit' and 'list'. */ +static void install_basic_node_commands(int node) { install_element(node, &config_help_cmd); install_element(node, &config_list_cmd); @@ -3609,11 +3633,6 @@ install_element(node, &config_write_memory_cmd); install_element(node, &config_write_cmd); install_element(node, &show_running_config_cmd); -} - -void vty_install_default(int node) -{ - install_default(node); install_element(node, &config_exit_cmd); @@ -3681,10 +3700,10 @@ host.motdfile = NULL; /* Install top nodes. */ - install_node(&view_node, NULL); + install_node_bare(&view_node, NULL); install_node(&enable_node, NULL); - install_node(&auth_node, NULL); - install_node(&auth_enable_node, NULL); + install_node_bare(&auth_node, NULL); + install_node_bare(&auth_enable_node, NULL); install_node(&config_node, config_write_host); /* Each node's basic commands. */ @@ -3701,7 +3720,6 @@ } if (terminal) { - vty_install_default(ENABLE_NODE); install_element(ENABLE_NODE, &config_disable_cmd); install_element(ENABLE_NODE, &config_terminal_cmd); install_element (ENABLE_NODE, ©_runningconfig_startupconfig_cmd); @@ -3714,8 +3732,6 @@ install_element(ENABLE_NODE, &config_terminal_length_cmd); install_element(ENABLE_NODE, &config_terminal_no_length_cmd); install_element(ENABLE_NODE, &echo_cmd); - - vty_install_default(CONFIG_NODE); } install_element(CONFIG_NODE, &hostname_cmd); diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 01480b1..0ab7686 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -776,7 +776,6 @@ install_element_ve(&show_alarms_cmd); install_node(&cfg_log_node, config_write_log); - vty_install_default(CFG_LOG_NODE); install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 57cdd30..a4c73fa 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_stats_interval_cmd); install_node(&cfg_stats_node, config_write_stats); - vty_install_default(CFG_STATS_NODE); install_element(CFG_STATS_NODE, &cfg_stats_reporter_local_ip_cmd); install_element(CFG_STATS_NODE, &cfg_no_stats_reporter_local_ip_cmd); diff --git a/src/vty/vty.c b/src/vty/vty.c index bd0d2c3..3d76b7a 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1798,7 +1798,6 @@ install_element(ENABLE_NODE, &terminal_monitor_cmd); install_element(ENABLE_NODE, &terminal_no_monitor_cmd); - vty_install_default(VTY_NODE); install_element(VTY_NODE, &vty_login_cmd); install_element(VTY_NODE, &no_vty_login_cmd); install_element(VTY_NODE, &vty_bind_cmd); diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index fe50e4c..2542baf 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -386,17 +386,14 @@ { install_element(CONFIG_NODE, &cfg_level1_cmd); install_node(&level1_node, NULL); - vty_install_default(LEVEL1_NODE); install_element(LEVEL1_NODE, &cfg_level1_child_cmd); install_element(LEVEL1_NODE, &cfg_level2_cmd); install_node(&level2_node, NULL); - vty_install_default(LEVEL2_NODE); install_element(LEVEL2_NODE, &cfg_level2_child_cmd); install_element(LEVEL2_NODE, &cfg_level3_cmd); install_node(&level3_node, NULL); - vty_install_default(LEVEL3_NODE); install_element(LEVEL3_NODE, &cfg_level3_child_cmd); } -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 23:16:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 23:16:14 +0000 Subject: [PATCH] libosmocore[master]: gb: drop special vty exit commands, use vty_install_default() Message-ID: Review at https://gerrit.osmocom.org/4054 gb: drop special vty exit commands, use vty_install_default() L_NS_NODE and L_BSSGP_NODE had specialized 'exit' and 'end' vty commands, but all they do is return to the CONFIG and ENABLE_NODEs like the default 'exit' and 'end' commands. Drop them and use the default 'exit' and 'end' cmds. Examining BSSGP and NS node behavior in osmo-sgsn exhibited identical list and exit/end behavior before and after this patch. Prepares for an upcoming commit incorporating vty_install_default() into install_node(), see I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b: this patch changes to the default commands, the upcoming change implies them. Change-Id: I5b0de066b4249d482c22620d5b1bcb03f381293c --- M src/gb/common_vty.c M src/gb/common_vty.h M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c 4 files changed, 2 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/4054/1 diff --git a/src/gb/common_vty.c b/src/gb/common_vty.c index 5de5135..16f3bbd 100644 --- a/src/gb/common_vty.c +++ b/src/gb/common_vty.c @@ -35,40 +35,6 @@ #include "common_vty.h" -/* Down vty node level. */ -gDEFUN(libgb_exit, - libgb_exit_cmd, "exit", "Exit current mode and down to previous mode\n") -{ - switch (vty->node) { - case L_NS_NODE: - case L_BSSGP_NODE: - vty->node = CONFIG_NODE; - vty->index = NULL; - break; - default: - break; - } - return CMD_SUCCESS; -} - -/* End of configuration. */ -gDEFUN(libgb_end, - libgb_end_cmd, "end", "End current mode and change to enable mode.") -{ - switch (vty->node) { - case L_NS_NODE: - case L_BSSGP_NODE: - vty_config_unlock(vty); - vty->node = ENABLE_NODE; - vty->index = NULL; - vty->index_sub = NULL; - break; - default: - break; - } - return CMD_SUCCESS; -} - int gprs_log_filter_fn(const struct log_context *ctx, struct log_target *tar) { diff --git a/src/gb/common_vty.h b/src/gb/common_vty.h index a0674a7..801d2da 100644 --- a/src/gb/common_vty.h +++ b/src/gb/common_vty.h @@ -5,6 +5,3 @@ extern int DNS, DBSSGP; -extern struct cmd_element libgb_exit_cmd; -extern struct cmd_element libgb_end_cmd; - diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index 703d130..c4c5428 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -211,9 +211,7 @@ install_element(CONFIG_NODE, &cfg_bssgp_cmd); install_node(&bssgp_node, config_write_bssgp); - install_default(L_BSSGP_NODE); - install_element(L_BSSGP_NODE, &libgb_exit_cmd); - install_element(L_BSSGP_NODE, &libgb_end_cmd); + vty_install_default(L_BSSGP_NODE); return 0; } diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index e320ba2..4bd5097 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -594,9 +594,7 @@ install_element(CONFIG_NODE, &cfg_ns_cmd); install_node(&ns_node, config_write_ns); - install_default(L_NS_NODE); - install_element(L_NS_NODE, &libgb_exit_cmd); - install_element(L_NS_NODE, &libgb_end_cmd); + vty_install_default(L_NS_NODE); install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); install_element(L_NS_NODE, &cfg_nse_remoteip_cmd); install_element(L_NS_NODE, &cfg_nse_remoteport_cmd); -- To view, visit https://gerrit.osmocom.org/4054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b0de066b4249d482c22620d5b1bcb03f381293c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 23:18:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 23:18:51 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 4: > Now I found some fallout fixed by preceding patch https://gerrit.osmocom.org/4054 It's good to follow the same ways everywhere and drop special wirings that just code dup the normal code; yet if it turns out more effort than it has already then it might not be worth it after all... -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Sep 24 23:24:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 23:24:36 +0000 Subject: [PATCH] osmo-mgw[master]: create libosmo-mgcp and osmo-mgw by copying legacy code In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4002 to look at the new patch set (#4). create libosmo-mgcp and osmo-mgw by copying legacy code This a cosmetic commit, copying libosmo-legacy-mgcp to libosmo-mgcp and osmo-bsc_mgcp to osmo-mgw 1:1 at first, to provide a basis for next patches that highlight the changes from legacy to new code. Until osmo-msc and osmo-bsc are adjusted to operate with the new code, we will keep the legacy code alongside the new code. The legacy code might be dropped later. Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 --- A doc/examples/osmo-mgw/osmo-mgw.cfg A include/osmocom/mgcp/Makefile.am A include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_transcode.h A include/osmocom/mgcp/osmux.h A include/osmocom/mgcp/vty.h A src/libosmo-mgcp/Makefile.am A src/libosmo-mgcp/g711common.h A src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_network.c A src/libosmo-mgcp/mgcp_osmux.c A src/libosmo-mgcp/mgcp_protocol.c A src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_transcode.c A src/libosmo-mgcp/mgcp_vty.c A src/osmo-mgw/Makefile.am A src/osmo-mgw/mgcp_main.c A tests/mgcp/Makefile.am A tests/mgcp/mgcp_test.c A tests/mgcp/mgcp_test.ok A tests/mgcp/mgcp_transcoding_test.c A tests/mgcp/mgcp_transcoding_test.ok 23 files changed, 10,325 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/02/4002/4 -- To view, visit https://gerrit.osmocom.org/4002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Sun Sep 24 23:24:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 23:24:36 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4003 to look at the new patch set (#5). Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h D include/osmocom/mgcp/mgcp_transcode.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c D src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 40 files changed, 3,311 insertions(+), 4,587 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/5 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Sun Sep 24 23:24:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 23:24:37 +0000 Subject: [PATCH] osmo-mgw[master]: drop code dup between libosmo-mgcp-client and libosmo-mgcp Message-ID: Review at https://gerrit.osmocom.org/4055 drop code dup between libosmo-mgcp-client and libosmo-mgcp Remove mgcp_common.c and replace with mgcp_common.h. Move mgcp_common.h from mgcp_client/ to mgcp/; Place a compile-time copy of it back in mgcp_client/. Add builddir/include to compiler -I paths to find generated header. Rationale: - Keep separate copies of the file for each of the library to not require debian dependencies between the two libraries. - Avoid code dup by copying during 'make' (think: a generated header, BUILT_SOURCE). - The copy does not have implications for linking (like mgcp_common.c did) nor is it a source for build confusion or fallout in other projects, because it does not reach across several git source trees (like gsm_data_shared.h did). mgcp_connection_mode_strs are not actually used in libosmo-mgcp, so drop them. (It would make semantic sense to have then in mgcp, but we can add it when it is needed. A similar value string array remains in libosmo-mgcp-client.) Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 --- M include/Makefile.am M include/osmocom/mgcp/mgcp.h R include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/Makefile.am M src/libosmo-mgcp-client/Makefile.am M src/libosmo-mgcp/Makefile.am D src/libosmo-mgcp/mgcp_common.c M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp_client/Makefile.am 15 files changed, 19 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/55/4055/1 diff --git a/include/Makefile.am b/include/Makefile.am index 3cc4b1d..b52e5ea 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -9,6 +9,7 @@ osmocom/mgcp_client/mgcp_client.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ + osmocom/mgcp/mgcp_common.h \ osmocom/mgcp/mgcp_internal.h \ osmocom/mgcp/osmux.h \ $(NULL) diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index d0c95d1..7307f3c 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -27,6 +27,8 @@ #include #include +#include + #include #include #include @@ -165,21 +167,6 @@ MGCP_BSC = 0, MGCP_BSC_NAT, }; - -enum mgcp_connection_mode { - MGCP_CONN_NONE = 0, - MGCP_CONN_RECV_ONLY = 1, - MGCP_CONN_SEND_ONLY = 2, - MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY, - MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND, -}; - -extern const struct value_string mgcp_connection_mode_strs[]; - -static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode) -{ - return get_value_string(mgcp_connection_mode_strs, mode); -} struct mgcp_config { int source_port; diff --git a/include/osmocom/mgcp_client/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h similarity index 100% rename from include/osmocom/mgcp_client/mgcp_common.h rename to include/osmocom/mgcp/mgcp_common.h diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 00d1f14..330c870 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -342,5 +342,3 @@ return endp->cfg->net_ports.bind_addr; return endp->cfg->source_addr; } - -int mgcp_msg_terminate_nul(struct msgb *msg); diff --git a/include/osmocom/mgcp_client/Makefile.am b/include/osmocom/mgcp_client/Makefile.am index 24401f1..0eaafcc 100644 --- a/include/osmocom/mgcp_client/Makefile.am +++ b/include/osmocom/mgcp_client/Makefile.am @@ -1,3 +1,11 @@ +BUILT_SOURCES = \ + mgcp_common.h \ + $(NULL) + noinst_HEADERS = \ mgcp_client_internal.h \ $(NULL) + +mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h + echo -e "/*\n\n DO NOT EDIT THIS FILE!\n THIS IS OVERWRITTEN DURING BUILD\n This is an automatic copy of \n\n */" > mgcp_common.h + cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index a2eb2be..3dd21db 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_builddir) \ $(NULL) diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am index 6135551..00221c2 100644 --- a/src/libosmo-mgcp/Makefile.am +++ b/src/libosmo-mgcp/Makefile.am @@ -32,7 +32,6 @@ $(NULL) libosmo_mgcp_la_SOURCES = \ - mgcp_common.c \ mgcp_protocol.c \ mgcp_network.c \ mgcp_vty.c \ diff --git a/src/libosmo-mgcp/mgcp_common.c b/src/libosmo-mgcp/mgcp_common.c deleted file mode 100644 index c246742..0000000 --- a/src/libosmo-mgcp/mgcp_common.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Media Gateway Control Protocol Media Gateway: RFC 3435 */ -/* Implementations useful both for the MGCP GW as well as MGCP GW clients */ - -/* - * (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include - -const struct value_string mgcp_connection_mode_strs[] = { - { MGCP_CONN_NONE, "none" }, - { MGCP_CONN_RECV_SEND, "sendrecv" }, - { MGCP_CONN_SEND_ONLY, "sendonly" }, - { MGCP_CONN_RECV_ONLY, "recvonly" }, - { MGCP_CONN_LOOPBACK, "loopback" }, - { 0, NULL } -}; - -/* Ensure that the msg->l2h is NUL terminated. */ -int mgcp_msg_terminate_nul(struct msgb *msg) -{ - unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data */ - if (tail[-1] == '\0') - /* nothing to do */; - else if (msgb_tailroom(msg) > 0) - tail[0] = '\0'; - else if (tail[-1] == '\r' || tail[-1] == '\n') - tail[-1] = '\0'; - else { - LOGP(DLMGCP, LOGL_ERROR, "Cannot NUL terminate MGCP message: " - "Length: %d, Buffer size: %d\n", - msgb_l2len(msg), msg->data_len); - return -ENOTSUP; - } - return 0; -} diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index ab529a7..2ba321e 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -22,7 +22,7 @@ */ #include -#include +#include /* Reset codec state and free memory */ static void mgcp_rtp_codec_reset(struct mgcp_rtp_codec *codec) diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 602285e..849a4c0 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index df3febb..4859c19 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 7957cfe..8389e9d 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 94eefa9..9167cba 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 02ea079..07f5222 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/tests/mgcp_client/Makefile.am b/tests/mgcp_client/Makefile.am index e33f0e8..5cd0d8a 100644 --- a/tests/mgcp_client/Makefile.am +++ b/tests/mgcp_client/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ $(all_includes) \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_srcdir) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/4055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Sep 24 23:29:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 24 Sep 2017 23:29:18 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 5: -Code-Review New patch set from dexter's branch pmaier/mgw4 and my own adjustments. For the record, submitted the patch set without asking dexter first, I hope it's not premature. -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 07:51:48 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 25 Sep 2017 07:51:48 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 5: (20 comments) > New patch set from dexter's branch pmaier/mgw4 and my own > adjustments. For the record, submitted the patch set without asking > dexter first, I hope it's not premature. Thanks for adjusting the patch. My main concern at the moment is how to move on with OSMUX. I think I can not fix the OSMUX related issues on the short run. I would need to learn more about osmox, how it works, how it is used. I would prefer to merge the patch without addressing the OSMUX issues at the moment. https://gerrit.osmocom.org/#/c/4003/4/include/osmocom/mgcp/mgcp.h File include/osmocom/mgcp/mgcp.h: Line 37: > why do we have a default range end of only 10 ports higher than the start p Done https://gerrit.osmocom.org/#/c/4003/4/include/osmocom/mgcp/mgcp_internal.h File include/osmocom/mgcp/mgcp_internal.h: Line 114: /* Each end has a separate socket for RTP and RTCP */ > separate Done Line 149: /* Specific connection type */ > the 'rtp_end' structure made sense when we had a bts_end and a net_end. Now I think so too, removing one level would make handling the struct a lot easier. I will keep that in in mind. Line 193: /*!< Backpointer to the endpoint where the conn belongs to */ > should this be some enum? or at least the comment above state what kind of Done Line 223: (e.g mgcp_dispatch_rtp_bridge_cb, see below) */ > if it's an endpoint type, mgcp_endpoint_type might be a better name having enum mgcp_type here type is wrong. This is something that is specific to an RTP connection only. I have moved it. https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_conn.c File src/libosmo-mgcp/mgcp_conn.c: Line 72: /*! \brief allocate a new connection list entry > as the connection list is per endpoint, it might make sense to pass in the Done Line 82: struct mgcp_conn *conn; > this is something specific to the "rtp bridge/proxy" endpoint type. I sugg Done Line 93: return NULL; > rather than the enum, this would be a pointer to the 'const struct rtp_endp This sets the type of the connection, so its not about the endpoint here. (We mainly use this to determine how to access the union.) However, this brings me to another thought. If we have various possible connection types. rtp_endpoint_type should have some bitfield with allowed connection types. But thats is not in the scope of this patch I think. Line 105: strcpy(conn->name, name); > why does mgpc_rtp_end_reset() not set those -1 values above? Done Line 123: /*! \brief find a connection by its ID > Is there a connection list outside of the context of a struct mgcp_endpoint Done PS4, Line 169: ns.next != NULL && endp > I wonder when do we need this. The below linear iteration seems quite expe Done Line 225: } > What if the list is empty? Done https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_network.c File src/libosmo-mgcp/mgcp_network.c: Line 704: > using an any of the libosmocore counters might be an idea here, rather than I think its best to solve this in a separate patch. I have created a task, so we do not forget about this. https://osmocom.org/issues/2517 Line 806: ENDPOINT_NUMBER(endp)); > see my other comment, as the socket/fd is part of the mgcp connection, priv Done Line 889: * port and IP-Address make sense at all. If not, we will be unable > see my other comment, this is a highly inefficient lookup, and we appear to Done Line 911: } > This lookup and the code below is again specific to the endpoint type. I wo Done https://gerrit.osmocom.org/#/c/4003/4/src/libosmo-mgcp/mgcp_osmux.c File src/libosmo-mgcp/mgcp_osmux.c: Line 126: h->in->osmux_seq = 0; > (whitespace) Done Line 205: > (whitespace) Done Line 585: return; > whitespace Done Line 613: > whitespace Done -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:22:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:22:53 +0000 Subject: [PATCH] osmo-ci[master]: Prepare to deprecate legacy GPRS projects Message-ID: Review at https://gerrit.osmocom.org/4056 Prepare to deprecate legacy GPRS projects * use coverity check on osmo-ggsn instead of openggsn * move osmo-sgsn from nightly-split into nightly Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh M scripts/osmocom-nightly-nitb-split.sh M scripts/osmocom-nightly-packages.sh 4 files changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/56/4056/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 58a74f2..bccd7ea 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -69,8 +69,8 @@ popd } -build_openggsn() { - pushd openggsn +build_osmoggsn() { + pushd osmo-ggsn do_build popd } @@ -155,7 +155,7 @@ build_libosmonetif build_libosmosccp build_libsmpp34 -build_openggsn +build_osmoggsn #IU build_osmoiuh build_osmopcu build_osmobts diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 6d226b2..386e16e 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -13,7 +13,7 @@ libosmo-sccp \ libsmpp34 \ openbsc \ - openggsn \ + osmo-ggsn \ osmo-bts \ osmo-gmr \ osmo-iuh \ diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index 3b547bf..8448459 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -94,7 +94,6 @@ checkout osmo-mgw checkout osmo-bsc checkout osmo-msc - checkout osmo-sgsn build libosmocore build libosmo-abis @@ -108,7 +107,6 @@ build osmo-mgw build osmo-bsc build osmo-msc - build osmo-sgsn post } diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 84cf6e4..032bd49 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,7 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 -git clone git://git.osmocom.org/openggsn +git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap @@ -51,7 +51,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 -build openggsn +build osmo-sgsn build osmo-ggsn build openbsc build osmo-pcap -- To view, visit https://gerrit.osmocom.org/4056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:25:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:25:15 +0000 Subject: [MERGED] osmo-bsc[master]: Further cleanup leftovers from BSC/MSC split In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Further cleanup leftovers from BSC/MSC split ...................................................................... Further cleanup leftovers from BSC/MSC split * drop unused header * fix name of jenkins test * remove dead code Change-Id: I986904864741995910b6ba92173b9f7b1b03e2f1 --- M contrib/jenkins.sh M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h D include/osmocom/bsc/osmo_msc.h M src/libbsc/bsc_init.c M tests/gsm0408/gsm0408_test.c 6 files changed, 1 insertion(+), 131 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2685d04..eb302d1 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -33,7 +33,7 @@ echo echo echo -echo " =============================== osmo-msc ===============================" +echo " =============================== osmo-bsc ===============================" echo set -x diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 3b8dbdf..8ad2b5d 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -42,7 +42,6 @@ osmo_bsc.h \ osmo_bsc_grace.h \ osmo_bsc_rf.h \ - osmo_msc.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ osmux.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d7f7667..4e56db5 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -670,7 +670,6 @@ /* control interface handling */ int bsc_base_ctrl_cmds_install(void); -int msc_ctrl_cmds_install(struct gsm_network *net); /* dependency handling */ void bts_depend_mark(struct gsm_bts *bts, int dep); diff --git a/include/osmocom/bsc/osmo_msc.h b/include/osmocom/bsc/osmo_msc.h deleted file mode 100644 index c08cb26..0000000 --- a/include/osmocom/bsc/osmo_msc.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Routines for the MSC handling */ - -#ifndef OSMO_MSC_H -#define OSMO_MSC_H - -#include -#include - -#include - -#include "bsc_api.h" - -#define MSC_HLR_REMOTE_IP_DEFAULT "127.0.0.1" -#define MSC_HLR_REMOTE_PORT_DEFAULT OSMO_GSUP_PORT - -enum subscr_conn_fsm_event { - /* Mark 0 as invalid to catch uninitialized vars */ - SUBSCR_CONN_E_INVALID = 0, - /* Timeout on connection establishment starts */ - SUBSCR_CONN_E_START, - /* LU or Process Access FSM has determined that this conn is good */ - SUBSCR_CONN_E_ACCEPTED, - /* received first reply from MS in "real" CC, SMS, USSD communication */ - SUBSCR_CONN_E_COMMUNICATING, - /* Some async action has completed, check again whether all is done */ - SUBSCR_CONN_E_BUMP, - /* MS/BTS/BSC originated close request */ - SUBSCR_CONN_E_MO_CLOSE, - /* MSC originated close request, e.g. failed authentication */ - SUBSCR_CONN_E_CN_CLOSE, -}; - -enum subscr_conn_fsm_state { - SUBSCR_CONN_S_INIT, - SUBSCR_CONN_S_NEW, - SUBSCR_CONN_S_ACCEPTED, - SUBSCR_CONN_S_COMMUNICATING, - SUBSCR_CONN_S_RELEASED, -}; - -enum subscr_conn_from { - SUBSCR_CONN_FROM_INVALID, - SUBSCR_CONN_FROM_LU, - SUBSCR_CONN_FROM_CM_SERVICE_REQ, - SUBSCR_CONN_FROM_PAGING_RESP, -}; - -extern const struct value_string subscr_conn_from_names[]; -static inline const char *subscr_conn_from_name(enum subscr_conn_from val) -{ - return get_value_string(subscr_conn_from_names, val); -} - -enum msc_compl_l3_rc { - MSC_CONN_ACCEPT = 0, - MSC_CONN_REJECT = 1, -}; - -struct bsc_api *msc_bsc_api(); - -int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id); - -int msc_vlr_alloc(struct gsm_network *net); -int msc_vlr_start(struct gsm_network *net); - -void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci); -int msc_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause); -int msc_compl_l3(struct gsm_subscriber_connection *conn, - struct msgb *msg, uint16_t chosen_channel); -void msc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, - struct msgb *msg); -void msc_cipher_mode_compl(struct gsm_subscriber_connection *conn, - struct msgb *msg, uint8_t alg_id); -void msc_rx_sec_mode_compl(struct gsm_subscriber_connection *conn); -void msc_classmark_chg(struct gsm_subscriber_connection *conn, - const uint8_t *cm2, uint8_t cm2_len, - const uint8_t *cm3, uint8_t cm3_len); -void msc_assign_fail(struct gsm_subscriber_connection *conn, - uint8_t cause, uint8_t *rr_cause); - -void msc_subscr_conn_init(void); -bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn); -void msc_subscr_conn_communicating(struct gsm_subscriber_connection *conn); -void msc_subscr_conn_close(struct gsm_subscriber_connection *conn, - uint32_t cause); - -#define msc_subscr_conn_get(conn) \ - _msc_subscr_conn_get(conn, __BASE_FILE__, __LINE__) -#define msc_subscr_conn_put(conn) \ - _msc_subscr_conn_put(conn, __BASE_FILE__, __LINE__) -struct gsm_subscriber_connection * -_msc_subscr_conn_get(struct gsm_subscriber_connection *conn, - const char *file, int line); -void _msc_subscr_conn_put(struct gsm_subscriber_connection *conn, - const char *file, int line); - -void msc_stop_paging(struct vlr_subscr *vsub); - -#endif diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 5b6530d..f3e13e2 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -37,7 +37,6 @@ #include #include #include -#include #include /* global pointer to the gsm network data structure */ diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 974ebe5..d5a5363 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -647,31 +647,6 @@ VERIFY(f0, ==, 1); } -#ifdef BEFORE_MSCSPLIT -static void test_gsm411_rp_ref_wrap(void) -{ - struct gsm_subscriber_connection conn; - int res; - - printf("testing RP-Reference wrap\n"); - - memset(&conn, 0, sizeof(conn)); - conn.next_rp_ref = 255; - - res = sms_next_rp_msg_ref(&conn.next_rp_ref); - printf("Allocated reference: %d\n", res); - OSMO_ASSERT(res == 255); - - res = sms_next_rp_msg_ref(&conn.next_rp_ref); - printf("Allocated reference: %d\n", res); - OSMO_ASSERT(res == 0); - - res = sms_next_rp_msg_ref(&conn.next_rp_ref); - printf("Allocated reference: %d\n", res); - OSMO_ASSERT(res == 1); -} -#endif - int main(int argc, char **argv) { osmo_init_logging(&log_info); @@ -684,9 +659,6 @@ test_arfcn_filter(); test_print_encoding(); test_range_encoding(); -#ifdef BEFORE_MSCSPLIT - test_gsm411_rp_ref_wrap(); -#endif test_si2q_segfault(); test_si2q_e(); -- To view, visit https://gerrit.osmocom.org/4014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I986904864741995910b6ba92173b9f7b1b03e2f1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:26:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:26:00 +0000 Subject: [MERGED] openbsc[master]: CTRL: cleanup write-only command functions In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: CTRL: cleanup write-only command functions ...................................................................... CTRL: cleanup write-only command functions Remove trivial functions by using more specific defines for CTRL commands. Change-Id: I719b75b6ca1e9372ea11e7e9ff7896021f357035 --- M openbsc/src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 3 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index c23ed21..423ed34 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -466,13 +466,7 @@ return 1; } -CTRL_CMD_DEFINE(net_notification, "notification"); -static int get_net_notification(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_notification, "notification"); static int set_net_notification(struct ctrl_cmd *cmd, void *data) { struct ctrl_cmd *trap; @@ -502,18 +496,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_notification(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_inform_msc, "inform-msc-v1"); -static int get_net_inform_msc(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_inform_msc, "inform-msc-v1"); static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data) { struct gsm_network *net; @@ -540,18 +523,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_inform_msc(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_ussd_notify, "ussd-notify-v1"); -static int get_net_ussd_notify(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO(net_ussd_notify, "ussd-notify-v1"); static int set_net_ussd_notify(struct ctrl_cmd *cmd, void *data) { struct gsm_subscriber_connection *conn; -- To view, visit https://gerrit.osmocom.org/4016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I719b75b6ca1e9372ea11e7e9ff7896021f357035 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:27:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:27:23 +0000 Subject: [MERGED] osmo-bsc[master]: CTRL: cleanup write-only command functions In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: CTRL: cleanup write-only command functions ...................................................................... CTRL: cleanup write-only command functions Remove trivial functions by using more specific defines for CTRL commands. Change-Id: I10d6d18663aed87324d60472a0fc3bd1d0961dea --- M src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 3 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 2446312..6330892 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -466,13 +466,7 @@ return 1; } -CTRL_CMD_DEFINE(net_notification, "notification"); -static int get_net_notification(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_notification, "notification"); static int set_net_notification(struct ctrl_cmd *cmd, void *data) { struct ctrl_cmd *trap; @@ -502,18 +496,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_notification(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_inform_msc, "inform-msc-v1"); -static int get_net_inform_msc(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO_NOVRF(net_inform_msc, "inform-msc-v1"); static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data) { struct gsm_network *net; @@ -540,18 +523,7 @@ return CTRL_CMD_HANDLED; } -static int verify_net_inform_msc(struct ctrl_cmd *cmd, const char *value, void *data) -{ - return 0; -} - -CTRL_CMD_DEFINE(net_ussd_notify, "ussd-notify-v1"); -static int get_net_ussd_notify(struct ctrl_cmd *cmd, void *data) -{ - cmd->reply = "There is nothing to read"; - return CTRL_CMD_ERROR; -} - +CTRL_CMD_DEFINE_WO(net_ussd_notify, "ussd-notify-v1"); static int set_net_ussd_notify(struct ctrl_cmd *cmd, void *data) { struct gsm_subscriber_connection *conn; -- To view, visit https://gerrit.osmocom.org/4015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10d6d18663aed87324d60472a0fc3bd1d0961dea Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:28:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:28:53 +0000 Subject: [MERGED] osmo-sgsn[master]: gbproxy: ensure peer allocation result In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: gbproxy: ensure peer allocation result ...................................................................... gbproxy: ensure peer allocation result gbproxy_peer_alloc() could return NULL which wasn't checked and used right away. Fix it by making this assumption explicit with OSMO_ASSERT(); While at it, also format log messages consistently. Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 --- M src/gprs/gb_proxy.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index eb2bbcc..17a0109 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1018,9 +1018,9 @@ if (!from_peer) { /* if a PTP-BVC is reset, and we don't know that * PTP-BVCI yet, we should allocate a new peer */ - LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for " - "BVCI=%u via NSEI=%u\n", bvci, nsei); + LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for BVCI=%u via NSEI=%u\n", bvci, nsei); from_peer = gbproxy_peer_alloc(cfg, bvci); + OSMO_ASSERT(from_peer); from_peer->nsei = nsei; } -- To view, visit https://gerrit.osmocom.org/3977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:29:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:29:28 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Expand OsmoGGSN manual In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Expand OsmoGGSN manual ...................................................................... Expand OsmoGGSN manual * add cross-references * add example of running without root priviledges Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 --- M OsmoGGSN/chapters/configuration.adoc M common/chapters/bibliography.adoc 2 files changed, 55 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGGSN/chapters/configuration.adoc b/OsmoGGSN/chapters/configuration.adoc index e37b709..9e07fb6 100644 --- a/OsmoGGSN/chapters/configuration.adoc +++ b/OsmoGGSN/chapters/configuration.adoc @@ -1,7 +1,7 @@ == Configuring OsmoGGSN All configuration of OsmoGGSN is performed using the VTY. For more -general information on the VTY interface, see FIXME. +general information on the VTY interface, see <>. === Configuring a virtual GGSN instance @@ -49,7 +49,7 @@ configure the properties of this GGSN instance. NOTE:: After creating a new GGSN instance, it is in `shutdown` mode. See -FIXME to take it out of shutdown, but make sure to configure it fully +<> to take it out of shutdown, but make sure to configure it fully before taking it out of shutdown. ==== Configuring a GGSN instance @@ -66,7 +66,7 @@ There are some further configuration statements that can be used at the GGSN node, some examples are given below. For a full list, see the -OpenGGSN VTY reference manual (FIXME). +_OsmoGGSN VTY reference manual_ <>. ---- OsmoGGSN(config-ggsn)# default-apn foobar <1> @@ -152,7 +152,7 @@ <5> Your prompt is now in the `ggsn` config node, where you can configure the properties of this GGSN instance. -NOTE:: The newly-create APN is created in `shutdown` mode. See FIXME to take it +NOTE:: The newly-create APN is created in `shutdown` mode. See <> to take it out of shutdown. @@ -178,7 +178,7 @@ NOTE:: If you use the optional `ip ifconfig` command to set the network device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` support. It might be better to configure related tun devices at system -startup and run OsmoGGSN as non-privileged user. See FIXME for more +startup and run OsmoGGSN as non-privileged user. See <> for more details. @@ -198,7 +198,7 @@ <3> Enter the config node of the GGSN instance `ggsn0` <4> Delete the APN `internet` - +[[unshutdown_apn]] ==== Taking an APN out of shutdown In order to bring a deactived APN in `shutdown` state into active @@ -241,3 +241,48 @@ <4> Enter the config ndoe of the APN `internet` <5> Shut down the APN +[[ggsn_no_root]] +=== Configuring for running without root priveleges + +It's possible to run OsmoGGSN without root privileges if the tun devices are already configured. + +.Example: device config via systemd-networkd using ggsn.netdev +---- +[NetDev] +Name=ggsn +Kind=tun + +[Tun] +User=username +Group=username +---- + +.Example: network settings via systemd-networkd using ggsn.network +---- +[Match] +Name=ggsn + +[Network] +Address=192.168.7.1 +IPMasquerade=yes +---- + +The pair of the configuration files above allows you to create and configure tun device which can be +used by OsmoGGSN as follows. + +.Example: using externally configured tun device as non-root +---- +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 127.0.0.6 + apn internet + gtpu-mode tun + tun-device ggsn + type-support v4 + ip prefix dynamic 192.168.7.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + no shutdown + default-apn internet + no shutdown ggsn +---- diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index a3c6436..9d4c234 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -26,8 +26,10 @@ http://ftp.osmocom.org/docs/latest/osmosgsn-usermanual.pdf - [[[vty-ref-osmosgsn]]] Osmocom Project: OsmoSGSN VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmonitb-vty-reference.pdf -//- [[[userman-openggsn]]] Osmocom Project: OpenGGSN User Manual. - +- [[[userman-osmoggsn]]] Osmocom Project: OpenGGSN User Manual. + http://ftp.osmocom.org/docs/latest/osmoggsn-usermanual.pdf +- [[[vty-ref-osmoggsn]]] Osmocom Project: OsmoGGSN VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmoggsn-vty-reference.pdf - [[[3gpp-ts-23-048]]] 3GPP TS 23.048: Security mechanisms for the (U)SIM application toolkit; Stage 2 http://www.3gpp.org/DynaReport/23048.htm -- To view, visit https://gerrit.osmocom.org/4011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1743f370ee2b351d2847f2e29e0f59f35cd401f4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:36:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:36:27 +0000 Subject: [PATCH] osmo-ggsn[master]: Move extended PDP logging macro to header In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3961 to look at the new patch set (#4). Move extended PDP logging macro to header It might be useful for any user of libgtp who uses libosmocore so let's make generalized version of it available as part of installable header. Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Related: SYS#3610 --- M TODO-RELEASE M ggsn/ggsn.c M gtp/pdp.h 3 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/3961/4 diff --git a/TODO-RELEASE b/TODO-RELEASE index e38e18c..1009c44 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libgtp pdp.h Addition of new tx_gpdu_seq struct member member +libgtp pdp.h add LOGPDPX() helper to public API diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 780a0c2..462b395 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -83,8 +83,7 @@ #define LOGPGGSN(level, ggsn, fmt, args...) \ LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) -#define LOGPPDP(level, pdp, fmt, args...) \ - LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) +#define LOGPPDP(level, pdp, fmt, args...) LOGPDPX(DGGSN, level, pdp, fmt, ## args) static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); diff --git a/gtp/pdp.h b/gtp/pdp.h index f8b0df8..106d544 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -17,6 +17,9 @@ struct gsn_t; +#define LOGPDPX(ss, level, pdp, fmt, args...) \ + LOGP(ss, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:44:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 08:44:20 +0000 Subject: libosmocore[master]: vty/vty.c: do not bind vty context to application's one In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9cb6ce9f24dbae400029e2d9f9c933fbfb16248f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:46:57 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 25 Sep 2017 08:46:57 +0000 Subject: [ABANDON] libosmo-sccp[master]: vty: command to set local ip of ASP In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: vty: command to set local ip of ASP ...................................................................... Abandoned This change violates the command concept of Cisco ITP -- To view, visit https://gerrit.osmocom.org/3271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Sep 25 08:57:44 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 25 Sep 2017 08:57:44 +0000 Subject: [MERGED] libosmo-sccp[master]: simple client: prevent overwriting asp settings In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: simple client: prevent overwriting asp settings ...................................................................... simple client: prevent overwriting asp settings If the user does not create an AS, but creates an ASP with a name that is equal to the default name, then the simple client detects that and trys to use this ASP. However, unfortunately it then overwrites the settings of the ASP with the default settings. If the detected ASP is not created by the simple client, use it, but preseve the settings of that ASP. Change-Id: I53d73059f804c3bbea6cb43dc73ad49a753b3b15 --- M src/sccp_user.c 1 file changed, 27 insertions(+), 12 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index 06a7174..21b2eed 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -414,20 +414,35 @@ * we intend to use. */ asp = osmo_ss7_asp_find_by_proto(as, prot); if (!asp) { - LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", - name); + /* Check if the user has already created an ASP elsewhere under + * the default asp name. */ asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); - asp = - osmo_ss7_asp_find_or_create(ss7, asp_name, - default_remote_port, - default_local_port, prot); - talloc_free(asp_name); - if (!asp) - goto out_rt; - asp_created = true; + asp = osmo_ss7_asp_find_by_name(ss7, asp_name); + if (!asp) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", + name); + asp = + osmo_ss7_asp_find_or_create(ss7, asp_name, + default_remote_port, + default_local_port, + prot); + talloc_free(asp_name); + if (!asp) + goto out_rt; + asp_created = true; - asp->cfg.local.host = default_local_ip ? talloc_strdup(asp, default_local_ip) : NULL; - asp->cfg.remote.host = default_remote_ip ? talloc_strdup(asp, default_remote_ip) : NULL; + asp->cfg.local.host = NULL; + asp->cfg.remote.host = NULL; + if (default_local_ip) { + asp->cfg.local.host = + talloc_strdup(asp, default_local_ip); + } + if (default_remote_ip) { + asp->cfg.remote.host = + talloc_strdup(asp, default_remote_ip); + } + } else + talloc_free(asp_name); osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53d73059f804c3bbea6cb43dc73ad49a753b3b15 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Sep 25 09:02:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 09:02:50 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) Also, example output of 'sh talloc-context ..' in commit message would be nice. https://gerrit.osmocom.org/#/c/4018/1/src/vty/talloc_ctx_vty.c File src/vty/talloc_ctx_vty.c: Line 48: I think it's big enough to warrant doxygen header with explanation of what it does and what's the meaning of parameters. Line 50: int max_depth, int is_ref, void *data) If it's 'int' than it means that it could be negative. Please either explain when this is the case or use unsigned type. Line 63: if (p->filter == WALK_FILTER_REGEXP) { So you explicitly check for 2 possible enum values and implicitly for 3rd one. I think switch() would be easier to read because all possible values are checked explicitly. Line 139: params = talloc_zero(tall_vty_ctx, struct walk_cb_params); Will this allocation be included in the report too? Line 229: talloc_free(params); The params are always alloced/freed in the same function. Do we have to use dynamic allocation? What would be disadvantage of having 'params' as local variable which address is passed down to talloc_ctx_walk()? -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 25 11:49:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 11:49:18 +0000 Subject: [PATCH] osmo-bts[master]: Remove dead code Message-ID: Review at https://gerrit.osmocom.org/4057 Remove dead code If I understood correctly, it's just leftover from copy-paste from corresponding OpenBSC code which is untouched for years. Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 --- M src/common/vty.c 1 file changed, 0 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/4057/1 diff --git a/src/common/vty.c b/src/common/vty.c index de9b23f..444b19c 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -762,24 +762,6 @@ VTY_NEWLINE); vty_out(vty, " CBCH backlog queue length: %u%s", llist_length(&btsb->smscb_state.queue), VTY_NEWLINE); -#if 0 - vty_out(vty, " Paging: %u pending requests, %u free slots%s", - paging_pending_requests_nr(bts), - bts->paging.available_slots, VTY_NEWLINE); - if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); - } else { - vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); - e1isl_dump_vty(vty, bts->oml_link); - } - - /* FIXME: chan_desc */ - memset(&pl, 0, sizeof(pl)); - bts_chan_load(&pl, bts); - vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); - dump_pchan_load_vty(vty, " ", &pl); -#endif } -- To view, visit https://gerrit.osmocom.org/4057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 11:49:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 11:49:23 +0000 Subject: [PATCH] osmo-bts[master]: vty: print version and description for each phy Message-ID: Review at https://gerrit.osmocom.org/4058 vty: print version and description for each phy When printing BTS via 'show bts ..' let's also print each TRX, why phy number and version it uses and its description. It's helpful in troubleshooting low-level issues as it allows vendor-specific code to easily expose firmware version. Related: SYS#3884 Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd --- M src/common/vty.c 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/4058/1 diff --git a/src/common/vty.c b/src/common/vty.c index 444b19c..6714041 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -730,6 +730,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct gsm_bts_role_bts *btsb = bts->role; + struct gsm_bts_trx *trx; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u and %u TRX%s", @@ -762,6 +763,17 @@ VTY_NEWLINE); vty_out(vty, " CBCH backlog queue length: %u%s", llist_length(&btsb->smscb_state.queue), VTY_NEWLINE); + + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + vty_out(vty, " TRX %u%s", trx->nr, VTY_NEWLINE); + if (pinst) { + vty_out(vty, " phy %d %s", pinst->num, pinst->version); + if (pinst->description) + vty_out(vty, " (%s)", pinst->description); + vty_out(vty, "%s", VTY_NEWLINE); + } + } } -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 12:52:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 12:52:47 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4003 to look at the new patch set (#6). Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. Store the linked list in struct mgcp_endpoint, have a private linked list for each endpoint. The list contains connection items which are implemented in struct mgcp_conn. A connection is allocated and freed using the functions in mgcp_conn.c. A connection is allocated on the reception of a CRCX command and freed with the reception of a DLCX command. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h D include/osmocom/mgcp/mgcp_transcode.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c D src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 40 files changed, 3,315 insertions(+), 4,587 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/6 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:01:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 13:01:13 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 6: (last patch set pushed by me for pmaier, from osmo-mgw/pmaier/mgw5) -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:29:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 13:29:57 +0000 Subject: [PATCH] osmo-ci[master]: Prepare to deprecate legacy GPRS projects In-Reply-To: References: Message-ID: Prepare to deprecate legacy GPRS projects * use coverity check on osmo-ggsn instead of openggsn * move osmo-sgsn and osmo-ggsn from nightly-split into nightly Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh M scripts/osmocom-nightly-nitb-split.sh M scripts/osmocom-nightly-packages.sh 4 files changed, 6 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/56/4056/2 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 58a74f2..bccd7ea 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -69,8 +69,8 @@ popd } -build_openggsn() { - pushd openggsn +build_osmoggsn() { + pushd osmo-ggsn do_build popd } @@ -155,7 +155,7 @@ build_libosmonetif build_libosmosccp build_libsmpp34 -build_openggsn +build_osmoggsn #IU build_osmoiuh build_osmopcu build_osmobts diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 6d226b2..386e16e 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -13,7 +13,7 @@ libosmo-sccp \ libsmpp34 \ openbsc \ - openggsn \ + osmo-ggsn \ osmo-bts \ osmo-gmr \ osmo-iuh \ diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index 3b547bf..4484214 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -90,11 +90,9 @@ checkout libasn1c checkout osmo-iuh checkout osmo-hlr - checkout osmo-ggsn checkout osmo-mgw checkout osmo-bsc checkout osmo-msc - checkout osmo-sgsn build libosmocore build libosmo-abis @@ -104,11 +102,9 @@ build libasn1c build osmo-iuh build osmo-hlr - build osmo-ggsn build osmo-mgw build osmo-bsc build osmo-msc - build osmo-sgsn post } diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 84cf6e4..032bd49 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,7 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 -git clone git://git.osmocom.org/openggsn +git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap @@ -51,7 +51,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 -build openggsn +build osmo-sgsn build osmo-ggsn build openbsc build osmo-pcap -- To view, visit https://gerrit.osmocom.org/4056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:32:50 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 25 Sep 2017 13:32:50 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) Hi Maxim, Thanks for review! > Also, example output of 'sh talloc-context ..' > in commit message would be nice. The output is the same as in case of calling the talloc_report() or talloc_report_full(). Not sure, should we add an output example. https://gerrit.osmocom.org/#/c/4018/1/src/vty/talloc_ctx_vty.c File src/vty/talloc_ctx_vty.c: Line 48: > I think it's big enough to warrant doxygen header with explanation of what Would be done in the next revision. Line 50: int max_depth, int is_ref, void *data) > If it's 'int' than it means that it could be negative. Please either explai Because a negative value could be used to get a report with unlimited length. This is actually how does the talloc_report_full() work. Line 63: if (p->filter == WALK_FILTER_REGEXP) { > So you explicitly check for 2 possible enum values and implicitly for 3rd o Ok, I'll do that. Thanks! Line 139: params = talloc_zero(tall_vty_ctx, struct walk_cb_params); > Will this allocation be included in the report too? No, because an independent talloc context is used as parent. Line 229: talloc_free(params); > The params are always alloced/freed in the same function. Do we have to use I think that exactly dynamic allocation is better here, because: - No need to keep the memory allocated until / after the command is used; - No need to set default values for all params (thanks to talloc); -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:48:05 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Mon, 25 Sep 2017 13:48:05 +0000 Subject: osmo-ci[master]: Prepare to deprecate legacy GPRS projects In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:52:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 13:52:26 +0000 Subject: [PATCH] osmo-msc[master]: fix debian: fix erratic doc/examples install path Message-ID: Review at https://gerrit.osmocom.org/4059 fix debian: fix erratic doc/examples install path Change-Id: I8fc3d50b95649145e45ea6b56792ddbaf0548050 --- M debian/osmo-msc.install 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/59/4059/1 diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 145d25d..3e289b2 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ usr/bin/osmo-msc -usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg +usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg -- To view, visit https://gerrit.osmocom.org/4059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fc3d50b95649145e45ea6b56792ddbaf0548050 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:52:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 13:52:39 +0000 Subject: osmo-msc[master]: fix debian: fix erratic doc/examples install path In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fc3d50b95649145e45ea6b56792ddbaf0548050 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:54:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 13:54:25 +0000 Subject: [PATCH] openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4008 to look at the new patch set (#3). Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts.c M openbsc/src/libbsc/e1_config.c 4 files changed, 33 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/08/4008/3 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 6b2269e..c19b125 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -715,6 +715,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index c6ff6d5..ada2f3c 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -237,6 +238,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; + struct timespec tp; + int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -307,8 +311,22 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ + sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec. since %s", + (sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24), + (sec % (60 * 60 * 24)) / (60 * 60), + (sec % (60 * 60)) / 60, sec % 60, ctime(&(bts->uptime))); + } + } + vty_out(vty, "%s", VTY_NEWLINE); + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..64eb4f2 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -395,6 +397,8 @@ struct gsm_bts *bts; struct ipaccess_unit *dev = unit_data; struct e1inp_sign_link *sign_link = NULL; + struct timespec tp; + int rc; bts = find_bts_by_unitid(bsc_gsmnet, dev->site_id, dev->bts_id); if (!bts) { @@ -423,6 +427,8 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/openbsc/src/libbsc/e1_config.c b/openbsc/src/libbsc/e1_config.c index d57dec5..92b2475 100644 --- a/openbsc/src/libbsc/e1_config.c +++ b/openbsc/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -160,6 +160,8 @@ struct e1inp_line *line; struct e1inp_sign_link *oml_link; struct gsm_bts_trx *trx; + struct timespec tp; + int rc; DEBUGP(DLMI, "e1_reconfig_bts(%u)\n", bts->nr); @@ -201,6 +203,8 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:54:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 13:54:31 +0000 Subject: [PATCH] osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4009 to look at the new patch set (#3). Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/bsc_vty.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/e1_config.c 4 files changed, 33 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4009/3 diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 6ce571e..f41bac4 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -722,6 +722,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3a80f06..addf97a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -234,6 +235,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; + struct timespec tp; + int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -304,8 +308,22 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ + sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec. since %s", + (sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24), + (sec % (60 * 60 * 24)) / (60 * 60), + (sec % (60 * 60)) / 60, sec % 60, ctime(&(bts->uptime))); + } + } + vty_out(vty, "%s", VTY_NEWLINE); + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index 1f203f5..87ec7b2 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -395,6 +397,8 @@ struct gsm_bts *bts; struct ipaccess_unit *dev = unit_data; struct e1inp_sign_link *sign_link = NULL; + struct timespec tp; + int rc; bts = find_bts_by_unitid(bsc_gsmnet, dev->site_id, dev->bts_id); if (!bts) { @@ -423,6 +427,8 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index 1923efd..3656315 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -160,6 +160,8 @@ struct e1inp_line *line; struct e1inp_sign_link *oml_link; struct gsm_bts_trx *trx; + struct timespec tp; + int rc; DEBUGP(DLMI, "e1_reconfig_bts(%u)\n", bts->nr); @@ -201,6 +203,8 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Sep 25 13:58:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 13:58:15 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 1: > The output is the same as in case of calling the talloc_report() or talloc_report_full(). Just add this to commit message. -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:06:52 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 25 Sep 2017 14:06:52 +0000 Subject: [PATCH] libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4018 to look at the new patch set (#2). VTY: implement talloc context introspection command This change introduces a new command, which could be used to inspect the application's talloc context directly from VTY. To enable this feature, an application need to provide it's context via the 'vty_app_info' struct, and register the VTY command by calling the osmo_talloc_vty_add_cmds(). The new command is a sub-command of 'show': show talloc-context [filter] Currently the following contexts may be inspected: - application - a context provided by an application; - null - all contexts, if NULL-context tracking is enabled. A report depth is defined by the next parameter, and could be: - full - full tree report, as the talloc_report_full() does; - brief - brief tree report, as the talloc_report() does; - DEPTH - user defined maximal report depth. Also, there are two optional report filters: - regexp - print only contexts, matching a regular expression; - tree - print a specific context, pointed by specified address. Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d --- M include/osmocom/vty/misc.h M src/vty/Makefile.am A src/vty/talloc_ctx_vty.c 3 files changed, 274 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/4018/2 diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index 545955c..335558d 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -28,6 +28,7 @@ void vty_out_fsm(struct vty *vty, struct osmo_fsm *fsm); void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi); void osmo_fsm_vty_add_cmds(void); +void osmo_talloc_vty_add_cmds(void); int osmo_vty_write_config_file(const char *filename); diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index e083a1c..1dc76c3 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -10,7 +10,8 @@ lib_LTLIBRARIES = libosmovty.la libosmovty_la_SOURCES = buffer.c command.c vty.c vector.c utils.c \ - telnet_interface.c logging_vty.c stats_vty.c fsm_vty.c + telnet_interface.c logging_vty.c stats_vty.c \ + fsm_vty.c talloc_ctx_vty.c libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined $(TALLOC_LIBS) libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la endif diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c new file mode 100644 index 0000000..7652200 --- /dev/null +++ b/src/vty/talloc_ctx_vty.c @@ -0,0 +1,271 @@ +/*! \file talloc_ctx_vty.c + * Osmocom talloc context introspection via VTY. */ +/* + * (C) 2017 by Vadim Yanitskiy + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include +#include + +extern void *tall_vty_ctx; +extern struct host host; + +enum walk_filter_type { + WALK_FILTER_NONE = 0, + WALK_FILTER_REGEXP, + WALK_FILTER_TREE, +}; + +struct walk_cb_params { + enum walk_filter_type filter; + unsigned int depth_pass; + const void *chunk_ptr; + struct vty *vty; + regex_t regexp; +}; + +/*! + * Print a talloc memory hierarchy to the given VTY. + * To be called by the talloc_report_depth_cb(). + * If one of supported filters is specified, then + * only satisfying memory trees would be printed. + * + * @param chunk The talloc chunk to be printed + * @param depth Current depth value + * @param max_depth Maximal depth of report (negative means full) + * @param is_ref Is this chunk a reference? + * @param data The walk_cb_params struct instance + */ +static void talloc_ctx_walk_cb(const void *chunk, int depth, + int max_depth, int is_ref, void *data) +{ + struct walk_cb_params *p = (struct walk_cb_params *) data; + const char *chunk_name = talloc_get_name(chunk); + struct vty *vty = p->vty; + int rc; + + if (depth > 0 && p->filter) { + if (p->depth_pass && depth > p->depth_pass) + goto filter_bypass; + else + p->depth_pass = 0; + + switch (p->filter) { + case WALK_FILTER_REGEXP: + /* Filter chunks using a regular expression */ + rc = regexec(&p->regexp, chunk_name, 0, NULL, 0); + if (rc) + return; + break; + case WALK_FILTER_TREE: + /* Print a specific memory tree only */ + if (chunk != p->chunk_ptr) + return; + break; + default: + /* Unsupported filter or incorrect value */ + return; + } + + p->depth_pass = depth; + } + +filter_bypass: + + if (is_ref) { + vty_out(vty, "%*sreference to: %s%s", + depth * 2, "", chunk_name, VTY_NEWLINE); + return; + } + + size_t chunk_blocks = talloc_total_blocks(chunk); + size_t chunk_size = talloc_total_size(chunk); + + if (depth == 0) { + vty_out(vty, "%stalloc report on '%s' " + "(total %6zu bytes in %3zu blocks)%s", + (max_depth < 0 ? "full " : ""), chunk_name, + chunk_size, chunk_blocks, VTY_NEWLINE); + return; + } + + vty_out(vty, "%*s%-30s contains %6zu bytes " + "in %3zu blocks (ref %zu) %p%s", depth * 2, "", + chunk_name, chunk_size, chunk_blocks, + talloc_reference_count(chunk), + chunk, VTY_NEWLINE); +} + +/*! + * Parse talloc context and depth values from a VTY command. + * + * @param ctx The context to be printed (a string from argv) + * @param depth The report depth (a string from argv) + * @param params The walk_cb_params struct instance + */ +static void talloc_ctx_walk(const char *ctx, const char *depth, + struct walk_cb_params *params) +{ + const void *talloc_ctx = NULL; + int max_depth; + + /* Determine a context for report */ + if (!strncmp(ctx, "app", 3)) + talloc_ctx = host.app_info->tall_ctx; + else if (!strncmp(ctx, "all", 3)) + talloc_ctx = NULL; + + /* Determine report depth */ + if (depth[0] == 'f') + max_depth = -1; + else if (depth[0] == 'b') + max_depth = 1; + else + max_depth = atoi(depth); + + talloc_report_depth_cb(talloc_ctx, 0, max_depth, + &talloc_ctx_walk_cb, params); +} + +DEFUN(show_talloc_ctx, show_talloc_ctx_cmd, + "show talloc-context (application|all) (full|brief|DEPTH)", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value") +{ + struct walk_cb_params *params; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Set up callback parameters */ + params->filter = WALK_FILTER_NONE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_filter, show_talloc_ctx_filter_cmd, + "show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value\n" + "Filter chunks using regular expression\n" + "Regular expression") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to compile a regular expression */ + rc = regcomp(¶ms->regexp, argv[2], 0); + if (rc) { + vty_out(vty, "Invalid expression%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_REGEXP; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + regfree(¶ms->regexp); + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_tree, show_talloc_ctx_tree_cmd, + "show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value\n" + "Display only a specific memory chunk\n" + "Chunk address (e.g. 0xdeadbeef)") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to parse an address */ + rc = sscanf(argv[2], "%p", ¶ms->chunk_ptr); + if (rc != 1) { + vty_out(vty, "Invalid chunk address%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_TREE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +/*! + * Install VTY commands for talloc context introspection. + * + * This installs a set of VTY commands for introspection of + * a talloc context. Call this once from your application + * if you want to support those commands. + */ +void osmo_talloc_vty_add_cmds(void) +{ + install_element_ve(&show_talloc_ctx_cmd); + install_element_ve(&show_talloc_ctx_tree_cmd); + install_element_ve(&show_talloc_ctx_filter_cmd); +} -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:10:37 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 25 Sep 2017 14:10:37 +0000 Subject: [PATCH] libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4018 to look at the new patch set (#3). VTY: implement talloc context introspection command This change introduces a new command, which could be used to inspect the application's talloc context directly from VTY. To enable this feature, an application need to provide it's context via the 'vty_app_info' struct, and register the VTY command by calling the osmo_talloc_vty_add_cmds(). The new command is a sub-command of 'show': show talloc-context [filter] Currently the following contexts may be inspected: - application - a context provided by an application; - null - all contexts, if NULL-context tracking is enabled. A report depth is defined by the next parameter, and could be: - full - full tree report, as the talloc_report_full() does; - brief - brief tree report, as the talloc_report() does; - DEPTH - user defined maximal report depth. Also, there are two optional report filters: - regexp - print only contexts, matching a regular expression; - tree - print a specific context, pointed by specified address. The command output is formatted the same way as in case of calling the talloc_report() or talloc_report_full(). Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d --- M include/osmocom/vty/misc.h M src/vty/Makefile.am A src/vty/talloc_ctx_vty.c 3 files changed, 274 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/4018/3 diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index 545955c..335558d 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -28,6 +28,7 @@ void vty_out_fsm(struct vty *vty, struct osmo_fsm *fsm); void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi); void osmo_fsm_vty_add_cmds(void); +void osmo_talloc_vty_add_cmds(void); int osmo_vty_write_config_file(const char *filename); diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index e083a1c..1dc76c3 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -10,7 +10,8 @@ lib_LTLIBRARIES = libosmovty.la libosmovty_la_SOURCES = buffer.c command.c vty.c vector.c utils.c \ - telnet_interface.c logging_vty.c stats_vty.c fsm_vty.c + telnet_interface.c logging_vty.c stats_vty.c \ + fsm_vty.c talloc_ctx_vty.c libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined $(TALLOC_LIBS) libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la endif diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c new file mode 100644 index 0000000..7652200 --- /dev/null +++ b/src/vty/talloc_ctx_vty.c @@ -0,0 +1,271 @@ +/*! \file talloc_ctx_vty.c + * Osmocom talloc context introspection via VTY. */ +/* + * (C) 2017 by Vadim Yanitskiy + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include +#include + +extern void *tall_vty_ctx; +extern struct host host; + +enum walk_filter_type { + WALK_FILTER_NONE = 0, + WALK_FILTER_REGEXP, + WALK_FILTER_TREE, +}; + +struct walk_cb_params { + enum walk_filter_type filter; + unsigned int depth_pass; + const void *chunk_ptr; + struct vty *vty; + regex_t regexp; +}; + +/*! + * Print a talloc memory hierarchy to the given VTY. + * To be called by the talloc_report_depth_cb(). + * If one of supported filters is specified, then + * only satisfying memory trees would be printed. + * + * @param chunk The talloc chunk to be printed + * @param depth Current depth value + * @param max_depth Maximal depth of report (negative means full) + * @param is_ref Is this chunk a reference? + * @param data The walk_cb_params struct instance + */ +static void talloc_ctx_walk_cb(const void *chunk, int depth, + int max_depth, int is_ref, void *data) +{ + struct walk_cb_params *p = (struct walk_cb_params *) data; + const char *chunk_name = talloc_get_name(chunk); + struct vty *vty = p->vty; + int rc; + + if (depth > 0 && p->filter) { + if (p->depth_pass && depth > p->depth_pass) + goto filter_bypass; + else + p->depth_pass = 0; + + switch (p->filter) { + case WALK_FILTER_REGEXP: + /* Filter chunks using a regular expression */ + rc = regexec(&p->regexp, chunk_name, 0, NULL, 0); + if (rc) + return; + break; + case WALK_FILTER_TREE: + /* Print a specific memory tree only */ + if (chunk != p->chunk_ptr) + return; + break; + default: + /* Unsupported filter or incorrect value */ + return; + } + + p->depth_pass = depth; + } + +filter_bypass: + + if (is_ref) { + vty_out(vty, "%*sreference to: %s%s", + depth * 2, "", chunk_name, VTY_NEWLINE); + return; + } + + size_t chunk_blocks = talloc_total_blocks(chunk); + size_t chunk_size = talloc_total_size(chunk); + + if (depth == 0) { + vty_out(vty, "%stalloc report on '%s' " + "(total %6zu bytes in %3zu blocks)%s", + (max_depth < 0 ? "full " : ""), chunk_name, + chunk_size, chunk_blocks, VTY_NEWLINE); + return; + } + + vty_out(vty, "%*s%-30s contains %6zu bytes " + "in %3zu blocks (ref %zu) %p%s", depth * 2, "", + chunk_name, chunk_size, chunk_blocks, + talloc_reference_count(chunk), + chunk, VTY_NEWLINE); +} + +/*! + * Parse talloc context and depth values from a VTY command. + * + * @param ctx The context to be printed (a string from argv) + * @param depth The report depth (a string from argv) + * @param params The walk_cb_params struct instance + */ +static void talloc_ctx_walk(const char *ctx, const char *depth, + struct walk_cb_params *params) +{ + const void *talloc_ctx = NULL; + int max_depth; + + /* Determine a context for report */ + if (!strncmp(ctx, "app", 3)) + talloc_ctx = host.app_info->tall_ctx; + else if (!strncmp(ctx, "all", 3)) + talloc_ctx = NULL; + + /* Determine report depth */ + if (depth[0] == 'f') + max_depth = -1; + else if (depth[0] == 'b') + max_depth = 1; + else + max_depth = atoi(depth); + + talloc_report_depth_cb(talloc_ctx, 0, max_depth, + &talloc_ctx_walk_cb, params); +} + +DEFUN(show_talloc_ctx, show_talloc_ctx_cmd, + "show talloc-context (application|all) (full|brief|DEPTH)", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value") +{ + struct walk_cb_params *params; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Set up callback parameters */ + params->filter = WALK_FILTER_NONE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_filter, show_talloc_ctx_filter_cmd, + "show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value\n" + "Filter chunks using regular expression\n" + "Regular expression") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to compile a regular expression */ + rc = regcomp(¶ms->regexp, argv[2], 0); + if (rc) { + vty_out(vty, "Invalid expression%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_REGEXP; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + regfree(¶ms->regexp); + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_tree, show_talloc_ctx_tree_cmd, + "show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS", + SHOW_STR "Show talloc memory hierarchy\n" + "Application's context\nAll contexts, " + "if NULL-context tracking is enabled\n" + "Display a full talloc memory hierarchy\n" + "Display a brief talloc memory hierarchy\n" + "Specify required maximal depth value\n" + "Display only a specific memory chunk\n" + "Chunk address (e.g. 0xdeadbeef)") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to parse an address */ + rc = sscanf(argv[2], "%p", ¶ms->chunk_ptr); + if (rc != 1) { + vty_out(vty, "Invalid chunk address%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_TREE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +/*! + * Install VTY commands for talloc context introspection. + * + * This installs a set of VTY commands for introspection of + * a talloc context. Call this once from your application + * if you want to support those commands. + */ +void osmo_talloc_vty_add_cmds(void) +{ + install_element_ve(&show_talloc_ctx_cmd); + install_element_ve(&show_talloc_ctx_tree_cmd); + install_element_ve(&show_talloc_ctx_filter_cmd); +} -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:16:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 25 Sep 2017 14:16:46 +0000 Subject: osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/4009/3/src/libbsc/bsc_vty.c File src/libbsc/bsc_vty.c: Line 317: sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); Make sure bts->uptime is also taken from MONOTONIC clock, otherwise you can get strange values with difftime. You should definetly not mix times using different clock sources. Specially because later on, you use ctime() with bts->uptime. So, as conclusion, one of the two parts of the code is wrong. I think it makes sense to use a monotonic clock to print the elapsed time, but you should be using a wall clock to print the ctime part, because a monotonic clock doesn't need to contain similar values than a wall clock (which would print really weird dates). This way it can also be seen easily if there has been some type of big clock drift and understand better the real time it has been up. Strictly speaking I am not sure it's actually good using difftime for this, because according to man page it expects calendar clocks and afaik MONOTONIC clock doesn't follow that rule. Anyway, implementation wise it's only substracting one with another which seems like the expected behaviour. Line 318: vty_out(vty, " %llu days %llu hours %llu min. %llu sec. since %s", All this code in here looks like a good candidate to be moved to its own function. libosmocore ./include/osmocom/core/timer.h (or a new time_util.h) may be a good idea. function timespec_to_elapsed(char *buf, timespec *tp) or similar? Line 319: (sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24), may be nice to also move all this operations to different macros in the same header file? may come handy later in other parts. -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:18:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 25 Sep 2017 14:18:05 +0000 Subject: openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 See my comments in the other patch. -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:23:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 14:23:53 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 3: (4 comments) https://gerrit.osmocom.org/#/c/4018/3/src/vty/talloc_ctx_vty.c File src/vty/talloc_ctx_vty.c: Line 56: * @param depth Current depth value What's the meaning of negative depth? Line 58: * @param is_ref Is this chunk a reference? So it's always used as boolean? Than the type should be bool. Line 73: p->depth_pass = 0; Sorry, I'm still kinda lost between all the goto and checks. Here you assign 0 to depth_pass. Line 92: p->depth_pass = depth; But here it's overwritten unless the return was triggered inside the switch(). If that's intentional than there should be the comment explaining how it works or why it's necessary. -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:34:26 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 25 Sep 2017 14:34:26 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 1: > (2 comments) Using two successive "bitvec_set_bit(dest, H)" will be a good idea to avoid to introduce a new API in libosmocore. -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:38:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 14:38:45 +0000 Subject: [PATCH] libosmocore[master]: Add time conversion helpers Message-ID: Review at https://gerrit.osmocom.org/4060 Add time conversion helpers Add macros to break down absolute time in seconds into days/hors/minutes passed. Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf --- M include/osmocom/core/timer.h 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/4060/1 diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 40b39b9..4958efb 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -45,6 +45,11 @@ #include #include +/* convert absolute time (in seconds) to elapsed days/hours/minutes */ +#define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60) +#define OSMO_SEC2HRS(sec) ((sec % (60 * 60 * 24)) / (60 * 60)) +#define OSMO_SEC2DAY(sec) ((sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24)) /* we ignore leap year for simplicity */ + /*! A structure representing a single instance of a timer */ struct osmo_timer_list { struct rb_node node; /*!< rb-tree node header */ -- To view, visit https://gerrit.osmocom.org/4060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:42:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 25 Sep 2017 14:42:06 +0000 Subject: [PATCH] libosmocore[master]: Add time conversion helpers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4060 to look at the new patch set (#2). Add time conversion helpers Add macros to break down absolute time in seconds into days/hours/minutes passed. Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf --- M include/osmocom/core/timer.h 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/4060/2 diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 40b39b9..4958efb 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -45,6 +45,11 @@ #include #include +/* convert absolute time (in seconds) to elapsed days/hours/minutes */ +#define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60) +#define OSMO_SEC2HRS(sec) ((sec % (60 * 60 * 24)) / (60 * 60)) +#define OSMO_SEC2DAY(sec) ((sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24)) /* we ignore leap year for simplicity */ + /*! A structure representing a single instance of a timer */ struct osmo_timer_list { struct rb_node node; /*!< rb-tree node header */ -- To view, visit https://gerrit.osmocom.org/4060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 25 14:50:56 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 25 Sep 2017 14:50:56 +0000 Subject: libosmocore[master]: Add time conversion helpers In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Sep 25 16:24:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 16:24:01 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4012 to look at the new patch set (#3). add OsmoMSC manual Add OsmoMSC and OsmoHLR to bibliography (even though the OsmoHLR manual does not yet exist, a reference to it has been added in OsmoMSC's manual). Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee --- M Makefile A OsmoMSC/Makefile A OsmoMSC/chapters/control.adoc A OsmoMSC/chapters/net.adoc A OsmoMSC/chapters/overview.adoc A OsmoMSC/chapters/running.adoc A OsmoMSC/chapters/smpp.adoc A OsmoMSC/osmomsc-usermanual-docinfo.xml A OsmoMSC/osmomsc-usermanual.adoc A OsmoMSC/osmomsc-vty-reference.xml A OsmoMSC/vty/msc_vty_additions.xml A OsmoMSC/vty/msc_vty_reference.xml M common/chapters/bibliography.adoc 13 files changed, 3,824 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/12/4012/3 diff --git a/Makefile b/Makefile index c09dd58..ffa25de 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) + cd OsmoMSC; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -19,6 +20,7 @@ cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean + cd OsmoMSC; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -30,6 +32,7 @@ cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload + cd OsmoMSC; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -42,6 +45,7 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + cd OsmoMSC; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile new file mode 100644 index 0000000..febf7d1 --- /dev/null +++ b/OsmoMSC/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +msc_reference = $(topdir)/osmomsc-vty-reference.xml +manuals = $(msc_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmomsc-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmomsc-usermanual__*.svg + -rm osmomsc-usermanual__*.png + -rm osmomsc-usermanual.check + +generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/msc_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/msc_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging MSC VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting MSC VTY to DocBook) diff --git a/OsmoMSC/chapters/control.adoc b/OsmoMSC/chapters/control.adoc new file mode 100644 index 0000000..af03be7 --- /dev/null +++ b/OsmoMSC/chapters/control.adoc @@ -0,0 +1,31 @@ +[[control]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoMSC. + +.Variables available on OsmoMSC's Control interface +[options="header",width="100%",cols="20%,5%,5%,50%,20%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber-list-active-v1|RO|No||Return list of active subscribers. +|=== + +=== subscriber-list-active-v1 + +Return a list of subscribers that are successfully attached (including full +successful authentication and ciphering if those are enabled). + +The reply comprises of one subscriber per line, of the format + +---- +,\n[,\n[...]] +---- + +For example: + +---- +901700000015252,22801 +901700000015253,22802 +---- diff --git a/OsmoMSC/chapters/net.adoc b/OsmoMSC/chapters/net.adoc new file mode 100644 index 0000000..06be4ba --- /dev/null +++ b/OsmoMSC/chapters/net.adoc @@ -0,0 +1,154 @@ +[[net]] +== Configuring the Core Network + +The core network parameters are configured by the config file (as in `osmo-msc +-c osmo-msc.cfg`). The config file is parsed by the VTY, which is also +available via telnet in the running `osmo-msc` instance. Be aware that even +though you may be able to change these parameters without restarting +`osmo-msc`, some may not take immediate effect, and it is safest to use the +config file to have these parameters set at startup time. + +The core network parameters are found in the `config` / `network`. + +A full reference to the available commands can be found in the _OsmoMSC VTY +reference manual_ <>. This section describes only the most +commonly used settings. + +Here is an overview of the config items, described in more detail below: + +---- +network + network country code 262 + mobile network code 89 + mm info 1 + short name OsmoMSC + long name OsmoMSC + authentication required + encryption a5 3 +---- + +[TIP] +==== +Use the telnet VTY interface to query the current configuration of a running +`osmo-msc` process: + +---- +$ telnet localhost 4254 +OsmoMSC> enable +OsmoMSC# show running-config +---- + +Some parameters may be changed without restarting `osmo-msc`. To reach the +`network` node, enter: + +---- +OsmoMSC> enable +OsmoMSC# configure terminal +OsmoMSC(config)# network +OsmoMSC(config-net)# short name Example-Name +OsmoMSC(config-net)# exit +OsmoMSC(config)# +---- + +The telnet VTY features tab-completion as well as context sensitive help shown +when entering a `?` question mark. + +You can always use the `list` VTY command or enter `?` on the blank prompt to +get a list of all possible commands at the current node. +==== + + +=== MCC/MNC + +The key identities of every GSM PLMN is the Mobile Country Code and the Mobile +Network Code. They are identical over the entire network. In most cases, the +MCC/MNC will be allocated to the operator by the respective local regulatory +authority. For example, to set the MCC/MNC of 262-89, have this in your +osmo-msc.cfg: + +---- +network + network country code 262 + mobile network code 89 +---- + + +=== Configuring MM INFO + +The _MM INFO_ procedure can be used after a successful _LOCATION UPDATE_ in +order to transmit the human-readable network name as well as local time zone +information to the MS. By default, _MM INFO_ is not active, i.e. `0`. Set to `1` +to activate this feature: + +---- +network + mm info 1 + short name OsmoMSC + long name OsmoMSC +---- + +[NOTE] +==== +Not all phones support the MM INFO procedure. If a phone is not +factory-programmed to contain the name for your MCC/MNC, it will likely only +provide a numeric display of the network name, such as _262-89_, or show the +country code transformed into a letter, such as _D 89_. +==== + +The time information transmitted is determined by the local system time of the +operating system on which OsmoMSC is running. + + +=== Authentication + +Authorized subscribers must be entered in the HLR database, see the _OsmoHLR +reference manual_ <>. If authentication tokens (such as KI for +2G, or K and OP/OPC for UMTS) are present in the HLR, OsmoMSC will only attach +a subscriber after successful authentication. + +If no authentication keys are present in the HLR for a given subscriber, +OsmoMSC will attach the subscriber _without_ authentication. You can reject +subscribers that lack authentication info in the HLR with this setting: + +---- +network + authentication required +---- + +=== Ciphering + +To enable ciphering on the radio link, authentication must take place first: +the Kc resulting from authentication is the key used for ciphering. Hence, all +subscribers must have authentication tokens available in the HLR for ciphering. + +The MS, BTS and MSC must agree on a ciphering algorithm to use. + +- The MS sends its supported ciphering algorithms via Classmark IEs during + Location Updating. +- Typically the BSC needs to know which A5 ciphers are supported by connected + BTSes. +- Finally, OsmoMSC may impose that specific A5 ciphers shall not be considered. + +It is the responsibility of the BSC to then pick an A5 cipher that satisfies +all requirements. + +- In OsmoMSC, A5/0 means that ciphering is turned off. ++ +---- +network + encryption a5 0 +---- + +- A5/1 and A5/3 are currently supported by Osmocom. ++ +---- +network + encryption a5 3 +---- + +- Never use A5/2: it is an "export grade cipher" and has been deprecated for + its low ciphering strength. + +NOTE: At the time of writing, OsmoMSC supports setting only a single A5 cipher, +while it should be able to allow a set of ciphers. This is subject to ongoing +development. diff --git a/OsmoMSC/chapters/overview.adoc b/OsmoMSC/chapters/overview.adoc new file mode 100644 index 0000000..0bb47d7 --- /dev/null +++ b/OsmoMSC/chapters/overview.adoc @@ -0,0 +1,127 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoMSC. It will cover +aspects of configuring and running the OsmoMSC. + +[[intro_overview]] +=== About OsmoMSC + +OsmoMSC is the Osmocom implementation of a Mobile Switching Center (MSC) for 2G +and 3G GSM and UMTS mobile networks. Its interfaces are: + +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. + +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. +Before it was split off, OsmoMSC originated from libmsc of the old openbsc.git. +Since a true _A_ interface and IuCS for 3G support is available, OsmoMSC +exists only as a separate standalone entity. + +Key differences of the new OsmoMSC compared to the old OsmoNITB are: + +- The complete VLR implementation that communicates with the separate HLR + (OsmoHLR) for subscriber management. In contrast to the OsmoNITB, HLR queries + are fully asynchronous, and the separate HLR allows using centralized + subscriber management for both circuit-switched and packet-switched domains + (i.e. one OsmoHLR for both OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- Addition of a true _A_ interface for 2G voice services. Previously, OsmoBSC + had an SCCPlite based _A_ interface towards 3rd party MSC implementations. + OsmoMSC features a true SCCP/M3UA _A_ interface, which allows running OsmoBSC + against this Osmocom based MSC implementation. The new SCCP/M3UA SIGTRAN for + the _A_ interface is implemented in libosmo-sccp, which is used by OsmoMSC + and OsmoBSC (and others), to establish a link via an STP (e.g. OsmoSTP). + +- Addition of an _IuCS_ interface to allow operating 3G voice services, also + via SCCP/M3UA SIGTRAN, for example connecting via OsmoHNBGW to a 3G small + cell device. + +Find the OsmoMSC issue tracker and wiki online at + +- https://osmocom.org/projects/osmomsc +- https://osmocom.org/projects/osmomsc/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoMSC +[graphviz] +---- +digraph G { + rankdir=LR; + MS0 [label="MS"] + MS1 [label="MS"] + MS2 [label="MS"] + MS3 [label="MS"] + UE0 [label="UE"] + UE1 [label="UE"] + BTS0 [label="BTS"] + BTS1 [label="BTS"] + STP [label="STP\n(SCCP routing)"] + HLR [label="HLR+AUC+EIR"] + HNB [label="RNC or hNodeB"] + MGW + MS0->BTS0 [label="Um"] + MS1->BTS0 [label="Um"] + MS2->BTS1 [label="Um"] + MS3->BTS1 [label="Um"] + UE0->HNB + UE1->HNB + BTS0->BSC [label="Abis"] + BTS1->BSC [label="Abis"] + BSC->STP [label="A/SCCP/M3UA"] + STP->MSC [label="A/SCCP/M3UA"] + STP->MSC [label="IuCS/SCCP/M3UA"] + VLR->HLR [label="GSUP"] + HNB->HNBGW [label="Iuh"] + HNBGW->STP [label="IuCS/SCCP/M3UA"] + MSC->MGW [label="MGCP"] + BTS0->MGW [label="RTP"] + BTS1->MGW [label="RTP"] + subgraph cluster_msc { + label = "OsmoMSC"; + MSC->SMSC; + MSC->VLR + } +} +---- + + +=== Software Components + +This is a brief description of OsmoMSC's internal software components. + +==== SMSC + +A minimal store-and-forward server for SMS, supporting both MO and MT +SMS service, as well as multi-part messages. + +The built-in SMSC also supports an external SMSC interface. For more +information, see <>. + +==== MSC + +The MSC component implements the mobility management (MM) functions of the TS +04.08 and delegates to SMSC for SMS message handling and the VLR for subscriber +management. + +Furthermore, it can handle TS 04.08 Call Control (CC), either by use of +an internal MNCC handler, or by use of an external MNCC agent. For more +information see <>. + +==== VLR + +A fully featured Visitor Location Register handles the subscriber management +and authentication, and interfaces via GSUP to the external HLR. diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc new file mode 100644 index 0000000..5925e02 --- /dev/null +++ b/OsmoMSC/chapters/running.adoc @@ -0,0 +1,148 @@ +== Running OsmoMSC + +The OsmoMSC executable (`osmo-msc`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-msc* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] [-M 'SOCKETPATH'] [-C] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as SMS storage +*-M, --mncc-sock-path*:: + Enable the MNCC socket for an external MNCC handler. See + <> for further information. +*-m, --mncc-sock*:: + Same as option -M (deprecated). +*-C, --no-dbcounter*:: + Disable the regular periodic synchronization of statistics + counters to the database. + + +=== Multiple instances + +Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, +CTRL) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different IP +addresses. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +If external SMPP is enabled, you may bind it to a different interface using: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 +---- + +More on SMPP configuration in <>. + +The external MNCC handler is configured by the `--mncc-sock` commandline +argument. Choose a different such socket path for each OsmoMSC instance running +on the same file system. See more in <>. + +For the following links, OsmoMSC acts as a client and does not listen/bind to a +specific interface, and will hence not encounter conflicts for multiple instances +running on the same interface: + +- The SCCP/M3UA links are established by OsmoMSC contacting an STP. +- The GSUP link is established by OsmoMSC contacting an HLR. + + +=== Configure primary links + +==== Configure SCCP/M3UA to accept _A_ and _IuCS_ links + +OsmoMSC will contact an STP instance to establish an SCCP/M3UA link. BSC and +HNBGW will then reach the MSC via this link. By default, an STP instance is +assumed to listen on the default M3UA port (2905) on the local host. + +Establishing an SCCP/M3UA link towards an STP instance not on the local host +can be configured as follows: + +---- +cs7 instance 0 + asp my-OsmoMSC 2905 0 m3ua + ! IP address of the remote STP: + remote-ip 10.23.24.1 +---- + +Note that _A_ and _IuCS_ may use different SCCP instances, if so desired: + +---- +cs7 instance 0 + asp my-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.42.1 +cs7 instance 1 + asp my-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.42.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 +---- + +A full configuration needs an `asp` on an `as` -- an Application Server Process +running on an Application Server -- as well as a local point code and routing +configuration. The SCCP VTY automatically creates those parts that are missing, +by assuming sane defaults. A complete configuration would look like this: + +---- +cs7 instance 0 + point-code 0.23.1 + asp my-OsmoMSC-A-Iu 2905 0 m3ua + remote-ip 127.0.0.1 + as my-as-for-OsmoMSC-A-Iu m3ua + asp my-OsmoMSC-A-Iu + routing-key 0 0.23.1 +---- + +==== Configure GSUP to reach the HLR + +OsmoMSC will assume a GSUP server (OsmoHLR) to run on the local host and the +default GSUP port (4222). Contacting an HLR at a different IP address can be +configured as follows: + +---- +hlr + ! IP address of the remote HLR: + remote-ip 10.23.42.1 + ! default port is 4222, optionally configurable by: + remote-port 1234 +---- diff --git a/OsmoMSC/chapters/smpp.adoc b/OsmoMSC/chapters/smpp.adoc new file mode 100644 index 0000000..aab5a2c --- /dev/null +++ b/OsmoMSC/chapters/smpp.adoc @@ -0,0 +1,147 @@ +[[smpp]] +== Short Message Peer to Peer (SMPP) + +In OsmoMSC, the _Short Message Peer to Peer_ (SMPP) Protocol <> +interface allows sending MT-SMS to an attached subscriber or receiving unrouted +MO-SMS. OsmoMSC implements version 3.4 of the protocol. + +NOTE: `osmo-msc` must have been compiled with the `--enable-smpp` configure +option to offer the SMPP interface. + +Multiple ESMEs (External SMS Entities) may interact with an SMSC (SMS Service +Center) via the SMPP protocol. Each entity is identified by its System Id, a +character string which is configured by the system administrator. + +OsmoMSC implements the SMSC side of SMPP and acts as a TCP server accepting +incoming connections from ESME client programs. + +Each ESME identifies itself to the SMSC with its system-id and an +optional shared password. + + +[[smpp-config-global]] +=== Global SMPP configuration + +Configure OsmoMSC's SMPP behavior at the top-level `smpp` VTY node, for +example: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 + system-id osmomsc123 + policy closed + no smpp-first +---- + +Use the `local-tcp-ip` command to define the TCP IP and port at which the +OsmoMSC internal SMSC should listen for incoming SMPP connections. The default +is to listen on all IPs (0.0.0.0) and the default port assigned to SMPP (2775). + +Use the `system-id` command to define the System ID of the SMSC. + +Use the `policy` parameter to define whether only explicitly configured +ESMEs are permitted to access the SMSC (`closed`), or whether any +ESME should be accepted (`accept-all`). + +Use the `smpp-first` command to define if SMPP routes have higher precedence +than MSISDNs contained in the HLR, or `no smpp-first` if only MSISDNs not +present in the HLR should be considered for routing to SMPP. + + +[[esme]] +=== ESME configuration + +Under the `smpp` vty node, you can add any number of `esme` nodes, one +for each ESME that you wish to configure. For example: + +---- +smpp + policy closed + no smpp-first + esme example1 + password s3cr3t + default-route + deliver-src-imsi + osmocom-extensions + esme example2 + password p4ssw0rd + deliver-src-imsi + osmocom-extensions + route prefix national isdn 2342 +---- + +Use the `esme NAME` command (where NAME corresponds to the system-id of +the ESME to be configured) under the SMPP vty node to enter the +configuration node for this given ESME. + +Use the `password` command to specify the password (if any) for the +ESME. + +Use the `default-route` command to indicate that any MO-SMS without a +more specific route should be routed to this ESME. + +Use the `deliver-src-imsi` command to indicate that the SMPP DELIVER +messages for MO SMS and the SMPP ALERT should state the IMSI (rather +than the MSISDN) as source address. + +Use the `osmocom-extensions` command to request that Osmocom specific +extension TLVs shall be included in the SMPP PDUs. Those extensions +include the ARFCN of the cell, the L1 transmit power of the MS, the +timing advance, the uplink and dwnlink RxLev and RxQual, as well as the +IMEI of the terminal at the time of generating the SMPP DELIVER PDU. + +Use the `dcs-transparent` command to transparently pass the DCS value +from the SMS Layer3 protocols to SMPP, instead of converting them to the +SMPP-specific values. + +Use the `route prefix` command to specify a route towards this ESME. +Using routes, you specify which destination MSISDNs should be routed +towards your ESME. + + +=== Osmocom SMPP protocol extensions + +Osmocom has implemented some extensions to the SMPP v3.4 protocol. + +These extensions can be enabled using the `osmocom-extensions` VTY +command at `esme` level, see <>. + +The TLV definitions can be found in the +`` header file provided by +libosmocore. + +==== RF channel measuremets + +When the Osmocom SMPP extensions are enabled, we add the following +TLVs to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length (Octets) | Purpose +| TLVID_osmo_arfcn | 0x2300 | 2 | GSM ARFCN of the radio interface +| TLVID_osmo_ta | 0x2301 | 1 | Timing Advance on the radio interface +| TLVID_osmo_ms_l1_txpwr | 0x2307 | 1 | Transmit Power of the MS in uplink direction +| TLVID_osmo_rxlev_ul | 0x2302 | 2 | Uplink receive level as measured by BTS in dBm (int16_t) +| TLVID_osmo_rxqual_ul | 0x2303 | 1 | Uplink RxQual value as measured by BTS +| TLVID_osmo_rxlev_dl | 0x2304 | 2 | Downlink receive level as measured by MS in dBm (int16_t) +| TLVID_osmo_rxqual_dl | 0x2305 | 1 | Downlink RxQual value as measured by MS +|=== + +All of the above values reflect the *last measurement report* as +recieved vi A-bis RSL from the BTS. It is thus a snapshot value (of +the average within one 480ms SACCH period), and not an average over +all the SACCH periods during which the channel was open or the SMS was +received. Not all measurement reports contain all the values. So you +might not get an TLVID_osmo_rxlev_dl IE, as that particular uplink +frame might habe benn lost for the given snapshot we report. + +==== Equipment IMEI + +If we know the IMEI of the subscribers phone, we add the following TLV +to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length | Purpose +| TLVID_osmo_imei | 0x2306 | variable | IMEI of the subscibers phone (ME) +|=== diff --git a/OsmoMSC/osmomsc-usermanual-docinfo.xml b/OsmoMSC/osmomsc-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc new file mode 100644 index 0000000..6c54065 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -0,0 +1,35 @@ +:gfdl-enabled: + +OsmoMSC User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/net.adoc[] + +include::chapters/smpp.adoc[] + +include::../common/chapters/mncc.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoMSC/osmomsc-vty-reference.xml b/OsmoMSC/osmomsc-vty-reference.xml new file mode 100644 index 0000000..a954b84 --- /dev/null +++ b/OsmoMSC/osmomsc-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoMSC VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoMSC/vty/msc_vty_additions.xml b/OsmoMSC/vty/msc_vty_additions.xml new file mode 100644 index 0000000..0d473bd --- /dev/null +++ b/OsmoMSC/vty/msc_vty_additions.xml @@ -0,0 +1,24 @@ + + + + MNCC Internal Configuration + This node allows to configure the default codecs for + the internal call control handling. + + + + SMPP Configuration + This node allows to configure the SMPP interface + for interfacing with external SMS applications. This section + contains generic/common SMPP related configuration, and no + per-ESME specific parameters. + + + + ESME Configuration + This node allows to configure one particular SMPP + ESME, which is an External SMS Entity such as a SMS based + application server. You can define any number of ESME within + the SMPP node of the OsmoNITB VTY. + + diff --git a/OsmoMSC/vty/msc_vty_reference.xml b/OsmoMSC/vty/msc_vty_reference.xml new file mode 100644 index 0000000..b7311ab --- /dev/null +++ b/OsmoMSC/vty/msc_vty_reference.xml @@ -0,0 +1,3019 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index 9d4c234..129758f 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -14,6 +14,14 @@ http://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf - [[[vty-ref-osmobsc]]] Osmocom Project: OsmoBSC VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf +- [[[userman-osmomsc]]] Osmocom Project: OsmoMSC User Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-usermanual.pdf +- [[[vty-ref-osmomsc]]] Osmocom Project: OsmoMSC VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-vty-reference.pdf +- [[[userman-osmohlr]]] Osmocom Project: OsmoHLR User Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-usermanual.pdf +- [[[vty-ref-osmohlr]]] Osmocom Project: OsmoHLR VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-vty-reference.pdf - [[[userman-osmopcu]]] Osmocom Project: OsmoPCU User Manual. http://ftp.osmocom.org/docs/latest/osmopcu-usermanual.pdf - [[[vty-ref-osmopcu]]] Osmocom Project: OsmoPCU VTY Reference Manual. -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 25 16:46:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 25 Sep 2017 16:46:34 +0000 Subject: [PATCH] osmo-sgsn[master]: Remove unneeded dep libdbi Message-ID: Review at https://gerrit.osmocom.org/4061 Remove unneeded dep libdbi This dependency is not needed and it's most probably a left over from openbsc git repository split. Change-Id: I84b0e2851dc89dca39e87215c71e93457acb884f --- M configure.ac M debian/control 2 files changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/61/4061/1 diff --git a/configure.ac b/configure.ac index d5d80cc..532b977 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,6 @@ dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) found_pcap=yes AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) diff --git a/debian/control b/debian/control index 4a3a07f..ce2167a 100644 --- a/debian/control +++ b/debian/control @@ -13,8 +13,6 @@ libtalloc-dev, libc-ares-dev, libgtp-dev, - libdbi-dev, - libdbd-sqlite3, libosmocore-dev, libosmo-abis-dev, libosmo-ranap-dev, -- To view, visit https://gerrit.osmocom.org/4061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84b0e2851dc89dca39e87215c71e93457acb884f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Sep 25 20:50:14 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 25 Sep 2017 20:50:14 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 3: (4 comments) https://gerrit.osmocom.org/#/c/4018/3/src/vty/talloc_ctx_vty.c File src/vty/talloc_ctx_vty.c: Line 56: * @param depth Current depth value > What's the meaning of negative depth? There is no meaning. Line 58: * @param is_ref Is this chunk a reference? > So it's always used as boolean? Than the type should be bool. Well, this way I would have to rewrite the talloc library API. This definition was taken from the talloc documentation, and by changing types we will get a compiler warning. No way ;) Line 73: p->depth_pass = 0; > Sorry, I'm still kinda lost between all the goto and checks. Here you assig No problem, I will add a brief description here. Read the bottom comment first, please. So, a filter is being bypassed while current depth value is higher than the 'depth_pass', i.e. the callback does processing the child memory chunks. As soon as this condition becomes false, we need to 'enable' a filter, and resume the processing other chunks. Line 92: p->depth_pass = depth; > But here it's overwritten unless the return was triggered inside the switch In short, as soon as a filter passes any chunk, all the memory tree starting from one would be printed. To do that, we need to temporary 'disable' a filter for child chunks (depth > current). So, the 'depth_pass' is used to store a depth value, from which a filter is being bypassed. -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Sep 25 21:27:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 21:27:27 +0000 Subject: [PATCH] osmo-hlr[master]: comment: ctrl: explain why status-ps is a SET cmd Message-ID: Review at https://gerrit.osmocom.org/4062 comment: ctrl: explain why status-ps is a SET cmd Change-Id: I1ccf6affaf3c5f2096fd3eb36454b18c3670a1b0 --- M src/ctrl.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/62/4062/1 diff --git a/src/ctrl.c b/src/ctrl.c index 81de961..40c1e53 100644 --- a/src/ctrl.c +++ b/src/ctrl.c @@ -74,6 +74,10 @@ return handle_cmd_ps(data, cmd, false); } +/* NOTE: Even though status-ps is actually a read-only operation, it is + * implemented as a 'SET' command, so that we are able to pass the IMSI as + * argument. 'GET' commands cannot be passed arguments besides the variable + * name. */ CTRL_CMD_DEFINE_WO_NOVRF(status_ps, "status-ps"); static int set_status_ps(struct ctrl_cmd *cmd, void *data) { -- To view, visit https://gerrit.osmocom.org/4062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ccf6affaf3c5f2096fd3eb36454b18c3670a1b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 25 21:27:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 21:27:27 +0000 Subject: [PATCH] osmo-hlr[master]: add basic CTRL interface tests Message-ID: Review at https://gerrit.osmocom.org/4063 add basic CTRL interface tests Prepare for adding tests of enable-/disable-/status-ps CTRL commands. Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e --- M configure.ac A contrib/ipa.py M tests/Makefile.am A tests/ctrl_test_runner.py A tests/test_subscriber.sql 5 files changed, 515 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/63/4063/1 diff --git a/configure.ac b/configure.ac index 6532940..167d7f3 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,21 @@ dnl checks for header files AC_HEADER_STDC +AC_ARG_ENABLE([external_tests], + AC_HELP_STRING([--enable-external-tests], + [Include the VTY/CTRL tests in make check [default=no]]), + [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) +if test "x$enable_ext_tests" = "xyes" ; then + AM_PATH_PYTHON + AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) + if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then + AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) + fi +fi +AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) +AC_MSG_RESULT([$enable_ext_tests]) +AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") + AC_OUTPUT( Makefile src/Makefile diff --git a/contrib/ipa.py b/contrib/ipa.py new file mode 100755 index 0000000..71cbf45 --- /dev/null +++ b/contrib/ipa.py @@ -0,0 +1,278 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.5" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, MGCP_OLD=0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, SCCP_OLD=0xFF) + _IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def _l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def _tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self._l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self._l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self._l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self._l(self._IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext=None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + if not len(data): + return None, None, None, None + (dlen, proto) = struct.unpack('>HB', data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack + return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data + return dlen, proto, None, data[3:] # length, protocol, _, data + + def split_combined(self, data): + """ + Split the data which contains multiple concatenated IPA messages into tuple (first, rest) where rest contains remaining messages, first is the single IPA message + """ + (length, _, _, _) = self.del_header(data) + return data[:(length + 3)], data[(length + 3):] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self._tag(self._IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self._tag(self._IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self._tag(self._IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self._tag(self._IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self._tag(self._IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self._tag(self._IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self._tag(self._IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self._tag(self._IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self._tag(self._IDTAG['UNIT'], data) + + def identity(self, unit=b'', mac=b'', location=b'', utype=b'', equip=b'', sw=b'', name=b'', serial=b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def rem_header(self, data): + """ + Remove CTRL header, check for appropriate protocol and extension + """ + (_, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return None + return d + + def parse(self, data, op=None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val)) + + def cmd(self, var, val=None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxsize) + if val is not None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + + def verify(self, reply, r, var, val=None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) diff --git a/tests/Makefile.am b/tests/Makefile.am index 0bd0820..d979fb6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,6 +25,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + ctrl_test_runner.py \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -33,8 +34,17 @@ atconfig \ $(NULL) +if ENABLE_EXT_TESTS +python-tests: $(BUILT_SOURCES) + $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v +else +python-tests: $(BUILT_SOURCES) + echo "Not running python-based tests (determined at configure-time)" +endif + check-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + $(MAKE) $(AM_MAKEFLAGS) python-tests installcheck-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py new file mode 100644 index 0000000..d453197 --- /dev/null +++ b/tests/ctrl_test_runner.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python + +# (C) 2013 by Jacob Erlbeck +# (C) 2014 by Holger Hans Peter Freyther +# based on vty_test_runner.py: +# (C) 2013 by Katerina Barone-Adesi +# (C) 2013 by Holger Hans Peter Freyther +# based on bsc_control.py. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import time +import unittest +import socket +import sys +import struct +import subprocess + +import osmopy.osmoutil as osmoutil + +# add $top_srcdir/contrib to find ipa.py +sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) + +from ipa import Ctrl, IPA + +# to be able to find $top_srcdir/doc/... +confpath = os.path.join(sys.path[0], '..') +verbose = False + +class TestCtrlBase(unittest.TestCase): + + def ctrl_command(self): + raise Exception("Needs to be implemented by a subclass") + + def ctrl_app(self): + raise Exception("Needs to be implemented by a subclass") + + def setUp(self): + osmo_ctrl_cmd = self.ctrl_command()[:] + config_index = osmo_ctrl_cmd.index('-c') + if config_index: + cfi = config_index + 1 + osmo_ctrl_cmd[cfi] = os.path.join(confpath, osmo_ctrl_cmd[cfi]) + + try: + self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) + except OSError: + print >> sys.stderr, "Current directory: %s" % os.getcwd() + print >> sys.stderr, "Consider setting -b" + time.sleep(2) + + appstring = self.ctrl_app()[2] + appport = self.ctrl_app()[0] + self.connect("127.0.0.1", appport) + self.next_id = 1000 + + def tearDown(self): + self.disconnect() + osmoutil.end_proc(self.proc) + + def disconnect(self): + if not (self.sock is None): + self.sock.close() + + def connect(self, host, port): + if verbose: + print "Connecting to host %s:%i" % (host, port) + + retries = 30 + while True: + try: + sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sck.setblocking(1) + sck.connect((host, port)) + except IOError: + retries -= 1 + if retries <= 0: + raise + time.sleep(.1) + continue + break + self.sock = sck + return sck + + def send(self, data): + if verbose: + print "Sending \"%s\"" %(data) + data = Ctrl().add_header(data) + return self.sock.send(data) == len(data) + + def send_set(self, var, value, id): + setmsg = "SET %s %s %s" %(id, var, value) + return self.send(setmsg) + + def send_get(self, var, id): + getmsg = "GET %s %s" %(id, var) + return self.send(getmsg) + + def do_set(self, var, value): + id = self.next_id + self.next_id += 1 + self.send_set(var, value, id) + return self.recv_msgs()[id] + + def do_get(self, var): + id = self.next_id + self.next_id += 1 + self.send_get(var, id) + return self.recv_msgs()[id] + + def assert_reply(self, r, mtype, var, val): + expect = dict(mtype=mtype, var=var, value=val) + result_matches = all([r.get(k) == expect.get(k) for k in expect.keys()]) + if not result_matches: + print('\nError details:\nGot reply: %r\nExpected reply: %r\n' % (r, expect)) + self.assertTrue(result_matches) + + def assert_set(self, var, val, result_val): + r = self.do_set(var, val) + self.assert_reply(r, 'SET_REPLY', var, result_val) + + def assert_get(self, var, result_val): + r = self.do_get(var) + self.assert_reply(r, 'GET_REPLY', var, result_val) + + def recv_msgs(self): + responses = {} + data = self.sock.recv(4096) + while (len(data)>0): + (head, data) = IPA().split_combined(data) + answer = Ctrl().rem_header(head) + if verbose: + print "Got message:", answer + (mtype, id, msg) = answer.split(None, 2) + id = int(id) + rsp = {'mtype': mtype, 'id': id} + if mtype == "ERROR": + rsp['error'] = msg + else: + split = msg.split(None, 1) + rsp['var'] = split[0] + if len(split) > 1: + rsp['value'] = split[1] + else: + rsp['value'] = None + responses[id] = rsp + + if verbose: + print "Decoded replies: ", responses + + return responses + + +if __name__ == '__main__': + import argparse + import sys + + workdir = '.' + + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--verbose", dest="verbose", + action="store_true", help="verbose mode") + parser.add_argument("-p", "--pythonconfpath", dest="p", + help="searchpath for config") + parser.add_argument("-w", "--workdir", dest="w", + help="Working directory") + args = parser.parse_args() + + verbose_level = 1 + if args.verbose: + verbose_level = 2 + verbose = True + + if args.w: + workdir = args.w + + if args.p: + confpath = args.p + + print "confpath %s, workdir %s" % (confpath, workdir) + os.chdir(workdir) + print "Running tests for specific control commands" + suite = unittest.TestSuite() + res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) + sys.exit(len(res.errors) + len(res.failures)) + +# vim: tabstop=4 shiftwidth=4 expandtab diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql new file mode 100644 index 0000000..0767d48 --- /dev/null +++ b/tests/test_subscriber.sql @@ -0,0 +1,13 @@ + +-- 2G only subscriber +INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); + +-- 3G only subscriber +INSERT INTO subscriber (id, imsi) VALUES (2, '901990000000002'); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); + +-- 2G + 3G subscriber +INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); -- To view, visit https://gerrit.osmocom.org/4063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Sep 25 21:27:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 25 Sep 2017 21:27:27 +0000 Subject: [PATCH] osmo-hlr[master]: add CTRL tests for enable-/disable-/status-ps Message-ID: Review at https://gerrit.osmocom.org/4064 add CTRL tests for enable-/disable-/status-ps Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 --- M tests/ctrl_test_runner.py 1 file changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/64/4064/1 diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py index d453197..7c14f50 100644 --- a/tests/ctrl_test_runner.py +++ b/tests/ctrl_test_runner.py @@ -163,6 +163,46 @@ return responses +class TestCtrlHLR(TestCtrlBase): + + HLR_DB = 'hlr_ctrl_test.db' + HLR_SQL = '%s/sql/hlr.sql' % confpath + HLR_TEST_SQL = '%s/tests/test_subscriber.sql' % confpath + + def setUp(self): + print('\n') + print(os.getcwd()) + assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_SQL), shell=True) == 0 + assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_TEST_SQL), shell=True) == 0 + super(TestCtrlHLR, self).setUp() + + def tearDown(self): + super(TestCtrlHLR, self).tearDown() + os.unlink("hlr_ctrl_test.db") + + def ctrl_command(self): + return ["./src/osmo-hlr", "-c", "doc/examples/osmo-hlr.cfg", '-l', 'hlr_ctrl_test.db'] + + def ctrl_app(self): + return (4259, "./src/osmo-hlr", "OsmoHLR", "hlr") + + def testCtrlErrs(self): + r = self.do_get('invalid') + self.assertEquals(r['mtype'], 'ERROR') + self.assertEquals(r['error'], 'Command not found') + + def testEnableDisablePs(self): + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + self.assert_set('disable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '0') + self.assert_set('disable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '0') + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + if __name__ == '__main__': import argparse import sys @@ -193,6 +233,8 @@ os.chdir(workdir) print "Running tests for specific control commands" suite = unittest.TestSuite() + test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlHLR) + suite.addTest(test) res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) sys.exit(len(res.errors) + len(res.failures)) -- To view, visit https://gerrit.osmocom.org/4064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:43:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:43:53 +0000 Subject: osmo-hlr[master]: add basic CTRL interface tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:44:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:44:46 +0000 Subject: osmo-hlr[master]: add CTRL tests for enable-/disable-/status-ps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:46:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:46:18 +0000 Subject: osmo-hlr[master]: comment: ctrl: explain why status-ps is a SET cmd In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4062/1/src/ctrl.c File src/ctrl.c: Line 80: * name. */ this sounds like a rather ugly work-around. I would consider this deserves some kind of a discussion on the mailing list and an investigation if we can change the control interface protocol -- To view, visit https://gerrit.osmocom.org/4062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ccf6affaf3c5f2096fd3eb36454b18c3670a1b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:46:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:46:56 +0000 Subject: osmo-gsm-manuals[master]: move mncc.adoc to common chapters In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I404758ff7f1372e841ffe33c75455f513fff3caf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:50:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:50:03 +0000 Subject: osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) > The differences between Osmo{NITB,MSC}/chapters/mncc.adoc are 32 > occurences of the name OsmoNITB replaced with OsmoMSC, [...] Pau has solved this by some variable substitution in the sysmoBTS user manuals, please see related examples as an idea to use here. But yes, your re-wording proposal would also work. Up to you. https://gerrit.osmocom.org/#/c/4012/3/OsmoMSC/chapters/smpp.adoc File OsmoMSC/chapters/smpp.adoc: Line 2: == Short Message Peer to Peer (SMPP) this is yet another copied chapter, isn't it? -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:50:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:50:21 +0000 Subject: osmo-sgsn[master]: Remove unneeded dep libdbi In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I84b0e2851dc89dca39e87215c71e93457acb884f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:57:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:57:07 +0000 Subject: libosmocore[master]: Add time conversion helpers In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 one could argue if its "timer.h" and shouldn't rather go into utils.h or something more general, but it's fine for me as-is. -- To view, visit https://gerrit.osmocom.org/4060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:57:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:57:28 +0000 Subject: [MERGED] osmo-msc[master]: fix debian: fix erratic doc/examples install path In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix debian: fix erratic doc/examples install path ...................................................................... fix debian: fix erratic doc/examples install path Change-Id: I8fc3d50b95649145e45ea6b56792ddbaf0548050 --- M debian/osmo-msc.install 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install index 145d25d..3e289b2 100644 --- a/debian/osmo-msc.install +++ b/debian/osmo-msc.install @@ -1,2 +1,2 @@ usr/bin/osmo-msc -usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg +usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg -- To view, visit https://gerrit.osmocom.org/4059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8fc3d50b95649145e45ea6b56792ddbaf0548050 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 26 01:59:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 01:59:30 +0000 Subject: libosmocore[master]: vty/vty.c: do not bind vty context to application's one In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I think we can do this, but actually only as 'tall_vty_ctx' is already exported globally, i.e. an application or even library code can use this global variable to refer to the talloc VTY context. So there's no need to have it as a sibling to the applications context. -- To view, visit https://gerrit.osmocom.org/4017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9cb6ce9f24dbae400029e2d9f9c933fbfb16248f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 02:05:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 02:05:23 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 (3 comments) Thanks a lot for your work on this extremely useful feature! Some minor coding style comments below, please kindly update accordingly. https://gerrit.osmocom.org/#/c/4018/3/src/vty/talloc_ctx_vty.c File src/vty/talloc_ctx_vty.c: Line 103: size_t chunk_blocks = talloc_total_blocks(chunk); we generally have all variable declarations at the top of the functions. Yes, it's arguable (like all coding style), but I would prefer to have all code the same style. Thanks! Line 153: "show talloc-context (application|all) (full|brief|DEPTH)", might make sense to also include "vty" here to show the tall_vty_ctx. Line 183: "Application's context\nAll contexts, " please make a new line also in the source code, not a \n in the middle of a string constant. In general, as you're using the same strings from multiple DEFUN(), please #define the string once and refer to it from the DEFUN() - We do this all over the Osmocom programs. -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 26 02:07:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 26 Sep 2017 02:07:11 +0000 Subject: [ABANDON] libosmocore[master]: bitvec: implement write L or H value to vector In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: bitvec: implement write L or H value to vector ...................................................................... Abandoned As discussed in https://gerrit.osmocom.org/#/c/3991/ we already have similar API in libosmocore and prefer to use that. Minh agrees that this is a good idea, so let's abandon this patch. -- To view, visit https://gerrit.osmocom.org/3990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I36a76916a5986f098b6be6b5b779639c470725ef Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Sep 26 05:14:24 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 26 Sep 2017 05:14:24 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 3: (3 comments) https://gerrit.osmocom.org/#/c/4018/3/src/vty/talloc_ctx_vty.c File src/vty/talloc_ctx_vty.c: Line 103: size_t chunk_blocks = talloc_total_blocks(chunk); > we generally have all variable declarations at the top of the functions. Y Done. Line 153: "show talloc-context (application|all) (full|brief|DEPTH)", > might make sense to also include "vty" here to show the tall_vty_ctx. I would suggest to go a bit different way. There is a lot of internal talloc contexts within the library (e.g. tall_msgb_ctx). Some of them could be easily bound to application's context, but some couldn't. Do we have any common talloc context export policy? If don't, I think we can discuss / implement it, and add corresponding changes here in a separate commit. What do you think? Line 183: "Application's context\nAll contexts, " > please make a new line also in the source code, not a \n in the middle of a Thanks, done. -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 26 05:14:40 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 26 Sep 2017 05:14:40 +0000 Subject: [PATCH] libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4018 to look at the new patch set (#4). VTY: implement talloc context introspection command This change introduces a new command, which could be used to inspect the application's talloc context directly from VTY. To enable this feature, an application need to provide it's context via the 'vty_app_info' struct, and register the VTY command by calling the osmo_talloc_vty_add_cmds(). The new command is a sub-command of 'show': show talloc-context [filter] Currently the following contexts may be inspected: - application - a context provided by an application; - null - all contexts, if NULL-context tracking is enabled. A report depth is defined by the next parameter, and could be: - full - full tree report, as the talloc_report_full() does; - brief - brief tree report, as the talloc_report() does; - DEPTH - user defined maximal report depth. Also, there are two optional report filters: - regexp - print only contexts, matching a regular expression; - tree - print a specific context, pointed by specified address. The command output is formatted the same way as in case of calling the talloc_report() or talloc_report_full(). Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d --- M include/osmocom/vty/misc.h M src/vty/Makefile.am A src/vty/talloc_ctx_vty.c 3 files changed, 282 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/4018/4 diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index 545955c..335558d 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -28,6 +28,7 @@ void vty_out_fsm(struct vty *vty, struct osmo_fsm *fsm); void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi); void osmo_fsm_vty_add_cmds(void); +void osmo_talloc_vty_add_cmds(void); int osmo_vty_write_config_file(const char *filename); diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index e083a1c..1dc76c3 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -10,7 +10,8 @@ lib_LTLIBRARIES = libosmovty.la libosmovty_la_SOURCES = buffer.c command.c vty.c vector.c utils.c \ - telnet_interface.c logging_vty.c stats_vty.c fsm_vty.c + telnet_interface.c logging_vty.c stats_vty.c \ + fsm_vty.c talloc_ctx_vty.c libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined $(TALLOC_LIBS) libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la endif diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c new file mode 100644 index 0000000..136a1b4 --- /dev/null +++ b/src/vty/talloc_ctx_vty.c @@ -0,0 +1,279 @@ +/*! \file talloc_ctx_vty.c + * Osmocom talloc context introspection via VTY. */ +/* + * (C) 2017 by Vadim Yanitskiy + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include +#include + +extern void *tall_vty_ctx; +extern struct host host; + +enum walk_filter_type { + WALK_FILTER_NONE = 0, + WALK_FILTER_REGEXP, + WALK_FILTER_TREE, +}; + +struct walk_cb_params { + enum walk_filter_type filter; + unsigned int depth_pass; + const void *chunk_ptr; + struct vty *vty; + regex_t regexp; +}; + +/*! + * Print a talloc memory hierarchy to the given VTY. + * To be called by the talloc_report_depth_cb(). + * If one of supported filters is specified, then + * only satisfying memory trees would be printed. + * + * @param chunk The talloc chunk to be printed + * @param depth Current depth value + * @param max_depth Maximal depth of report (negative means full) + * @param is_ref Is this chunk a reference? + * @param data The walk_cb_params struct instance + */ +static void talloc_ctx_walk_cb(const void *chunk, int depth, + int max_depth, int is_ref, void *data) +{ + struct walk_cb_params *p = (struct walk_cb_params *) data; + const char *chunk_name = talloc_get_name(chunk); + struct vty *vty = p->vty; + size_t chunk_blocks; + size_t chunk_size; + int rc; + + if (depth > 0 && p->filter) { + /** + * A filter is being bypassed while current depth value + * is higher than the 'depth_pass', i.e. the callback does + * processing the child memory chunks. As soon as this + * condition becomes false, we need to 'enable' a filter, + * and resume the processing other chunks. + */ + if (p->depth_pass && depth > p->depth_pass) + goto filter_bypass; + else + p->depth_pass = 0; + + switch (p->filter) { + case WALK_FILTER_REGEXP: + /* Filter chunks using a regular expression */ + rc = regexec(&p->regexp, chunk_name, 0, NULL, 0); + if (rc) + return; + break; + case WALK_FILTER_TREE: + /* Print a specific memory tree only */ + if (chunk != p->chunk_ptr) + return; + break; + default: + /* Unsupported filter or incorrect value */ + return; + } + + /** + * As soon as a filter passes any chunk, all the memory + * tree starting from one would be printed. To do that, + * we need to temporary 'disable' a filter for child + * chunks (current_depth > depth_pass). + */ + p->depth_pass = depth; + } + +filter_bypass: + + if (is_ref) { + vty_out(vty, "%*sreference to: %s%s", + depth * 2, "", chunk_name, VTY_NEWLINE); + return; + } + + chunk_blocks = talloc_total_blocks(chunk); + chunk_size = talloc_total_size(chunk); + + if (depth == 0) { + vty_out(vty, "%stalloc report on '%s' " + "(total %6zu bytes in %3zu blocks)%s", + (max_depth < 0 ? "full " : ""), chunk_name, + chunk_size, chunk_blocks, VTY_NEWLINE); + return; + } + + vty_out(vty, "%*s%-30s contains %6zu bytes " + "in %3zu blocks (ref %zu) %p%s", depth * 2, "", + chunk_name, chunk_size, chunk_blocks, + talloc_reference_count(chunk), + chunk, VTY_NEWLINE); +} + +/*! + * Parse talloc context and depth values from a VTY command. + * + * @param ctx The context to be printed (a string from argv) + * @param depth The report depth (a string from argv) + * @param params The walk_cb_params struct instance + */ +static void talloc_ctx_walk(const char *ctx, const char *depth, + struct walk_cb_params *params) +{ + const void *talloc_ctx = NULL; + int max_depth; + + /* Determine a context for report */ + if (!strncmp(ctx, "app", 3)) + talloc_ctx = host.app_info->tall_ctx; + else if (!strncmp(ctx, "all", 3)) + talloc_ctx = NULL; + + /* Determine report depth */ + if (depth[0] == 'f') + max_depth = -1; + else if (depth[0] == 'b') + max_depth = 1; + else + max_depth = atoi(depth); + + talloc_report_depth_cb(talloc_ctx, 0, max_depth, + &talloc_ctx_walk_cb, params); +} + +#define BASE_CMD_STR \ + "show talloc-context (application|all) (full|brief|DEPTH)" + +#define BASE_CMD_DESCR \ + SHOW_STR "Show talloc memory hierarchy\n" \ + "Application's context\n" \ + "All contexts, if NULL-context tracking is enabled\n" \ + "Display a full talloc memory hierarchy\n" \ + "Display a brief talloc memory hierarchy\n" \ + "Specify required maximal depth value" + +DEFUN(show_talloc_ctx, show_talloc_ctx_cmd, + BASE_CMD_STR, BASE_CMD_DESCR) +{ + struct walk_cb_params *params; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Set up callback parameters */ + params->filter = WALK_FILTER_NONE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_filter, show_talloc_ctx_filter_cmd, + BASE_CMD_STR " filter REGEXP", BASE_CMD_DESCR + "Filter chunks using regular expression\n" + "Regular expression") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to compile a regular expression */ + rc = regcomp(¶ms->regexp, argv[2], 0); + if (rc) { + vty_out(vty, "Invalid expression%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_REGEXP; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + regfree(¶ms->regexp); + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_tree, show_talloc_ctx_tree_cmd, + BASE_CMD_STR " tree ADDRESS", BASE_CMD_DESCR + "Display only a specific memory chunk\n" + "Chunk address (e.g. 0xdeadbeef)") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to parse an address */ + rc = sscanf(argv[2], "%p", ¶ms->chunk_ptr); + if (rc != 1) { + vty_out(vty, "Invalid chunk address%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_TREE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +/*! + * Install VTY commands for talloc context introspection. + * + * This installs a set of VTY commands for introspection of + * a talloc context. Call this once from your application + * if you want to support those commands. + */ +void osmo_talloc_vty_add_cmds(void) +{ + install_element_ve(&show_talloc_ctx_cmd); + install_element_ve(&show_talloc_ctx_tree_cmd); + install_element_ve(&show_talloc_ctx_filter_cmd); +} -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Tue Sep 26 07:53:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 26 Sep 2017 07:53:13 +0000 Subject: [MERGED] osmo-sgsn[master]: Remove unneeded dep libdbi In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Remove unneeded dep libdbi ...................................................................... Remove unneeded dep libdbi This dependency is not needed and it's most probably a left over from openbsc git repository split. Change-Id: I84b0e2851dc89dca39e87215c71e93457acb884f --- M configure.ac M debian/control 2 files changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index d5d80cc..532b977 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,6 @@ dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) found_pcap=yes AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) diff --git a/debian/control b/debian/control index 4a3a07f..ce2167a 100644 --- a/debian/control +++ b/debian/control @@ -13,8 +13,6 @@ libtalloc-dev, libc-ares-dev, libgtp-dev, - libdbi-dev, - libdbd-sqlite3, libosmocore-dev, libosmo-abis-dev, libosmo-ranap-dev, -- To view, visit https://gerrit.osmocom.org/4061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84b0e2851dc89dca39e87215c71e93457acb884f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 26 08:18:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 26 Sep 2017 08:18:35 +0000 Subject: [MERGED] libosmocore[master]: Add time conversion helpers In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add time conversion helpers ...................................................................... Add time conversion helpers Add macros to break down absolute time in seconds into days/hours/minutes passed. Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf --- M include/osmocom/core/timer.h 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 40b39b9..4958efb 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -45,6 +45,11 @@ #include #include +/* convert absolute time (in seconds) to elapsed days/hours/minutes */ +#define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60) +#define OSMO_SEC2HRS(sec) ((sec % (60 * 60 * 24)) / (60 * 60)) +#define OSMO_SEC2DAY(sec) ((sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24)) /* we ignore leap year for simplicity */ + /*! A structure representing a single instance of a timer */ struct osmo_timer_list { struct rb_node node; /*!< rb-tree node header */ -- To view, visit https://gerrit.osmocom.org/4060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 26 08:27:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 26 Sep 2017 08:27:44 +0000 Subject: osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/4058/1//COMMIT_MSG Commit Message: Line 9: When printing BTS via 'show bts ..' let's also print each TRX, why phy s/why/which/ ? https://gerrit.osmocom.org/#/c/4058/1/src/common/vty.c File src/common/vty.c: Line 770: if (pinst) { Can pinst be null? ie can a trx have no phy instance? Line 771: vty_out(vty, " phy %d %s", pinst->num, pinst->version); Is version a string? sounds like pinst->num should be an unsigned integer. -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 26 09:42:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 26 Sep 2017 09:42:24 +0000 Subject: osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/4058/1/src/common/vty.c File src/common/vty.c: Line 770: if (pinst) { > Can pinst be null? ie can a trx have no phy instance? AFAIK no, but trx_phy_instance() can return NULL so it's better to check for it. Line 771: vty_out(vty, " phy %d %s", pinst->num, pinst->version); > Is version a string? sounds like pinst->num should be an unsigned integer. Yes, version is a string (which could be 0-length though). I agree that num should be unsigned but it's "int" in hte header so it's better to print it as such. -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 26 09:42:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 26 Sep 2017 09:42:57 +0000 Subject: [PATCH] osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4058 to look at the new patch set (#2). vty: print version and description for each phy When printing BTS via 'show bts ..' let's also print each TRX, which phy number and version it uses and its description. It's helpful in troubleshooting low-level issues as it allows vendor-specific code to easily expose firmware version. Related: SYS#3884 Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd --- M src/common/vty.c 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/4058/2 diff --git a/src/common/vty.c b/src/common/vty.c index 444b19c..6714041 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -730,6 +730,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct gsm_bts_role_bts *btsb = bts->role; + struct gsm_bts_trx *trx; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u and %u TRX%s", @@ -762,6 +763,17 @@ VTY_NEWLINE); vty_out(vty, " CBCH backlog queue length: %u%s", llist_length(&btsb->smscb_state.queue), VTY_NEWLINE); + + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + vty_out(vty, " TRX %u%s", trx->nr, VTY_NEWLINE); + if (pinst) { + vty_out(vty, " phy %d %s", pinst->num, pinst->version); + if (pinst->description) + vty_out(vty, " (%s)", pinst->description); + vty_out(vty, "%s", VTY_NEWLINE); + } + } } -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 26 09:48:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 26 Sep 2017 09:48:33 +0000 Subject: [PATCH] osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4009 to look at the new patch set (#4). Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/bsc_vty.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/e1_config.c 4 files changed, 31 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/4009/4 diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 6ce571e..f41bac4 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -722,6 +722,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3a80f06..f1c78c8 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -234,6 +235,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; + struct timespec tp; + int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -304,8 +308,20 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ + sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), + sec % 60, VTY_NEWLINE); + } + } + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index 1f203f5..87ec7b2 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -395,6 +397,8 @@ struct gsm_bts *bts; struct ipaccess_unit *dev = unit_data; struct e1inp_sign_link *sign_link = NULL; + struct timespec tp; + int rc; bts = find_bts_by_unitid(bsc_gsmnet, dev->site_id, dev->bts_id); if (!bts) { @@ -423,6 +427,8 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index 1923efd..3656315 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -160,6 +160,8 @@ struct e1inp_line *line; struct e1inp_sign_link *oml_link; struct gsm_bts_trx *trx; + struct timespec tp; + int rc; DEBUGP(DLMI, "e1_reconfig_bts(%u)\n", bts->nr); @@ -201,6 +203,8 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 26 09:49:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 26 Sep 2017 09:49:38 +0000 Subject: osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 09:52:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 26 Sep 2017 09:52:30 +0000 Subject: [PATCH] openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4008 to look at the new patch set (#4). Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts.c M openbsc/src/libbsc/e1_config.c 4 files changed, 31 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/08/4008/4 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 6b2269e..c19b125 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -715,6 +715,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index c6ff6d5..0d5377d 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -237,6 +238,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; + struct timespec tp; + int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -307,8 +311,20 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ + sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), + sec % 60, VTY_NEWLINE); + } + } + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..64eb4f2 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -395,6 +397,8 @@ struct gsm_bts *bts; struct ipaccess_unit *dev = unit_data; struct e1inp_sign_link *sign_link = NULL; + struct timespec tp; + int rc; bts = find_bts_by_unitid(bsc_gsmnet, dev->site_id, dev->bts_id); if (!bts) { @@ -423,6 +427,8 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/openbsc/src/libbsc/e1_config.c b/openbsc/src/libbsc/e1_config.c index d57dec5..92b2475 100644 --- a/openbsc/src/libbsc/e1_config.c +++ b/openbsc/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -160,6 +160,8 @@ struct e1inp_line *line; struct e1inp_sign_link *oml_link; struct gsm_bts_trx *trx; + struct timespec tp; + int rc; DEBUGP(DLMI, "e1_reconfig_bts(%u)\n", bts->nr); @@ -201,6 +203,8 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 26 10:02:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 26 Sep 2017 10:02:40 +0000 Subject: openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4008/4/openbsc/src/libbsc/bts_ipaccess_nanobts.c File openbsc/src/libbsc/bts_ipaccess_nanobts.c: Line 431: bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ You could add here a bts->uptime_dateref with a normal clock and them print it later with ctime(). -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Sep 26 11:39:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 11:39:26 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: document logrotate maxsize Message-ID: Review at https://gerrit.osmocom.org/4065 OsmoGSMTester: document logrotate maxsize Change-Id: Ib3e7143eb5d90eea4860a0a334da25efe926a231 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/65/4065/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index 4d2b677..6eef2fa 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -484,6 +484,14 @@ gpasswd -a jenkins usrp ---- +==== Log Rotation + +To avoid clogging up /var/log, it makes sense to choose a sane maximum log size: + +---- +echo maxsize 10M > /etc/logrotate.d/maxsize +---- + ==== Install Scripts IMPORTANT: When using the jenkins build slave as configured above, *there is no -- To view, visit https://gerrit.osmocom.org/4065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3e7143eb5d90eea4860a0a334da25efe926a231 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 26 11:52:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 26 Sep 2017 11:52:20 +0000 Subject: [PATCH] osmo-mgw[master]: libosmo-legacy-mgcp: fix link against libgsm Message-ID: Review at https://gerrit.osmocom.org/4066 libosmo-legacy-mgcp: fix link against libgsm libosmo-legacy-mgcp was not linked against libgsm when built with --enable-mgcp-transcoding. When afterwards a binary such as osmo-bsc is built and tries to link against it, it will fail with an error like the one below: /home/pespin/dev/sysmocom/bin/../build/new/out/lib/libosmo-legacy-mgcp.so: undefined reference to `gsm_create' Tested that building with this patch fixes the issue. Also tested that it still builds fine without --enable-mgcp-transcoding. Change-Id: I5ed356ac0c8f476e263fc6dcc5613d594890dfcd --- M src/libosmo-legacy-mgcp/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/66/4066/1 diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index bcf6242..ede1da4 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -19,6 +19,7 @@ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(LIBBCG729_LIBS) \ + $(LIBRARY_GSM) \ $(NULL) # This is not at all related to the release version, but a range of supported -- To view, visit https://gerrit.osmocom.org/4066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ed356ac0c8f476e263fc6dcc5613d594890dfcd Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 26 11:56:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 11:56:22 +0000 Subject: osmo-mgw[master]: libosmo-legacy-mgcp: fix link against libgsm In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ed356ac0c8f476e263fc6dcc5613d594890dfcd Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 11:56:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 11:56:23 +0000 Subject: [MERGED] osmo-mgw[master]: libosmo-legacy-mgcp: fix link against libgsm In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libosmo-legacy-mgcp: fix link against libgsm ...................................................................... libosmo-legacy-mgcp: fix link against libgsm libosmo-legacy-mgcp was not linked against libgsm when built with --enable-mgcp-transcoding. When afterwards a binary such as osmo-bsc is built and tries to link against it, it will fail with an error like the one below: /home/pespin/dev/sysmocom/bin/../build/new/out/lib/libosmo-legacy-mgcp.so: undefined reference to `gsm_create' Tested that building with this patch fixes the issue. Also tested that it still builds fine without --enable-mgcp-transcoding. Change-Id: I5ed356ac0c8f476e263fc6dcc5613d594890dfcd --- M src/libosmo-legacy-mgcp/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index bcf6242..ede1da4 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -19,6 +19,7 @@ $(LIBOSMONETIF_LIBS) \ $(COVERAGE_LDFLAGS) \ $(LIBBCG729_LIBS) \ + $(LIBRARY_GSM) \ $(NULL) # This is not at all related to the release version, but a range of supported -- To view, visit https://gerrit.osmocom.org/4066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ed356ac0c8f476e263fc6dcc5613d594890dfcd Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 26 13:47:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 13:47:48 +0000 Subject: [PATCH] libosmocore[master]: CTRL: add unit tests for CTRL command parsing Message-ID: Review at https://gerrit.osmocom.org/4067 CTRL: add unit tests for CTRL command parsing This uncovers some interesting behavior of the CTRL interface which we may want to guard against in subsequent patches: trailing whitespace, ignored tokens, special characters as cmd->id. Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 --- M tests/ctrl/ctrl_test.c M tests/ctrl/ctrl_test.ok 2 files changed, 353 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/4067/1 diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index 08be15f..b8425c7 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -6,6 +6,9 @@ #include #include +#include +#include +#include static void check_type(enum ctrl_type c) { @@ -19,8 +22,254 @@ printf("-> %d %s\n", v, c != v ? "FAIL" : "OK"); } +struct msgb *msgb_from_string(const char *str) +{ + char *rc; + size_t len = strlen(str) + 1; + /* ctrl_cmd_parse() appends a '\0' to the msgb, allow one more byte. */ + struct msgb *msg = msgb_alloc(len + 1, str); + msg->l2h = msg->head; + rc = (char*)msgb_put(msg, len); + OSMO_ASSERT(rc == (char*)msg->l2h); + strcpy(rc, str); + return msg; +} + +static void *ctx = NULL; + +void print_escaped(const char *str) +{ + if (!str) { + printf("NULL"); + return; + } + + printf("'"); + for (;*str; str++) { + switch (*str) { + case '\n': + printf("\\n"); + break; + case '\r': + printf("\\r"); + break; + case '\t': + printf("\\t"); + break; + default: + printf("%c", *str); + break; + } + } + printf("'"); +} + +void assert_same_str(const char *label, const char *expect, const char *got) +{ + if ((expect == got) || (expect && got && (strcmp(expect, got) == 0))) { + printf("%s = ", label); + print_escaped(got); + printf("\n"); + return; + } + + printf("MISMATCH for '%s':\ngot: ", label); print_escaped(got); + printf("\nexpected: "); print_escaped(expect); + printf("\n"); + OSMO_ASSERT(expect == got); +} + +static void assert_parsing(const char *str, const struct ctrl_cmd *expect) +{ + struct ctrl_cmd *cmd; + struct msgb *msg = msgb_from_string(str); + + printf("test parsing: "); + print_escaped(str); + printf("\n"); + + cmd = ctrl_cmd_parse(ctx, msg); + OSMO_ASSERT(cmd); + + OSMO_ASSERT(expect->type == cmd->type); + +#define ASSERT_SAME_STR(field) \ + assert_same_str(#field, expect->field, cmd->field) + + ASSERT_SAME_STR(id); + ASSERT_SAME_STR(variable); + ASSERT_SAME_STR(value); + ASSERT_SAME_STR(reply); + + talloc_free(cmd); + msgb_free(msg); + + printf("ok\n"); +} + +struct one_parsing_test { + const char *cmd_str; + struct ctrl_cmd expect; +}; + +static const struct one_parsing_test test_parsing_list[] = { + { "GET 1 variable", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + } + }, + { "GET 1 variable\n", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable\n", /* current bug */ + } + }, + { "GET 1 var\ni\nable", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "var\ni\nable", /* current bug */ + } + }, + { "GET 1 variable value", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "GET 1 variable value\n", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "GET 1 variable multiple value tokens", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "GET 1 variable multiple value tokens\n", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "SET 1 variable value", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value", + } + }, + { "SET 1 variable value\n", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value", + } + }, + { "SET weird_id variable value", + { + .type = CTRL_TYPE_SET, + .id = "weird_id", + .variable = "variable", + .value = "value", + } + }, + { "SET weird_id variable value\n", + { + .type = CTRL_TYPE_SET, + .id = "weird_id", + .variable = "variable", + .value = "value", + } + }, + { "SET 1 variable multiple value tokens", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "multiple value tokens", + } + }, + { "SET 1 variable multiple value tokens\n", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "multiple value tokens", + } + }, + { "SET 1 variable value_with_trailing_spaces ", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value_with_trailing_spaces ", + } + }, + { "SET 1 variable value_with_trailing_spaces \n", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value_with_trailing_spaces ", + } + }, + { "SET \n special_char_id value", + { + .type = CTRL_TYPE_SET, + .id = "\n", + .variable = "special_char_id", + .value = "value", + } + }, + { "SET \t special_char_id value", + { + .type = CTRL_TYPE_SET, + .id = "\t", + .variable = "special_char_id", + .value = "value", + } + }, +}; + +static void test_parsing() +{ + int i; + + for (i = 0; i < ARRAY_SIZE(test_parsing_list); i++) + assert_parsing(test_parsing_list[i].cmd_str, + &test_parsing_list[i].expect); +} + +static struct log_info_cat test_categories[] = { +}; + +static struct log_info info = { + .cat = test_categories, + .num_cat = ARRAY_SIZE(test_categories), +}; + int main(int argc, char **argv) { + ctx = talloc_named_const(NULL, 1, "ctrl_test"); + osmo_init_logging(&info); + printf("Checking ctrl types...\n"); check_type(CTRL_TYPE_UNKNOWN); @@ -32,5 +281,7 @@ check_type(CTRL_TYPE_ERROR); check_type(64); + test_parsing(); + return 0; } diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok index 8f97a27..9c8877b 100644 --- a/tests/ctrl/ctrl_test.ok +++ b/tests/ctrl/ctrl_test.ok @@ -7,3 +7,105 @@ ctrl type 5 is TRAP -> 5 OK ctrl type 6 is ERROR -> 6 OK ctrl type 64 is unknown 0x40 [PARSE FAILED] +test parsing: 'GET 1 variable' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable\n' +id = '1' +variable = 'variable\n' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 var\ni\nable' +id = '1' +variable = 'var\ni\nable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable value' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable value\n' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable multiple value tokens' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable multiple value tokens\n' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'SET 1 variable value' +id = '1' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET 1 variable value\n' +id = '1' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET weird_id variable value' +id = 'weird_id' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET weird_id variable value\n' +id = 'weird_id' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET 1 variable multiple value tokens' +id = '1' +variable = 'variable' +value = 'multiple value tokens' +reply = NULL +ok +test parsing: 'SET 1 variable multiple value tokens\n' +id = '1' +variable = 'variable' +value = 'multiple value tokens' +reply = NULL +ok +test parsing: 'SET 1 variable value_with_trailing_spaces ' +id = '1' +variable = 'variable' +value = 'value_with_trailing_spaces ' +reply = NULL +ok +test parsing: 'SET 1 variable value_with_trailing_spaces \n' +id = '1' +variable = 'variable' +value = 'value_with_trailing_spaces ' +reply = NULL +ok +test parsing: 'SET \n special_char_id value' +id = '\n' +variable = 'special_char_id' +value = 'value' +reply = NULL +ok +test parsing: 'SET \t special_char_id value' +id = '\t' +variable = 'special_char_id' +value = 'value' +reply = NULL +ok -- To view, visit https://gerrit.osmocom.org/4067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 26 13:47:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 13:47:48 +0000 Subject: [PATCH] libosmocore[master]: CTRL: GET parsing: add '\n' as token delimiter Message-ID: Review at https://gerrit.osmocom.org/4068 CTRL: GET parsing: add '\n' as token delimiter For GET commands, we expect the command to end after the GET variable name. However, the token parsing uses a single space as delimiter, potentially parsing along the line ending. Add line ending to token delimiters for GET parsing. Adjust test expectations accordingly. Change-Id: I33efb56f76cb7a41e94454666e218617e9b713ae --- M src/ctrl/control_cmd.c M tests/ctrl/ctrl_test.c M tests/ctrl/ctrl_test.ok 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/4068/1 diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 24b388b..a0476dd 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -312,7 +312,7 @@ switch (cmd->type) { case CTRL_TYPE_GET: - var = strtok_r(NULL, " ", &saveptr); + var = strtok_r(NULL, " \n", &saveptr); if (!var) { cmd->type = CTRL_TYPE_ERROR; cmd->reply = "GET incomplete"; diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index b8425c7..bf8abae 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -124,14 +124,14 @@ { .type = CTRL_TYPE_GET, .id = "1", - .variable = "variable\n", /* current bug */ + .variable = "variable", } }, { "GET 1 var\ni\nable", { .type = CTRL_TYPE_GET, .id = "1", - .variable = "var\ni\nable", /* current bug */ + .variable = "var", } }, { "GET 1 variable value", diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok index 9c8877b..bca5f4b 100644 --- a/tests/ctrl/ctrl_test.ok +++ b/tests/ctrl/ctrl_test.ok @@ -15,13 +15,13 @@ ok test parsing: 'GET 1 variable\n' id = '1' -variable = 'variable\n' +variable = 'variable' value = NULL reply = NULL ok test parsing: 'GET 1 var\ni\nable' id = '1' -variable = 'var\ni\nable' +variable = 'var' value = NULL reply = NULL ok -- To view, visit https://gerrit.osmocom.org/4068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33efb56f76cb7a41e94454666e218617e9b713ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 26 13:47:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 13:47:49 +0000 Subject: [PATCH] libosmocore[master]: CTRL: allow argument for GET commands Message-ID: Review at https://gerrit.osmocom.org/4069 CTRL: allow argument for GET commands It is sometimes necessary to pass an argument for GET commands, e.g. to get a variable's value for a specific subscriber. Example from osmo-hlr: GET status-ps Just a 'status-ps' without the IMSI cannot return that IMSI's PS status. So far osmo-hlr's hack is to implement status-ps as a SET command instead. That's semantically very ugly: it's a designated write-only acting as read-only. With this patch, we can easily allow passing a value along with a GET command. All passing on of the value is already in place, in form of the ctrl_cmd struct. So far, string tokens following the variable name would be ignored. All that this patch needs to do is pass remaining tokens along as value part. Change-Id: I228342bedd623f6058493e1d0dea0c721d21c4e5 --- M src/ctrl/control_cmd.c M tests/ctrl/ctrl_test.c M tests/ctrl/ctrl_test.ok 3 files changed, 14 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/4069/1 diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index a0476dd..3eeb015 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -313,6 +313,7 @@ switch (cmd->type) { case CTRL_TYPE_GET: var = strtok_r(NULL, " \n", &saveptr); + val = strtok_r(NULL, "\n", &saveptr); if (!var) { cmd->type = CTRL_TYPE_ERROR; cmd->reply = "GET incomplete"; @@ -320,7 +321,9 @@ goto err; } cmd->variable = talloc_strdup(cmd, var); - LOGP(DLCTRL, LOGL_DEBUG, "Command: GET %s\n", cmd->variable); + cmd->value = talloc_strdup(cmd, val); + LOGP(DLCTRL, LOGL_DEBUG, "Command: GET %s%s%s\n", cmd->variable, + cmd->value? " " : "", cmd->value? cmd->value : ""); break; case CTRL_TYPE_SET: var = strtok_r(NULL, " ", &saveptr); diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index bf8abae..a55e788 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -132,6 +132,7 @@ .type = CTRL_TYPE_GET, .id = "1", .variable = "var", + .value = "i", } }, { "GET 1 variable value", @@ -139,7 +140,7 @@ .type = CTRL_TYPE_GET, .id = "1", .variable = "variable", - .value = NULL, + .value = "value", } }, { "GET 1 variable value\n", @@ -147,7 +148,7 @@ .type = CTRL_TYPE_GET, .id = "1", .variable = "variable", - .value = NULL, + .value = "value", } }, { "GET 1 variable multiple value tokens", @@ -155,7 +156,7 @@ .type = CTRL_TYPE_GET, .id = "1", .variable = "variable", - .value = NULL, + .value = "multiple value tokens", } }, { "GET 1 variable multiple value tokens\n", @@ -163,7 +164,7 @@ .type = CTRL_TYPE_GET, .id = "1", .variable = "variable", - .value = NULL, + .value = "multiple value tokens", } }, { "SET 1 variable value", diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok index bca5f4b..3812d9a 100644 --- a/tests/ctrl/ctrl_test.ok +++ b/tests/ctrl/ctrl_test.ok @@ -22,31 +22,31 @@ test parsing: 'GET 1 var\ni\nable' id = '1' variable = 'var' -value = NULL +value = 'i' reply = NULL ok test parsing: 'GET 1 variable value' id = '1' variable = 'variable' -value = NULL +value = 'value' reply = NULL ok test parsing: 'GET 1 variable value\n' id = '1' variable = 'variable' -value = NULL +value = 'value' reply = NULL ok test parsing: 'GET 1 variable multiple value tokens' id = '1' variable = 'variable' -value = NULL +value = 'multiple value tokens' reply = NULL ok test parsing: 'GET 1 variable multiple value tokens\n' id = '1' variable = 'variable' -value = NULL +value = 'multiple value tokens' reply = NULL ok test parsing: 'SET 1 variable value' -- To view, visit https://gerrit.osmocom.org/4069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I228342bedd623f6058493e1d0dea0c721d21c4e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Sep 26 14:10:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 26 Sep 2017 14:10:28 +0000 Subject: [PATCH] osmo-bsc[master]: Remove unneeded dbi dependency Message-ID: Review at https://gerrit.osmocom.org/4070 Remove unneeded dbi dependency Most probably a leftover from openbsc git Change-Id: I230564b6a6ad244ec6328a99a1c3dbd9bc5521ae --- M debian/control M tests/channel/Makefile.am M tests/gsm0408/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/trau/Makefile.am 5 files changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/4070/1 diff --git a/debian/control b/debian/control index e6e5724..f931341 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,6 @@ libtool, pkg-config, python-minimal, - libdbi-dev, libssl-dev, libsctp-dev, libtalloc-dev, diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index d190cba..395daf7 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -30,5 +30,4 @@ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBCRYPTO_LIBS) \ - -ldbi \ $(NULL) diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am index ae81c2c..3bf4a22 100644 --- a/tests/gsm0408/Makefile.am +++ b/tests/gsm0408/Makefile.am @@ -30,5 +30,4 @@ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ - -ldbi \ $(NULL) diff --git a/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am index 050d7cd..8b5e116 100644 --- a/tests/nanobts_omlattr/Makefile.am +++ b/tests/nanobts_omlattr/Makefile.am @@ -29,5 +29,4 @@ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ - -ldbi \ $(NULL) diff --git a/tests/trau/Makefile.am b/tests/trau/Makefile.am index 1d014ba..b51c184 100644 --- a/tests/trau/Makefile.am +++ b/tests/trau/Makefile.am @@ -40,6 +40,4 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBRARY_DL) \ - -ldbi \ $(NULL) - -- To view, visit https://gerrit.osmocom.org/4070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I230564b6a6ad244ec6328a99a1c3dbd9bc5521ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Sep 26 14:17:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 14:17:34 +0000 Subject: osmo-hlr[master]: comment: ctrl: explain why status-ps is a SET cmd In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 See also https://gerrit.osmocom.org/4069 -- until that is clarified, let me mark this as -2 -- To view, visit https://gerrit.osmocom.org/4062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ccf6affaf3c5f2096fd3eb36454b18c3670a1b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 14:18:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 26 Sep 2017 14:18:06 +0000 Subject: osmo-hlr[master]: comment: ctrl: explain why status-ps is a SET cmd In-Reply-To: References: Message-ID: Patch Set 1: and https://lists.osmocom.org/pipermail/openbsc/2017-September/011218.html -- To view, visit https://gerrit.osmocom.org/4062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ccf6affaf3c5f2096fd3eb36454b18c3670a1b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Sep 26 19:53:47 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 26 Sep 2017 19:53:47 +0000 Subject: [PATCH] osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3991 to look at the new patch set (#2). EDGE: fix wrong encoding of LH bits Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 --- M src/encoding.cpp 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/91/3991/2 diff --git a/src/encoding.cpp b/src/encoding.cpp index 6742efd..74fb315 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -85,7 +85,8 @@ return -EINVAL; } // GSM 04.08 10.5.2.16 IA Rest Octets - bitvec_write_field(dest, &wp, 3, 2); // "HH" + bitvec_write_field(dest, &wp, 3, 2); // "H" + bitvec_write_field(dest, &wp, 3, 2); // "H" bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment bitvec_write_field(dest, &wp,tbf->tlli(),32); // TLLI bitvec_write_field(dest, &wp,0x1,1); // switch TFI : on @@ -115,7 +116,7 @@ if (tbf->is_egprs_enabled()) { /* see GMS 44.018, 10.5.2.16 */ unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32; - bitvec_write_field(dest, &wp, 1, 1); // "H" + bitvec_write_field(dest, &wp, 3, 2); // "H" bitvec_write_field(dest, &wp, ws_enc, 5); // EGPRS Window Size bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present @@ -133,7 +134,7 @@ OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); // GMS 04.08 10.5.2.37b 10.5.2.16 - bitvec_write_field(dest, &wp, 3, 2); // "HH" + bitvec_write_field_lh(dest, &wp, 3, 2); // "HH" bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment if (tbf == NULL) { bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Sep 26 20:14:08 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 26 Sep 2017 20:14:08 +0000 Subject: [PATCH] osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3991 to look at the new patch set (#3). EDGE: fix wrong encoding of LH bits Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 --- M src/encoding.cpp 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/91/3991/3 diff --git a/src/encoding.cpp b/src/encoding.cpp index 6742efd..591cf0b 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -85,7 +85,8 @@ return -EINVAL; } // GSM 04.08 10.5.2.16 IA Rest Octets - bitvec_write_field(dest, &wp, 3, 2); // "HH" + bitvec_write_field(dest, &wp, 3, 2); // "H" + bitvec_write_field(dest, &wp, 3, 2); // "H" bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment bitvec_write_field(dest, &wp,tbf->tlli(),32); // TLLI bitvec_write_field(dest, &wp,0x1,1); // switch TFI : on @@ -115,7 +116,7 @@ if (tbf->is_egprs_enabled()) { /* see GMS 44.018, 10.5.2.16 */ unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32; - bitvec_write_field(dest, &wp, 1, 1); // "H" + bitvec_write_field(dest, &wp, 3, 2); // "H" bitvec_write_field(dest, &wp, ws_enc, 5); // EGPRS Window Size bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present @@ -133,7 +134,8 @@ OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); // GMS 04.08 10.5.2.37b 10.5.2.16 - bitvec_write_field(dest, &wp, 3, 2); // "HH" + bitvec_write_field(dest, &wp, 3, 2); // "H" + bitvec_write_field(dest, &wp, 3, 2); // "H" bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment if (tbf == NULL) { bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Sep 27 08:28:56 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 08:28:56 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: You'll have to update test output too when updating the code. Btw, how does it looks like when testing against real phone? Which effect is caused by old code and how it differs when using new code? -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 08:32:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 08:32:02 +0000 Subject: osmo-bsc[master]: Remove unneeded dbi dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 We should check other split repositories - there might be the same unneeded dependency there as well. -- To view, visit https://gerrit.osmocom.org/4070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I230564b6a6ad244ec6328a99a1c3dbd9bc5521ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 08:41:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 08:41:16 +0000 Subject: libosmocore[master]: CTRL: allow argument for GET commands In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I228342bedd623f6058493e1d0dea0c721d21c4e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 08:45:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 08:45:13 +0000 Subject: libosmocore[master]: CTRL: add unit tests for CTRL command parsing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 08:46:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 08:46:58 +0000 Subject: libosmocore[master]: CTRL: GET parsing: add '\n' as token delimiter In-Reply-To: References: Message-ID: Patch Set 1: What about \r and \t? -- To view, visit https://gerrit.osmocom.org/4068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33efb56f76cb7a41e94454666e218617e9b713ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 08:48:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 08:48:29 +0000 Subject: libosmocore[master]: CTRL: allow argument for GET commands In-Reply-To: References: Message-ID: Patch Set 1: -Code-Review Have it been tested against osmo-bsc ctrl_test_runner.py? -- To view, visit https://gerrit.osmocom.org/4069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I228342bedd623f6058493e1d0dea0c721d21c4e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 08:51:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 08:51:26 +0000 Subject: openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 4: Yes, but what for? For troubleshooting uptime in h:m:s is more than enough. -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:05:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 27 Sep 2017 10:05:42 +0000 Subject: [PATCH] libosmo-sccp[master]: contrib: Add osmo-stp systemd service file Message-ID: Review at https://gerrit.osmocom.org/4071 contrib: Add osmo-stp systemd service file Change-Id: If6423222b5f1574701c48b5e93eb6c4918879d6c --- A contrib/systemd/osmo-stp.service 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/71/4071/1 diff --git a/contrib/systemd/osmo-stp.service b/contrib/systemd/osmo-stp.service new file mode 100644 index 0000000..5d06870 --- /dev/null +++ b/contrib/systemd/osmo-stp.service @@ -0,0 +1,11 @@ +[Unit] +Description=Osmocom STP (Signal Transfer Point) + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/osmo-stp -c /etc/osmocom/osmo-stp.cfg +RestartSec=2 + +[Install] +WantedBy=multi-user.target -- To view, visit https://gerrit.osmocom.org/4071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6423222b5f1574701c48b5e93eb6c4918879d6c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:30:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:30:26 +0000 Subject: libosmo-sccp[master]: contrib: Add osmo-stp systemd service file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If6423222b5f1574701c48b5e93eb6c4918879d6c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:31:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:31:09 +0000 Subject: openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:31:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 27 Sep 2017 10:31:35 +0000 Subject: [MERGED] libosmo-sccp[master]: contrib: Add osmo-stp systemd service file In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: contrib: Add osmo-stp systemd service file ...................................................................... contrib: Add osmo-stp systemd service file Change-Id: If6423222b5f1574701c48b5e93eb6c4918879d6c --- A contrib/systemd/osmo-stp.service 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/systemd/osmo-stp.service b/contrib/systemd/osmo-stp.service new file mode 100644 index 0000000..5d06870 --- /dev/null +++ b/contrib/systemd/osmo-stp.service @@ -0,0 +1,11 @@ +[Unit] +Description=Osmocom STP (Signal Transfer Point) + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/osmo-stp -c /etc/osmocom/osmo-stp.cfg +RestartSec=2 + +[Install] +WantedBy=multi-user.target -- To view, visit https://gerrit.osmocom.org/4071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6423222b5f1574701c48b5e93eb6c4918879d6c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:32:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:32:06 +0000 Subject: libosmocore[master]: CTRL: allow argument for GET commands In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I228342bedd623f6058493e1d0dea0c721d21c4e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:32:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:32:42 +0000 Subject: libosmocore[master]: CTRL: GET parsing: add '\n' as token delimiter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33efb56f76cb7a41e94454666e218617e9b713ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:32:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:32:53 +0000 Subject: libosmocore[master]: gb: drop special vty exit commands, use vty_install_default() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b0de066b4249d482c22620d5b1bcb03f381293c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:33:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:33:30 +0000 Subject: libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:33:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:33:46 +0000 Subject: libosmocore[master]: vty: deprecate now empty node commands In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf5d83f641e838cebcccc635a043e94ba352abff Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:34:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:34:10 +0000 Subject: libosmocore[master]: CTRL: add unit tests for CTRL command parsing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:34:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:34:32 +0000 Subject: osmo-bsc[master]: Remove unneeded dbi dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I230564b6a6ad244ec6328a99a1c3dbd9bc5521ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:35:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 27 Sep 2017 10:35:06 +0000 Subject: [MERGED] osmo-bsc[master]: Remove unneeded dbi dependency In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Remove unneeded dbi dependency ...................................................................... Remove unneeded dbi dependency Most probably a leftover from openbsc git Change-Id: I230564b6a6ad244ec6328a99a1c3dbd9bc5521ae --- M debian/control M tests/channel/Makefile.am M tests/gsm0408/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/trau/Makefile.am 5 files changed, 0 insertions(+), 6 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index e6e5724..f931341 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,6 @@ libtool, pkg-config, python-minimal, - libdbi-dev, libssl-dev, libsctp-dev, libtalloc-dev, diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index d190cba..395daf7 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -30,5 +30,4 @@ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBCRYPTO_LIBS) \ - -ldbi \ $(NULL) diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am index ae81c2c..3bf4a22 100644 --- a/tests/gsm0408/Makefile.am +++ b/tests/gsm0408/Makefile.am @@ -30,5 +30,4 @@ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ - -ldbi \ $(NULL) diff --git a/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am index 050d7cd..8b5e116 100644 --- a/tests/nanobts_omlattr/Makefile.am +++ b/tests/nanobts_omlattr/Makefile.am @@ -29,5 +29,4 @@ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ - -ldbi \ $(NULL) diff --git a/tests/trau/Makefile.am b/tests/trau/Makefile.am index 1d014ba..b51c184 100644 --- a/tests/trau/Makefile.am +++ b/tests/trau/Makefile.am @@ -40,6 +40,4 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBRARY_DL) \ - -ldbi \ $(NULL) - -- To view, visit https://gerrit.osmocom.org/4070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I230564b6a6ad244ec6328a99a1c3dbd9bc5521ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:36:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:36:02 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 in case you're unaware: 'make check' executes the testsuite. It's good practise to run a 'make distcheck' before pushing a patch to gerrit to ensure all unit tests are still building, and that out-of-source builds also still work (and no files were forgotten in the commit). -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:38:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:38:53 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/4018/3/src/vty/talloc_ctx_vty.c File src/vty/talloc_ctx_vty.c: Line 153: "show talloc-context (application|all) (full|brief|DEPTH)", > I would suggest to go a bit different way. There is a lot We don't have any policy. If you'd like to make a proposal, please start a discussion on the mailing list. I personally would like to see them added here in the show command, but maybe you know a better way :) -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:38:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:38:59 +0000 Subject: libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:40:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:40:00 +0000 Subject: osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:41:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:41:28 +0000 Subject: osmo-bts[master]: Remove dead code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Yes, but I would suggest to add printing of the related bits, i.e. he OML connection state but more importantly the paging state. I suppose it was commented out as a reminder that this information should still be printed in the BTS, but it would have to use a different implementation? -- To view, visit https://gerrit.osmocom.org/4057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:44:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 10:44:16 +0000 Subject: osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:47:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 27 Sep 2017 10:47:39 +0000 Subject: osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:53:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 10:53:28 +0000 Subject: [MERGED] osmo-bsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Show OML link uptime in vty ...................................................................... Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/bsc_vty.c M src/libbsc/bts_ipaccess_nanobts.c M src/libbsc/e1_config.c 4 files changed, 31 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 6ce571e..f41bac4 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -722,6 +722,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3a80f06..f1c78c8 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -234,6 +235,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; + struct timespec tp; + int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -304,8 +308,20 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ + sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), + sec % 60, VTY_NEWLINE); + } + } + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index 1f203f5..87ec7b2 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -395,6 +397,8 @@ struct gsm_bts *bts; struct ipaccess_unit *dev = unit_data; struct e1inp_sign_link *sign_link = NULL; + struct timespec tp; + int rc; bts = find_bts_by_unitid(bsc_gsmnet, dev->site_id, dev->bts_id); if (!bts) { @@ -423,6 +427,8 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c index 1923efd..3656315 100644 --- a/src/libbsc/e1_config.c +++ b/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -160,6 +160,8 @@ struct e1inp_line *line; struct e1inp_sign_link *oml_link; struct gsm_bts_trx *trx; + struct timespec tp; + int rc; DEBUGP(DLMI, "e1_reconfig_bts(%u)\n", bts->nr); @@ -201,6 +203,8 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 10:54:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 10:54:13 +0000 Subject: [MERGED] openbsc[master]: Show OML link uptime in vty In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Show OML link uptime in vty ...................................................................... Show OML link uptime in vty Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts.c M openbsc/src/libbsc/e1_config.c 4 files changed, 31 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 6b2269e..c19b125 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -715,6 +715,8 @@ struct gsm_e1_subslot oml_e1_link; uint8_t oml_tei; struct e1inp_sign_link *oml_link; + /* when OML link was established */ + time_t uptime; /* Abis network management O&M handle */ struct abis_nm_h *nmh; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index c6ff6d5..0d5377d 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -237,6 +238,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct pchan_load pl; + unsigned long long sec; + struct timespec tp; + int rc; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -307,8 +311,20 @@ paging_pending_requests_nr(bts), bts->paging.available_slots, VTY_NEWLINE); if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + vty_out(vty, " OML Link state: "); + if (bts->oml_link) { + vty_out(vty, "connected"); + if (bts->uptime) { + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */ + sec = (unsigned long long)difftime(tp.tv_sec, bts->uptime); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), + sec % 60, VTY_NEWLINE); + } + } + } else + vty_out(vty, "disconnected.%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index a1bde77..64eb4f2 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -20,6 +20,7 @@ */ #include +#include #include @@ -364,6 +365,7 @@ e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = NULL; + bts->uptime = 0; /* we have issues reconnecting RSL, drop everything. */ llist_for_each_entry(trx, &bts->trx_list, list) @@ -395,6 +397,8 @@ struct gsm_bts *bts; struct ipaccess_unit *dev = unit_data; struct e1inp_sign_link *sign_link = NULL; + struct timespec tp; + int rc; bts = find_bts_by_unitid(bsc_gsmnet, dev->site_id, dev->bts_id); if (!bts) { @@ -423,6 +427,8 @@ e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], E1INP_SIGN_OML, bts->c0, bts->oml_tei, 0); + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; diff --git a/openbsc/src/libbsc/e1_config.c b/openbsc/src/libbsc/e1_config.c index d57dec5..92b2475 100644 --- a/openbsc/src/libbsc/e1_config.c +++ b/openbsc/src/libbsc/e1_config.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include @@ -160,6 +160,8 @@ struct e1inp_line *line; struct e1inp_sign_link *oml_link; struct gsm_bts_trx *trx; + struct timespec tp; + int rc; DEBUGP(DLMI, "e1_reconfig_bts(%u)\n", bts->nr); @@ -201,6 +203,8 @@ if (bts->oml_link) e1inp_sign_link_destroy(bts->oml_link); bts->oml_link = oml_link; + rc = clock_gettime(CLOCK_MONOTONIC, &tp); + bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ llist_for_each_entry(trx, &bts->trx_list, list) e1_reconfig_trx(trx); -- To view, visit https://gerrit.osmocom.org/4008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 11:02:19 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 27 Sep 2017 11:02:19 +0000 Subject: [MERGED] libosmocore[master]: VTY: implement talloc context introspection command In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: VTY: implement talloc context introspection command ...................................................................... VTY: implement talloc context introspection command This change introduces a new command, which could be used to inspect the application's talloc context directly from VTY. To enable this feature, an application need to provide it's context via the 'vty_app_info' struct, and register the VTY command by calling the osmo_talloc_vty_add_cmds(). The new command is a sub-command of 'show': show talloc-context [filter] Currently the following contexts may be inspected: - application - a context provided by an application; - null - all contexts, if NULL-context tracking is enabled. A report depth is defined by the next parameter, and could be: - full - full tree report, as the talloc_report_full() does; - brief - brief tree report, as the talloc_report() does; - DEPTH - user defined maximal report depth. Also, there are two optional report filters: - regexp - print only contexts, matching a regular expression; - tree - print a specific context, pointed by specified address. The command output is formatted the same way as in case of calling the talloc_report() or talloc_report_full(). Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d --- M include/osmocom/vty/misc.h M src/vty/Makefile.am A src/vty/talloc_ctx_vty.c 3 files changed, 282 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index 545955c..335558d 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -28,6 +28,7 @@ void vty_out_fsm(struct vty *vty, struct osmo_fsm *fsm); void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi); void osmo_fsm_vty_add_cmds(void); +void osmo_talloc_vty_add_cmds(void); int osmo_vty_write_config_file(const char *filename); diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index e083a1c..1dc76c3 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -10,7 +10,8 @@ lib_LTLIBRARIES = libosmovty.la libosmovty_la_SOURCES = buffer.c command.c vty.c vector.c utils.c \ - telnet_interface.c logging_vty.c stats_vty.c fsm_vty.c + telnet_interface.c logging_vty.c stats_vty.c \ + fsm_vty.c talloc_ctx_vty.c libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined $(TALLOC_LIBS) libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la endif diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c new file mode 100644 index 0000000..136a1b4 --- /dev/null +++ b/src/vty/talloc_ctx_vty.c @@ -0,0 +1,279 @@ +/*! \file talloc_ctx_vty.c + * Osmocom talloc context introspection via VTY. */ +/* + * (C) 2017 by Vadim Yanitskiy + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include +#include + +extern void *tall_vty_ctx; +extern struct host host; + +enum walk_filter_type { + WALK_FILTER_NONE = 0, + WALK_FILTER_REGEXP, + WALK_FILTER_TREE, +}; + +struct walk_cb_params { + enum walk_filter_type filter; + unsigned int depth_pass; + const void *chunk_ptr; + struct vty *vty; + regex_t regexp; +}; + +/*! + * Print a talloc memory hierarchy to the given VTY. + * To be called by the talloc_report_depth_cb(). + * If one of supported filters is specified, then + * only satisfying memory trees would be printed. + * + * @param chunk The talloc chunk to be printed + * @param depth Current depth value + * @param max_depth Maximal depth of report (negative means full) + * @param is_ref Is this chunk a reference? + * @param data The walk_cb_params struct instance + */ +static void talloc_ctx_walk_cb(const void *chunk, int depth, + int max_depth, int is_ref, void *data) +{ + struct walk_cb_params *p = (struct walk_cb_params *) data; + const char *chunk_name = talloc_get_name(chunk); + struct vty *vty = p->vty; + size_t chunk_blocks; + size_t chunk_size; + int rc; + + if (depth > 0 && p->filter) { + /** + * A filter is being bypassed while current depth value + * is higher than the 'depth_pass', i.e. the callback does + * processing the child memory chunks. As soon as this + * condition becomes false, we need to 'enable' a filter, + * and resume the processing other chunks. + */ + if (p->depth_pass && depth > p->depth_pass) + goto filter_bypass; + else + p->depth_pass = 0; + + switch (p->filter) { + case WALK_FILTER_REGEXP: + /* Filter chunks using a regular expression */ + rc = regexec(&p->regexp, chunk_name, 0, NULL, 0); + if (rc) + return; + break; + case WALK_FILTER_TREE: + /* Print a specific memory tree only */ + if (chunk != p->chunk_ptr) + return; + break; + default: + /* Unsupported filter or incorrect value */ + return; + } + + /** + * As soon as a filter passes any chunk, all the memory + * tree starting from one would be printed. To do that, + * we need to temporary 'disable' a filter for child + * chunks (current_depth > depth_pass). + */ + p->depth_pass = depth; + } + +filter_bypass: + + if (is_ref) { + vty_out(vty, "%*sreference to: %s%s", + depth * 2, "", chunk_name, VTY_NEWLINE); + return; + } + + chunk_blocks = talloc_total_blocks(chunk); + chunk_size = talloc_total_size(chunk); + + if (depth == 0) { + vty_out(vty, "%stalloc report on '%s' " + "(total %6zu bytes in %3zu blocks)%s", + (max_depth < 0 ? "full " : ""), chunk_name, + chunk_size, chunk_blocks, VTY_NEWLINE); + return; + } + + vty_out(vty, "%*s%-30s contains %6zu bytes " + "in %3zu blocks (ref %zu) %p%s", depth * 2, "", + chunk_name, chunk_size, chunk_blocks, + talloc_reference_count(chunk), + chunk, VTY_NEWLINE); +} + +/*! + * Parse talloc context and depth values from a VTY command. + * + * @param ctx The context to be printed (a string from argv) + * @param depth The report depth (a string from argv) + * @param params The walk_cb_params struct instance + */ +static void talloc_ctx_walk(const char *ctx, const char *depth, + struct walk_cb_params *params) +{ + const void *talloc_ctx = NULL; + int max_depth; + + /* Determine a context for report */ + if (!strncmp(ctx, "app", 3)) + talloc_ctx = host.app_info->tall_ctx; + else if (!strncmp(ctx, "all", 3)) + talloc_ctx = NULL; + + /* Determine report depth */ + if (depth[0] == 'f') + max_depth = -1; + else if (depth[0] == 'b') + max_depth = 1; + else + max_depth = atoi(depth); + + talloc_report_depth_cb(talloc_ctx, 0, max_depth, + &talloc_ctx_walk_cb, params); +} + +#define BASE_CMD_STR \ + "show talloc-context (application|all) (full|brief|DEPTH)" + +#define BASE_CMD_DESCR \ + SHOW_STR "Show talloc memory hierarchy\n" \ + "Application's context\n" \ + "All contexts, if NULL-context tracking is enabled\n" \ + "Display a full talloc memory hierarchy\n" \ + "Display a brief talloc memory hierarchy\n" \ + "Specify required maximal depth value" + +DEFUN(show_talloc_ctx, show_talloc_ctx_cmd, + BASE_CMD_STR, BASE_CMD_DESCR) +{ + struct walk_cb_params *params; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Set up callback parameters */ + params->filter = WALK_FILTER_NONE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_filter, show_talloc_ctx_filter_cmd, + BASE_CMD_STR " filter REGEXP", BASE_CMD_DESCR + "Filter chunks using regular expression\n" + "Regular expression") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to compile a regular expression */ + rc = regcomp(¶ms->regexp, argv[2], 0); + if (rc) { + vty_out(vty, "Invalid expression%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_REGEXP; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + regfree(¶ms->regexp); + talloc_free(params); + + return CMD_SUCCESS; +} + +DEFUN(show_talloc_ctx_tree, show_talloc_ctx_tree_cmd, + BASE_CMD_STR " tree ADDRESS", BASE_CMD_DESCR + "Display only a specific memory chunk\n" + "Chunk address (e.g. 0xdeadbeef)") +{ + struct walk_cb_params *params; + int rc; + + /* Allocate memory */ + params = talloc_zero(tall_vty_ctx, struct walk_cb_params); + if (!params) + return CMD_WARNING; + + /* Attempt to parse an address */ + rc = sscanf(argv[2], "%p", ¶ms->chunk_ptr); + if (rc != 1) { + vty_out(vty, "Invalid chunk address%s", VTY_NEWLINE); + talloc_free(params); + return CMD_WARNING; + } + + /* Set up callback parameters */ + params->filter = WALK_FILTER_TREE; + params->vty = vty; + + talloc_ctx_walk(argv[0], argv[1], params); + + /* Free memory */ + talloc_free(params); + + return CMD_SUCCESS; +} + +/*! + * Install VTY commands for talloc context introspection. + * + * This installs a set of VTY commands for introspection of + * a talloc context. Call this once from your application + * if you want to support those commands. + */ +void osmo_talloc_vty_add_cmds(void) +{ + install_element_ve(&show_talloc_ctx_cmd); + install_element_ve(&show_talloc_ctx_tree_cmd); + install_element_ve(&show_talloc_ctx_filter_cmd); +} -- To view, visit https://gerrit.osmocom.org/4018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Sep 27 11:02:20 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 27 Sep 2017 11:02:20 +0000 Subject: [MERGED] libosmocore[master]: vty/vty.c: do not bind vty context to application's one In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: vty/vty.c: do not bind vty context to application's one ...................................................................... vty/vty.c: do not bind vty context to application's one The 'vty_app_info' struct could be used by some applications to provide its talloc context. In the future, it will facilitate the implementation of talloc context introspection via VTY. But the 'vty' talloc context, that contains lots of items (memory chunks), is being bound to an application's one, so it becomes hard to read the last. Let's do not bind the 'vty' context automatically, until some common talloc context export policy is implemented. Change-Id: I9cb6ce9f24dbae400029e2d9f9c933fbfb16248f --- M src/vty/vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/vty.c b/src/vty/vty.c index bd0d2c3..3d9c0d6 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1773,7 +1773,7 @@ /* Install vty's own commands like `who' command. */ void vty_init(struct vty_app_info *app_info) { - tall_vty_ctx = talloc_named_const(app_info->tall_ctx, 0, "vty"); + tall_vty_ctx = talloc_named_const(NULL, 0, "vty"); tall_vty_vec_ctx = talloc_named_const(tall_vty_ctx, 0, "vty_vector"); tall_vty_cmd_ctx = talloc_named_const(tall_vty_ctx, 0, "vty_command"); -- To view, visit https://gerrit.osmocom.org/4017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9cb6ce9f24dbae400029e2d9f9c933fbfb16248f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Sep 27 11:11:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 11:11:36 +0000 Subject: osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Patch Set 6: (3 comments) https://gerrit.osmocom.org/#/c/4003/4/include/osmocom/mgcp/mgcp.h File include/osmocom/mgcp/mgcp.h: Line 37: > Done ow is he 64 be better? What is this RANGE_END used for? We have no idea how many calls a single osmo-mgw will handle in reality. Which limitations exist in the current implementation? Some explanation is needed I suppose. https://gerrit.osmocom.org/#/c/4003/6/include/osmocom/mgcp/mgcp_internal.h File include/osmocom/mgcp/mgcp_internal.h: Line 246: struct mgcp_endpoint_type type; pointer here, to a 'const struct mgcp_endpoint_type' that only exists once (see other comment in this review). https://gerrit.osmocom.org/#/c/4003/6/src/libosmo-mgcp/mgcp_protocol.c File src/libosmo-mgcp/mgcp_protocol.c: Line 1258: tcfg->endpoints[i].type.dispatch_rtp_cb = you're keeping the 'type' as a static member of each individual endpoint, this wastes memory as we now have number_of_endpoints for the same function pointer, or for the same digit '2' above. I tried to explain in the previous commen on patch version 4 that from my point of view there should be a 'const struct rtp_endpoint_type' and which exists once in memory and is const. Each individual endpoint then has one pointer 'type' which points to the that single location in memory where we store things like max_conns and dispatch_rtp_cb. This is a common pattern in Osmococm code (and other projects). see e.g. "struct gsm_bts_model" in libbsc. We don't keep the attributes/function pointers for each 'struct gsm_bts' but only once, globally for all BTSs of that type. -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 27 11:13:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 11:13:32 +0000 Subject: [PATCH] osmo-pcu[master]: Add missing multislot classes Message-ID: Review at https://gerrit.osmocom.org/4072 Add missing multislot classes The table B.1 is copy-pasted from 3GPP TS 45.002 and reformatted via Emacs macros into C struct to avoid typos. Note: classes 35-45 which need TA offset are not properly supported yet (this was the case with the old code too). Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 52 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..a8b3e63 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -32,12 +32,14 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -/* 3GPP TS 05.02 Annex B.1 */ +/* 3GPP TS 45.002 Annex B Table B.1 */ #define MS_NA 255 /* N/A */ #define MS_A 254 /* 1 with hopping, 0 without */ #define MS_B 253 /* 1 with hopping, 0 without (change Rx to Tx)*/ #define MS_C 252 /* 1 with hopping, 0 without (change Tx to Rx)*/ +/* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly */ +#define MS_TO 0 /* 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value) */ struct gprs_ms_multislot_class { uint8_t rx, tx, sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -45,40 +47,55 @@ uint8_t type; /* Type of Mobile */ }; -static const struct gprs_ms_multislot_class gprs_ms_multislot_class[32] = { -/* M-S Class Rx Tx Sum Tta Ttb Tra Trb Type */ -/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, -/* 1 */ { 1, 1, 2, 3, 2, 4, 2, 1 }, -/* 2 */ { 2, 1, 3, 3, 2, 3, 1, 1 }, -/* 3 */ { 2, 2, 3, 3, 2, 3, 1, 1 }, -/* 4 */ { 3, 1, 4, 3, 1, 3, 1, 1 }, -/* 5 */ { 2, 2, 4, 3, 1, 3, 1, 1 }, -/* 6 */ { 3, 2, 4, 3, 1, 3, 1, 1 }, -/* 7 */ { 3, 3, 4, 3, 1, 3, 1, 1 }, -/* 8 */ { 4, 1, 5, 3, 1, 2, 1, 1 }, -/* 9 */ { 3, 2, 5, 3, 1, 2, 1, 1 }, -/* 10 */ { 4, 2, 5, 3, 1, 2, 1, 1 }, -/* 11 */ { 4, 3, 5, 3, 1, 2, 1, 1 }, -/* 12 */ { 4, 4, 5, 2, 1, 2, 1, 1 }, -/* 13 */ { 3, 3, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 14 */ { 4, 4, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 15 */ { 5, 5, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, -/* 16 */ { 6, 6, MS_NA, MS_NA, MS_A, 2, MS_A, 2 }, -/* 17 */ { 7, 7, MS_NA, MS_NA, MS_A, 1, 0, 2 }, -/* 18 */ { 8, 8, MS_NA, MS_NA, 0, 0, 0, 2 }, -/* 19 */ { 6, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 20 */ { 6, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 21 */ { 6, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 22 */ { 6, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 23 */ { 6, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 24 */ { 8, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 25 */ { 8, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 26 */ { 8, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, -/* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 }, -/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, -/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, +static const struct gprs_ms_multislot_class gprs_ms_multislot_class[] = { + /* M-S Class | Max # of slots | Min # of slots | Type */ + /* | Rx Tx Sum | Tta Ttb Tra Trb | */ + /* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, + /* 1 */ { 1, 1, 2, 3, 2, 4, 2, 1 }, + /* 2 */ { 2, 1, 3, 3, 2, 3, 1, 1 }, + /* 3 */ { 2, 2, 3, 3, 2, 3, 1, 1 }, + /* 4 */ { 3, 1, 4, 3, 1, 3, 1, 1 }, + /* 5 */ { 2, 2, 4, 3, 1, 3, 1, 1 }, + /* 6 */ { 3, 2, 4, 3, 1, 3, 1, 1 }, + /* 7 */ { 3, 3, 4, 3, 1, 3, 1, 1 }, + /* 8 */ { 4, 1, 5, 3, 1, 2, 1, 1 }, + /* 9 */ { 3, 2, 5, 3, 1, 2, 1, 1 }, + /* 10 */ { 4, 2, 5, 3, 1, 2, 1, 1 }, + /* 11 */ { 4, 3, 5, 3, 1, 2, 1, 1 }, + /* 12 */ { 4, 4, 5, 2, 1, 2, 1, 1 }, + /* 13 */ { 3, 3, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 14 */ { 4, 4, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 15 */ { 5, 5, MS_NA, MS_NA, MS_A, 3, MS_A, 2 }, + /* 16 */ { 6, 6, MS_NA, MS_NA, MS_A, 2, MS_A, 2 }, + /* 17 */ { 7, 7, MS_NA, MS_NA, MS_A, 1, 0, 2 }, + /* 18 */ { 8, 8, MS_NA, MS_NA, 0, 0, 0, 2 }, + /* 19 */ { 6, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 20 */ { 6, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 21 */ { 6, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 22 */ { 6, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 23 */ { 6, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 24 */ { 8, 2, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 25 */ { 8, 3, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 26 */ { 8, 4, MS_NA, 3, MS_B, 2, MS_C, 1 }, + /* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 }, + /* 30 */ { 5, 1, 6, 2, 1, 1, 1, 1 }, + /* 31 */ { 5, 2, 6, 2, 1, 1, 1, 1 }, + /* 32 */ { 5, 3, 6, 2, 1, 1, 1, 1 }, + /* 33 */ { 5, 4, 6, 2, 1, 1, 1, 1 }, + /* 34 */ { 5, 5, 6, 2, 1, 1, 1, 1 }, + /* 35 */ { 5, 1, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 36 */ { 5, 2, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 37 */ { 5, 3, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 38 */ { 5, 4, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 39 */ { 5, 5, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 40 */ { 6, 1, 7, 1, 1, 1, MS_TO, 1 }, + /* 41 */ { 6, 2, 7, 1, 1, 1, MS_TO, 1 }, + /* 42 */ { 6, 3, 7, 1, 1, 1, MS_TO, 1 }, + /* 43 */ { 6, 4, 7, 1, 1, 1, MS_TO, 1 }, + /* 44 */ { 6, 5, 7, 1, 1, 1, MS_TO, 1 }, + /* 45 */ { 6, 6, 7, 1, 1, 1, MS_TO, 1 }, }; static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 27 12:00:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 12:00:00 +0000 Subject: osmo-ggsn[master]: Move extended PDP logging macro to header In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 12:01:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 12:01:13 +0000 Subject: libosmocore[master]: vty: fix style: bssgp node vty prompt In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I88db128cad9fcc6e53326b4aed5d06ea9102f328 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 12:01:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 27 Sep 2017 12:01:17 +0000 Subject: [MERGED] libosmocore[master]: vty: fix style: bssgp node vty prompt In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: fix style: bssgp node vty prompt ...................................................................... vty: fix style: bssgp node vty prompt Add trailing space and 'config-' prefix to match our common VTY node prompt style. Change-Id: I88db128cad9fcc6e53326b4aed5d06ea9102f328 --- M src/gb/gprs_bssgp_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index 703d130..30ba603 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -58,7 +58,7 @@ static struct cmd_node bssgp_node = { L_BSSGP_NODE, - "%s(bssgp)#", + "%s(config-bssgp)# ", 1, }; -- To view, visit https://gerrit.osmocom.org/4053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88db128cad9fcc6e53326b4aed5d06ea9102f328 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 27 12:01:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 12:01:30 +0000 Subject: [MERGED] osmo-ggsn[master]: Move extended PDP logging macro to header In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move extended PDP logging macro to header ...................................................................... Move extended PDP logging macro to header It might be useful for any user of libgtp who uses libosmocore so let's make generalized version of it available as part of installable header. Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Related: SYS#3610 --- M TODO-RELEASE M ggsn/ggsn.c M gtp/pdp.h 3 files changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index e38e18c..1009c44 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libgtp pdp.h Addition of new tx_gpdu_seq struct member member +libgtp pdp.h add LOGPDPX() helper to public API diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 780a0c2..462b395 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -83,8 +83,7 @@ #define LOGPGGSN(level, ggsn, fmt, args...) \ LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args) -#define LOGPPDP(level, pdp, fmt, args...) \ - LOGP(DGGSN, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) +#define LOGPPDP(level, pdp, fmt, args...) LOGPDPX(DGGSN, level, pdp, fmt, ## args) static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); diff --git a/gtp/pdp.h b/gtp/pdp.h index f8b0df8..106d544 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -17,6 +17,9 @@ struct gsn_t; +#define LOGPDPX(ss, level, pdp, fmt, args...) \ + LOGP(ss, level, "PDP(%s:%u): " fmt, imsi_gtp2str(&(pdp)->imsi), (pdp)->nsapi, ## args) + #define PDP_MAX 1024 /* Max number of PDP contexts */ #define PDP_MAXNSAPI 16 /* Max number of NSAPI */ -- To view, visit https://gerrit.osmocom.org/3961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 27 12:05:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 12:05:27 +0000 Subject: [PATCH] osmo-bts[master]: Replace dead code In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4057 to look at the new patch set (#2). Replace dead code * remove leftover from copy-paste of corresponding OpenBSC code * print OML link state * print paging load Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 --- M src/common/vty.c 1 file changed, 5 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/4057/2 diff --git a/src/common/vty.c b/src/common/vty.c index de9b23f..ef56705 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -762,24 +762,11 @@ VTY_NEWLINE); vty_out(vty, " CBCH backlog queue length: %u%s", llist_length(&btsb->smscb_state.queue), VTY_NEWLINE); -#if 0 - vty_out(vty, " Paging: %u pending requests, %u free slots%s", - paging_pending_requests_nr(bts), - bts->paging.available_slots, VTY_NEWLINE); - if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); - } else { - vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); - e1isl_dump_vty(vty, bts->oml_link); - } - - /* FIXME: chan_desc */ - memset(&pl, 0, sizeof(pl)); - bts_chan_load(&pl, bts); - vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); - dump_pchan_load_vty(vty, " ", &pl); -#endif + vty_out(vty, " Paging: queue length %d, buffer space %d%s", + paging_queue_length(btsb->paging_state), paging_buffer_space(btsb->paging_state), + VTY_NEWLINE); + vty_out(vty, " OML Link state: %s.%s", + bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 12:08:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 12:08:42 +0000 Subject: [PATCH] osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4058 to look at the new patch set (#3). vty: print version and description for each phy When printing BTS via 'show bts ..' let's also print each TRX, which phy number and version it uses and its description. It's helpful in troubleshooting low-level issues as it allows vendor-specific code to easily expose firmware version. Related: SYS#3884 Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd --- M src/common/vty.c 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/4058/3 diff --git a/src/common/vty.c b/src/common/vty.c index ef56705..77bb47d 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -730,6 +730,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct gsm_bts_role_bts *btsb = bts->role; + struct gsm_bts_trx *trx; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u and %u TRX%s", @@ -767,6 +768,17 @@ VTY_NEWLINE); vty_out(vty, " OML Link state: %s.%s", bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + vty_out(vty, " TRX %u%s", trx->nr, VTY_NEWLINE); + if (pinst) { + vty_out(vty, " phy %d %s", pinst->num, pinst->version); + if (pinst->description) + vty_out(vty, " (%s)", pinst->description); + vty_out(vty, "%s", VTY_NEWLINE); + } + } } -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 13:12:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 13:12:06 +0000 Subject: [PATCH] osmo-sgsn[master]: Use extended logging for PDP contexts Message-ID: Review at https://gerrit.osmocom.org/4073 Use extended logging for PDP contexts Log additional details (IMSI, NSAPI etc) on PDP context creation/deletion by using appropriate LOGP() wrappers. Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Related: SYS#3610 --- M src/gprs/sgsn_libgtp.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/73/4073/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 9a00266..9b8fe16 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -145,7 +145,6 @@ const uint8_t *qos; int rc; - LOGP(DGPRS, LOGL_ERROR, "Create PDP Context\n"); pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); @@ -174,6 +173,7 @@ pdp->selmode = 0xFC | 0x00; /* IMSI, TEID/TEIC, FLLU/FLLC, TID, NSAPI set in pdp_newpdp */ + LOGPDPCTXP(LOGL_NOTICE, pctx, "Create PDP Context\n"); /* Put the MSISDN in case we have it */ if (mmctx->subscr && mmctx->subscr->sgsn_data->msisdn_len) { @@ -635,7 +635,8 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { - LOGP(DGPRS, LOGL_INFO, "PDP Context was deleted\n"); + LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context was deleted\n") ; + return 0; } -- To view, visit https://gerrit.osmocom.org/4073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 27 13:42:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 13:42:39 +0000 Subject: [PATCH] osmo-sgsn[master]: Cleanup configure checks Message-ID: Review at https://gerrit.osmocom.org/4074 Cleanup configure checks * remove unused sqlite3 check * remove unused NAT/SMPP/BSC/MGCP test checks Change-Id: I83ae896f57cfb4cb139a42fbf3d77d4b11313f65 --- M configure.ac M tests/atlocal.in 2 files changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/74/4074/1 diff --git a/configure.ac b/configure.ac index 532b977..cd60f07 100644 --- a/configure.ac +++ b/configure.ac @@ -88,11 +88,6 @@ AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no) AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes) -found_sqlite3=yes -PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no) -AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes) -AC_SUBST(found_sqlite3) - dnl Checks for typedefs, structures and compiler characteristics diff --git a/tests/atlocal.in b/tests/atlocal.in index 362bfa9..c854487 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +1,3 @@ -enable_nat_test='@osmo_ac_build_nat@' -enable_smpp_test='@osmo_ac_build_smpp@' -enable_bsc_test='@osmo_ac_build_bsc@' -enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@' enable_sgsn_test='@found_libgtp_and_libcares@' enable_oap_test='@found_libgtp_and_libcares@' enable_gtphub_test='@found_libgtp_and_libcares@' -- To view, visit https://gerrit.osmocom.org/4074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83ae896f57cfb4cb139a42fbf3d77d4b11313f65 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Sep 27 13:54:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 13:54:52 +0000 Subject: [PATCH] osmo-sgsn[master]: Use extended logging for PDP contexts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4073 to look at the new patch set (#2). Use extended logging for PDP contexts Log additional details (IMSI, NSAPI etc) on PDP context creation/deletion by using appropriate LOGP() wrappers. Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Related: SYS#3610 --- M configure.ac M src/gprs/sgsn_libgtp.c 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/73/4073/2 diff --git a/configure.ac b/configure.ac index 532b977..3742594 100644 --- a/configure.ac +++ b/configure.ac @@ -62,7 +62,7 @@ found_libgtp=yes -PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) +PKG_CHECK_MODULES(LIBGTP, libgtp >= 1.0.0, , found_libgtp=no) AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) AC_SUBST(found_libgtp) diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 9a00266..9b8fe16 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -145,7 +145,6 @@ const uint8_t *qos; int rc; - LOGP(DGPRS, LOGL_ERROR, "Create PDP Context\n"); pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); @@ -174,6 +173,7 @@ pdp->selmode = 0xFC | 0x00; /* IMSI, TEID/TEIC, FLLU/FLLC, TID, NSAPI set in pdp_newpdp */ + LOGPDPCTXP(LOGL_NOTICE, pctx, "Create PDP Context\n"); /* Put the MSISDN in case we have it */ if (mmctx->subscr && mmctx->subscr->sgsn_data->msisdn_len) { @@ -635,7 +635,8 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { - LOGP(DGPRS, LOGL_INFO, "PDP Context was deleted\n"); + LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context was deleted\n") ; + return 0; } -- To view, visit https://gerrit.osmocom.org/4073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Sep 27 13:57:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 13:57:54 +0000 Subject: libosmocore[master]: CTRL: allow argument for GET commands In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 It has been tested with ctrl_test_runner.py in osmo-hlr.git, but Holger has pointed out that this may work like: subscriber.1234567.status-ps so let be block this until it's clarified. -- To view, visit https://gerrit.osmocom.org/4069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I228342bedd623f6058493e1d0dea0c721d21c4e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 14:01:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 14:01:26 +0000 Subject: libosmocore[master]: CTRL: GET parsing: add '\n' as token delimiter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 > What about \r and \t? I'm not sure yet which way we want to go there. Should we disallow all whitespace other than plain space? Maybe still allow anything within the value part? Technically there could be a CTRL command to send an SMS with arbitrary special characters, as long as it doesn't interfere. I'm also not sure about this one here, it only looked like it made sense because '\n' was used in the 'SET' command parsing. I need some more reflecting on this I guess. -- To view, visit https://gerrit.osmocom.org/4068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33efb56f76cb7a41e94454666e218617e9b713ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 14:04:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 14:04:09 +0000 Subject: [MERGED] libosmocore[master]: vty: install 'exit', 'end', ... commands on *all* nodes In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: install 'exit', 'end',... commands on *all* nodes ...................................................................... vty: install 'exit', 'end',... commands on *all* nodes In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Make both install_default() and vty_install_default() no-ops so that users of the API may still call them without harm. Do not yet deprecate yet, which follows in Icf5d83f641e838cebcccc635a043e94ba352abff. Drop all invocations to these two functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b --- M include/osmocom/vty/command.h M src/ctrl/control_vty.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c M src/vty/command.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/vty.c M tests/vty/vty_test.c 9 files changed, 31 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 58f248f..8fbdb7b 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -27,6 +27,8 @@ #include #include "vector.h" +#include + /*! \defgroup command VTY Command * @{ * \file command.h */ @@ -363,9 +365,6 @@ void install_element_ve(struct cmd_element *cmd); void sort_node(void); -/* This is similar to install_default() but it also creates - * 'exit' and 'end' commands. - */ void vty_install_default(int node_type); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index 97f42de..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -82,7 +82,6 @@ ctrl_vty_ctx = ctx; install_element(CONFIG_NODE, &cfg_ctrl_cmd); install_node(&ctrl_node, config_write_ctrl); - vty_install_default(L_CTRL_NODE); install_element(L_CTRL_NODE, &cfg_ctrl_bind_addr_cmd); return 0; diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index dc786a1..f787846 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -211,7 +211,6 @@ install_element(CONFIG_NODE, &cfg_bssgp_cmd); install_node(&bssgp_node, config_write_bssgp); - vty_install_default(L_BSSGP_NODE); return 0; } diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 4bd5097..f94d9c2 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_ns_cmd); install_node(&ns_node, config_write_ns); - vty_install_default(L_NS_NODE); install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); install_element(L_NS_NODE, &cfg_nse_remoteip_cmd); install_element(L_NS_NODE, &cfg_nse_remoteport_cmd); diff --git a/src/vty/command.c b/src/vty/command.c index 8ad2e97..21b26b4 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -149,14 +149,23 @@ return name_buf; } -/*! Install top node of command vector. */ -void install_node(struct cmd_node *node, int (*func) (struct vty *)) +static void install_basic_node_commands(int node); + +/*! Install top node of command vector, without adding basic node commands. */ +static void install_node_bare(struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index(cmdvec, node->node, node); node->func = func; node->cmd_vector = vector_init(VECTOR_MIN_SIZE); if (!*node->name) node_name_from_prompt(node->prompt, node->name, sizeof(node->name)); +} + +/*! Install top node of command vector. */ +void install_node(struct cmd_node *node, int (*func) (struct vty *)) +{ + install_node_bare(node, func); + install_basic_node_commands(node->node); } /* Compare two command's string. Used in sort_node (). */ @@ -3599,7 +3608,22 @@ host.config = talloc_strdup(tall_vty_cmd_ctx, filename); } +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ void install_default(int node) +{ +} + +/*! Deprecated, now happens implicitly when calling install_node(). + * Users of the API may still attempt to call this function, hence + * leave it here as a no-op. */ +void vty_install_default(int node) +{ +} + +/*! Install common commands like 'exit' and 'list'. */ +static void install_basic_node_commands(int node) { install_element(node, &config_help_cmd); install_element(node, &config_list_cmd); @@ -3609,11 +3633,6 @@ install_element(node, &config_write_memory_cmd); install_element(node, &config_write_cmd); install_element(node, &show_running_config_cmd); -} - -void vty_install_default(int node) -{ - install_default(node); install_element(node, &config_exit_cmd); @@ -3681,10 +3700,10 @@ host.motdfile = NULL; /* Install top nodes. */ - install_node(&view_node, NULL); + install_node_bare(&view_node, NULL); install_node(&enable_node, NULL); - install_node(&auth_node, NULL); - install_node(&auth_enable_node, NULL); + install_node_bare(&auth_node, NULL); + install_node_bare(&auth_enable_node, NULL); install_node(&config_node, config_write_host); /* Each node's basic commands. */ @@ -3701,7 +3720,6 @@ } if (terminal) { - vty_install_default(ENABLE_NODE); install_element(ENABLE_NODE, &config_disable_cmd); install_element(ENABLE_NODE, &config_terminal_cmd); install_element (ENABLE_NODE, ©_runningconfig_startupconfig_cmd); @@ -3714,8 +3732,6 @@ install_element(ENABLE_NODE, &config_terminal_length_cmd); install_element(ENABLE_NODE, &config_terminal_no_length_cmd); install_element(ENABLE_NODE, &echo_cmd); - - vty_install_default(CONFIG_NODE); } install_element(CONFIG_NODE, &hostname_cmd); diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 01480b1..0ab7686 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -776,7 +776,6 @@ install_element_ve(&show_alarms_cmd); install_node(&cfg_log_node, config_write_log); - vty_install_default(CFG_LOG_NODE); install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 57cdd30..a4c73fa 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -594,7 +594,6 @@ install_element(CONFIG_NODE, &cfg_stats_interval_cmd); install_node(&cfg_stats_node, config_write_stats); - vty_install_default(CFG_STATS_NODE); install_element(CFG_STATS_NODE, &cfg_stats_reporter_local_ip_cmd); install_element(CFG_STATS_NODE, &cfg_no_stats_reporter_local_ip_cmd); diff --git a/src/vty/vty.c b/src/vty/vty.c index 3d9c0d6..aef73b3 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1798,7 +1798,6 @@ install_element(ENABLE_NODE, &terminal_monitor_cmd); install_element(ENABLE_NODE, &terminal_no_monitor_cmd); - vty_install_default(VTY_NODE); install_element(VTY_NODE, &vty_login_cmd); install_element(VTY_NODE, &no_vty_login_cmd); install_element(VTY_NODE, &vty_bind_cmd); diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index fe50e4c..2542baf 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -386,17 +386,14 @@ { install_element(CONFIG_NODE, &cfg_level1_cmd); install_node(&level1_node, NULL); - vty_install_default(LEVEL1_NODE); install_element(LEVEL1_NODE, &cfg_level1_child_cmd); install_element(LEVEL1_NODE, &cfg_level2_cmd); install_node(&level2_node, NULL); - vty_install_default(LEVEL2_NODE); install_element(LEVEL2_NODE, &cfg_level2_child_cmd); install_element(LEVEL2_NODE, &cfg_level3_cmd); install_node(&level3_node, NULL); - vty_install_default(LEVEL3_NODE); install_element(LEVEL3_NODE, &cfg_level3_child_cmd); } -- To view, visit https://gerrit.osmocom.org/3998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 27 14:04:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 14:04:09 +0000 Subject: [MERGED] libosmocore[master]: gb: drop special vty exit commands, use vty_install_default() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gb: drop special vty exit commands, use vty_install_default() ...................................................................... gb: drop special vty exit commands, use vty_install_default() L_NS_NODE and L_BSSGP_NODE had specialized 'exit' and 'end' vty commands, but all they do is return to the CONFIG and ENABLE_NODEs like the default 'exit' and 'end' commands. Drop them and use the default 'exit' and 'end' cmds. Examining BSSGP and NS node behavior in osmo-sgsn exhibited identical list and exit/end behavior before and after this patch. Prepares for an upcoming commit incorporating vty_install_default() into install_node(), see I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b: this patch changes to the default commands, the upcoming change implies them. Change-Id: I5b0de066b4249d482c22620d5b1bcb03f381293c --- M src/gb/common_vty.c M src/gb/common_vty.h M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c 4 files changed, 2 insertions(+), 43 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/common_vty.c b/src/gb/common_vty.c index 5de5135..16f3bbd 100644 --- a/src/gb/common_vty.c +++ b/src/gb/common_vty.c @@ -35,40 +35,6 @@ #include "common_vty.h" -/* Down vty node level. */ -gDEFUN(libgb_exit, - libgb_exit_cmd, "exit", "Exit current mode and down to previous mode\n") -{ - switch (vty->node) { - case L_NS_NODE: - case L_BSSGP_NODE: - vty->node = CONFIG_NODE; - vty->index = NULL; - break; - default: - break; - } - return CMD_SUCCESS; -} - -/* End of configuration. */ -gDEFUN(libgb_end, - libgb_end_cmd, "end", "End current mode and change to enable mode.") -{ - switch (vty->node) { - case L_NS_NODE: - case L_BSSGP_NODE: - vty_config_unlock(vty); - vty->node = ENABLE_NODE; - vty->index = NULL; - vty->index_sub = NULL; - break; - default: - break; - } - return CMD_SUCCESS; -} - int gprs_log_filter_fn(const struct log_context *ctx, struct log_target *tar) { diff --git a/src/gb/common_vty.h b/src/gb/common_vty.h index a0674a7..801d2da 100644 --- a/src/gb/common_vty.h +++ b/src/gb/common_vty.h @@ -5,6 +5,3 @@ extern int DNS, DBSSGP; -extern struct cmd_element libgb_exit_cmd; -extern struct cmd_element libgb_end_cmd; - diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index 30ba603..dc786a1 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -211,9 +211,7 @@ install_element(CONFIG_NODE, &cfg_bssgp_cmd); install_node(&bssgp_node, config_write_bssgp); - install_default(L_BSSGP_NODE); - install_element(L_BSSGP_NODE, &libgb_exit_cmd); - install_element(L_BSSGP_NODE, &libgb_end_cmd); + vty_install_default(L_BSSGP_NODE); return 0; } diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index e320ba2..4bd5097 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -594,9 +594,7 @@ install_element(CONFIG_NODE, &cfg_ns_cmd); install_node(&ns_node, config_write_ns); - install_default(L_NS_NODE); - install_element(L_NS_NODE, &libgb_exit_cmd); - install_element(L_NS_NODE, &libgb_end_cmd); + vty_install_default(L_NS_NODE); install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); install_element(L_NS_NODE, &cfg_nse_remoteip_cmd); install_element(L_NS_NODE, &cfg_nse_remoteport_cmd); -- To view, visit https://gerrit.osmocom.org/4054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5b0de066b4249d482c22620d5b1bcb03f381293c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 27 14:06:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 27 Sep 2017 14:06:02 +0000 Subject: libosmocore[master]: CTRL: add unit tests for CTRL command parsing In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4067/2/tests/ctrl/ctrl_test.c File tests/ctrl/ctrl_test.c: Line 127: .variable = "variable\n", /* current bug */ So, it's debatable whether it's a bug or not? -- To view, visit https://gerrit.osmocom.org/4067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 27 14:07:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 14:07:17 +0000 Subject: libosmocore[master]: CTRL: add unit tests for CTRL command parsing In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4067/2/tests/ctrl/ctrl_test.c File tests/ctrl/ctrl_test.c: Line 127: .variable = "variable\n", /* current bug */ > So, it's debatable whether it's a bug or not? yes indeed -- To view, visit https://gerrit.osmocom.org/4067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 27 14:09:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 14:09:10 +0000 Subject: libosmocore[master]: CTRL: add unit tests for CTRL command parsing In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4067/2/tests/ctrl/ctrl_test.c File tests/ctrl/ctrl_test.c: Line 127: .variable = "variable\n", /* current bug */ > yes indeed actually wait, this is in the *variable* name. In the value part, I would allow newlines, but not in the variable name and only in SET commands. So this one is a bug alright. -- To view, visit https://gerrit.osmocom.org/4067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Sep 27 14:09:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 14:09:34 +0000 Subject: [MERGED] libosmocore[master]: CTRL: add unit tests for CTRL command parsing In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: CTRL: add unit tests for CTRL command parsing ...................................................................... CTRL: add unit tests for CTRL command parsing This uncovers some interesting behavior of the CTRL interface which we may want to guard against in subsequent patches: trailing whitespace, ignored tokens, special characters as cmd->id. Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 --- M tests/ctrl/ctrl_test.c M tests/ctrl/ctrl_test.ok 2 files changed, 353 insertions(+), 0 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index 08be15f..b8425c7 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -6,6 +6,9 @@ #include #include +#include +#include +#include static void check_type(enum ctrl_type c) { @@ -19,8 +22,254 @@ printf("-> %d %s\n", v, c != v ? "FAIL" : "OK"); } +struct msgb *msgb_from_string(const char *str) +{ + char *rc; + size_t len = strlen(str) + 1; + /* ctrl_cmd_parse() appends a '\0' to the msgb, allow one more byte. */ + struct msgb *msg = msgb_alloc(len + 1, str); + msg->l2h = msg->head; + rc = (char*)msgb_put(msg, len); + OSMO_ASSERT(rc == (char*)msg->l2h); + strcpy(rc, str); + return msg; +} + +static void *ctx = NULL; + +void print_escaped(const char *str) +{ + if (!str) { + printf("NULL"); + return; + } + + printf("'"); + for (;*str; str++) { + switch (*str) { + case '\n': + printf("\\n"); + break; + case '\r': + printf("\\r"); + break; + case '\t': + printf("\\t"); + break; + default: + printf("%c", *str); + break; + } + } + printf("'"); +} + +void assert_same_str(const char *label, const char *expect, const char *got) +{ + if ((expect == got) || (expect && got && (strcmp(expect, got) == 0))) { + printf("%s = ", label); + print_escaped(got); + printf("\n"); + return; + } + + printf("MISMATCH for '%s':\ngot: ", label); print_escaped(got); + printf("\nexpected: "); print_escaped(expect); + printf("\n"); + OSMO_ASSERT(expect == got); +} + +static void assert_parsing(const char *str, const struct ctrl_cmd *expect) +{ + struct ctrl_cmd *cmd; + struct msgb *msg = msgb_from_string(str); + + printf("test parsing: "); + print_escaped(str); + printf("\n"); + + cmd = ctrl_cmd_parse(ctx, msg); + OSMO_ASSERT(cmd); + + OSMO_ASSERT(expect->type == cmd->type); + +#define ASSERT_SAME_STR(field) \ + assert_same_str(#field, expect->field, cmd->field) + + ASSERT_SAME_STR(id); + ASSERT_SAME_STR(variable); + ASSERT_SAME_STR(value); + ASSERT_SAME_STR(reply); + + talloc_free(cmd); + msgb_free(msg); + + printf("ok\n"); +} + +struct one_parsing_test { + const char *cmd_str; + struct ctrl_cmd expect; +}; + +static const struct one_parsing_test test_parsing_list[] = { + { "GET 1 variable", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + } + }, + { "GET 1 variable\n", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable\n", /* current bug */ + } + }, + { "GET 1 var\ni\nable", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "var\ni\nable", /* current bug */ + } + }, + { "GET 1 variable value", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "GET 1 variable value\n", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "GET 1 variable multiple value tokens", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "GET 1 variable multiple value tokens\n", + { + .type = CTRL_TYPE_GET, + .id = "1", + .variable = "variable", + .value = NULL, + } + }, + { "SET 1 variable value", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value", + } + }, + { "SET 1 variable value\n", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value", + } + }, + { "SET weird_id variable value", + { + .type = CTRL_TYPE_SET, + .id = "weird_id", + .variable = "variable", + .value = "value", + } + }, + { "SET weird_id variable value\n", + { + .type = CTRL_TYPE_SET, + .id = "weird_id", + .variable = "variable", + .value = "value", + } + }, + { "SET 1 variable multiple value tokens", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "multiple value tokens", + } + }, + { "SET 1 variable multiple value tokens\n", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "multiple value tokens", + } + }, + { "SET 1 variable value_with_trailing_spaces ", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value_with_trailing_spaces ", + } + }, + { "SET 1 variable value_with_trailing_spaces \n", + { + .type = CTRL_TYPE_SET, + .id = "1", + .variable = "variable", + .value = "value_with_trailing_spaces ", + } + }, + { "SET \n special_char_id value", + { + .type = CTRL_TYPE_SET, + .id = "\n", + .variable = "special_char_id", + .value = "value", + } + }, + { "SET \t special_char_id value", + { + .type = CTRL_TYPE_SET, + .id = "\t", + .variable = "special_char_id", + .value = "value", + } + }, +}; + +static void test_parsing() +{ + int i; + + for (i = 0; i < ARRAY_SIZE(test_parsing_list); i++) + assert_parsing(test_parsing_list[i].cmd_str, + &test_parsing_list[i].expect); +} + +static struct log_info_cat test_categories[] = { +}; + +static struct log_info info = { + .cat = test_categories, + .num_cat = ARRAY_SIZE(test_categories), +}; + int main(int argc, char **argv) { + ctx = talloc_named_const(NULL, 1, "ctrl_test"); + osmo_init_logging(&info); + printf("Checking ctrl types...\n"); check_type(CTRL_TYPE_UNKNOWN); @@ -32,5 +281,7 @@ check_type(CTRL_TYPE_ERROR); check_type(64); + test_parsing(); + return 0; } diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok index 8f97a27..9c8877b 100644 --- a/tests/ctrl/ctrl_test.ok +++ b/tests/ctrl/ctrl_test.ok @@ -7,3 +7,105 @@ ctrl type 5 is TRAP -> 5 OK ctrl type 6 is ERROR -> 6 OK ctrl type 64 is unknown 0x40 [PARSE FAILED] +test parsing: 'GET 1 variable' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable\n' +id = '1' +variable = 'variable\n' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 var\ni\nable' +id = '1' +variable = 'var\ni\nable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable value' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable value\n' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable multiple value tokens' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'GET 1 variable multiple value tokens\n' +id = '1' +variable = 'variable' +value = NULL +reply = NULL +ok +test parsing: 'SET 1 variable value' +id = '1' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET 1 variable value\n' +id = '1' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET weird_id variable value' +id = 'weird_id' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET weird_id variable value\n' +id = 'weird_id' +variable = 'variable' +value = 'value' +reply = NULL +ok +test parsing: 'SET 1 variable multiple value tokens' +id = '1' +variable = 'variable' +value = 'multiple value tokens' +reply = NULL +ok +test parsing: 'SET 1 variable multiple value tokens\n' +id = '1' +variable = 'variable' +value = 'multiple value tokens' +reply = NULL +ok +test parsing: 'SET 1 variable value_with_trailing_spaces ' +id = '1' +variable = 'variable' +value = 'value_with_trailing_spaces ' +reply = NULL +ok +test parsing: 'SET 1 variable value_with_trailing_spaces \n' +id = '1' +variable = 'variable' +value = 'value_with_trailing_spaces ' +reply = NULL +ok +test parsing: 'SET \n special_char_id value' +id = '\n' +variable = 'special_char_id' +value = 'value' +reply = NULL +ok +test parsing: 'SET \t special_char_id value' +id = '\t' +variable = 'special_char_id' +value = 'value' +reply = NULL +ok -- To view, visit https://gerrit.osmocom.org/4067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Sep 27 17:07:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 27 Sep 2017 17:07:13 +0000 Subject: openbsc[master]: abis: fix unaligned memory access In-Reply-To: References: Message-ID: Patch Set 3: > (1 comment) > > How often are those unaligned accesses? Are they in frequently-used > code paths? Do we really consider fixing those up an efficient use > of our time/resources? I got this too while testing packages from post-NITB repositories in sysmoBTS. it seems to happen every time a osmo-bts connects to osmo-bsc. See https://osmocom.org/issues/2472#note-3 -- To view, visit https://gerrit.osmocom.org/3750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Sep 27 18:57:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 27 Sep 2017 18:57:12 +0000 Subject: [PATCH] osmo-ggsn[master]: contrib: osmo-ggsn.service: Use expected suffix for cfg file Message-ID: Review at https://gerrit.osmocom.org/4075 contrib: osmo-ggsn.service: Use expected suffix for cfg file files in doc/examples/ dir end with .cfg, as well as all configuration files present in all projects. Change-Id: I361c67809d095dd08b0f400de2a6f84f981411c5 --- M contrib/osmo-ggsn.service 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/75/4075/1 diff --git a/contrib/osmo-ggsn.service b/contrib/osmo-ggsn.service index a8d123a..10e3507 100644 --- a/contrib/osmo-ggsn.service +++ b/contrib/osmo-ggsn.service @@ -5,7 +5,7 @@ [Service] Type=simple Restart=always -ExecStart=/usr/bin/osmo-ggsn -c /etc/osmocom/osmo-ggsn.conf -f +ExecStart=/usr/bin/osmo-ggsn -c /etc/osmocom/osmo-ggsn.cfg -f RestartSec=2 RestartPreventExitStatus=1 -- To view, visit https://gerrit.osmocom.org/4075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I361c67809d095dd08b0f400de2a6f84f981411c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Sep 27 21:04:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 27 Sep 2017 21:04:06 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: move mncc.adoc to common chapters In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move mncc.adoc to common chapters ...................................................................... move mncc.adoc to common chapters Upcoming OsmoMSC will reference the same, hence MNCC becomes a common chapter. Move the file and adjust various wording to include OsmoMSC. Change-Id: I404758ff7f1372e841ffe33c75455f513fff3caf --- M OsmoNITB/osmonitb-usermanual.adoc R common/chapters/mncc.adoc 2 files changed, 51 insertions(+), 44 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 0d6fa7e..7d342c5 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -29,7 +29,7 @@ include::chapters/smpp.adoc[] -include::chapters/mncc.adoc[] +include::../common/chapters/mncc.adoc[] include::../common/chapters/control_if.adoc[] diff --git a/OsmoNITB/chapters/mncc.adoc b/common/chapters/mncc.adoc similarity index 65% rename from OsmoNITB/chapters/mncc.adoc rename to common/chapters/mncc.adoc index 504ce09..47dfcbe 100644 --- a/OsmoNITB/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -1,5 +1,5 @@ [[mncc]] -== MNCC for external Call Control +== MNCC for External Call Control The 3GPP GSM specifications define an interface point (service access point) inside the MSC between the call-control part and the rest of the @@ -9,21 +9,24 @@ However, like for all internal interfaces, 3GPP does not give any specific encoding for the primitives passed at this SAP. -The MNCC protocol of OsmoNITB has been created by the Osmocom community +The MNCC protocol has been created by the Osmocom community and allows to control the call handling and audio processing by an external application. The interface is currently exposed using Unix Domain Sockets. The protocol is defined in the `mncc.h` header file. -OsmoNITB can run in two different modes: +It is exposed by the Osmocom MSC layer (both in the old OsmoNITB as well as the +new OsmoMSC. + +Osmocom's MSCs can run in two different modes: . with internal MNCC handler . with external MNCC handler === Internal MNCC handler -When the internal MNCC handler is enabled, OsmoNITB will switch voice -calls between GSM subscribers internally and automatically based on -the subscribers __extension__ number. No external software is required. +When the internal MNCC handler is enabled, OsmoMSC/OsmoNITB will switch voice +calls between GSM subscribers internally and automatically based on the +subscribers __extension__ number. No external software is required. NOTE: Internal MNCC is the default behavior. @@ -42,131 +45,135 @@ Using this command, you can configure the default voice codec to be used by voice calls on TCH/H channels. +[[mncc-external]] === External MNCC handler -When the external MNCC handler is enabled, OsmoNITB will not perform any -internal call switching, but delegate all call-control handling towards -the external MNCC program connected via the MNCC socket. +When the external MNCC handler is enabled, OsmoMSC/OsmoNITB will not perform +any internal call switching, but delegate all call-control handling towards the +external MNCC program connected via the MNCC socket. -If you intend to operate OsmoNITB with external MNCC handler, you have +If you intend to operate with external MNCC handler, you have to start it with the `-m` or `--mncc-sock` command line option. -At the time of this writing, the only external application implementing -the MNCC interface compatible with the OsmoNITB MNCC socket was `lcr`, -the Linux Call Router. +At the time of this writing, the only external application implementing the +MNCC interface compatible with the Osmocom MNCC socket is `lcr`, the Linux Call +Router. More widespread integration of external call routing is available via +the OsmoSIPConnector. === MNCC protocol description -The protocol follows the primitives specified in 3GPP TS 04.07 Chapter -7.1. The encoding of the primitives is provided in the `openbsc/mncc.h` -header file, which uses some common definitions from -`osmocom/gsm/mncc.h` (part of libosmocore.git). +The protocol follows the primitives specified in 3GPP TS 04.07 Chapter 7.1. +The encoding of the primitives is provided in the `mncc.h` header file +(`osmocom/msc/mncc.h` in `osmo-msc.git` or `openbsc/mncc.h` in old +`openbsc.git`), which uses some common definitions from `osmocom/gsm/mncc.h` +(part of `libosmocore.git`). -However, OsmoNITB MNCC specifies a number of additional primitives -beyond those listed in the 3GPP specification. +However, Osmocom's MNCC specifies a number of additional primitives beyond +those listed in the 3GPP specification. The different calls in the network are distinguished by their callref (call reference), which is a unique unsigned 32bit integer. +NOTE: _MSC_ below refers to both OsmoMSC and _libmsc_ of the OsmoNITB. + ==== MNCC_HOLD_IND -Direction: NITB -> Handler +Direction: MSC -> Handler A 'CC HOLD' message was received from the MS. ==== MNCC_HOLD_CNF -Direction: Handler -> NITB +Direction: Handler -> MSC Acknowledge a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD ACK' message to the MS. ==== MNCC_HOLD_REJ -Direction: Handler -> NITB +Direction: Handler -> MSC Reject a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD REJ' message to the MS. ==== MNCC_RETRIEVE_IND -Direction: NITB -> Handler +Direction: MSC -> Handler A 'CC RETRIEVE' message was received from the MS. ==== MNCC_RETRIEVE_CNF -Direction: Handler -> NITB +Direction: Handler -> MSC Acknowledge a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE ACK' message to the MS. - ==== MNCC_RETRIEVE_REJ -Direction: Handler -> NITB +Direction: Handler -> MSC Reject a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE REJ' message to the MS. ==== MNCC_USERINFO_REQ -Direction: NITB -> Handler +Direction: MSC -> Handler Causes a 'CC USER INFO' message to be sent to the MS. ==== MNCC_USERINFO_IND -Direction: NITB -> Handler +Direction: MSC -> Handler Indicates that a 'CC USER-USER' message has been received from the MS. ==== MNCC_BRIDGE -Direction: Handler -> NITB +Direction: Handler -> MSC Requests that the TCH (voice) channels of two calls shall be inter-connected. This is the old-fashioned way of using MNCC, primarily required for circuit-switched BTSs whose TRAU frames are -received via an E1 interface card on the NITB machine. +received via an E1 interface card on the MSC machine. ==== MNCC_FRAME_RECV -Direction: Handler -> NITB +Direction: Handler -> MSC Enable the forwarding of TCHF voice frames via the MNCC interface in -NITB->Handler direction for the specified call. +MSC->Handler direction for the specified call. ==== MNCC_FRAME_DROP -Direction: Handler -> NITB +Direction: Handler -> MSC Disable the forwarding of TCHF voice frames via the MNCC interface in -NITB->Handler direction for the specified call. +MSC->Handler direction for the specified call. ==== MNCC_LCHAN_MODIFY -Direction: Handler -> NITB +Direction: Handler -> MSC Modify the current dedicated radio channel from signalling to voice, or if it is a signalling-only channel (SDCCH), assign a TCH to the MS. ==== MNCC_RTP_CREATE -Direction: Handler -> NITB +Direction: Handler -> MSC Create a RTP socket for this call at the BTS/TRAU that serves this BTS. ==== MNCC_RTP_CONNECT -Direction: Handler -> NITB +Direction: Handler -> MSC Connect the RTP socket of this call to the given remote IP address and port. ==== MNCC_RTP_FREE -Direction: Handler -> NITB +Direction: Handler -> MSC Release a RTP connection for one given call. @@ -175,32 +182,32 @@ Direction: both Transfer the payload of a GSM Full-Rate (FR) voice frame between the -NITB and an external MNCC handler. +MSC and an external MNCC handler. ==== GSM_TCHF_FRAME_EFR Direction: both Transfer the payload of a GSM Enhanced Full-Rate (EFR) voice frame -between the NITB and an external MNCC handler. +between the MSC and an external MNCC handler. ==== GSM_TCHH_FRAME Direction: both Transfer the payload of a GSM Half-Rate (HR) voice frame between the -NITB and an external MNCC handler. +MSC and an external MNCC handler. ==== GSM_TCH_FRAE_AMR Direction: both Transfer the payload of a GSM Adaptive-Multi-Rate (AMR) voice frame -between the NITB and an external MNCC handler. +between the MSC and an external MNCC handler. ==== GSM_BAD_FRAME -Direction: NITB -> Handler +Direction: MSC -> Handler Indicate that no valid voice frame, but a 'bad frame' was received over the radio link from the MS. -- To view, visit https://gerrit.osmocom.org/4051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I404758ff7f1372e841ffe33c75455f513fff3caf Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 00:08:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 00:08:03 +0000 Subject: [PATCH] libosmocore[master]: IPA msgb: on ipa_msg_alloc(), set caller as talloc string Message-ID: Review at https://gerrit.osmocom.org/4076 IPA msgb: on ipa_msg_alloc(), set caller as talloc string Upon talloc, instead of "IPA Multiplex", actually use the calling function as talloc string: - add ipa_msg_alloc2(), which takes a talloc name as argument. - make ipa_msg_alloc() a macro that calls ipa_msg_alloc2() passing __func__ as string. Future callers may invoke ipa_msg_alloc2() directly and provide a talloc string. All current callers now produce a talloc string that indicates exactly which caller created the msgb. This was useful to find a memory leak in OsmoMSC, see OS#2476. Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 --- M include/osmocom/gsm/ipa.h M src/gsm/ipa.c M src/gsm/libosmogsm.map 3 files changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/4076/1 diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h index 7e1d723..d2c27fa 100644 --- a/include/osmocom/gsm/ipa.h +++ b/include/osmocom/gsm/ipa.h @@ -70,7 +70,8 @@ /* prepend (push) an ipaccess_head to the msgb */ void ipa_prepend_header(struct msgb *msg, int proto); -struct msgb *ipa_msg_alloc(int headroom); +#define ipa_msg_alloc(headroom) ipa_msg_alloc2((headroom), __func__) +struct msgb *ipa_msg_alloc2(int headroom, const char *msgb_name); int ipa_msg_recv(int fd, struct msgb **rmsg); int ipa_msg_recv_buffered(int fd, struct msgb **rmsg, struct msgb **tmp_msg); diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index fef73c3..2ef513c 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -576,13 +576,13 @@ #endif /* SYS_SOCKET_H */ -struct msgb *ipa_msg_alloc(int headroom) +struct msgb *ipa_msg_alloc2(int headroom, const char *msgb_name) { struct msgb *nmsg; headroom += sizeof(struct ipaccess_head); - nmsg = msgb_alloc_headroom(1200 + headroom, headroom, "IPA Multiplex"); + nmsg = msgb_alloc_headroom(1200 + headroom, headroom, msgb_name); if (!nmsg) return NULL; return nmsg; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 066f410..54b61a4 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -398,7 +398,7 @@ ipa_ccm_idtag_parse_off; ipa_ccm_make_id_resp; ipa_ccm_make_id_resp_from_req; -ipa_msg_alloc; +ipa_msg_alloc2; ipa_msg_recv; ipa_msg_recv_buffered; ipa_parse_unitid; -- To view, visit https://gerrit.osmocom.org/4076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 01:52:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 01:52:06 +0000 Subject: [PATCH] osmo-msc[master]: fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() Message-ID: Review at https://gerrit.osmocom.org/4077 fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() Add required msgb_free() to vlr_gsupc_read_cb(). Adjust msc_vlr_tests.c gsup_rx() to *not* free the msgb again after vlr_gsupc_read_cb() did. Related: OS#2476 Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0 --- M src/libvlr/vlr.c M tests/msc_vlr/msc_vlr_tests.c 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/77/4077/1 diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index 6094c9c..adfe258 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -804,6 +804,7 @@ osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + msgb_free(msg); if (rc < 0) { LOGP(DVLR, LOGL_ERROR, "decoding GSUP message fails with error '%s' (%d)\n", diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a6e0f29..f9dc278 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -130,12 +130,12 @@ label = osmo_gsup_message_type_name(msg->l2h[0]); fprintf(stderr, "<-- GSUP rx %s: %s\n", label, osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg))); + /* GSUP read cb takes ownership of msgb */ rc = vlr_gsupc_read_cb(net->vlr->gsup_client, msg); fprintf(stderr, "<-- GSUP rx %s: vlr_gsupc_read_cb() returns %d\n", label, rc); if (expect_tx_hex) OSMO_ASSERT(gsup_tx_confirmed); - talloc_free(msg); } bool conn_exists(struct gsm_subscriber_connection *conn) -- To view, visit https://gerrit.osmocom.org/4077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 01:52:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 01:52:08 +0000 Subject: [PATCH] osmo-msc[master]: cosmetic: vlr: declare a struct in .h; drop unused header Message-ID: Review at https://gerrit.osmocom.org/4078 cosmetic: vlr: declare a struct in .h; drop unused header In vlr_core.h, "pre-declare" a struct used in function declaration. In vlr_lu_fsm.c, gsup.h is not used, drop the #include. Change-Id: I61d793c3001abbe6d381be1ae0bb350b07403e88 --- M src/libvlr/vlr_core.h M src/libvlr/vlr_lu_fsm.c 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/78/4078/1 diff --git a/src/libvlr/vlr_core.h b/src/libvlr/vlr_core.h index 6ca54e8..310cd97 100644 --- a/src/libvlr/vlr_core.h +++ b/src/libvlr/vlr_core.h @@ -2,6 +2,8 @@ #include +struct osmo_gsup_message; + #define LOGGSUPP(level, gsup, fmt, args...) \ LOGP(DVLR, level, "GSUP(%s) " fmt, \ (gsup)->imsi, \ diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index ea7529e..37fe235 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -21,7 +21,6 @@ #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/4078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61d793c3001abbe6d381be1ae0bb350b07403e88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 01:54:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 01:54:56 +0000 Subject: osmo-mgw[master]: create libosmo-mgcp and osmo-mgw by copying legacy code In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 re-add previous +2, only trivial difference: the code that is copied changed in a comment. -- To view, visit https://gerrit.osmocom.org/4002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 01:55:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 01:55:35 +0000 Subject: osmo-mgw[master]: create libosmo-mgcp and osmo-mgw by copying legacy code In-Reply-To: References: Message-ID: Patch Set 4: let's wait to merge it together with 4003 -- To view, visit https://gerrit.osmocom.org/4002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf54481754a1765bdb2d0d7033bc0d7dc2018024 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 01:59:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 01:59:31 +0000 Subject: [ABANDON] osmo-mgw[master]: libosmo-mgcp-client: make independent of other mgcp libs In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: libosmo-mgcp-client: make independent of other mgcp libs ...................................................................... Abandoned replaced by https://gerrit.osmocom.org/4010 and https://gerrit.osmocom.org/4055 -- To view, visit https://gerrit.osmocom.org/4005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ifd3a2c7cdabb31bc50cb7f671758ffb7cdd10221 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 28 02:08:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 02:08:47 +0000 Subject: libosmocore[master]: vty: deprecate now empty node commands In-Reply-To: References: Message-ID: Patch Set 4: I'd first like to submit some patches removing invocations to the deprecated functions in the other repositories before merging this deprecation marking, to avoid cluttering builds with deprecation warnings. -- To view, visit https://gerrit.osmocom.org/4052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf5d83f641e838cebcccc635a043e94ba352abff Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 02:16:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 02:16:10 +0000 Subject: osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 Verified+1 ah, waiting for me ... ok then. Let's do any tweaks later, not like merging this changes anything on jenkins in itself. -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 7 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 02:16:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 02:16:20 +0000 Subject: [MERGED] osmo-ci[master]: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Gerrit verification jobs as Jenkins Job Builder YAML [1] file. ...................................................................... Gerrit verification jobs as Jenkins Job Builder YAML [1] file. All jobs are in jobs/ directory and will be automatically verified and deployed in a follow-up commit. Note: osmocom-nightly-nitb-split.yml has been moved to jobs/ dir. [1] https://docs.openstack.org/infra/jenkins-job-builder/ Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f --- M README.adoc A jobs/README.adoc A jobs/gerrit-verifications.yml R jobs/osmocom-nightly-nitb-split.yml 4 files changed, 287 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified Harald Welte: Looks good to me, but someone else must approve diff --git a/README.adoc b/README.adoc index 796d148..aa45b58 100644 --- a/README.adoc +++ b/README.adoc @@ -6,6 +6,9 @@ - a cov-analysis-linux64-8.5.0 in coverity/ (or the like, may need to adjust some scripts to match) +jobs: Jenkins Job Builder YAML files defining jenkins jobs. Read jobs/README.adoc +for more information about deployment. + scripts: used by jenkins jobs. Various osmo*/contrib/jenkins.sh scripts assume osmo-ci to be checked out in the build slave user's home, i.e. using a PATH of $HOME/osmo-ci/scripts. diff --git a/jobs/README.adoc b/jobs/README.adoc new file mode 100644 index 0000000..b8c8164 --- /dev/null +++ b/jobs/README.adoc @@ -0,0 +1,31 @@ +This "jobs" folder holds +https://docs.openstack.org/infra/jenkins-job-builder/index.html[Jenkins Job Builder] +YAML files, which define jenkins' jobs. + +One can declare a single job per file or create a job-template to declare several jobs of the same kind. +The gerrit-verifications.yaml file for example holds all gerrit verification jobs. + +''' +*WIP:* Furthermore, we're planning to automatically deploy merged changes by having two jobs based on gerrit events: + +pre-merge: + +- test generation of XML + +post-merge: + +- test generation of XML +- deploy jobs + +''' +The XML test generation is done by: + + jenkins-jobs test jobs/ + + +The deployment will be done by: + + jenkins-jobs --conf "$JJB_CONFIGFILE" update jobs/ + +but it is not clear *yet* how we want to store/inject the `"$JJB_CONFIGFILE"` part. + diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml new file mode 100644 index 0000000..780f2d5 --- /dev/null +++ b/jobs/gerrit-verifications.yml @@ -0,0 +1,253 @@ +# This file holds all gerrit verifications https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/. +# One cane simply add a gerrit job by adding project's repository to repos list. + +- project: + name: gerrit + # following default values can be overridden by each repo + disabled: false + concurrent: false + node: linux_amd64_debian8 + # axes related defaults + slave_axis: !!python/tuple [linux_amd64_debian8] + a1_name: a1 + a1: !!python/tuple [default] + a2_name: a2 + a2: !!python/tuple [default] + a3_name: a3 + a3: !!python/tuple [default] + a4_name: a4 + a4: !!python/tuple [default] + combination_filter: '' + # most common build invocation + cmd: ./contrib/jenkins.sh + + repos: + - osmo-iuh + - osmo-gsm-manuals + - osmo-sip-connector + - osmocom-bb + - osmo-tetra + + - osmo-hlr: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-trx: + slave_axis: !!python/tuple [OsmocomBuild1] + + - osmo-ggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - osmo-pcap: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libsmpp34: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - openggsn: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-sccp: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-netif: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libosmo-abis: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - libasn1c: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + + - cellmgr-ng: + concurrent: true + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -w /build -i -u build -v $PWD:/build \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-bsc: + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \ + -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-gsm-tester: + slave_axis: !!python/tuple [OsmocomBuild1] + cmd: 'make deps; make check' + + - osmo-bts: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, femtobts_v2.7, superfemto_v2.4, superfemto_v3.0.1pre, superfemto_v3.1, superfemto_v5.1, v2017.01, origin/nrw/litecell15-next] + a2_name: BTS_MODEL + a2: !!python/tuple [sysmo, oct, trx, oct+trx, lc15] + combination_filter: > + FIRMWARE_VERSION == "master" || + (FIRMWARE_VERSION == "femtobts_v2.7" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v2.4" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.0.1pre" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "superfemto_v5.1" && BTS_MODEL == "sysmo") || + (FIRMWARE_VERSION == "v2017.01" && BTS_MODEL == "lc15") || + (FIRMWARE_VERSION == "superfemto_v3.1" && BTS_MODEL == "lc15") + cmd: './contrib/jenkins_bts_model.sh "$BTS_MODEL"' + + - openBSC: + a1_name: SMPP + a1: !!python/tuple [--enable-smpp] + a2_name: MGCP + a2: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + a3_name: IU + a3: !!python/tuple [--disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e SMPP="$SMPP" -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" \ + -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build -v "$PWD:/build" \ + -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - libosmocore: + slave_axis: !!python/tuple [linux_amd64_debian8, FreeBSD_amd64] + a1_name: arch + a1: !!python/tuple [arm-none-eabi, amd64] + combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' + cmd: > + if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then + ./contrib/jenkins-arm.sh + else + ./contrib/jenkins.sh + fi + + - osmo-mgw: + a1_name: MGCP + a1: !!python/tuple [--enable-mgcp-transcoding, --disable-mgcp-transcoding] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e MGCP="$MGCP" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh' + + - osmo-msc: + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" + mkdir -p "$ARTIFACT_STORE" + + docker run --rm=true -i -e HOME=/build -e ARTIFACT_STORE=/artifact_store \ + -e JOB_NAME="$JOB_NAME" -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" \ + -w /build -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + - osmo-pcu: + a1_name: FIRMWARE_VERSION + a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] + a2_name: with_vty + a2: !!python/tuple [yes ,no] + a3_name: with_dsp + a3: !!python/tuple [sysmo, lc15, none] + combination_filter: > + (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + + - osmo-sgsn: + concurrent: true + a1_name: IU + a1: !!python/tuple [--enable-iu, --disable-iu] + cmd: > + docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \ + -e IU="$IU" -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build \ + -i -u build -v "$PWD:/build" -v "$HOME/bin:/build_bin" \ + osmocom:amd64 /build/contrib/jenkins.sh + + jobs: + - '{repos}-gerrit' + +- job-template: + name: '{repos}-gerrit' + project-type: matrix + node: '{node}' + concurrent: '{obj:concurrent}' + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + build-discarder: + daysToKeep: 30 + numToKeep: 120 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + description: 'Pending reviews: https://gerrit.osmocom.org/#/q/status:open+project:{repos} ' + + execution-strategy: + combination-filter: | + {obj:combination_filter} + axes: + - axis: + type: slave + name: label + values: '{obj:slave_axis}' + - axis: + type: user-defined + name: '{obj:a1_name}' + values: '{obj:a1}' + - axis: + type: user-defined + name: '{obj:a2_name}' + values: '{obj:a2}' + - axis: + type: user-defined + name: '{obj:a3_name}' + values: '{obj:a3}' + - axis: + type: user-defined + name: '{obj:a4_name}' + values: '{obj:a4}' + + scm: + - git: + url: ssh://jenkins at gerrit.osmocom.org:29418/{repos} + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + clean: + before: true + + triggers: + - gerrit: + trigger-on: + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{repos}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent: false + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + + builders: + - shell: '{obj:cmd}' + + publishers: + - warnings: + console-log-parsers: + - 'GNU C Compiler 4 (gcc)' + resolve-relative-paths: true diff --git a/scripts/osmocom-nightly-nitb-split.yml b/jobs/osmocom-nightly-nitb-split.yml similarity index 100% rename from scripts/osmocom-nightly-nitb-split.yml rename to jobs/osmocom-nightly-nitb-split.yml -- To view, visit https://gerrit.osmocom.org/3911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04387367a6e2d737bfb50423c81a8908d3c2a89f Gerrit-PatchSet: 7 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 28 02:25:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 02:25:50 +0000 Subject: openbsc[master]: libmsc: db_subscriber_alloc_exten() remove infinite loop In-Reply-To: References: Message-ID: Patch Set 5: > Actually something other than +1 (maybe something random here) > would avoid sequential numbers if desired. ah sure, the +1 selects only the adjacent missing numbers, so if there aren't more than one scattered gaps, we will again create sequential numbers. Not the complete solution there, I agree we'd need some ranges. Hmm, whether sqlite does it for us or we write it up ourselves, it remains an expensive problem to solve. -- To view, visit https://gerrit.osmocom.org/3910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf0f1e5a7f360bc27592a55890f74a9a12bc9f42 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 08:18:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 08:18:47 +0000 Subject: osmo-ggsn[master]: contrib: osmo-ggsn.service: Use expected suffix for cfg file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I361c67809d095dd08b0f400de2a6f84f981411c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 13:45:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 13:45:09 +0000 Subject: libosmocore[master]: IPA msgb: on ipa_msg_alloc(), set caller as talloc string In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 14:20:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 14:20:41 +0000 Subject: [PATCH] osmo-sgsn[master]: jenkins.sh: fix echo string to say osmo-sgsn, not msc Message-ID: Review at https://gerrit.osmocom.org/4079 jenkins.sh: fix echo string to say osmo-sgsn, not msc Change-Id: I3e9a1503de55e939179c032c17df53d27bdddd51 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/79/4079/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2882989..9cf7575 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -39,7 +39,7 @@ echo echo echo -echo " =============================== osmo-msc ===============================" +echo " =============================== osmo-sgsn ===============================" echo set -x -- To view, visit https://gerrit.osmocom.org/4079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e9a1503de55e939179c032c17df53d27bdddd51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 14:38:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 14:38:35 +0000 Subject: [PATCH] osmo-sgsn[master]: jenkins: use osmo-ggsn for tests Message-ID: Review at https://gerrit.osmocom.org/4080 jenkins: use osmo-ggsn for tests Change-Id: I62b29b5531bfb9895318254c41a4e24ba1078fbf --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/80/4080/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2882989..07173cc 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,7 +27,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -osmo-build-dep.sh openggsn +osmo-build-dep.sh osmo-ggsn if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/4080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62b29b5531bfb9895318254c41a4e24ba1078fbf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 28 14:58:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 14:58:13 +0000 Subject: osmo-sgsn[master]: jenkins: use osmo-ggsn for tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62b29b5531bfb9895318254c41a4e24ba1078fbf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 14:58:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 14:58:15 +0000 Subject: [MERGED] osmo-sgsn[master]: jenkins: use osmo-ggsn for tests In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: use osmo-ggsn for tests ...................................................................... jenkins: use osmo-ggsn for tests Change-Id: I62b29b5531bfb9895318254c41a4e24ba1078fbf --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2882989..07173cc 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -27,7 +27,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -osmo-build-dep.sh openggsn +osmo-build-dep.sh osmo-ggsn if [ "x$IU" = "x--enable-iu" ]; then osmo-build-dep.sh libasn1c -- To view, visit https://gerrit.osmocom.org/4080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62b29b5531bfb9895318254c41a4e24ba1078fbf Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:01:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:01:13 +0000 Subject: [ABANDON] openbsc[master]: SGSN: log IMSI on PDP context creation/deletion In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: SGSN: log IMSI on PDP context creation/deletion ...................................................................... Abandoned Superseded by #4073. -- To view, visit https://gerrit.osmocom.org/3575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:08:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:08:07 +0000 Subject: [PATCH] osmo-ci[master]: Use new GPRS repositories In-Reply-To: References: Message-ID: Hello Andr? Boddenberg, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4056 to look at the new patch set (#3). Use new GPRS repositories * use coverity check on osmo-ggsn instead of openggsn * move osmo-sgsn and osmo-ggsn from nightly-split into nightly Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh M scripts/osmocom-nightly-nitb-split.sh M scripts/osmocom-nightly-packages.sh 4 files changed, 6 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/56/4056/3 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 58a74f2..bccd7ea 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -69,8 +69,8 @@ popd } -build_openggsn() { - pushd openggsn +build_osmoggsn() { + pushd osmo-ggsn do_build popd } @@ -155,7 +155,7 @@ build_libosmonetif build_libosmosccp build_libsmpp34 -build_openggsn +build_osmoggsn #IU build_osmoiuh build_osmopcu build_osmobts diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index 6d226b2..386e16e 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -13,7 +13,7 @@ libosmo-sccp \ libsmpp34 \ openbsc \ - openggsn \ + osmo-ggsn \ osmo-bts \ osmo-gmr \ osmo-iuh \ diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh index 3b547bf..4484214 100755 --- a/scripts/osmocom-nightly-nitb-split.sh +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -90,11 +90,9 @@ checkout libasn1c checkout osmo-iuh checkout osmo-hlr - checkout osmo-ggsn checkout osmo-mgw checkout osmo-bsc checkout osmo-msc - checkout osmo-sgsn build libosmocore build libosmo-abis @@ -104,11 +102,9 @@ build libasn1c build osmo-iuh build osmo-hlr - build osmo-ggsn build osmo-mgw build osmo-bsc build osmo-msc - build osmo-sgsn post } diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 84cf6e4..032bd49 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -14,7 +14,7 @@ git clone git://git.osmocom.org/libosmo-abis git clone git://git.osmocom.org/libosmo-netif git clone git://git.osmocom.org/libsmpp34 -git clone git://git.osmocom.org/openggsn +git clone git://git.osmocom.org/osmo-sgsn git clone git://git.osmocom.org/osmo-ggsn git clone git://git.osmocom.org/openbsc git clone git://git.osmocom.org/osmo-pcap @@ -51,7 +51,7 @@ build libosmo-abis build libosmo-netif build libsmpp34 -build openggsn +build osmo-sgsn build osmo-ggsn build openbsc build osmo-pcap -- To view, visit https://gerrit.osmocom.org/4056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:10 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3905 to look at the new patch set (#8). Simplify TS alloc: move slot assignment Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 74 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/8 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 1bde088..99ce4c5 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -819,6 +819,75 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + ts_format(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -988,47 +1057,16 @@ /* Step 4: Update MS and TBF and really allocate the resources */ - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - ts_format(slot_info, dl_slots, ul_slots); - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:10 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split off RX mask computation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3913 to look at the new patch set (#6). Simplify TS alloc: split off RX mask computation Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 58 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/6 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2763100..57faebf 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -612,6 +612,56 @@ return (win | win >> 8) & 0xFF; } +enum { MASK_TT, MASK_TR }; + +/*! Fill in RX mask table for a given MS Class + * + * \param[in] ms_cl MS Class pointer + * \param[in] num_tx Number of TX slots to consider + * \param[out] rx_mask RX mask table + */ +static inline void fill_rx_mask(const struct gprs_ms_multislot_class *ms_cl, uint8_t num_tx, uint8_t *rx_mask) +{ + static const char *digit[10] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + uint8_t Tta = ms_cl->ta, Ttb = ms_cl->tb, Tra = ms_cl->ra, Trb = ms_cl->rb, /* Minimum Number of Slots */ + Tx = ms_cl->tx, Sum = ms_cl->sum, /* Maximum Number of Slots: Tx, Sum = Rx + Tx */ + Type = ms_cl->type; /* Type of Mobile */ + + /* MS_A maps to 0 if frequency hopping is disabled */ + /* TODO: Set it to 1 if FH is implemented and enabled */ + if (Ttb == MS_A) + Ttb = 0; + if (Trb == MS_A) + Trb = 0; + + /* MS_A and MS_B are 0 iff FH is disabled and there is no Tx/Rx change. + * This is never the case with the current implementation, so 1 will always be used. */ + if (Ttb == MS_B) + Ttb = 1; + if (Trb == MS_C) + Trb = 1; + + if (num_tx == 1) /* it's enough to log this once per TX slot set iteration */ + LOGP(DRLCMAC, LOGL_DEBUG, " Rx=%u, Tx=%u, Sum Rx + Tx=%s [Tta=%s Ttb=%u] [Tra=%u Trb=%u] Type=%u\n", + ms_cl->rx, Tx, + (Sum == MS_NA) ? "N/A" : digit[Sum], + (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); + + if (ms_cl->type == 1) { + rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; + rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); + rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + } else { + /* Class type 2 MS have independant RX and TX */ + rx_mask[MASK_TT] = 0xff; + rx_mask[MASK_TR] = 0xff; + } + + rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); + rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -623,17 +673,12 @@ static int find_multi_slots(const struct gprs_rlcmac_trx *trx, const GprsMs *ms, uint8_t *ul_slots, uint8_t *dl_slots) { const struct gprs_ms_multislot_class *ms_class; - uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ - uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ - uint8_t Type; /* Type of Mobile */ uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; int16_t rx_window, tx_window; - static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; - int max_capacity; - uint8_t max_ul_slots; - uint8_t max_dl_slots; - enum {MASK_TT, MASK_TR}; + int max_capacity = -1; + uint8_t max_ul_slots = 0; + uint8_t max_dl_slots = 0; if (ms->ms_class() >= 32) { LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", @@ -657,34 +702,6 @@ return -EINVAL; } - Tx = ms_class->tx; - Sum = ms_class->sum; - Tta = ms_class->ta; - Ttb = ms_class->tb; - Tra = ms_class->ra; - Trb = ms_class->rb; - Type = ms_class->type; - - /* MS_A maps to 0 if frequency hopping is disabled */ - /* TODO: Set it to 1 if FH is implemented and enabled */ - if (Ttb == MS_A) - Ttb = 0; - if (Trb == MS_A) - Trb = 0; - - /* MS_A and MS_B are 0 iff FH is disabled and there is no Tx/Rx change. - * This is never the case with the current implementation, so 1 will - * always be used. */ - if (Ttb == MS_B) - Ttb = 1; - if (Trb == MS_C) - Trb = 1; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d " - " Tra=%d Trb=%d Type=%d\n", ms_class->rx, Tx, - (Sum == MS_NA) ? "N/A" : digit[Sum], - (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); - max_slots = OSMO_MAX(ms_class->rx, ms_class->tx); if (*dl_slots == 0) @@ -704,29 +721,12 @@ /* Check for each UL (TX) slot */ - max_capacity = -1; - max_ul_slots = 0; - max_dl_slots = 0; - /* Iterate through possible numbers of TX slots */ for (num_tx = 1; num_tx <= ms_class->tx; num_tx += 1) { uint16_t tx_valid_win = (1 << num_tx) - 1; + uint8_t rx_mask[MASK_TR + 1]; - uint8_t rx_mask[MASK_TR+1]; - if (ms_class->type == 1) { - rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; - rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); - rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); - } else { - /* Class type 2 MS have independant RX and TX */ - rx_mask[MASK_TT] = 0xff; - rx_mask[MASK_TR] = 0xff; - } - - rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); - rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); + fill_rx_mask(ms_class, num_tx, rx_mask); /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9016eb1..22b7746 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3328,12 +3328,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -3367,12 +3367,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=4, Sum Rx + Tx=5 [Tta=2 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -6541,12 +6541,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 11 -- Rx=4 Tx=3 Sum Rx+Tx=5 Tta=3 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) + Rx=4, Tx=3, Sum Rx + Tx=5 [Tta=3 Ttb=1] [Tra=2 Trb=1] Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:10 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3920 to look at the new patch set (#5). Simplify TS alloc: use defines for constants * define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 4 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/5 diff --git a/src/bts.cpp b/src/bts.cpp index b768569..6debb68 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -458,7 +458,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = NO_FREE_TFI; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index d65cd2f..1d13a64 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define NO_FREE_TFI 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..3b596f4 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -128,7 +128,7 @@ int8_t tfi; tfi_map = pdch->assigned_tfi(dir); - if (tfi_map == 0xffffffffUL) + if (tfi_map == NO_FREE_TFI) return -1; /* look for USF, don't use USF=7 */ @@ -209,7 +209,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -340,10 +340,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == NO_FREE_TFI) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..9bff38a 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -613,17 +613,17 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != NO_FREE_TFI) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != NO_FREE_TFI) continue; busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", + printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", tfi, ms_class, get_dir_char(0x01, ul_slots, dl_slots, busy_slots), get_dir_char(0x02, ul_slots, dl_slots, busy_slots), -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:10 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: internalize TRX check In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3760 to look at the new patch set (#17). Simplify TS alloc: internalize TRX check Move TRX check inside local tfi_find_free() wrapper to make main algorithm easier to follow. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 10 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/17 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 4ab6543..57fd27b 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -374,7 +374,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -386,6 +386,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -854,16 +863,6 @@ ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 17 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:10 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#6). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 21 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/6 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57fd27b..1bde088 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -81,18 +81,19 @@ /* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, }; -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } +} - return buf; +static void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); } static bool test_and_set_bit(uint32_t *bits, size_t elem) @@ -596,11 +597,9 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_format(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ @@ -912,12 +911,10 @@ } if (tbf->direction == GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, dl_slots, 'D'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); + "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); /* assign downlink */ if (dl_slots == 0) { @@ -950,12 +947,10 @@ ul_slots = 1 << ts; usf[ts] = free_usf; + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, ul_slots, 'U'); LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); + "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n",slot_info, single ? ", single" : ""); slotcount++; first_ts = ts; @@ -1000,12 +995,9 @@ ms_->set_reserved_slots(trx, reserved_ul_slots, reserved_dl_slots); + ts_format(slot_info, dl_slots, ul_slots); LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); + "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); } tbf_->trx = trx; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 602e35b..9016eb1 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6549,7 +6549,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:10 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3807 to look at the new patch set (#10). Simplify TS alloc: adjust allocator signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#228 --- M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp 7 files changed, 59 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/10 diff --git a/src/bts.h b/src/bts.h index 1d13a64..0ce5123 100644 --- a/src/bts.h +++ b/src/bts.h @@ -205,11 +205,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..c16a954 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -98,20 +100,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 3b596f4..9ceceb2 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -396,14 +396,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -796,15 +801,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -1025,7 +1035,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -1033,10 +1043,15 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; @@ -1048,7 +1063,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -1057,8 +1072,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e54157..d470c19 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -489,8 +489,7 @@ return -EINVAL; tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, false, -1); /* if no resource */ if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, "No resource after update???\n"); @@ -752,9 +751,8 @@ LOGP(DRLCMAC, LOGL_ERROR, "- Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -769,8 +767,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -830,9 +827,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -921,9 +917,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..8f92149 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -314,13 +314,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 3d27883..cbde283 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -118,7 +118,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -136,11 +136,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 9bff38a..14aa44a 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -39,7 +39,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -452,10 +452,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:10 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3935 to look at the new patch set (#4). Simplify TS alloc: move slot check into functions Move timeslot applicability check outside of nested for loop into separate functions and document them. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 97 insertions(+), 113 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/4 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 0301d79..2763100 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -139,11 +139,11 @@ return -1; } -static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, - const char *mask_reason = NULL) +static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; - int valid_ts_set = 0; + uint8_t valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { @@ -430,7 +430,7 @@ int trx_no; int tfi = -1; int usf = -1; - int mask = 0xff; + uint8_t mask = 0xff; const char *mask_reason = NULL; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; @@ -514,7 +514,7 @@ * \param[in] tx_window Transmit window * \returns non-negative capacity */ -static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int16_t rx_window, int16_t tx_window) { const struct gprs_rlcmac_pdch *pdch; unsigned ts, capacity = 0; @@ -534,6 +534,84 @@ return capacity; } +/*! Decide if a given slot should be skipped by multislot allocator + * + * \param[in] ms_class Pointer to MS Class object + * \param[in] check_tr Flag indicating whether we should check for Tra or Tta parameters for a given MS class + * \param[in] rx_window Receive window + * \param[in] rx_slot_count Number of TS in RX + * \param[in] tx_window Transmit window + * \param[in] tx_slot_count Number of TS in TX + * \param[in,out] checked_rx array with already checked RX timeslots + * \returns true if the slot should be skipped, false otherwise + */ +static bool skip_slot(const struct gprs_ms_multislot_class *ms_class, bool check_tr, int16_t rx_window, + uint8_t rx_slot_count, int16_t tx_window, uint8_t tx_slot_count, uint32_t *checked_rx) +{ + uint8_t common_slot_count, req_common_slots; + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on check_tr. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (ms_class->type == 1) { + uint16_t slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (!check_tr) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (check_tr) + return true; /* Skip Tra */ + } else + return true; /* No supported row in TS 45.002, table 6.4.2.2.1. */ + } + + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (ms_class->type == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + return true; + + return false; +} + +/*! Filter out bad slots + * + * \param[in] mask TS selection mask + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] rx_valid_win Mask for valid RX window value + * \returns negative error code or RX window on success + */ +static int16_t filter_bad_slots(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win) +{ + uint8_t rx_good; + uint16_t rx_bad = (uint16_t)(0xff & ~mask) << ul_slots; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = dl_slots & ~rx_bad; + if (!rx_good) + return -1; + + return rx_good & rx_valid_win; +} + +static inline uint16_t wrap_window(uint16_t win) +{ + return (win | win >> 8) & 0xFF; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -548,18 +626,14 @@ uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ uint8_t Type; /* Type of Mobile */ - int rx_window, tx_window, pdch_slots; + uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; + int16_t rx_window, tx_window; static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; int max_capacity; uint8_t max_ul_slots; uint8_t max_dl_slots; - unsigned max_slots; - - unsigned ul_ts, dl_ts; - unsigned num_tx; enum {MASK_TT, MASK_TR}; - unsigned mask_sel; if (ms->ms_class() >= 32) { LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", @@ -656,13 +730,12 @@ /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; + uint8_t tx_slot_count; uint16_t rx_valid_win; uint32_t checked_rx[256/32] = {0}; /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + tx_valid_win = wrap_window(tx_valid_win); tx_window = tx_valid_win; @@ -679,117 +752,28 @@ tx_slot_count = pcu_bitcount(tx_window); - max_rx = OSMO_MIN(ms_class->rx, ms_class->sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + rx_valid_win = (1 << OSMO_MIN(ms_class->rx, ms_class->sum - num_tx)) - 1; /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { /* Wrap valid window */ - rx_valid_win = (rx_valid_win | rx_valid_win >> 8) & 0xff; + rx_valid_win = wrap_window(rx_valid_win); /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; + uint8_t rx_slot_count; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; + rx_window = filter_bad_slots(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); + if (rx_window < 0) + continue; - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; rx_slot_count = pcu_bitcount(rx_window); -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (ms_class->type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); -#endif - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) - continue; - - if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); -#endif - continue; - } - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (ms_class->type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); -#endif - continue; - } + if (skip_slot(ms_class, mask_sel != MASK_TT, + rx_window, rx_slot_count, + tx_window, tx_slot_count, checked_rx)) + continue; /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:12 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: fix allocation calls Message-ID: Review at https://gerrit.osmocom.org/4084 Simplify TS alloc: fix allocation calls Using the semantic patch below, adjust allocation-related calls to match updated allocator signatures. // spatch --c++ --dir src -I src --sp-file callfix.spatch --in-place --recursive-includes // spatch --c++ --dir tests -I src --sp-file callfix.spatch --in-place --recursive-includes @@ expression A, B, C, D, E; @@ tbf_alloc_ul_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) @@ expression A, B, C, D, E; @@ tbf_alloc_dl_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Related: OS#228 --- M src/bts.cpp M src/tbf.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 4 files changed, 33 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/84/4084/1 diff --git a/src/bts.cpp b/src/bts.cpp index 6debb68..7e756ca 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -653,11 +653,11 @@ if (is_11bit) { tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); + ms_class, true); } else { /* set class to 0, since we don't know the multislot * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, true); } if (!tbf) { diff --git a/src/tbf.cpp b/src/tbf.cpp index d470c19..67ea99c 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -385,7 +385,8 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, + false); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -1311,7 +1312,7 @@ new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 14aa44a..d93c799 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -202,7 +202,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -210,7 +210,8 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, + false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -244,7 +245,7 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); @@ -252,7 +253,8 @@ trx_no = dl_tbf->ms()->current_trx()->trx_no; dump_assignment(dl_tbf, "DL"); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, + false); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; OSMO_ASSERT(ul_tbf); @@ -294,7 +296,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); OSMO_ASSERT(ul_tbf); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); @@ -302,7 +304,8 @@ dump_assignment(ul_tbf, "UL"); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, + false); OSMO_ASSERT(dl_tbf); dump_assignment(dl_tbf, "DL"); @@ -357,14 +360,15 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(ul_tbf->ms()); OSMO_ASSERT(ul_tbf->ms()->current_trx()); trx_no = ul_tbf->ms()->current_trx()->trx_no; OSMO_ASSERT(ul_tbf); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, + false); OSMO_ASSERT(dl_tbf); /* verify that both are on the same ts */ @@ -401,14 +405,15 @@ ENABLE_PDCH(6, ts6, trx); ENABLE_PDCH(7, ts7, trx); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); OSMO_ASSERT(dl_tbf); OSMO_ASSERT(dl_tbf->ms()); OSMO_ASSERT(dl_tbf->ms()->current_trx()); trx_no = dl_tbf->ms()->current_trx()->trx_no; dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, + false); OSMO_ASSERT(ul_tbf); ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); ul_tbf->m_contention_resolution_done = 1; @@ -495,7 +500,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -504,7 +509,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -815,7 +820,8 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -825,7 +831,8 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..4692f4f 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -83,14 +83,14 @@ */ gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -170,7 +170,8 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, + true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2209,7 +2210,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2223,7 +2224,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2267,7 +2268,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/4084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:12 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: avoid TS reassignment Message-ID: Review at https://gerrit.osmocom.org/4085 Simplify TS alloc: avoid TS reassignment Assign reserved_*_slots only when multislot masks are found to avoid reassignment and make code easier to follow. Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/85/4085/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 76a84c7..4ab6543 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -850,8 +850,8 @@ return -EINVAL; } - reserved_dl_slots = dl_slots = ms->reserved_dl_slots(); - reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); @@ -880,11 +880,11 @@ rc = find_multi_slots(trx, ms, &ul_slots, &dl_slots); if (rc < 0) return rc; - - reserved_dl_slots = dl_slots; - reserved_ul_slots = ul_slots; } + reserved_dl_slots = dl_slots; + reserved_ul_slots = ul_slots; + /* Step 3: Derive the slot set for the current TBF */ if (single) { /* Make sure to consider the first common slot only */ -- To view, visit https://gerrit.osmocom.org/4085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:51:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 15:51:12 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: improve readability Message-ID: Review at https://gerrit.osmocom.org/4086 Simplify TS alloc: improve readability * consistently format log messages to make it possible to grep for test output in source code * remove dead code Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 12 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/86/4086/1 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57faebf..190f18d 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -250,8 +250,7 @@ tfi = find_free_tfi(pdch, dir); if (tfi < 0) { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -260,25 +259,22 @@ usf = find_free_usf(pdch); if (usf < 0) { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -688,17 +684,17 @@ if (ms->ms_class()) { ms_class = &gprs_ms_multislot_class[ms->ms_class()]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "class %d\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, + "Slot Allocation (Algorithm B) for class %d\n", ms->ms_class()); } else { ms_class = &gprs_ms_multislot_class[12]; - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " - "unknown class (assuming 12)\n"); + LOGP(DRLCMAC, LOGL_DEBUG, + "Slot Allocation (Algorithm B) for unknown class (assuming 12)\n"); } if (ms_class->tx == MS_NA) { - LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not " - "applicable.\n", ms->ms_class()); + LOGP(DRLCMAC, LOGL_NOTICE, + "Multislot class %d not applicable.\n", ms->ms_class()); return -EINVAL; } @@ -777,19 +773,6 @@ /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); - -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); -#endif if (capacity <= max_capacity) continue; -- To view, visit https://gerrit.osmocom.org/4086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:55:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 15:55:35 +0000 Subject: osmo-ggsn[master]: contrib: osmo-ggsn.service: Use expected suffix for cfg file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I361c67809d095dd08b0f400de2a6f84f981411c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 15:55:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 15:55:38 +0000 Subject: [MERGED] osmo-ggsn[master]: contrib: osmo-ggsn.service: Use expected suffix for cfg file In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: contrib: osmo-ggsn.service: Use expected suffix for cfg file ...................................................................... contrib: osmo-ggsn.service: Use expected suffix for cfg file files in doc/examples/ dir end with .cfg, as well as all configuration files present in all projects. Change-Id: I361c67809d095dd08b0f400de2a6f84f981411c5 --- M contrib/osmo-ggsn.service 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/osmo-ggsn.service b/contrib/osmo-ggsn.service index a8d123a..10e3507 100644 --- a/contrib/osmo-ggsn.service +++ b/contrib/osmo-ggsn.service @@ -5,7 +5,7 @@ [Service] Type=simple Restart=always -ExecStart=/usr/bin/osmo-ggsn -c /etc/osmocom/osmo-ggsn.conf -f +ExecStart=/usr/bin/osmo-ggsn -c /etc/osmocom/osmo-ggsn.cfg -f RestartSec=2 RestartPreventExitStatus=1 -- To view, visit https://gerrit.osmocom.org/4075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I361c67809d095dd08b0f400de2a6f84f981411c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:38 +0000 Subject: [PATCH] meta-telephony[201705]: Update osmocom versions to point to current master Message-ID: Review at https://gerrit.osmocom.org/4087 Update osmocom versions to point to current master New versions are required in order to build new git repositories which will deprecate osmo-nitb soon. Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb M recipes-osmocom/libosmo-netif/libosmo-netif_git.bb M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/openbsc/openbsc_git.bb M recipes-osmocom/openggsn/openggsn_git.bb 6 files changed, 11 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/87/4087/1 diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index c9c2077..f796948 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -3,7 +3,7 @@ DEPENDS += "libtalloc" S = "${WORKDIR}/git" -SRCREV = "35003ec2ea7de49d67e5332938a66fe92580b94d" +SRCREV = "01543a1ea392fa98974ea2f99cafbc28e9966656" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" PV = "0.3.2+gitr${SRCPV}" -PR = "${INC_PR}.1" +PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb index bea2435..0e55628 100644 --- a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb +++ b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb @@ -3,7 +3,7 @@ DEPENDS += "libtalloc lksctp-tools" S = "${WORKDIR}/git" -SRCREV = "243a3b0372fe738b01c2d32d6f6cb7b7c99a1180" +SRCREV = "59941982083f7f0d6ab11f7bbb42c297a3fb8d69" SRC_URI = "git://git.osmocom.org/libosmo-netif.git;protocol=git" PV = "0.4.0+gitr${SRCPV}" -PR = "${INC_PR}.2" +PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 1e5af41..1ce9efc 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -1,13 +1,9 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "882f340b6c394f581f6c32cafefa10c7b57073b9" +SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" -PR = "${INC_PR}.1" - -# we require the tests to link to the static libosmo-sigtran library to -# access symbols not starting with osmo_* -EXTRA_OECONF_remove = "--disable-static" +PR = "${INC_PR}.0" # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index 964dea2..052a7a4 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "a8a8d3977dc3b31352f8a87ca005763677bd7e8c" +SRCREV = "657c5b6cadcef470c7ff9bffed3caab227026e6a" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" PV = "0.9.0+gitr${SRCPV}" PR = "r1" diff --git a/recipes-osmocom/openbsc/openbsc_git.bb b/recipes-osmocom/openbsc/openbsc_git.bb index ac0d257..59667f7 100644 --- a/recipes-osmocom/openbsc/openbsc_git.bb +++ b/recipes-osmocom/openbsc/openbsc_git.bb @@ -2,9 +2,9 @@ PV = "0.15.0+gitr${SRCPV}" PRINC = "0" -PR = "${INC_PR}.6" +PR = "${INC_PR}.0" -SRCREV = "ba66e79953cb1c2230fe2916ef7d8de78500c7fd" +SRCREV = "3ae8682f974058970fa564f09a34a51e867b896b" SRC_URI += "git://git.osmocom.org/openbsc.git;protocol=git" S = "${WORKDIR}/git/openbsc" diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb index d704bc5..55ca924 100644 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ b/recipes-osmocom/openggsn/openggsn_git.bb @@ -2,9 +2,9 @@ LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" PV = "0.92+gitr${SRCPV}" -PR = "r1" +PR = "r0" -SRCREV = "283188790bb1b3af673d4edbd56ff649b7464e1e" +SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" SRC_URI = "git://git.osmocom.org/openggsn \ file://openggsn.init \ file://libgtp-queue_depth_32.patch \ -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:38 +0000 Subject: [PATCH] meta-telephony[201705]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... Message-ID: Review at https://gerrit.osmocom.org/4088 libosmo-sccp: Attempt to fix link issue on 201705-nightly builds This project will build some static libraries needed for testing and also for downstream users. Do not disable the static build on newer Poky versions. arm-poky-linux-gnueabi-libtool: link: arm-poky-linux-gnueabi-gcc -march=armv5te -marm --sysroot=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot -Wall -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1=/usr/src/debug/libosmo-sccp/git-r1.18.1 -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot-native= -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o xua_test xua_test.o sccp_test_data.o ../../src/.libs/libosmo-sigtran.so -losmogsm -ltalloc -losmovty -losmocore -losmonetif -lsctp | xua_test.o: In function `test_helpers': | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:160: undefined reference to `xua_part_add_gt' | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:168: undefined reference to `sua_parse_gt' | xua_test.o: In function `test_sccp2sua_case': Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/88/4088/1 diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 1ce9efc..3d55f69 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -5,6 +5,10 @@ SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" PR = "${INC_PR}.0" +# we require the tests to link to the static libosmo-sigtran library to +# access symbols not starting with osmo_* +EXTRA_OECONF_remove = "--disable-static" + # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { echo "${PV}" > ${S}/.tarball-version -- To view, visit https://gerrit.osmocom.org/4088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:39 +0000 Subject: [PATCH] meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn Message-ID: Review at https://gerrit.osmocom.org/4089 update PV versions for libosmocore, libosmo-sccp and openggsn As we're building git master, we need to make sure PV is not lagging behind. I wish there was some OE magic by which it could discover PV from the source it builds. Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/openggsn/openggsn_git.bb 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/89/4089/1 diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 3d55f69..7ec2224 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -3,6 +3,7 @@ S = "${WORKDIR}/git" SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" +PV = "0.7.0+gitr${SRCPV}" PR = "${INC_PR}.0" # we require the tests to link to the static libosmo-sigtran library to diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index 052a7a4..e4f1784 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -3,7 +3,7 @@ S = "${WORKDIR}/git" SRCREV = "657c5b6cadcef470c7ff9bffed3caab227026e6a" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" -PV = "0.9.0+gitr${SRCPV}" +PV = "0.9.6+gitr${SRCPV}" PR = "r1" DEPENDS += "libtalloc" diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb index 55ca924..6190b22 100644 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ b/recipes-osmocom/openggsn/openggsn_git.bb @@ -1,7 +1,7 @@ DESCRITOPN = "OpenGGSN a Free Software GGSN" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" -PV = "0.92+gitr${SRCPV}" +PV = "0.94+gitr${SRCPV}" PR = "r0" SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:39 +0000 Subject: [PATCH] meta-telephony[201705]: libosmo-abis: modify PV to match recent release Message-ID: Review at https://gerrit.osmocom.org/4090 libosmo-abis: modify PV to match recent release The upstream release commit is 7f17b8c45d094941292036143f3292a1d5789cf5. This should fix current issue with 201705/nightly package feed: $ opkg upgrade Not selecting libosmo-abis 0.3.2+gitr0+d3292913ac as installing it would break existing dependencies. $ opkg list_installed | grep libosmo-abis libosmo-abis - 0.3.2+gitr2+d3292913ac-r2.18.1.0 See that gitr in repos is 0 while the previously installed one has gitr2, which is higher. Explanations I can find for this: - PR server was somehow reset? - the value in gitr is calculated based on offset from latest tag. As new release introduced new tag, gitr may have been reset. In any case, updating PV to have the correct value should fix this issue. Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/90/4090/1 diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index f796948..6f9c2fd 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -5,5 +5,5 @@ S = "${WORKDIR}/git" SRCREV = "01543a1ea392fa98974ea2f99cafbc28e9966656" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" -PV = "0.3.2+gitr${SRCPV}" +PV = "0.4.0+gitr${SRCPV}" PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:39 +0000 Subject: [PATCH] meta-telephony[201705]: libosmo-sccp: Install cfg and service file for osmo-stp Message-ID: Review at https://gerrit.osmocom.org/4091 libosmo-sccp: Install cfg and service file for osmo-stp Patch with systemd service file is added while waiting to have it merged in upstream. Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp.inc M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb 2 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/91/4091/1 diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc index bac8527..5a503ab 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc @@ -7,6 +7,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -inherit autotools pkgconfig +inherit autotools pkgconfig systemd ALLOW_EMPTY_libosmo-sccp = "1" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 7ec2224..ed28cea 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -4,13 +4,30 @@ SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" PV = "0.7.0+gitr${SRCPV}" -PR = "${INC_PR}.0" +PR = "${INC_PR}.1" # we require the tests to link to the static libosmo-sigtran library to # access symbols not starting with osmo_* EXTRA_OECONF_remove = "--disable-static" +PACKAGES =+ "osmo-stp" +SYSTEMD_PACKAGES = "osmo-stp" +SYSTEMD_SERVICE_osmo-stp = "osmo-stp.service" + # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { echo "${PV}" > ${S}/.tarball-version } + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-stp.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-stp.service ${D}${systemd_system_unitdir}/ +} + +FILES_osmo-stp = " \ + ${bindir}/osmo-stp \ + ${sysconfdir}/osmocom/osmo-stp.cfg \ + " -- To view, visit https://gerrit.osmocom.org/4091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:39 +0000 Subject: [PATCH] meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn Message-ID: Review at https://gerrit.osmocom.org/4092 Drop openggsn and introduce osmo-ggsn Take the opportunity to enable systemd service instead of sysvint like other osmocom services already do. Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a --- M recipes-osmocom/openbsc/openbsc.inc D recipes-osmocom/openggsn/openggsn_git.bb R recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch R recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init A recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb M recipes-telephony/tasks/task-telephony-all.bb 6 files changed, 48 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/92/4092/1 diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index a965040..164b492 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -1,5 +1,5 @@ DESCRIPTION = "OpenBSC a Free Software GSM BaseStationController" -DEPENDS = "libdbi libosmocore libosmo-sccp libosmo-abis libosmo-netif openggsn libsmpp34 bcg729 libgsm libpcap c-ares" +DEPENDS = "libdbi libosmocore libosmo-sccp libosmo-abis libosmo-netif osmo-ggsn libsmpp34 bcg729 libgsm libpcap c-ares" HOMEPAGE = "http://openbsc.osmocom.org/" LICENSE = "AGPLv3+" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" @@ -11,7 +11,7 @@ file://osmo-bsc.init \ file://osmo-sgsn.init" -INC_PR = "r21.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r22.${META_TELEPHONY_OSMO_INC}" EXTRA_OECONF += " --enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" @@ -97,4 +97,3 @@ ${systemd_unitdir}/system/osmo-gbproxy.service \ " FILES_osmo-gbproxy-dbg = " ${bindir}/.debug/osmo-gbproxy " - diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb deleted file mode 100644 index 6190b22..0000000 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ /dev/null @@ -1,40 +0,0 @@ -DESCRITOPN = "OpenGGSN a Free Software GGSN" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" -PV = "0.94+gitr${SRCPV}" -PR = "r0" - -SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" -SRC_URI = "git://git.osmocom.org/openggsn \ - file://openggsn.init \ - file://libgtp-queue_depth_32.patch \ - " -S = "${WORKDIR}/git" - -DEPENDS = "libosmocore" - -PACKAGES =+ " libgtp libgtp-dev libgtp-staticdev openggsn-sgsnemu" -RDEPENDS_${PN} += "kernel-module-tun" - -inherit autotools update-rc.d pkgconfig - -do_install_append() { - install -d ${D}${sysconfdir}/init.d - install -d ${D}${systemd_unitdir}/system - - install -m 0776 ${WORKDIR}/openggsn.init ${D}${sysconfdir}/init.d/openggsn - install -m 0644 ${S}/contrib/openggsn.service ${D}${systemd_unitdir}/system/ -} - -INITSCRIPT_PACKAGES = "openggsn" - -INITSCRIPT_NAME_openggsn = "openggsn" -INITSCRIPT_PARAMS_openggsn = "defaults 29 29" -RDEPENDS_${PN} += "iptables kernel-module-ipt-masquerade" - -FILES_libgtp = "${libdir}/*${SOLIBS}" -FILES_libgtp-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" -FILES_libgtp-staticdev = "${libdir}/*.a" - -FILES_openggsn-sgsnemu = "${bindir}/sgsnemu" -FILES_${PN} += "${systemd_unitdir}/system/*" diff --git a/recipes-osmocom/openggsn/files/libgtp-queue_depth_32.patch b/recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch similarity index 100% rename from recipes-osmocom/openggsn/files/libgtp-queue_depth_32.patch rename to recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch diff --git a/recipes-osmocom/openggsn/files/openggsn.init b/recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init similarity index 97% rename from recipes-osmocom/openggsn/files/openggsn.init rename to recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init index 695a6cc..af34dc0 100755 --- a/recipes-osmocom/openggsn/files/openggsn.init +++ b/recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs # Required-Stop: # Default-Start: 2 3 4 5 @@ -15,8 +15,8 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" -NAME=openggsn +DESC="Open Source GGSN" +NAME=osmo-ggsn DAEMON=/usr/bin/ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid diff --git a/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb new file mode 100644 index 0000000..ba024e1 --- /dev/null +++ b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb @@ -0,0 +1,41 @@ +DESCRITOPN = "Open Source GGSN" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" +PV = "1.0.0+gitr${SRCPV}" +PR = "r0" + +SRCREV = "b5624c3d4838cd774c3a6df4208b709890174a25" +SRC_URI = "git://git.osmocom.org/osmo-ggsn \ + file://osmo-ggsn.init \ + file://libgtp-queue_depth_32.patch \ + " +S = "${WORKDIR}/git" + +DEPENDS = "libosmocore" + +PACKAGES =+ " libgtp libgtp-dev libgtp-staticdev osmo-sgsnemu" +RDEPENDS_${PN} += "iptables kernel-module-ipt-masquerade kernel-module-tun" + +inherit autotools update-rc.d pkgconfig systemd + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}/${sysconfdir}/osmocom/ + + install -m 0776 ${WORKDIR}/osmo-ggsn.init ${D}${sysconfdir}/init.d/osmo-ggsn + install -m 0644 ${S}/contrib/osmo-ggsn.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/doc/examples/osmo-ggsn.cfg ${D}${sysconfdir}/osmocom/ +} + +SYSTEMD_SERVICE_osmo-ggsn = "osmo-ggsn.service" + +INITSCRIPT_PACKAGES = "osmo-ggsn" +INITSCRIPT_NAME_osmo-ggsn = "osmo-ggsn" +INITSCRIPT_PARAMS_osmo-ggsn = "defaults 29 29" + +FILES_libgtp = "${libdir}/*${SOLIBS}" +FILES_libgtp-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" +FILES_libgtp-staticdev = "${libdir}/*.a" + +FILES_osmo-sgsnemu = "${bindir}/sgsnemu" diff --git a/recipes-telephony/tasks/task-telephony-all.bb b/recipes-telephony/tasks/task-telephony-all.bb index cc1ca0b..5efec10 100644 --- a/recipes-telephony/tasks/task-telephony-all.bb +++ b/recipes-telephony/tasks/task-telephony-all.bb @@ -3,7 +3,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" ALLOW_EMPTY_${PN} = "1" -PR = "r4" +PR = "r5" DEPENDS = "\ libosmo-abis \ @@ -11,7 +11,7 @@ libosmocore \ openbsc \ packagegroup-osmocom \ - openggsn \ + osmo-ggsn \ misdn-utils \ dahdi-linux \ dahdi-tools \ @@ -21,4 +21,3 @@ libdbi \ libdbi-drivers \ " - -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:39 +0000 Subject: [PATCH] meta-telephony[201705]: libasn1c: Introduce recipe Message-ID: Review at https://gerrit.osmocom.org/4093 libasn1c: Introduce recipe Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 --- A recipes-osmocom/libasn1c/libasn1c.inc A recipes-osmocom/libasn1c/libasn1c_git.bb 2 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/93/4093/1 diff --git a/recipes-osmocom/libasn1c/libasn1c.inc b/recipes-osmocom/libasn1c/libasn1c.inc new file mode 100644 index 0000000..96500f8 --- /dev/null +++ b/recipes-osmocom/libasn1c/libasn1c.inc @@ -0,0 +1,10 @@ +SUMMARY = "Rruntime library of Lev Walkin's asn1c split out as separate library" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=25192323023bb0db6998ac6fcd5aa6a1" + +DEPENDS = "libtalloc" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig diff --git a/recipes-osmocom/libasn1c/libasn1c_git.bb b/recipes-osmocom/libasn1c/libasn1c_git.bb new file mode 100644 index 0000000..0d4800a --- /dev/null +++ b/recipes-osmocom/libasn1c/libasn1c_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "aaae8c76496a97050264e4c49e539b0420496737" +SRC_URI = "git://git.osmocom.org/libasn1c.git;protocol=git" +PV = "0.9.28+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:40 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-iuh: Introduce recipe Message-ID: Review at https://gerrit.osmocom.org/4094 osmo-iuh: Introduce recipe Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 --- A recipes-osmocom/osmo-iuh/osmo-iuh.inc A recipes-osmocom/osmo-iuh/osmo-iuh_git.bb 2 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/94/4094/1 diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh.inc b/recipes-osmocom/osmo-iuh/osmo-iuh.inc new file mode 100644 index 0000000..613df72 --- /dev/null +++ b/recipes-osmocom/osmo-iuh/osmo-iuh.inc @@ -0,0 +1,20 @@ +DESCRITOPN = "Osmocom Iuh and HNB-GW implementation" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libosmocore libosmo-netif libosmo-sccp libasn1c" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-hnbgw.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-hnbgw.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_${PN} = "osmo-hnbgw.service" diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb b/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb new file mode 100644 index 0000000..821373d --- /dev/null +++ b/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "5a3df8fa9ffc4400367250a0f9ff0e20dc4b5d3b" +SRC_URI = "git://git.osmocom.org/osmo-iuh.git;protocol=git" +PV = "0.1.0+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:40 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-sgsn: Introduce recipe Message-ID: Review at https://gerrit.osmocom.org/4095 osmo-sgsn: Introduce recipe Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 --- A recipes-osmocom/osmo-sgsn/osmo-sgsn.inc A recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb 2 files changed, 48 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/95/4095/1 diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc new file mode 100644 index 0000000..a8b34ae --- /dev/null +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -0,0 +1,41 @@ +DESCRITOPN = "Osmocom SGSN implementation" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif osmo-iuh osmo-ggsn" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-iu" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-sgsn/osmo-sgsn.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/contrib/systemd/osmo-sgsn.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/contrib/systemd/osmo-gbproxy.service ${D}${systemd_system_unitdir}/ +} + +PACKAGES =+ "osmo-gbproxy-doc osmo-gtphub-doc osmo-gbproxy osmo-gtphub" +SYSTEMD_PACKAGES = "osmo-sgsn osmo-gbproxy" +SYSTEMD_SERVICE_osmo-sgsn = "osmo-sgsn.service" +SYSTEMD_SERVICE_osmo-gbproxy = "osmo-gbproxy.service" + +FILES_osmo-gbproxy = " \ + ${bindir}/osmo-gbproxy \ + ${sysconfdir}/osmocom/osmo-gbproxy.cfg \ + " + +FILES_osmo-gtphub = " \ + ${bindir}/osmo-gtphub \ + ${sysconfdir}/osmocom/osmo-gtphub.cfg \ + " + +FILES_osmo-gbproxy-doc = " ${docdir}/osmo-sgsn/examples/osmo-gbproxy " +FILES_osmo-gtphub-doc = " ${docdir}/osmo-sgsn/examples/osmo-gtphub " diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb b/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb new file mode 100644 index 0000000..e94618f --- /dev/null +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "341d446b4db87b48812afe8d2149ebc840e8a357" +SRC_URI = "git://git.osmocom.org/osmo-sgsn.git;protocol=git" +PV = "0.1.0+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:40 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-mgw: Introduce recipe Message-ID: Review at https://gerrit.osmocom.org/4096 osmo-mgw: Introduce recipe Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a --- A recipes-osmocom/osmo-mgw/osmo-mgw.inc A recipes-osmocom/osmo-mgw/osmo-mgw_git.bb 2 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/96/4096/1 diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw.inc b/recipes-osmocom/osmo-mgw/osmo-mgw.inc new file mode 100644 index 0000000..b98f2a2 --- /dev/null +++ b/recipes-osmocom/osmo-mgw/osmo-mgw.inc @@ -0,0 +1,22 @@ +DESCRITOPN = "Osmocom Media Gateway (MGCP) implementation" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libosmocore libosmo-netif bcg729 libgsm" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-mgcp-transcoding --with-g729" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-bsc_mgcp/mgcp.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg + install -m 0644 ${S}/contrib/systemd/osmo-bsc-mgcp.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_osmo-mgw = "osmo-bsc-mgcp.service" diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb new file mode 100644 index 0000000..1ea1a7b --- /dev/null +++ b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "1c8d67d7f5f6f8788d92df65a0b68e0ec19a34dc" +SRC_URI = "git://git.osmocom.org/osmo-mgw.git;protocol=git" +PV = "1.0.2+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:40 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-hlr: Introduce recipe Message-ID: Review at https://gerrit.osmocom.org/4097 osmo-hlr: Introduce recipe Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 --- A recipes-osmocom/osmo-hlr/osmo-hlr.inc A recipes-osmocom/osmo-hlr/osmo-hlr_git.bb 2 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/97/4097/1 diff --git a/recipes-osmocom/osmo-hlr/osmo-hlr.inc b/recipes-osmocom/osmo-hlr/osmo-hlr.inc new file mode 100644 index 0000000..c70b83d --- /dev/null +++ b/recipes-osmocom/osmo-hlr/osmo-hlr.inc @@ -0,0 +1,28 @@ +DESCRITOPN = "Osmocom HLR implementation" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libdbi libtalloc libosmocore libosmo-abis sqlite3 sqlite3-native" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +RDEPENDS_${PN} = "libdbd-sqlite3" + +do_compile_append() { + sqlite3 ${WORKDIR}/hlr.db < ${S}/sql/hlr.sql +} + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + install -d ${D}${localstatedir}/lib/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-hlr.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-hlr.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/hlr.db ${D}${localstatedir}/lib/osmocom/hlr.db +} + +SYSTEMD_SERVICE_${PN} = "${PN}.service" diff --git a/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb b/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb new file mode 100644 index 0000000..8a08d94 --- /dev/null +++ b/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "05c8b465ab2fe13edb67c95210a9b475f91ebeb3" +SRC_URI = "git://git.osmocom.org/osmo-hlr.git;protocol=git" +PV = "0.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:41 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-msc: Introduce recipe Message-ID: Review at https://gerrit.osmocom.org/4098 osmo-msc: Introduce recipe Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e --- A recipes-osmocom/osmo-msc/osmo-msc.inc A recipes-osmocom/osmo-msc/osmo-msc_git.bb 2 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/98/4098/1 diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc new file mode 100644 index 0000000..594d754 --- /dev/null +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -0,0 +1,24 @@ +DESCRITOPN = "Osmocom MSC implementation" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-smpp --enable-iu" + +RDEPENDS_${PN} = "libdbd-sqlite3" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-msc/osmo-msc.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-msc.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_${PN} = "${PN}.service" diff --git a/recipes-osmocom/osmo-msc/osmo-msc_git.bb b/recipes-osmocom/osmo-msc/osmo-msc_git.bb new file mode 100644 index 0000000..7d55237 --- /dev/null +++ b/recipes-osmocom/osmo-msc/osmo-msc_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "4e7ece0bd969389132d7babf8de4f57cf7d0126f" +SRC_URI = "git://git.osmocom.org/osmo-msc.git;protocol=git" +PV = "1.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:41 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-bsc: Introduce recipe Message-ID: Review at https://gerrit.osmocom.org/4099 osmo-bsc: Introduce recipe Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 --- A recipes-osmocom/osmo-bsc/osmo-bsc.inc A recipes-osmocom/osmo-bsc/osmo-bsc_git.bb 2 files changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/99/4099/1 diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc b/recipes-osmocom/osmo-bsc/osmo-bsc.inc new file mode 100644 index 0000000..ae3af65 --- /dev/null +++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc @@ -0,0 +1,37 @@ +DESCRITOPN = "Osmocom BSC implementation" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "sqlite3 libosmocore libosmo-abis libosmo-sccp libosmo-netif osmo-mgw" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/contrib/systemd/osmo-bsc.service ${D}${systemd_system_unitdir}/ +} + +PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils" +SYSTEMD_PACKAGES = "osmo-bsc" +SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service" + +FILES_ipaccess-utils = " \ + ${bindir}/ipaccess-find \ + ${bindir}/ipaccess-config \ + ${bindir}/ipaccess-proxy \ + " + +FILES_osmo-bsc-nat = " \ + ${bindir}/osmo-bsc_nat \ + ${sysconfdir}/osmocom/osmo-bsc_nat.cfg \ + " + +FILES_osmo-bsc-nat-doc = " ${docdir}/osmo-bsc/examples/osmo-bsc_nat " diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb new file mode 100644 index 0000000..234e054 --- /dev/null +++ b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "00c22464a0c1b51bb4b29efecab39e993224949c" +SRC_URI = "git://git.osmocom.org/osmo-bsc.git;protocol=git" +PV = "1.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:41 +0000 Subject: [PATCH] meta-telephony[201705]: openbsc: Drop packages present in other recipes after split Message-ID: Review at https://gerrit.osmocom.org/4100 openbsc: Drop packages present in other recipes after split The osmo-bsc one is renamed to osmo-bsc-sccplite and kept because the code in the new osmo-bsc repository still doesn't support SCCPLite, this this one can still be used by installing the osmo-bsc-sccplite package. Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 --- M recipes-osmocom/openbsc/openbsc.inc R recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init A recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service 3 files changed, 40 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/00/4100/1 diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index 164b492..9645153 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -8,13 +8,15 @@ SRC_URI = "file://osmo-nitb.init \ file://osmo-bsc_mgcp.init \ - file://osmo-bsc.init \ - file://osmo-sgsn.init" + file://osmo-bsc-sccplite.init \ + file://osmo-sgsn.init \ + file://osmo-bsc-sccplite.service \ + " -INC_PR = "r22.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r23.${META_TELEPHONY_OSMO_INC}" -EXTRA_OECONF += " --enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" +EXTRA_OECONF += "--enable-osmo-bsc --enable-mgcp-transcoding --with-g729" inherit autotools update-rc.d pkgconfig @@ -26,50 +28,38 @@ do_install_append() { install -d ${D}${sysconfdir}/osmocom install -m 0660 ${S}/doc/examples/osmo-nitb/nanobts/openbsc.cfg ${D}${sysconfdir}/osmocom/osmo-nitb.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc_mgcp/mgcp.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg - install -m 0660 ${S}/doc/examples/osmo-sgsn/osmo-sgsn.cfg ${D}${sysconfdir}/osmocom/osmo-sgsn.cfg + install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg # Install sysv-init files install -d ${D}${sysconfdir}/init.d install -d ${D}${sysconfdir}/rc5.d install -m 0775 ${WORKDIR}/osmo-nitb.init ${D}${sysconfdir}/init.d/osmo-nitb - install -m 0775 ${WORKDIR}/osmo-bsc_mgcp.init ${D}${sysconfdir}/init.d/osmo-bsc-mgcp - install -m 0775 ${WORKDIR}/osmo-bsc.init ${D}${sysconfdir}/init.d/osmo-bsc - install -m 0775 ${WORKDIR}/osmo-sgsn.init ${D}${sysconfdir}/init.d/osmo-sgsn + install -m 0775 ${WORKDIR}/osmo-bsc-sccplite.init ${D}${sysconfdir}/init.d/osmo-bsc-sccplite # Install systemd files and enable on sysinit - install -d ${D}${systemd_unitdir}/system - for i in `ls ${S}/contrib/systemd`; do - install -m 0644 ${S}/contrib/systemd/$i ${D}${systemd_unitdir}/system/ - done + install -d ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/contrib/systemd/osmo-nitb.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/osmo-bsc-sccplite.service ${D}${systemd_system_unitdir}/ install -d ${D}/var/lib/osmocom + + mv ${D}${bindir}/osmo-bsc ${D}${bindir}/osmo-bsc-sccplite } -PACKAGES =+ "osmo-bsc osmo-nitb osmo-gbproxy osmo-gbproxy-dbg osmo-sgsn ipaccess-utils osmo-bsc-mgcp osmo-bsc-nat" +PACKAGES =+ "osmo-bsc-sccplite osmo-nitb" -INITSCRIPT_PACKAGES = "osmo-bsc osmo-bsc-mgcp osmo-nitb osmo-sgsn" +INITSCRIPT_PACKAGES = "osmo-bsc-sccplite osmo-nitb" # Do not start any of the services by default SYSTEMD_AUTO_ENABLE = "disable" -CONFFILES_osmo-bsc = "${sysconfdir}/osmocom/osmo-bsc.cfg" -INITSCRIPT_NAME_osmo-bsc = "osmo-bsc" -INITSCRIPT_PARAMS_osmo-bsc = "defaults 30 30" -FILES_osmo-bsc = " ${bindir}/osmo-bsc \ - ${sysconfdir}/osmocom/osmo-bsc.cfg \ - ${sysconfdir}/init.d/osmo-bsc \ - ${systemd_unitdir}/system/osmo-bsc.service \ - " - -CONFFILES_osmo-bsc-mgcp = "${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg" -INITSCRIPT_NAME_osmo-bsc-mgcp = "osmo-bsc-mgcp" -INITSCRIPT_PARAMS_osmo-bsc-mgcp = "defaults 30 30" -FILES_osmo-bsc-mgcp = " ${bindir}/osmo-bsc_mgcp \ - ${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg \ - ${sysconfdir}/init.d/osmo-bsc-mgcp \ - ${systemd_unitdir}/system/osmo-bsc-mgcp.service \ +CONFFILES_osmo-bsc-sccplite = "${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg" +INITSCRIPT_NAME_osmo-bsc-sccplite = "osmo-bsc-sccplite" +INITSCRIPT_PARAMS_osmo-bsc-sccplite = "defaults 30 30" +FILES_osmo-bsc-sccplite = " ${bindir}/osmo-bsc-sccplite \ + ${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg \ + ${sysconfdir}/init.d/osmo-bsc-sccplite \ + ${systemd_system_unitdir}/osmo-bsc-sccplite.service \ " CONFFILES_osmo-nitb = "${sysconfdir}/osmocom/osmo-nitb.cfg" @@ -81,19 +71,3 @@ ${sysconfdir}/osmocom/osmo-nitb.cfg \ ${systemd_unitdir}/system/osmo-nitb.service \ " - -CONFFILES_osmo-sgsn = "${sysconfdir}/osmocom/osmo-sgsn.cfg" -INITSCRIPT_NAME_osmo-sgsn = "osmo-sgsn" -INITSCRIPT_PARAMS_osmo-sgsn = "defaults 30 30" -FILES_osmo-sgsn = " ${bindir}/osmo-sgsn \ - ${sysconfdir}/init.d/osmo-sgsn \ - ${sysconfdir}/osmocom/osmo-sgsn.cfg \ - ${systemd_unitdir}/system/osmo-sgsn.service \ - " - -FILES_ipaccess-utils = " ${bindir}/ipaccess-find ${bindir}/ipaccess-config ${bindir}/ipaccess-proxy " -FILES_osmo-bsc-nat = " ${bindir}/osmo-bsc_nat " -FILES_osmo-gbproxy = " ${bindir}/osmo-gbproxy \ - ${systemd_unitdir}/system/osmo-gbproxy.service \ - " -FILES_osmo-gbproxy-dbg = " ${bindir}/.debug/osmo-gbproxy " diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc.init b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init similarity index 66% rename from recipes-osmocom/openbsc/openbsc/osmo-bsc.init rename to recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init index c793a0b..3186f6d 100755 --- a/recipes-osmocom/openbsc/openbsc/osmo-bsc.init +++ b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init @@ -1,24 +1,24 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: osmo-bsc +# Provides: osmo-bsc-sccplite # Required-Start: $syslog $networking # Required-Stop: $syslog # Default-Start: 5 # Default-Stop: 1 -# Short-Description: Osmocom GSM Base Station Controller +# Short-Description: Osmocom GSM Base Station Controller (legacy, with SCCPLite) ### END INIT INFO -DAEMON=/usr/bin/osmo-bsc -NAME=osmo-bsc +DAEMON=/usr/bin/osmo-bsc-sccplite +NAME=osmo-bsc-sccplite DESC="Osmocom GSM Base Station Controller" -NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc.cfg -r /var/run/openbsc.ctl" +NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc-sccplite.cfg -r /var/run/openbsc.ctl" OSMOBTS_EXTRA_ARGS="" NO_START=1 set -e -test ! -r /etc/default/osmo-bsc || . /etc/default/osmo-bsc +test ! -r /etc/default/osmo-bsc-sccplite || . /etc/default/osmo-bsc-sccplite test "$NO_START" = "0" || exit 0 test -x "$DAEMON" || exit 0 diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service new file mode 100644 index 0000000..3edd35c --- /dev/null +++ b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service @@ -0,0 +1,12 @@ +[Unit] +Description=OpenBSC BSC (legacy, with SCCPLite) +Wants=osmo-bsc-mgcp.service + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/osmo-bsc-sccplite -c /etc/osmocom/osmo-bsc-sccplite.cfg -s +RestartSec=2 + +[Install] +WantedBy=multi-user.target -- To view, visit https://gerrit.osmocom.org/4100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:16:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 28 Sep 2017 16:16:42 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-msc: Avoid installed duplicated binaries in osmo-bsc Message-ID: Review at https://gerrit.osmocom.org/4101 osmo-msc: Avoid installed duplicated binaries in osmo-bsc Those two binaries are currently being installed by osmo-bsc too. Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e --- M recipes-osmocom/osmo-msc/osmo-msc.inc 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/01/4101/1 diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc index 594d754..4c3125d 100644 --- a/recipes-osmocom/osmo-msc/osmo-msc.inc +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -5,7 +5,7 @@ DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd @@ -19,6 +19,10 @@ install -m 0644 ${S}/doc/examples/osmo-msc/osmo-msc.cfg ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/contrib/systemd/osmo-msc.service ${D}${systemd_system_unitdir}/ + + # osmo-bsc already provides these, see issue Osmocom #2522: + rm -f ${D}${bindir}/.debug/*meas* + rm -f ${D}${bindir}/*meas* } SYSTEMD_SERVICE_${PN} = "${PN}.service" -- To view, visit https://gerrit.osmocom.org/4101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:29:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:29:20 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4012 to look at the new patch set (#4). add OsmoMSC manual Add OsmoMSC and OsmoHLR to bibliography (even though the OsmoHLR manual does not yet exist, a reference to it has been added in OsmoMSC's manual). Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee --- M Makefile A OsmoMSC/Makefile A OsmoMSC/chapters/control.adoc A OsmoMSC/chapters/net.adoc A OsmoMSC/chapters/overview.adoc A OsmoMSC/chapters/running.adoc A OsmoMSC/chapters/smpp.adoc A OsmoMSC/osmomsc-usermanual-docinfo.xml A OsmoMSC/osmomsc-usermanual.adoc A OsmoMSC/osmomsc-vty-reference.xml A OsmoMSC/vty/msc_vty_additions.xml A OsmoMSC/vty/msc_vty_reference.xml M common/chapters/bibliography.adoc 13 files changed, 3,825 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/12/4012/4 diff --git a/Makefile b/Makefile index c09dd58..ffa25de 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ cd OsmoNAT; $(MAKE) cd OsmoPCU; $(MAKE) cd OsmoGSMTester; $(MAKE) + cd OsmoMSC; $(MAKE) clean: cd OsmoBTS; $(MAKE) clean @@ -19,6 +20,7 @@ cd OsmoNAT; $(MAKE) clean cd OsmoPCU; $(MAKE) clean cd OsmoGSMTester; $(MAKE) clean + cd OsmoMSC; $(MAKE) clean upload: cd OsmoBTS; $(MAKE) upload @@ -30,6 +32,7 @@ cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload cd OsmoGSMTester; $(MAKE) upload + cd OsmoMSC; $(MAKE) upload check: cd OsmoBTS; $(MAKE) check @@ -42,6 +45,7 @@ #cd OsmoMGCP; $(MAKE) check #cd OsmoNAT; $(MAKE) check cd OsmoGSMTester; $(MAKE) check + cd OsmoMSC; $(MAKE) check define check_dep_bin @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; } diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile new file mode 100644 index 0000000..febf7d1 --- /dev/null +++ b/OsmoMSC/Makefile @@ -0,0 +1,42 @@ +# XSL stylesheets downloaded from http://docbook.sourceforge.net/release/xsl/current/html/ +# Makefile from BitBake/OpenEmbedded manuals + +topdir = . +msc_reference = $(topdir)/osmomsc-vty-reference.xml +manuals = $(msc_reference) +# types = pdf txt rtf ps xhtml html man tex texi dvi +# types = pdf txt +types = $(docbooktotypes) +docbooktotypes = pdf +# htmlcssfile = +# htmlcss = + +TOPDIR := .. +ASCIIDOCS := osmomsc-usermanual + +include $(TOPDIR)/build/Makefile.asciidoc.inc +include $(TOPDIR)/build/Makefile.inc + +osmomsc-usermanual.pdf: chapters/*.adoc generated/docbook_vty.xml + +clean: + -rm -rf $(cleanfiles) + -rm osmomsc-usermanual__*.svg + -rm osmomsc-usermanual__*.png + -rm osmomsc-usermanual.check + +generated/docbook_vty.xml: osmomsc-vty-reference.xml vty/*xml ../common/vty_additions.xml ../vty_reference.xsl + $(call command,xsltproc -o generated/combined1.xml \ + --stringparam with $(PWD)/../common/vty_additions.xml \ + $(MERGE_DOC) vty/msc_vty_reference.xml, \ + XSLTPROC,Merging Common VTY) + $(call command,xsltproc -o generated/combined2.xml \ + --stringparam with $(PWD)/../common/bsc_vty_additions.xml \ + $(MERGE_DOC) generated/combined1.xml, \ + XSLTPROC,Merging Common BSC VTY) + $(call command,xsltproc -o generated/combined3.xml \ + --stringparam with $(PWD)/vty/msc_vty_additions.xml \ + $(MERGE_DOC) generated/combined2.xml, \ + XSLTPROC,Merging MSC VTY) + $(call command,xsltproc ../vty_reference.xsl generated/combined3.xml > generated/docbook_vty.xml, \ + XSLTPROC,Converting MSC VTY to DocBook) diff --git a/OsmoMSC/chapters/control.adoc b/OsmoMSC/chapters/control.adoc new file mode 100644 index 0000000..af03be7 --- /dev/null +++ b/OsmoMSC/chapters/control.adoc @@ -0,0 +1,31 @@ +[[control]] +== Control interface + +The actual protocol is described in <>, the variables common +to all programs using it are described in <>. This section +describes the CTRL interface variables specific to OsmoMSC. + +.Variables available on OsmoMSC's Control interface +[options="header",width="100%",cols="20%,5%,5%,50%,20%"] +|=== +|Name|Access|Trap|Value|Comment +|subscriber-list-active-v1|RO|No||Return list of active subscribers. +|=== + +=== subscriber-list-active-v1 + +Return a list of subscribers that are successfully attached (including full +successful authentication and ciphering if those are enabled). + +The reply comprises of one subscriber per line, of the format + +---- +,\n[,\n[...]] +---- + +For example: + +---- +901700000015252,22801 +901700000015253,22802 +---- diff --git a/OsmoMSC/chapters/net.adoc b/OsmoMSC/chapters/net.adoc new file mode 100644 index 0000000..06be4ba --- /dev/null +++ b/OsmoMSC/chapters/net.adoc @@ -0,0 +1,154 @@ +[[net]] +== Configuring the Core Network + +The core network parameters are configured by the config file (as in `osmo-msc +-c osmo-msc.cfg`). The config file is parsed by the VTY, which is also +available via telnet in the running `osmo-msc` instance. Be aware that even +though you may be able to change these parameters without restarting +`osmo-msc`, some may not take immediate effect, and it is safest to use the +config file to have these parameters set at startup time. + +The core network parameters are found in the `config` / `network`. + +A full reference to the available commands can be found in the _OsmoMSC VTY +reference manual_ <>. This section describes only the most +commonly used settings. + +Here is an overview of the config items, described in more detail below: + +---- +network + network country code 262 + mobile network code 89 + mm info 1 + short name OsmoMSC + long name OsmoMSC + authentication required + encryption a5 3 +---- + +[TIP] +==== +Use the telnet VTY interface to query the current configuration of a running +`osmo-msc` process: + +---- +$ telnet localhost 4254 +OsmoMSC> enable +OsmoMSC# show running-config +---- + +Some parameters may be changed without restarting `osmo-msc`. To reach the +`network` node, enter: + +---- +OsmoMSC> enable +OsmoMSC# configure terminal +OsmoMSC(config)# network +OsmoMSC(config-net)# short name Example-Name +OsmoMSC(config-net)# exit +OsmoMSC(config)# +---- + +The telnet VTY features tab-completion as well as context sensitive help shown +when entering a `?` question mark. + +You can always use the `list` VTY command or enter `?` on the blank prompt to +get a list of all possible commands at the current node. +==== + + +=== MCC/MNC + +The key identities of every GSM PLMN is the Mobile Country Code and the Mobile +Network Code. They are identical over the entire network. In most cases, the +MCC/MNC will be allocated to the operator by the respective local regulatory +authority. For example, to set the MCC/MNC of 262-89, have this in your +osmo-msc.cfg: + +---- +network + network country code 262 + mobile network code 89 +---- + + +=== Configuring MM INFO + +The _MM INFO_ procedure can be used after a successful _LOCATION UPDATE_ in +order to transmit the human-readable network name as well as local time zone +information to the MS. By default, _MM INFO_ is not active, i.e. `0`. Set to `1` +to activate this feature: + +---- +network + mm info 1 + short name OsmoMSC + long name OsmoMSC +---- + +[NOTE] +==== +Not all phones support the MM INFO procedure. If a phone is not +factory-programmed to contain the name for your MCC/MNC, it will likely only +provide a numeric display of the network name, such as _262-89_, or show the +country code transformed into a letter, such as _D 89_. +==== + +The time information transmitted is determined by the local system time of the +operating system on which OsmoMSC is running. + + +=== Authentication + +Authorized subscribers must be entered in the HLR database, see the _OsmoHLR +reference manual_ <>. If authentication tokens (such as KI for +2G, or K and OP/OPC for UMTS) are present in the HLR, OsmoMSC will only attach +a subscriber after successful authentication. + +If no authentication keys are present in the HLR for a given subscriber, +OsmoMSC will attach the subscriber _without_ authentication. You can reject +subscribers that lack authentication info in the HLR with this setting: + +---- +network + authentication required +---- + +=== Ciphering + +To enable ciphering on the radio link, authentication must take place first: +the Kc resulting from authentication is the key used for ciphering. Hence, all +subscribers must have authentication tokens available in the HLR for ciphering. + +The MS, BTS and MSC must agree on a ciphering algorithm to use. + +- The MS sends its supported ciphering algorithms via Classmark IEs during + Location Updating. +- Typically the BSC needs to know which A5 ciphers are supported by connected + BTSes. +- Finally, OsmoMSC may impose that specific A5 ciphers shall not be considered. + +It is the responsibility of the BSC to then pick an A5 cipher that satisfies +all requirements. + +- In OsmoMSC, A5/0 means that ciphering is turned off. ++ +---- +network + encryption a5 0 +---- + +- A5/1 and A5/3 are currently supported by Osmocom. ++ +---- +network + encryption a5 3 +---- + +- Never use A5/2: it is an "export grade cipher" and has been deprecated for + its low ciphering strength. + +NOTE: At the time of writing, OsmoMSC supports setting only a single A5 cipher, +while it should be able to allow a set of ciphers. This is subject to ongoing +development. diff --git a/OsmoMSC/chapters/overview.adoc b/OsmoMSC/chapters/overview.adoc new file mode 100644 index 0000000..0bb47d7 --- /dev/null +++ b/OsmoMSC/chapters/overview.adoc @@ -0,0 +1,127 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoMSC. It will cover +aspects of configuring and running the OsmoMSC. + +[[intro_overview]] +=== About OsmoMSC + +OsmoMSC is the Osmocom implementation of a Mobile Switching Center (MSC) for 2G +and 3G GSM and UMTS mobile networks. Its interfaces are: + +- GSUP towards OsmoHLR (or a MAP proxy); +- A over IP towards a BSC (e.g. OsmoBSC); +- IuCS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G voice; +- MNCC (Mobile Network Call Control derived from GSM TS 04.07); +- SMPP 3.4 (Short Message Peer-to-Peer); +- The Osmocom typical telnet VTY and CTRL interfaces. + +OsmoMSC originated from the OpenBSC project, which started as a minimalistic +all-in-one implementation of the GSM Network. In 2017, OpenBSC had reached +maturity and diversity (including M3UA SIGTRAN and 3G support in the form of +IuCS and IuPS interfaces) that naturally lead to a separation of the all-in-one +approach to fully independent separate programs as in typical GSM networks. +Before it was split off, OsmoMSC originated from libmsc of the old openbsc.git. +Since a true _A_ interface and IuCS for 3G support is available, OsmoMSC +exists only as a separate standalone entity. + +Key differences of the new OsmoMSC compared to the old OsmoNITB are: + +- The complete VLR implementation that communicates with the separate HLR + (OsmoHLR) for subscriber management. In contrast to the OsmoNITB, HLR queries + are fully asynchronous, and the separate HLR allows using centralized + subscriber management for both circuit-switched and packet-switched domains + (i.e. one OsmoHLR for both OsmoMSC and OsmoSGSN). + +- VLR and HLR brought full UMTS AKA (Authentication and Key Agreement) support, + i.e. Milenage authentication in both the full 3G variant as well as the + backwards compatible 2G variant. + +- Addition of a true _A_ interface for 2G voice services. Previously, OsmoBSC + had an SCCPlite based _A_ interface towards 3rd party MSC implementations. + OsmoMSC features a true SCCP/M3UA _A_ interface, which allows running OsmoBSC + against this Osmocom based MSC implementation. The new SCCP/M3UA SIGTRAN for + the _A_ interface is implemented in libosmo-sccp, which is used by OsmoMSC + and OsmoBSC (and others), to establish a link via an STP (e.g. OsmoSTP). + +- Addition of an _IuCS_ interface to allow operating 3G voice services, also + via SCCP/M3UA SIGTRAN, for example connecting via OsmoHNBGW to a 3G small + cell device. + +Find the OsmoMSC issue tracker and wiki online at + +- https://osmocom.org/projects/osmomsc +- https://osmocom.org/projects/osmomsc/wiki + + +[[fig-gsm]] +.Typical GSM network architecture used with OsmoMSC +[graphviz] +---- +digraph G { + rankdir=LR; + MS0 [label="MS"] + MS1 [label="MS"] + MS2 [label="MS"] + MS3 [label="MS"] + UE0 [label="UE"] + UE1 [label="UE"] + BTS0 [label="BTS"] + BTS1 [label="BTS"] + STP [label="STP\n(SCCP routing)"] + HLR [label="HLR+AUC+EIR"] + HNB [label="RNC or hNodeB"] + MGW + MS0->BTS0 [label="Um"] + MS1->BTS0 [label="Um"] + MS2->BTS1 [label="Um"] + MS3->BTS1 [label="Um"] + UE0->HNB + UE1->HNB + BTS0->BSC [label="Abis"] + BTS1->BSC [label="Abis"] + BSC->STP [label="A/SCCP/M3UA"] + STP->MSC [label="A/SCCP/M3UA"] + STP->MSC [label="IuCS/SCCP/M3UA"] + VLR->HLR [label="GSUP"] + HNB->HNBGW [label="Iuh"] + HNBGW->STP [label="IuCS/SCCP/M3UA"] + MSC->MGW [label="MGCP"] + BTS0->MGW [label="RTP"] + BTS1->MGW [label="RTP"] + subgraph cluster_msc { + label = "OsmoMSC"; + MSC->SMSC; + MSC->VLR + } +} +---- + + +=== Software Components + +This is a brief description of OsmoMSC's internal software components. + +==== SMSC + +A minimal store-and-forward server for SMS, supporting both MO and MT +SMS service, as well as multi-part messages. + +The built-in SMSC also supports an external SMSC interface. For more +information, see <>. + +==== MSC + +The MSC component implements the mobility management (MM) functions of the TS +04.08 and delegates to SMSC for SMS message handling and the VLR for subscriber +management. + +Furthermore, it can handle TS 04.08 Call Control (CC), either by use of +an internal MNCC handler, or by use of an external MNCC agent. For more +information see <>. + +==== VLR + +A fully featured Visitor Location Register handles the subscriber management +and authentication, and interfaces via GSUP to the external HLR. diff --git a/OsmoMSC/chapters/running.adoc b/OsmoMSC/chapters/running.adoc new file mode 100644 index 0000000..5925e02 --- /dev/null +++ b/OsmoMSC/chapters/running.adoc @@ -0,0 +1,148 @@ +== Running OsmoMSC + +The OsmoMSC executable (`osmo-msc`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-msc* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-T] [-e 'LOGLEVEL'] [-l 'DATABASE'] [-M 'SOCKETPATH'] [-C] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-d, --debug 'DBGMASK','DBGLEVELS'*:: + Set the log subsystems and levels for logging to stderr. This + has mostly been superseded by VTY-based logging configuration, + see <> for further information. +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `openbsc.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. +*-T, --timestamp*:: + Enable time-stamping of log messages to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-e, --log-level 'LOGLEVEL'*:: + Set the global log level for logging to stderr. This has mostly + been deprecated by VTY based logging configuration, see + <> for more information. +*-l, --database 'DATABASE'*:: + Specify the file name of the SQLite3 database to use as SMS storage +*-M, --mncc-sock-path*:: + Enable the MNCC socket for an external MNCC handler. See + <> for further information. +*-m, --mncc-sock*:: + Same as option -M (deprecated). +*-C, --no-dbcounter*:: + Disable the regular periodic synchronization of statistics + counters to the database. + + +=== Multiple instances + +Running multiple instances of `osmo-msc` is possible if all interfaces (VTY, +CTRL) are separated using the appropriate configuration options. The IP based +interfaces are binding to local host by default. In order to separate the +processes, the user has to bind those services to specific but different IP +addresses. + +The VTY and the Control interface can be bound to IP addresses from the loopback +address range, for example: + +---- +line vty + bind 127.0.0.2 +ctrl + bind 127.0.0.2 +---- + +If external SMPP is enabled, you may bind it to a different interface using: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 +---- + +More on SMPP configuration in <>. + +The external MNCC handler is configured by the `--mncc-sock` commandline +argument. Choose a different such socket path for each OsmoMSC instance running +on the same file system. See more in <>. + +For the following links, OsmoMSC acts as a client and does not listen/bind to a +specific interface, and will hence not encounter conflicts for multiple instances +running on the same interface: + +- The SCCP/M3UA links are established by OsmoMSC contacting an STP. +- The GSUP link is established by OsmoMSC contacting an HLR. + + +=== Configure primary links + +==== Configure SCCP/M3UA to accept _A_ and _IuCS_ links + +OsmoMSC will contact an STP instance to establish an SCCP/M3UA link. BSC and +HNBGW will then reach the MSC via this link. By default, an STP instance is +assumed to listen on the default M3UA port (2905) on the local host. + +Establishing an SCCP/M3UA link towards an STP instance not on the local host +can be configured as follows: + +---- +cs7 instance 0 + asp my-OsmoMSC 2905 0 m3ua + ! IP address of the remote STP: + remote-ip 10.23.24.1 +---- + +Note that _A_ and _IuCS_ may use different SCCP instances, if so desired: + +---- +cs7 instance 0 + asp my-OsmoMSC-A 2905 0 m3ua + remote-ip 10.23.42.1 +cs7 instance 1 + asp my-OsmoMSC-Iu 2905 0 m3ua + remote-ip 10.23.42.2 +msc + cs7-instance-a 0 + cs7-instance-iu 1 +---- + +A full configuration needs an `asp` on an `as` -- an Application Server Process +running on an Application Server -- as well as a local point code and routing +configuration. The SCCP VTY automatically creates those parts that are missing, +by assuming sane defaults. A complete configuration would look like this: + +---- +cs7 instance 0 + point-code 0.23.1 + asp my-OsmoMSC-A-Iu 2905 0 m3ua + remote-ip 127.0.0.1 + as my-as-for-OsmoMSC-A-Iu m3ua + asp my-OsmoMSC-A-Iu + routing-key 0 0.23.1 +---- + +==== Configure GSUP to reach the HLR + +OsmoMSC will assume a GSUP server (OsmoHLR) to run on the local host and the +default GSUP port (4222). Contacting an HLR at a different IP address can be +configured as follows: + +---- +hlr + ! IP address of the remote HLR: + remote-ip 10.23.42.1 + ! default port is 4222, optionally configurable by: + remote-port 1234 +---- diff --git a/OsmoMSC/chapters/smpp.adoc b/OsmoMSC/chapters/smpp.adoc new file mode 100644 index 0000000..aab5a2c --- /dev/null +++ b/OsmoMSC/chapters/smpp.adoc @@ -0,0 +1,147 @@ +[[smpp]] +== Short Message Peer to Peer (SMPP) + +In OsmoMSC, the _Short Message Peer to Peer_ (SMPP) Protocol <> +interface allows sending MT-SMS to an attached subscriber or receiving unrouted +MO-SMS. OsmoMSC implements version 3.4 of the protocol. + +NOTE: `osmo-msc` must have been compiled with the `--enable-smpp` configure +option to offer the SMPP interface. + +Multiple ESMEs (External SMS Entities) may interact with an SMSC (SMS Service +Center) via the SMPP protocol. Each entity is identified by its System Id, a +character string which is configured by the system administrator. + +OsmoMSC implements the SMSC side of SMPP and acts as a TCP server accepting +incoming connections from ESME client programs. + +Each ESME identifies itself to the SMSC with its system-id and an +optional shared password. + + +[[smpp-config-global]] +=== Global SMPP configuration + +Configure OsmoMSC's SMPP behavior at the top-level `smpp` VTY node, for +example: + +---- +smpp + local-tcp-ip 10.23.42.1 2775 + system-id osmomsc123 + policy closed + no smpp-first +---- + +Use the `local-tcp-ip` command to define the TCP IP and port at which the +OsmoMSC internal SMSC should listen for incoming SMPP connections. The default +is to listen on all IPs (0.0.0.0) and the default port assigned to SMPP (2775). + +Use the `system-id` command to define the System ID of the SMSC. + +Use the `policy` parameter to define whether only explicitly configured +ESMEs are permitted to access the SMSC (`closed`), or whether any +ESME should be accepted (`accept-all`). + +Use the `smpp-first` command to define if SMPP routes have higher precedence +than MSISDNs contained in the HLR, or `no smpp-first` if only MSISDNs not +present in the HLR should be considered for routing to SMPP. + + +[[esme]] +=== ESME configuration + +Under the `smpp` vty node, you can add any number of `esme` nodes, one +for each ESME that you wish to configure. For example: + +---- +smpp + policy closed + no smpp-first + esme example1 + password s3cr3t + default-route + deliver-src-imsi + osmocom-extensions + esme example2 + password p4ssw0rd + deliver-src-imsi + osmocom-extensions + route prefix national isdn 2342 +---- + +Use the `esme NAME` command (where NAME corresponds to the system-id of +the ESME to be configured) under the SMPP vty node to enter the +configuration node for this given ESME. + +Use the `password` command to specify the password (if any) for the +ESME. + +Use the `default-route` command to indicate that any MO-SMS without a +more specific route should be routed to this ESME. + +Use the `deliver-src-imsi` command to indicate that the SMPP DELIVER +messages for MO SMS and the SMPP ALERT should state the IMSI (rather +than the MSISDN) as source address. + +Use the `osmocom-extensions` command to request that Osmocom specific +extension TLVs shall be included in the SMPP PDUs. Those extensions +include the ARFCN of the cell, the L1 transmit power of the MS, the +timing advance, the uplink and dwnlink RxLev and RxQual, as well as the +IMEI of the terminal at the time of generating the SMPP DELIVER PDU. + +Use the `dcs-transparent` command to transparently pass the DCS value +from the SMS Layer3 protocols to SMPP, instead of converting them to the +SMPP-specific values. + +Use the `route prefix` command to specify a route towards this ESME. +Using routes, you specify which destination MSISDNs should be routed +towards your ESME. + + +=== Osmocom SMPP protocol extensions + +Osmocom has implemented some extensions to the SMPP v3.4 protocol. + +These extensions can be enabled using the `osmocom-extensions` VTY +command at `esme` level, see <>. + +The TLV definitions can be found in the +`` header file provided by +libosmocore. + +==== RF channel measuremets + +When the Osmocom SMPP extensions are enabled, we add the following +TLVs to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length (Octets) | Purpose +| TLVID_osmo_arfcn | 0x2300 | 2 | GSM ARFCN of the radio interface +| TLVID_osmo_ta | 0x2301 | 1 | Timing Advance on the radio interface +| TLVID_osmo_ms_l1_txpwr | 0x2307 | 1 | Transmit Power of the MS in uplink direction +| TLVID_osmo_rxlev_ul | 0x2302 | 2 | Uplink receive level as measured by BTS in dBm (int16_t) +| TLVID_osmo_rxqual_ul | 0x2303 | 1 | Uplink RxQual value as measured by BTS +| TLVID_osmo_rxlev_dl | 0x2304 | 2 | Downlink receive level as measured by MS in dBm (int16_t) +| TLVID_osmo_rxqual_dl | 0x2305 | 1 | Downlink RxQual value as measured by MS +|=== + +All of the above values reflect the *last measurement report* as +recieved vi A-bis RSL from the BTS. It is thus a snapshot value (of +the average within one 480ms SACCH period), and not an average over +all the SACCH periods during which the channel was open or the SMS was +received. Not all measurement reports contain all the values. So you +might not get an TLVID_osmo_rxlev_dl IE, as that particular uplink +frame might habe benn lost for the given snapshot we report. + +==== Equipment IMEI + +If we know the IMEI of the subscribers phone, we add the following TLV +to each SMPP DELIVER PDU: + +[options="header", cols="3,1,1,5"] +|=== +| TLV | IEI | Length | Purpose +| TLVID_osmo_imei | 0x2306 | variable | IMEI of the subscibers phone (ME) +|=== diff --git a/OsmoMSC/osmomsc-usermanual-docinfo.xml b/OsmoMSC/osmomsc-usermanual-docinfo.xml new file mode 100644 index 0000000..d99bba7 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + September 18th, 2017 + NH + + Initial version; based on OsmoNITB manual version 2. + + + + + + + Neels + Hofmeyr + nhofmeyr at sysmocom.de + NH + + sysmocom + sysmocom - s.f.m.c. GmbH + Senior Developer + + + + + + 2017 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc new file mode 100644 index 0000000..7c20020 --- /dev/null +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -0,0 +1,36 @@ +:gfdl-enabled: +:program-name: OsmoMSC + +OsmoMSC User Manual +==================== +Neels Hofmeyr + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::chapters/control.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/net.adoc[] + +include::../common/chapters/smpp.adoc[] + +include::../common/chapters/mncc.adoc[] + +include::../common/chapters/control_if.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + diff --git a/OsmoMSC/osmomsc-vty-reference.xml b/OsmoMSC/osmomsc-vty-reference.xml new file mode 100644 index 0000000..a954b84 --- /dev/null +++ b/OsmoMSC/osmomsc-vty-reference.xml @@ -0,0 +1,38 @@ + + + + +]> + + + + + + v1 + 18th September 2017 + nh + Initial + + + + OsmoMSC VTY Reference + + + 2017 + + + + This work is copyright by sysmocom - s.f.m.c. GmbH. All rights reserved. + + + + + + &chapter-vty; + + diff --git a/OsmoMSC/vty/msc_vty_additions.xml b/OsmoMSC/vty/msc_vty_additions.xml new file mode 100644 index 0000000..0d473bd --- /dev/null +++ b/OsmoMSC/vty/msc_vty_additions.xml @@ -0,0 +1,24 @@ + + + + MNCC Internal Configuration + This node allows to configure the default codecs for + the internal call control handling. + + + + SMPP Configuration + This node allows to configure the SMPP interface + for interfacing with external SMS applications. This section + contains generic/common SMPP related configuration, and no + per-ESME specific parameters. + + + + ESME Configuration + This node allows to configure one particular SMPP + ESME, which is an External SMS Entity such as a SMS based + application server. You can define any number of ESME within + the SMPP node of the OsmoNITB VTY. + + diff --git a/OsmoMSC/vty/msc_vty_reference.xml b/OsmoMSC/vty/msc_vty_reference.xml new file mode 100644 index 0000000..b7311ab --- /dev/null +++ b/OsmoMSC/vty/msc_vty_reference.xml @@ -0,0 +1,3019 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/chapters/bibliography.adoc b/common/chapters/bibliography.adoc index 9d4c234..129758f 100644 --- a/common/chapters/bibliography.adoc +++ b/common/chapters/bibliography.adoc @@ -14,6 +14,14 @@ http://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf - [[[vty-ref-osmobsc]]] Osmocom Project: OsmoBSC VTY Reference Manual. http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf +- [[[userman-osmomsc]]] Osmocom Project: OsmoMSC User Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-usermanual.pdf +- [[[vty-ref-osmomsc]]] Osmocom Project: OsmoMSC VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmomsc-vty-reference.pdf +- [[[userman-osmohlr]]] Osmocom Project: OsmoHLR User Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-usermanual.pdf +- [[[vty-ref-osmohlr]]] Osmocom Project: OsmoHLR VTY Reference Manual. + http://ftp.osmocom.org/docs/latest/osmohlr-vty-reference.pdf - [[[userman-osmopcu]]] Osmocom Project: OsmoPCU User Manual. http://ftp.osmocom.org/docs/latest/osmopcu-usermanual.pdf - [[[vty-ref-osmopcu]]] Osmocom Project: OsmoPCU VTY Reference Manual. -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:29:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:29:20 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: tweak common/mncc.adoc: use variable for program name Message-ID: Review at https://gerrit.osmocom.org/4102 tweak common/mncc.adoc: use variable for program name Change-Id: I993a3c3bf617b9823f49898364b5f728a4549330 --- M OsmoNITB/osmonitb-usermanual.adoc M common/chapters/mncc.adoc 2 files changed, 32 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/02/4102/1 diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 7d342c5..85b4c7d 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -1,4 +1,5 @@ :gfdl-enabled: +:program-name: OsmoNITB OsmoNITB User Manual ==================== diff --git a/common/chapters/mncc.adoc b/common/chapters/mncc.adoc index 47dfcbe..74ca6cf 100644 --- a/common/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -17,16 +17,16 @@ It is exposed by the Osmocom MSC layer (both in the old OsmoNITB as well as the new OsmoMSC. -Osmocom's MSCs can run in two different modes: +{program-name} can run in two different modes: . with internal MNCC handler . with external MNCC handler === Internal MNCC handler -When the internal MNCC handler is enabled, OsmoMSC/OsmoNITB will switch voice +When the internal MNCC handler is enabled, {program-name} will switch voice calls between GSM subscribers internally and automatically based on the -subscribers __extension__ number. No external software is required. +the subscribers _extension_ number. No external software is required. NOTE: Internal MNCC is the default behavior. @@ -48,11 +48,11 @@ [[mncc-external]] === External MNCC handler -When the external MNCC handler is enabled, OsmoMSC/OsmoNITB will not perform +When the external MNCC handler is enabled, {program-name} will not perform any internal call switching, but delegate all call-control handling towards the external MNCC program connected via the MNCC socket. -If you intend to operate with external MNCC handler, you have +If you intend to operate {program-name} with external MNCC handler, you have to start it with the `-m` or `--mncc-sock` command line option. At the time of this writing, the only external application implementing the @@ -63,10 +63,9 @@ === MNCC protocol description The protocol follows the primitives specified in 3GPP TS 04.07 Chapter 7.1. -The encoding of the primitives is provided in the `mncc.h` header file -(`osmocom/msc/mncc.h` in `osmo-msc.git` or `openbsc/mncc.h` in old -`openbsc.git`), which uses some common definitions from `osmocom/gsm/mncc.h` -(part of `libosmocore.git`). +The encoding of the primitives is provided in the `mncc.h` header file in +{program-name}'s source tree, which uses some common definitions from +`osmocom/gsm/mncc.h` (part of libosmocore.git). However, Osmocom's MNCC specifies a number of additional primitives beyond those listed in the 3GPP specification. @@ -74,106 +73,104 @@ The different calls in the network are distinguished by their callref (call reference), which is a unique unsigned 32bit integer. -NOTE: _MSC_ below refers to both OsmoMSC and _libmsc_ of the OsmoNITB. - ==== MNCC_HOLD_IND -Direction: MSC -> Handler +Direction: {program-name} -> Handler A 'CC HOLD' message was received from the MS. ==== MNCC_HOLD_CNF -Direction: Handler -> MSC +Direction: Handler -> {program-name} Acknowledge a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD ACK' message to the MS. ==== MNCC_HOLD_REJ -Direction: Handler -> MSC +Direction: Handler -> {program-name} Reject a previously-received 'CC HOLD' message, causes the transmission of a 'CC HOLD REJ' message to the MS. ==== MNCC_RETRIEVE_IND -Direction: MSC -> Handler +Direction: {program-name} -> Handler A 'CC RETRIEVE' message was received from the MS. ==== MNCC_RETRIEVE_CNF -Direction: Handler -> MSC +Direction: Handler -> {program-name} Acknowledge a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE ACK' message to the MS. ==== MNCC_RETRIEVE_REJ -Direction: Handler -> MSC +Direction: Handler -> {program-name} Reject a previously-received 'CC RETRIEVE' message, causes the transmission of a 'CC RETRIEVE REJ' message to the MS. ==== MNCC_USERINFO_REQ -Direction: MSC -> Handler +Direction: {program-name} -> Handler Causes a 'CC USER INFO' message to be sent to the MS. ==== MNCC_USERINFO_IND -Direction: MSC -> Handler +Direction: {program-name} -> Handler Indicates that a 'CC USER-USER' message has been received from the MS. ==== MNCC_BRIDGE -Direction: Handler -> MSC +Direction: Handler -> {program-name} Requests that the TCH (voice) channels of two calls shall be inter-connected. This is the old-fashioned way of using MNCC, primarily required for circuit-switched BTSs whose TRAU frames are -received via an E1 interface card on the MSC machine. +received via an E1 interface card on the {program-name} machine. ==== MNCC_FRAME_RECV -Direction: Handler -> MSC +Direction: Handler -> {program-name} Enable the forwarding of TCHF voice frames via the MNCC interface in -MSC->Handler direction for the specified call. +{program-name}->Handler direction for the specified call. ==== MNCC_FRAME_DROP -Direction: Handler -> MSC +Direction: Handler -> {program-name} Disable the forwarding of TCHF voice frames via the MNCC interface in -MSC->Handler direction for the specified call. +{program-name}->Handler direction for the specified call. ==== MNCC_LCHAN_MODIFY -Direction: Handler -> MSC +Direction: Handler -> {program-name} Modify the current dedicated radio channel from signalling to voice, or if it is a signalling-only channel (SDCCH), assign a TCH to the MS. ==== MNCC_RTP_CREATE -Direction: Handler -> MSC +Direction: Handler -> {program-name} Create a RTP socket for this call at the BTS/TRAU that serves this BTS. ==== MNCC_RTP_CONNECT -Direction: Handler -> MSC +Direction: Handler -> {program-name} Connect the RTP socket of this call to the given remote IP address and port. ==== MNCC_RTP_FREE -Direction: Handler -> MSC +Direction: Handler -> {program-name} Release a RTP connection for one given call. @@ -182,32 +179,32 @@ Direction: both Transfer the payload of a GSM Full-Rate (FR) voice frame between the -MSC and an external MNCC handler. +{program-name} and an external MNCC handler. ==== GSM_TCHF_FRAME_EFR Direction: both Transfer the payload of a GSM Enhanced Full-Rate (EFR) voice frame -between the MSC and an external MNCC handler. +between the {program-name} and an external MNCC handler. ==== GSM_TCHH_FRAME Direction: both Transfer the payload of a GSM Half-Rate (HR) voice frame between the -MSC and an external MNCC handler. +{program-name} and an external MNCC handler. ==== GSM_TCH_FRAE_AMR Direction: both Transfer the payload of a GSM Adaptive-Multi-Rate (AMR) voice frame -between the MSC and an external MNCC handler. +between the {program-name} and an external MNCC handler. ==== GSM_BAD_FRAME -Direction: MSC -> Handler +Direction: {program-name} -> Handler Indicate that no valid voice frame, but a 'bad frame' was received over the radio link from the MS. -- To view, visit https://gerrit.osmocom.org/4102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I993a3c3bf617b9823f49898364b5f728a4549330 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:29:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:29:20 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: mncc.adoc: clarify MNCC_BRIDGE, with future outlook Message-ID: Review at https://gerrit.osmocom.org/4103 mncc.adoc: clarify MNCC_BRIDGE, with future outlook Change-Id: Ic71a83d71f2da87e1066fcc060b2b942643eddbc --- M common/chapters/mncc.adoc 1 file changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/03/4103/1 diff --git a/common/chapters/mncc.adoc b/common/chapters/mncc.adoc index 74ca6cf..77579a5 100644 --- a/common/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -131,8 +131,20 @@ Requests that the TCH (voice) channels of two calls shall be inter-connected. This is the old-fashioned way of using MNCC, -primarily required for circuit-switched BTSs whose TRAU frames are -received via an E1 interface card on the {program-name} machine. +historically required for circuit-switched BTSs whose TRAU frames are +received via an E1 interface card, and works only when the TCH channel types +match. + +NOTE: Internal MNCC uses MNCC_BRIDGE to connect calls directly between +connected BTSs or RNCs, in effect disallowing calls between mismatching TCH +types and forcing all BTSs to be configured with exactly one TCH type and +codec. This is a limitation that will probably remain for the old OsmoNITB. For +the new OsmoMSC, the MNCC_BRIDGE command will instruct the separate OsmoMGW to +bridge calls, which will be able to handle transcoding between different TCH as +well as 3G (IuUP) payloads (but note: not yet implemented at the time of +writing this). Hence an external MNCC may decide to bridge calls directly +between BTSs or RNCs that both are internal to the OsmoMSC, for optimization +reasons. ==== MNCC_FRAME_RECV -- To view, visit https://gerrit.osmocom.org/4103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic71a83d71f2da87e1066fcc060b2b942643eddbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:29:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:29:21 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: move smpp.adoc to common chapters Message-ID: Review at https://gerrit.osmocom.org/4104 move smpp.adoc to common chapters It will soon be referenced by OsmoMSC as well. Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c --- M OsmoNITB/osmonitb-usermanual.adoc R common/chapters/smpp.adoc 2 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/04/4104/1 diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 85b4c7d..63d430a 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -28,7 +28,7 @@ include::chapters/hlr.adoc[] -include::chapters/smpp.adoc[] +include::../common/chapters/smpp.adoc[] include::../common/chapters/mncc.adoc[] diff --git a/OsmoNITB/chapters/smpp.adoc b/common/chapters/smpp.adoc similarity index 92% rename from OsmoNITB/chapters/smpp.adoc rename to common/chapters/smpp.adoc index 23951ba..e62a844 100644 --- a/OsmoNITB/chapters/smpp.adoc +++ b/common/chapters/smpp.adoc @@ -2,16 +2,19 @@ == Short Message Peer to Peer (SMPP) The _Short Message Peer to Peer (SMPP) Protocol_ <> has been -used for the communication with SMSCs. OsmoNITB implements version 3.4 +used for the communication with SMSCs. Osmocom implements version 3.4 of the protocol. Using this interface one can send MT-SMS to an attached subscriber or receive unrouted MO-SMS. + +SMPP is served by the Osmocom MSC layer (both in the old OsmoNITB as well as +the new OsmoMSC. SMPP describes a situation where multiple ESMEs (External SMS Entities) interact with a SMSC (SMS Service Center) via the SMPP protocol. Each entity is identified by its System Id. The System ID is a character string which is configured by the system administrator. -OsmoNITB implements the SMSC side of SMPP and subsequently acts as a TCP +{program-name} implements the SMSC side of SMPP and subsequently acts as a TCP server accepting incoming connections from ESME client programs. Each ESME identifies itself to the SMSC with its system-id and an @@ -21,13 +24,13 @@ === Global SMPP configuration -There is a `smpp` vty node at the top level of the OsmoNITB +There is a `smpp` vty node at the top level of the {program-name} configuration. Under this node, the global SMPP configuration is performed. Use the `local-tcp-ip` command to define the TCP IP and port at which the -OsmoNITB internal SMSC should listen for incoming SMPP connections. The +{program-name} internal SMSC should listen for incoming SMPP connections. The default behaviour is to listen on all IPs (0.0.0.0), and the default port assigned to SMPP is 2775. -- To view, visit https://gerrit.osmocom.org/4104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:29:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:29:21 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: mncc: not 'TCHF', rather 'TCH' Message-ID: Review at https://gerrit.osmocom.org/4105 mncc: not 'TCHF', rather 'TCH' Change-Id: I0edf1763122f182c66ad4c7155ddd4bea0c1d608 --- M common/chapters/mncc.adoc 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/05/4105/1 diff --git a/common/chapters/mncc.adoc b/common/chapters/mncc.adoc index 77579a5..4f098e6 100644 --- a/common/chapters/mncc.adoc +++ b/common/chapters/mncc.adoc @@ -150,14 +150,14 @@ Direction: Handler -> {program-name} -Enable the forwarding of TCHF voice frames via the MNCC interface in +Enable the forwarding of TCH voice frames via the MNCC interface in {program-name}->Handler direction for the specified call. ==== MNCC_FRAME_DROP Direction: Handler -> {program-name} -Disable the forwarding of TCHF voice frames via the MNCC interface in +Disable the forwarding of TCH voice frames via the MNCC interface in {program-name}->Handler direction for the specified call. ==== MNCC_LCHAN_MODIFY -- To view, visit https://gerrit.osmocom.org/4105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0edf1763122f182c66ad4c7155ddd4bea0c1d608 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:33:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:33:25 +0000 Subject: osmo-hlr[master]: add CTRL tests for enable-/disable-/status-ps In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 (1 comment) https://gerrit.osmocom.org/#/c/4064/2/tests/ctrl_test_runner.py File tests/ctrl_test_runner.py: Line 170: HLR_TEST_SQL = '%s/tests/test_subscriber.sql' % confpath this file is missing from the patch. -- To view, visit https://gerrit.osmocom.org/4064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:33:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:33:56 +0000 Subject: osmo-hlr[master]: add basic CTRL interface tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 external tests should be added to the jenkins.sh configure -- To view, visit https://gerrit.osmocom.org/4063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:48:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 16:48:38 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:50:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 28 Sep 2017 16:50:13 +0000 Subject: meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:52:42 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 28 Sep 2017 16:52:42 +0000 Subject: osmo-msc[master]: fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 > Build Started http://jenkins.osmocom.org/jenkins/job/osmo-msc-gerrit/368/ -- To view, visit https://gerrit.osmocom.org/4077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:53:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:53:32 +0000 Subject: [PATCH] osmo-hlr[master]: add CTRL tests for enable-/disable-/status-ps In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4064 to look at the new patch set (#3). add CTRL tests for enable-/disable-/status-ps Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 --- M tests/ctrl_test_runner.py A tests/test_subscriber.sql 2 files changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/64/4064/3 diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py index d453197..7c14f50 100644 --- a/tests/ctrl_test_runner.py +++ b/tests/ctrl_test_runner.py @@ -163,6 +163,46 @@ return responses +class TestCtrlHLR(TestCtrlBase): + + HLR_DB = 'hlr_ctrl_test.db' + HLR_SQL = '%s/sql/hlr.sql' % confpath + HLR_TEST_SQL = '%s/tests/test_subscriber.sql' % confpath + + def setUp(self): + print('\n') + print(os.getcwd()) + assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_SQL), shell=True) == 0 + assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_TEST_SQL), shell=True) == 0 + super(TestCtrlHLR, self).setUp() + + def tearDown(self): + super(TestCtrlHLR, self).tearDown() + os.unlink("hlr_ctrl_test.db") + + def ctrl_command(self): + return ["./src/osmo-hlr", "-c", "doc/examples/osmo-hlr.cfg", '-l', 'hlr_ctrl_test.db'] + + def ctrl_app(self): + return (4259, "./src/osmo-hlr", "OsmoHLR", "hlr") + + def testCtrlErrs(self): + r = self.do_get('invalid') + self.assertEquals(r['mtype'], 'ERROR') + self.assertEquals(r['error'], 'Command not found') + + def testEnableDisablePs(self): + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + self.assert_set('disable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '0') + self.assert_set('disable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '0') + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + if __name__ == '__main__': import argparse import sys @@ -193,6 +233,8 @@ os.chdir(workdir) print "Running tests for specific control commands" suite = unittest.TestSuite() + test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlHLR) + suite.addTest(test) res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) sys.exit(len(res.errors) + len(res.failures)) diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql new file mode 100644 index 0000000..0767d48 --- /dev/null +++ b/tests/test_subscriber.sql @@ -0,0 +1,13 @@ + +-- 2G only subscriber +INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); + +-- 3G only subscriber +INSERT INTO subscriber (id, imsi) VALUES (2, '901990000000002'); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); + +-- 2G + 3G subscriber +INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); -- To view, visit https://gerrit.osmocom.org/4064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:53:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:53:32 +0000 Subject: [PATCH] osmo-hlr[master]: add basic CTRL interface tests In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4063 to look at the new patch set (#3). add basic CTRL interface tests Prepare for adding tests of enable-/disable-/status-ps CTRL commands. Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e --- M configure.ac A contrib/ipa.py M contrib/jenkins.sh M tests/Makefile.am A tests/ctrl_test_runner.py 5 files changed, 503 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/63/4063/3 diff --git a/configure.ac b/configure.ac index 6532940..167d7f3 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,21 @@ dnl checks for header files AC_HEADER_STDC +AC_ARG_ENABLE([external_tests], + AC_HELP_STRING([--enable-external-tests], + [Include the VTY/CTRL tests in make check [default=no]]), + [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) +if test "x$enable_ext_tests" = "xyes" ; then + AM_PATH_PYTHON + AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) + if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then + AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) + fi +fi +AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) +AC_MSG_RESULT([$enable_ext_tests]) +AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") + AC_OUTPUT( Makefile src/Makefile diff --git a/contrib/ipa.py b/contrib/ipa.py new file mode 100755 index 0000000..71cbf45 --- /dev/null +++ b/contrib/ipa.py @@ -0,0 +1,278 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.5" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, MGCP_OLD=0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, SCCP_OLD=0xFF) + _IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def _l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def _tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self._l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self._l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self._l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self._l(self._IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext=None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + if not len(data): + return None, None, None, None + (dlen, proto) = struct.unpack('>HB', data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack + return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data + return dlen, proto, None, data[3:] # length, protocol, _, data + + def split_combined(self, data): + """ + Split the data which contains multiple concatenated IPA messages into tuple (first, rest) where rest contains remaining messages, first is the single IPA message + """ + (length, _, _, _) = self.del_header(data) + return data[:(length + 3)], data[(length + 3):] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self._tag(self._IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self._tag(self._IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self._tag(self._IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self._tag(self._IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self._tag(self._IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self._tag(self._IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self._tag(self._IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self._tag(self._IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self._tag(self._IDTAG['UNIT'], data) + + def identity(self, unit=b'', mac=b'', location=b'', utype=b'', equip=b'', sw=b'', name=b'', serial=b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def rem_header(self, data): + """ + Remove CTRL header, check for appropriate protocol and extension + """ + (_, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return None + return d + + def parse(self, data, op=None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val)) + + def cmd(self, var, val=None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxsize) + if val is not None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + + def verify(self, reply, r, var, val=None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index e2abb60..b08c63b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -35,7 +35,7 @@ cd "$base" autoreconf --install --force -./configure +./configure --enable-external-tests $MAKE $PARALLEL_MAKE if [ "x$label" != "xFreeBSD_amd64" ]; then $MAKE check || cat-testlogs.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 0bd0820..d979fb6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,6 +25,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + ctrl_test_runner.py \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -33,8 +34,17 @@ atconfig \ $(NULL) +if ENABLE_EXT_TESTS +python-tests: $(BUILT_SOURCES) + $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v +else +python-tests: $(BUILT_SOURCES) + echo "Not running python-based tests (determined at configure-time)" +endif + check-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + $(MAKE) $(AM_MAKEFLAGS) python-tests installcheck-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py new file mode 100644 index 0000000..d453197 --- /dev/null +++ b/tests/ctrl_test_runner.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python + +# (C) 2013 by Jacob Erlbeck +# (C) 2014 by Holger Hans Peter Freyther +# based on vty_test_runner.py: +# (C) 2013 by Katerina Barone-Adesi +# (C) 2013 by Holger Hans Peter Freyther +# based on bsc_control.py. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import time +import unittest +import socket +import sys +import struct +import subprocess + +import osmopy.osmoutil as osmoutil + +# add $top_srcdir/contrib to find ipa.py +sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) + +from ipa import Ctrl, IPA + +# to be able to find $top_srcdir/doc/... +confpath = os.path.join(sys.path[0], '..') +verbose = False + +class TestCtrlBase(unittest.TestCase): + + def ctrl_command(self): + raise Exception("Needs to be implemented by a subclass") + + def ctrl_app(self): + raise Exception("Needs to be implemented by a subclass") + + def setUp(self): + osmo_ctrl_cmd = self.ctrl_command()[:] + config_index = osmo_ctrl_cmd.index('-c') + if config_index: + cfi = config_index + 1 + osmo_ctrl_cmd[cfi] = os.path.join(confpath, osmo_ctrl_cmd[cfi]) + + try: + self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) + except OSError: + print >> sys.stderr, "Current directory: %s" % os.getcwd() + print >> sys.stderr, "Consider setting -b" + time.sleep(2) + + appstring = self.ctrl_app()[2] + appport = self.ctrl_app()[0] + self.connect("127.0.0.1", appport) + self.next_id = 1000 + + def tearDown(self): + self.disconnect() + osmoutil.end_proc(self.proc) + + def disconnect(self): + if not (self.sock is None): + self.sock.close() + + def connect(self, host, port): + if verbose: + print "Connecting to host %s:%i" % (host, port) + + retries = 30 + while True: + try: + sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sck.setblocking(1) + sck.connect((host, port)) + except IOError: + retries -= 1 + if retries <= 0: + raise + time.sleep(.1) + continue + break + self.sock = sck + return sck + + def send(self, data): + if verbose: + print "Sending \"%s\"" %(data) + data = Ctrl().add_header(data) + return self.sock.send(data) == len(data) + + def send_set(self, var, value, id): + setmsg = "SET %s %s %s" %(id, var, value) + return self.send(setmsg) + + def send_get(self, var, id): + getmsg = "GET %s %s" %(id, var) + return self.send(getmsg) + + def do_set(self, var, value): + id = self.next_id + self.next_id += 1 + self.send_set(var, value, id) + return self.recv_msgs()[id] + + def do_get(self, var): + id = self.next_id + self.next_id += 1 + self.send_get(var, id) + return self.recv_msgs()[id] + + def assert_reply(self, r, mtype, var, val): + expect = dict(mtype=mtype, var=var, value=val) + result_matches = all([r.get(k) == expect.get(k) for k in expect.keys()]) + if not result_matches: + print('\nError details:\nGot reply: %r\nExpected reply: %r\n' % (r, expect)) + self.assertTrue(result_matches) + + def assert_set(self, var, val, result_val): + r = self.do_set(var, val) + self.assert_reply(r, 'SET_REPLY', var, result_val) + + def assert_get(self, var, result_val): + r = self.do_get(var) + self.assert_reply(r, 'GET_REPLY', var, result_val) + + def recv_msgs(self): + responses = {} + data = self.sock.recv(4096) + while (len(data)>0): + (head, data) = IPA().split_combined(data) + answer = Ctrl().rem_header(head) + if verbose: + print "Got message:", answer + (mtype, id, msg) = answer.split(None, 2) + id = int(id) + rsp = {'mtype': mtype, 'id': id} + if mtype == "ERROR": + rsp['error'] = msg + else: + split = msg.split(None, 1) + rsp['var'] = split[0] + if len(split) > 1: + rsp['value'] = split[1] + else: + rsp['value'] = None + responses[id] = rsp + + if verbose: + print "Decoded replies: ", responses + + return responses + + +if __name__ == '__main__': + import argparse + import sys + + workdir = '.' + + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--verbose", dest="verbose", + action="store_true", help="verbose mode") + parser.add_argument("-p", "--pythonconfpath", dest="p", + help="searchpath for config") + parser.add_argument("-w", "--workdir", dest="w", + help="Working directory") + args = parser.parse_args() + + verbose_level = 1 + if args.verbose: + verbose_level = 2 + verbose = True + + if args.w: + workdir = args.w + + if args.p: + confpath = args.p + + print "confpath %s, workdir %s" % (confpath, workdir) + os.chdir(workdir) + print "Running tests for specific control commands" + suite = unittest.TestSuite() + res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) + sys.exit(len(res.errors) + len(res.failures)) + +# vim: tabstop=4 shiftwidth=4 expandtab -- To view, visit https://gerrit.osmocom.org/4063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:53:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:53:59 +0000 Subject: osmo-hlr[master]: add basic CTRL interface tests In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 16:54:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 16:54:17 +0000 Subject: osmo-hlr[master]: add CTRL tests for enable-/disable-/status-ps In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 17:18:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 17:18:50 +0000 Subject: [MERGED] osmo-hlr[master]: add CTRL tests for enable-/disable-/status-ps In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add CTRL tests for enable-/disable-/status-ps ...................................................................... add CTRL tests for enable-/disable-/status-ps Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 --- M tests/ctrl_test_runner.py A tests/test_subscriber.sql 2 files changed, 55 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py index d453197..7c14f50 100644 --- a/tests/ctrl_test_runner.py +++ b/tests/ctrl_test_runner.py @@ -163,6 +163,46 @@ return responses +class TestCtrlHLR(TestCtrlBase): + + HLR_DB = 'hlr_ctrl_test.db' + HLR_SQL = '%s/sql/hlr.sql' % confpath + HLR_TEST_SQL = '%s/tests/test_subscriber.sql' % confpath + + def setUp(self): + print('\n') + print(os.getcwd()) + assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_SQL), shell=True) == 0 + assert subprocess.call('sqlite3 %s < %s' % (self.HLR_DB, self.HLR_TEST_SQL), shell=True) == 0 + super(TestCtrlHLR, self).setUp() + + def tearDown(self): + super(TestCtrlHLR, self).tearDown() + os.unlink("hlr_ctrl_test.db") + + def ctrl_command(self): + return ["./src/osmo-hlr", "-c", "doc/examples/osmo-hlr.cfg", '-l', 'hlr_ctrl_test.db'] + + def ctrl_app(self): + return (4259, "./src/osmo-hlr", "OsmoHLR", "hlr") + + def testCtrlErrs(self): + r = self.do_get('invalid') + self.assertEquals(r['mtype'], 'ERROR') + self.assertEquals(r['error'], 'Command not found') + + def testEnableDisablePs(self): + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + self.assert_set('disable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '0') + self.assert_set('disable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '0') + self.assert_set('enable-ps', '901990000000001', 'OK') + self.assert_set('status-ps', '901990000000001', '1') + if __name__ == '__main__': import argparse import sys @@ -193,6 +233,8 @@ os.chdir(workdir) print "Running tests for specific control commands" suite = unittest.TestSuite() + test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlHLR) + suite.addTest(test) res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) sys.exit(len(res.errors) + len(res.failures)) diff --git a/tests/test_subscriber.sql b/tests/test_subscriber.sql new file mode 100644 index 0000000..0767d48 --- /dev/null +++ b/tests/test_subscriber.sql @@ -0,0 +1,13 @@ + +-- 2G only subscriber +INSERT INTO subscriber (id, imsi) VALUES (1, '901990000000001'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (1, 1, '000102030405060708090a0b0c0d0e0f'); + +-- 3G only subscriber +INSERT INTO subscriber (id, imsi) VALUES (2, '901990000000002'); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); + +-- 2G + 3G subscriber +INSERT INTO subscriber (id, imsi) VALUES (3, '901990000000003'); +INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); -- To view, visit https://gerrit.osmocom.org/4064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I014437db9c0f15d818e04810f6cb14bf475ee002 Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 17:18:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 17:18:50 +0000 Subject: [MERGED] osmo-hlr[master]: add basic CTRL interface tests In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add basic CTRL interface tests ...................................................................... add basic CTRL interface tests Prepare for adding tests of enable-/disable-/status-ps CTRL commands. Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e --- M configure.ac A contrib/ipa.py M contrib/jenkins.sh M tests/Makefile.am A tests/ctrl_test_runner.py 5 files changed, 503 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 6532940..167d7f3 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,21 @@ dnl checks for header files AC_HEADER_STDC +AC_ARG_ENABLE([external_tests], + AC_HELP_STRING([--enable-external-tests], + [Include the VTY/CTRL tests in make check [default=no]]), + [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) +if test "x$enable_ext_tests" = "xyes" ; then + AM_PATH_PYTHON + AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) + if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then + AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) + fi +fi +AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) +AC_MSG_RESULT([$enable_ext_tests]) +AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") + AC_OUTPUT( Makefile src/Makefile diff --git a/contrib/ipa.py b/contrib/ipa.py new file mode 100755 index 0000000..71cbf45 --- /dev/null +++ b/contrib/ipa.py @@ -0,0 +1,278 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.5" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, MGCP_OLD=0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, SCCP_OLD=0xFF) + _IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def _l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def _tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self._l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self._l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self._l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self._l(self._IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext=None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + if not len(data): + return None, None, None, None + (dlen, proto) = struct.unpack('>HB', data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack + return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data + return dlen, proto, None, data[3:] # length, protocol, _, data + + def split_combined(self, data): + """ + Split the data which contains multiple concatenated IPA messages into tuple (first, rest) where rest contains remaining messages, first is the single IPA message + """ + (length, _, _, _) = self.del_header(data) + return data[:(length + 3)], data[(length + 3):] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self._tag(self._IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self._tag(self._IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self._tag(self._IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self._tag(self._IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self._tag(self._IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self._tag(self._IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self._tag(self._IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self._tag(self._IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self._tag(self._IDTAG['UNIT'], data) + + def identity(self, unit=b'', mac=b'', location=b'', utype=b'', equip=b'', sw=b'', name=b'', serial=b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def rem_header(self, data): + """ + Remove CTRL header, check for appropriate protocol and extension + """ + (_, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return None + return d + + def parse(self, data, op=None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val)) + + def cmd(self, var, val=None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxsize) + if val is not None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + + def verify(self, reply, r, var, val=None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index e2abb60..b08c63b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -35,7 +35,7 @@ cd "$base" autoreconf --install --force -./configure +./configure --enable-external-tests $MAKE $PARALLEL_MAKE if [ "x$label" != "xFreeBSD_amd64" ]; then $MAKE check || cat-testlogs.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 0bd0820..d979fb6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,6 +25,7 @@ testsuite.at \ $(srcdir)/package.m4 \ $(TESTSUITE) \ + ctrl_test_runner.py \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -33,8 +34,17 @@ atconfig \ $(NULL) +if ENABLE_EXT_TESTS +python-tests: $(BUILT_SOURCES) + $(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v +else +python-tests: $(BUILT_SOURCES) + echo "Not running python-based tests (determined at configure-time)" +endif + check-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + $(MAKE) $(AM_MAKEFLAGS) python-tests installcheck-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py new file mode 100644 index 0000000..d453197 --- /dev/null +++ b/tests/ctrl_test_runner.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python + +# (C) 2013 by Jacob Erlbeck +# (C) 2014 by Holger Hans Peter Freyther +# based on vty_test_runner.py: +# (C) 2013 by Katerina Barone-Adesi +# (C) 2013 by Holger Hans Peter Freyther +# based on bsc_control.py. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import time +import unittest +import socket +import sys +import struct +import subprocess + +import osmopy.osmoutil as osmoutil + +# add $top_srcdir/contrib to find ipa.py +sys.path.append(os.path.join(sys.path[0], '..', 'contrib')) + +from ipa import Ctrl, IPA + +# to be able to find $top_srcdir/doc/... +confpath = os.path.join(sys.path[0], '..') +verbose = False + +class TestCtrlBase(unittest.TestCase): + + def ctrl_command(self): + raise Exception("Needs to be implemented by a subclass") + + def ctrl_app(self): + raise Exception("Needs to be implemented by a subclass") + + def setUp(self): + osmo_ctrl_cmd = self.ctrl_command()[:] + config_index = osmo_ctrl_cmd.index('-c') + if config_index: + cfi = config_index + 1 + osmo_ctrl_cmd[cfi] = os.path.join(confpath, osmo_ctrl_cmd[cfi]) + + try: + self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) + except OSError: + print >> sys.stderr, "Current directory: %s" % os.getcwd() + print >> sys.stderr, "Consider setting -b" + time.sleep(2) + + appstring = self.ctrl_app()[2] + appport = self.ctrl_app()[0] + self.connect("127.0.0.1", appport) + self.next_id = 1000 + + def tearDown(self): + self.disconnect() + osmoutil.end_proc(self.proc) + + def disconnect(self): + if not (self.sock is None): + self.sock.close() + + def connect(self, host, port): + if verbose: + print "Connecting to host %s:%i" % (host, port) + + retries = 30 + while True: + try: + sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sck.setblocking(1) + sck.connect((host, port)) + except IOError: + retries -= 1 + if retries <= 0: + raise + time.sleep(.1) + continue + break + self.sock = sck + return sck + + def send(self, data): + if verbose: + print "Sending \"%s\"" %(data) + data = Ctrl().add_header(data) + return self.sock.send(data) == len(data) + + def send_set(self, var, value, id): + setmsg = "SET %s %s %s" %(id, var, value) + return self.send(setmsg) + + def send_get(self, var, id): + getmsg = "GET %s %s" %(id, var) + return self.send(getmsg) + + def do_set(self, var, value): + id = self.next_id + self.next_id += 1 + self.send_set(var, value, id) + return self.recv_msgs()[id] + + def do_get(self, var): + id = self.next_id + self.next_id += 1 + self.send_get(var, id) + return self.recv_msgs()[id] + + def assert_reply(self, r, mtype, var, val): + expect = dict(mtype=mtype, var=var, value=val) + result_matches = all([r.get(k) == expect.get(k) for k in expect.keys()]) + if not result_matches: + print('\nError details:\nGot reply: %r\nExpected reply: %r\n' % (r, expect)) + self.assertTrue(result_matches) + + def assert_set(self, var, val, result_val): + r = self.do_set(var, val) + self.assert_reply(r, 'SET_REPLY', var, result_val) + + def assert_get(self, var, result_val): + r = self.do_get(var) + self.assert_reply(r, 'GET_REPLY', var, result_val) + + def recv_msgs(self): + responses = {} + data = self.sock.recv(4096) + while (len(data)>0): + (head, data) = IPA().split_combined(data) + answer = Ctrl().rem_header(head) + if verbose: + print "Got message:", answer + (mtype, id, msg) = answer.split(None, 2) + id = int(id) + rsp = {'mtype': mtype, 'id': id} + if mtype == "ERROR": + rsp['error'] = msg + else: + split = msg.split(None, 1) + rsp['var'] = split[0] + if len(split) > 1: + rsp['value'] = split[1] + else: + rsp['value'] = None + responses[id] = rsp + + if verbose: + print "Decoded replies: ", responses + + return responses + + +if __name__ == '__main__': + import argparse + import sys + + workdir = '.' + + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--verbose", dest="verbose", + action="store_true", help="verbose mode") + parser.add_argument("-p", "--pythonconfpath", dest="p", + help="searchpath for config") + parser.add_argument("-w", "--workdir", dest="w", + help="Working directory") + args = parser.parse_args() + + verbose_level = 1 + if args.verbose: + verbose_level = 2 + verbose = True + + if args.w: + workdir = args.w + + if args.p: + confpath = args.p + + print "confpath %s, workdir %s" % (confpath, workdir) + os.chdir(workdir) + print "Running tests for specific control commands" + suite = unittest.TestSuite() + res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) + sys.exit(len(res.errors) + len(res.failures)) + +# vim: tabstop=4 shiftwidth=4 expandtab -- To view, visit https://gerrit.osmocom.org/4063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie195169c574716b514da7e04a3ce9727ef70a55e Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 17:42:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 17:42:15 +0000 Subject: [PATCH] libosmocore[master]: doxygen: adjust copyright to include 2017 Message-ID: Review at https://gerrit.osmocom.org/4106 doxygen: adjust copyright to include 2017 Change-Id: If7c09a676f67da15454aedcda99d0e9b301c9945 --- M src/application.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/06/4106/1 diff --git a/src/application.c b/src/application.c index aec3fd7..ee22639 100644 --- a/src/application.c +++ b/src/application.c @@ -43,7 +43,7 @@ * a multi-threaded context, you have to add your own locking. * * \section sec_copyright Copyright and License - * Copyright ? 2008-2016 - Harald Welte, Holger Freyther and contributors\n + * Copyright ? 2008-2017 - Harald Welte, Holger Freyther and contributors\n * All rights reserved. \n\n * The source code of libosmocore is licensed under the terms of the GNU * General Public License as published by the Free Software Foundation; -- To view, visit https://gerrit.osmocom.org/4106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7c09a676f67da15454aedcda99d0e9b301c9945 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 19:07:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 19:07:27 +0000 Subject: osmo-sgsn[master]: jenkins.sh: fix echo string to say osmo-sgsn, not msc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e9a1503de55e939179c032c17df53d27bdddd51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 19:07:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 19:07:29 +0000 Subject: [MERGED] osmo-sgsn[master]: jenkins.sh: fix echo string to say osmo-sgsn, not msc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins.sh: fix echo string to say osmo-sgsn, not msc ...................................................................... jenkins.sh: fix echo string to say osmo-sgsn, not msc Change-Id: I3e9a1503de55e939179c032c17df53d27bdddd51 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 07173cc..dc1a1a5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -39,7 +39,7 @@ echo echo echo -echo " =============================== osmo-msc ===============================" +echo " =============================== osmo-sgsn ===============================" echo set -x -- To view, visit https://gerrit.osmocom.org/4079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e9a1503de55e939179c032c17df53d27bdddd51 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:03:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:03:51 +0000 Subject: meta-telephony[201705]: osmo-msc: Avoid installed duplicated binaries in osmo-bsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4101/1//COMMIT_MSG Commit Message: Line 7: osmo-msc: Avoid installed duplicated binaries in osmo-bsc please name the binaries that are removed -- To view, visit https://gerrit.osmocom.org/4101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:12:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:12:16 +0000 Subject: meta-telephony[201705]: openbsc: Drop packages present in other recipes after split In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (4 comments) https://gerrit.osmocom.org/#/c/4100/1/recipes-osmocom/openbsc/openbsc.inc File recipes-osmocom/openbsc/openbsc.inc: Line 10: file://osmo-bsc_mgcp.init \ shouln't osmo-bsc_mgcp come from osmo-mgw.git now? Line 12: file://osmo-sgsn.init \ shouldn't osmo-sgsn come from osmo-sgsn.git now? Line 32: ...ah, they are removed here, maybe also on top Line 40: install -d ${D}${systemd_system_unitdir}/ stripping a path element? didn't read about that in the commit log. Is it correct? ah, the ${} name also changed... -- To view, visit https://gerrit.osmocom.org/4100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:13:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:13:16 +0000 Subject: meta-telephony[201705]: osmo-msc: Avoid installed duplicated binaries in osmo-bsc In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4101/1/recipes-osmocom/osmo-msc/osmo-msc.inc File recipes-osmocom/osmo-msc/osmo-msc.inc: Line 2: HOMEPAGE = "https://osmocom.org/" link to msc project page? -- To view, visit https://gerrit.osmocom.org/4101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:15:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:15:19 +0000 Subject: meta-telephony[201705]: osmo-msc: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4098/1/recipes-osmocom/osmo-msc/osmo-msc.inc File recipes-osmocom/osmo-msc/osmo-msc.inc: Line 2: HOMEPAGE = "https://osmocom.org/" link to OsmoMSC project page? -- To view, visit https://gerrit.osmocom.org/4098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:17:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:17:34 +0000 Subject: meta-telephony[201705]: osmo-hlr: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/4097/1/recipes-osmocom/osmo-hlr/osmo-hlr.inc File recipes-osmocom/osmo-hlr/osmo-hlr.inc: Line 2: HOMEPAGE = "https://osmocom.org/" link to OsmoHLR project page? Line 12: RDEPENDS_${PN} = "libdbd-sqlite3" we should not require libdbd-sqlite3, not using libdbi in osmo-hlr. Some plain libsqlite3 or something should suffice -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:19:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:19:00 +0000 Subject: meta-telephony[201705]: osmo-mgw: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/4096/1/recipes-osmocom/osmo-mgw/osmo-mgw.inc File recipes-osmocom/osmo-mgw/osmo-mgw.inc: Line 2: HOMEPAGE = "https://osmocom.org/" link to OsmoMGW project page? Line 19: install -m 0644 ${S}/contrib/systemd/osmo-bsc-mgcp.service ${D}${systemd_system_unitdir}/ (soon there will also be the osmo-mgw binary, see G#4003) -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:24:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:24:03 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/4095/1/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc File recipes-osmocom/osmo-sgsn/osmo-sgsn.inc: Line 2: HOMEPAGE = "https://osmocom.org/" link to OsmoSGSN project page? Line 25: PACKAGES =+ "osmo-gbproxy-doc osmo-gtphub-doc osmo-gbproxy osmo-gtphub" there isn't a gtphub service file further above. I guess it doesn't really need to be installed, so drop it here as well? If we install gtphub though, then maybe a .service and examples should also be installed above? Line 38: " (I'm confused, don't we need FILES_osmo-sgsn as well?) -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:26:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:26:57 +0000 Subject: meta-telephony[201705]: osmo-bsc: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/4099/1//COMMIT_MSG Commit Message: Line 7: osmo-bsc: Introduce recipe mention that this is from the new osmo-bsc.git and replaces old osmo-bsc from openbsc.git? https://gerrit.osmocom.org/#/c/4099/1/recipes-osmocom/osmo-bsc/osmo-bsc.inc File recipes-osmocom/osmo-bsc/osmo-bsc.inc: Line 2: HOMEPAGE = "https://osmocom.org/" link to OsmoBSC project page? -- To view, visit https://gerrit.osmocom.org/4099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:27:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:27:33 +0000 Subject: meta-telephony[201705]: osmo-iuh: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/4094/1/recipes-osmocom/osmo-iuh/osmo-iuh.inc File recipes-osmocom/osmo-iuh/osmo-iuh.inc: Line 2: HOMEPAGE = "https://osmocom.org/" link to OsmoHNBGW project page? -- To view, visit https://gerrit.osmocom.org/4094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:29:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:29:09 +0000 Subject: meta-telephony[201705]: libasn1c: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/4093/1/recipes-osmocom/libasn1c/libasn1c.inc File recipes-osmocom/libasn1c/libasn1c.inc: Line 1: SUMMARY = "Rruntime library of Lev Walkin's asn1c split out as separate library" rrrruntime! arriva!! -- To view, visit https://gerrit.osmocom.org/4093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:34:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:34:48 +0000 Subject: meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/4092/1/recipes-osmocom/openbsc/openbsc.inc File recipes-osmocom/openbsc/openbsc.inc: Line 3: HOMEPAGE = "http://openbsc.osmocom.org/" Link to OsmoGGSN project page? https://gerrit.osmocom.org/#/c/4092/1/recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init File recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init: Line 18: DESC="Open Source GGSN" hmm, is this an improvement? https://gerrit.osmocom.org/#/c/4092/1/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb File recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb: Line 1: DESCRITOPN = "Open Source GGSN" DESCRIXTPN Not sure about the name though. Something of Osmocom's GGSN or Gateway GPRS Support Node seems more legit? -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:37:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:37:09 +0000 Subject: meta-telephony[201705]: libosmo-sccp: Install cfg and service file for osmo-stp In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) errors unrelated to this patch... https://gerrit.osmocom.org/#/c/4091/1/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc File recipes-osmocom/libosmo-sccp/libosmo-sccp.inc: Line 1: DESCRITOPN = "An utility library for Open Source Mobile Communications" DESCROMNOMNOM Line 3: HOMEPAGE = "http://openbsc.gnumonks.org" link -- To view, visit https://gerrit.osmocom.org/4091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:37:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:37:16 +0000 Subject: meta-telephony[201705]: libosmo-sccp: Install cfg and service file for osmo-stp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:38:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:38:21 +0000 Subject: meta-telephony[201705]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (I don't understand but looks like you do) -- To view, visit https://gerrit.osmocom.org/4090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:40:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:40:03 +0000 Subject: meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) why do we still have an openggsn? Does this one precede or follow the osmo-ggsn patch? https://gerrit.osmocom.org/#/c/4089/1/recipes-osmocom/openggsn/openggsn_git.bb File recipes-osmocom/openggsn/openggsn_git.bb: Line 1: DESCRITOPN = "OpenGGSN a Free Software GGSN" this DESCRITOPN is everywhere! -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:40:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:40:15 +0000 Subject: meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:43:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:43:36 +0000 Subject: meta-telephony[201705]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 can't claim to understand -- To view, visit https://gerrit.osmocom.org/4088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:46:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:46:25 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/4087/1/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb File recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb: Line 7: erm, wasn't the EXTRA_OECONF_remove just added in the preceding patch? Does it make sense to squash them together? https://gerrit.osmocom.org/#/c/4087/1/recipes-osmocom/libosmocore/libosmocore_git.bb File recipes-osmocom/libosmocore/libosmocore_git.bb: Line 7: PR = "r1" when the hash changes, should PR go to 0? -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Sep 28 23:47:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 28 Sep 2017 23:47:29 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4087/1/recipes-osmocom/openggsn/openggsn_git.bb File recipes-osmocom/openggsn/openggsn_git.bb: Line 1: DESCRITOPN = "OpenGGSN a Free Software GGSN" DECROPITION ... and why bother to modify openggsn when we have osmo-ggsn? -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 10:23:30 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 29 Sep 2017 10:23:30 +0000 Subject: [PATCH] osmo-mgw[master]: Initially implement the new osmo-mgw and libosmo-mgcp In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4003 to look at the new patch set (#7). Initially implement the new osmo-mgw and libosmo-mgcp Leave the old osmo-bsc_mgcp and libosmo-legacy-mgcp as it is; on a copy thereof (added by a previous commit), apply changes to initially implement the new osmo-mgw. Adjust build system and debian packaging to accomodate the new libosmo-mgcp and osmo-mgw. The main differences: *) use a list to manage rtp connections. Aggregate all rtp related information inside a single struct. Use a linked list to manage the both connections (net and bts). The idea behind using a list is that we might support conference calls at some later point. Store the linked list in struct mgcp_endpoint, have a private linked list for each endpoint. The list contains connection items which are implemented in struct mgcp_conn. A connection is allocated and freed using the functions in mgcp_conn.c. A connection is allocated on the reception of a CRCX command and freed with the reception of a DLCX command. *) remove external transcoder feature Fortunatelly the external transcoder feature is not needed anymore. This patch removes the related code. *) vty: get rid of CONN_BTS and CONN_NET Since the new connection model does not make a difference between BTS and NET connections the VTY should not use the fixed CONN_BTS and CONN_NET constants. - Handle the conns list inside the endpoint directly - introduce function to dump basic rtp connection info - introduce human readable names for connections Parts of the code adjusted to use generalized connections instead of explicit BTS/NET ones: - teach mgcp_send_dummy() to send dummy packets to any RTP connection - network: generalize mgcp_bind_net/bts_rtp_port() - network: generalize mgcp_send() - tap: generalize call tapping feature - stat: generalize statistics - Replace rtp_data_net() and rtp_data_bts() with generalized rtp_data_rx() *) mgcp_protocol.c fixes: - check ci string before it is converted: In case of missing ci, a nullpointer is delivered to strtoul(). Add a function that takes ci, checks it and converts it to an uint32_t. Use the return code to react on missing ci. - output error message on missing CI. - when parsing the mode, print log message when mode is missing. - use mode_orig when mode is missing. - fix ptime formatstring to use %u rather than %d. - cosmetic: log when connection is deleted on DLCX. - change loglevels of CRCX, MDCX, DLCX events from DEBUG to NOTICE. *) mgcp_test - apply rename of strline_r() to mgcp_strline(). - MGCP command macros: - Add 'I: 1' parameters. - Use proper port numbers: from m=audio 0 RTP/AVP 126 to m=audio 16002 RTP/AVP 128 - Change ptime to 'a=ptime:40' because this is what the MGW currently returns. CRCX generally feed a ptime:40 and this is expected to be returned. - struct mgcp_test: Use only one ptype, there are no explicit BTS and NET endpoints anymore. Hence remove one column from tests[]. - test_messages(): - Enable: remove '#if 0' - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. - remove endpoint init, now done internally. - add false asserts in error cases. - test_retransmission(): - remove endpoint init, now done internally. - add false asserts in error cases. - test_packet_error_detection(): - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - remove endpoint init, now done internally. - add false assert in error case. - Assert that a conn really vanishes on DLCX, previously the conn would remain and just be unused, now it is actually discarded. - test_no_cycle() - Remove concept of BTS and NET endpoints: test only one conn, as they are now interchangeable anyway. Use arbitrary conn ids (e.g. 4711). - test_no_name() - Enable: remove '#if 0'. - remove endpoint init, now done internally. - add false assert in error case. - mgcp_test.ok: adjust expected results to status quo: - We now see two dummy packets instead of one, now sent to both sides because we don't know of BTS or NET side. (maybe drop dummy packets later...) - packet duration, conn mode: now sane defaults show instead of unset. - various whitespace and formatting changes from lindent. Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 --- M Makefile.am M configure.ac M debian/control A debian/libosmo-mgcp-dev.install A debian/libosmo-mgcp0.install M doc/examples/osmo-mgw/osmo-mgw.cfg M include/Makefile.am M include/osmocom/Makefile.am M include/osmocom/mgcp/Makefile.am M include/osmocom/mgcp/mgcp.h A include/osmocom/mgcp/mgcp_conn.h A include/osmocom/mgcp/mgcp_ep.h M include/osmocom/mgcp/mgcp_internal.h A include/osmocom/mgcp/mgcp_msg.h A include/osmocom/mgcp/mgcp_stat.h D include/osmocom/mgcp/mgcp_transcode.h M include/osmocom/mgcp/osmux.h A libosmo-mgcp.pc.in M osmoappdesc.py M src/Makefile.am M src/libosmo-mgcp/Makefile.am M src/libosmo-mgcp/mgcp_common.c A src/libosmo-mgcp/mgcp_conn.c A src/libosmo-mgcp/mgcp_ep.c A src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c A src/libosmo-mgcp/mgcp_stat.c D src/libosmo-mgcp/mgcp_transcode.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/Makefile.am R src/osmo-mgw/mgw_main.c M tests/Makefile.am M tests/legacy_mgcp/mgcp_test.c M tests/mgcp/Makefile.am M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok M tests/testsuite.at 42 files changed, 3,387 insertions(+), 4,588 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/4003/7 -- To view, visit https://gerrit.osmocom.org/4003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie008599136c7ed8a0dfbb0cf803188975a499fc5 Gerrit-PatchSet: 7 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Sep 29 10:55:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 10:55:33 +0000 Subject: meta-telephony[201705]: openbsc: Drop packages present in other recipes after split In-Reply-To: References: Message-ID: Patch Set 1: (4 comments) https://gerrit.osmocom.org/#/c/4100/1/recipes-osmocom/openbsc/openbsc.inc File recipes-osmocom/openbsc/openbsc.inc: Line 10: file://osmo-bsc_mgcp.init \ > shouln't osmo-bsc_mgcp come from osmo-mgw.git now? Indeed, this reference (+file) needs to be removed. Thanks for pointing out. Line 12: file://osmo-sgsn.init \ > shouldn't osmo-sgsn come from osmo-sgsn.git now? Indeed, this reference (+file) needs to be removed. Thanks for pointing out. Line 32: > ...ah, they are removed here, maybe also on top Agree, when I removed this lines I didn't pay attention to see that files come from meta-telephony and not from openbsc.git, so they need to be removed in the meta-telephony repo too. Line 40: install -d ${D}${systemd_system_unitdir}/ > stripping a path element? didn't read about that in the commit log. Is it c Yes, this change is correct, and the old ${systemd_unitdir} is incorrect by nature because system and user systemd units can have a different prefix (before the systemd/ dir). systemd_unitdir would have been marked as deprecated if there was a way to do so. I know for sure, I was the one adding this variable in OE a few years ago :) If you are interested about the different paths, you can look at https://github.com/openembedded/openembedded-core/blob/master/meta/conf/bitbake.conf -- To view, visit https://gerrit.osmocom.org/4100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 11:08:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 11:08:45 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/4087/1/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb File recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb: Line 7: > erm, wasn't the EXTRA_OECONF_remove just added in the preceding patch? Does Hi Neels, indeed this was added and removed like you say, but it has an explanation: These first commits basically come from current laforge/nightly, in which we keep the osmocom recipes with SRCREV ="AUTOINC", which basically thakes latest master every time the recipe is run. In there, we spot new build issues and we fix them in there. To apply new changes, I need newer revisions than the ones from current stable 201705, and so I pull all the commits pushed into laforge/nightly. I think it's fair to leave addition then removal of this lines in the commits to leave it as history to understand better why is this needed or not. Otherwise you end up with lines doing strange things in recipes and you are never sure why is that being done or what's the purpose, or if they can already be removed. Somebody spent hours trying to fix stuff and applying a better fix, so it's better to just keep the history. https://gerrit.osmocom.org/#/c/4087/1/recipes-osmocom/libosmocore/libosmocore_git.bb File recipes-osmocom/libosmocore/libosmocore_git.bb: Line 7: PR = "r1" > when the hash changes, should PR go to 0? Agree https://gerrit.osmocom.org/#/c/4087/1/recipes-osmocom/openggsn/openggsn_git.bb File recipes-osmocom/openggsn/openggsn_git.bb: Line 1: DESCRITOPN = "OpenGGSN a Free Software GGSN" > DECROPITION ... and why bother to modify openggsn when we have osmo-ggsn? We still don't have osmo-ggsn here, this is the first commit in the patchset, and makes later patches more incremental. -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 11:09:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 11:09:59 +0000 Subject: meta-telephony[201705]: osmo-mgw: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4096/1/recipes-osmocom/osmo-mgw/osmo-mgw.inc File recipes-osmocom/osmo-mgw/osmo-mgw.inc: Line 19: install -m 0644 ${S}/contrib/systemd/osmo-bsc-mgcp.service ${D}${systemd_system_unitdir}/ > (soon there will also be the osmo-mgw binary, see G#4003) Heh took me a while to understand G means gerrit: https://gerrit.osmocom.org/#/c/4003/ -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 11:29:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 11:29:43 +0000 Subject: meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4092/1/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb File recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb: Line 1: DESCRITOPN = "Open Source GGSN" > DESCRIXTPN I took "Open Source GGSN" from the description in first line of osmo-ggsn/README.md I'll change it to "Osmocom GGSN implementation" as for the other packages. -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 11:50:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 11:50:32 +0000 Subject: meta-telephony[201705]: libasn1c: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4093/1/recipes-osmocom/libasn1c/libasn1c.inc File recipes-osmocom/libasn1c/libasn1c.inc: Line 1: SUMMARY = "Rruntime library of Lev Walkin's asn1c split out as separate library" > rrrruntime! arriva!! Good catch. https://www.spanish.cl/vocabulario/trabalenguas-con-r.htm -- To view, visit https://gerrit.osmocom.org/4093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:00:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:00:35 +0000 Subject: meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4089/1/recipes-osmocom/openggsn/openggsn_git.bb File recipes-osmocom/openggsn/openggsn_git.bb: Line 1: DESCRITOPN = "OpenGGSN a Free Software GGSN" > this DESCRITOPN is everywhere! It seems it was in a lot of places before my patches, because people just copy from other recipes to have a template to create a new one. I did the same I extended the issue to new recipes :P I'm fixing this inline for each commit adding a new recipe, and I'll add a new extra commit at the end to fix the recipes non-related to this patchset. -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:12:56 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:12:56 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/4095/1/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc File recipes-osmocom/osmo-sgsn/osmo-sgsn.inc: Line 25: PACKAGES =+ "osmo-gbproxy-doc osmo-gtphub-doc osmo-gbproxy osmo-gtphub" > there isn't a gtphub service file further above. I guess it doesn't really There's no gtphub service being installed because basically there no such service file in osmo-sgsn repository, it is missing there. As we don't really require it for now, it's fine to have the package without a service file. In any case, we are not installing it in our images, but it is still nice to have the package available in case somebody wants to install it from feeds and run it. Take into account thiese "install" cmds are not installing into the image, but into a tmp directory which is used to build the packages. Then in the image recipe you specify which packages it should contain and it simply installs the packages. Line 38: " > (I'm confused, don't we need FILES_osmo-sgsn as well?) FILES_${PN} (FILES_osmo-sgsn in this case) is handled/populated by default by some OE class (package.bbclass?), no need to explicitly state it. And it's usually better to leave OE do all the magic. Also, FILES for each package are taken based on order in PACKAGES variable. That's why I'm prepending ("=+" in bitbake syntax), because otherwise everything would end up in FILES_osmo-sgsn -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:13:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:13:53 +0000 Subject: meta-telephony[201705]: osmo-mgw: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: Let's take osmo-bsc_mgcp for now and add osmo-mgw binary later when it's avialable. -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:15:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:15:50 +0000 Subject: meta-telephony[201705]: osmo-hlr: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4097/1/recipes-osmocom/osmo-hlr/osmo-hlr.inc File recipes-osmocom/osmo-hlr/osmo-hlr.inc: Line 12: RDEPENDS_${PN} = "libdbd-sqlite3" > we should not require libdbd-sqlite3, not using libdbi in osmo-hlr. Some pl Ok good to know, then debian/control is wrong, I'll send a patch to fix it. -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:18:55 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:18:55 +0000 Subject: [PATCH] osmo-hlr[master]: debian: remove unneeded dependency libdbd-sqlite3 Message-ID: Review at https://gerrit.osmocom.org/4107 debian: remove unneeded dependency libdbd-sqlite3 Take the opportunity to remove duplicated pkg-config dependency. Change-Id: I5bfe9c71740c1ced5bad0a41dfca568b9e00070c --- M debian/control 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/07/4107/1 diff --git a/debian/control b/debian/control index 0ff3801..7104c37 100644 --- a/debian/control +++ b/debian/control @@ -7,12 +7,10 @@ dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, - pkg-config, python-minimal, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, - libdbd-sqlite3, libsqlite3-dev Standards-Version: 3.9.6 Vcs-Browser: http://cgit.osmocom.org/osmo-hlr -- To view, visit https://gerrit.osmocom.org/4107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bfe9c71740c1ced5bad0a41dfca568b9e00070c Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:20:49 +0000 Subject: meta-telephony[201705]: osmo-hlr: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/4097/1/recipes-osmocom/osmo-hlr/osmo-hlr.inc File recipes-osmocom/osmo-hlr/osmo-hlr.inc: Line 12: RDEPENDS_${PN} = "libdbd-sqlite3" > Ok good to know, then debian/control is wrong, I'll send a patch to fix it. https://gerrit.osmocom.org/#/c/4107/ -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:40:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 29 Sep 2017 12:40:31 +0000 Subject: [PATCH] osmo-bsc[master]: Fix repo split aftermath Message-ID: Review at https://gerrit.osmocom.org/4108 Fix repo split aftermath * remove checks for non-existent tests * always enable bsc and nat-trie tests because both are built unconditionally * enable gsm0408 test which was removed by mistake Change-Id: I73ad079a6333ba56e73b7c4d1d0e9c8255c2a03b Related: OS#2257 --- M tests/atlocal.in M tests/testsuite.at 2 files changed, 6 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/4108/1 diff --git a/tests/atlocal.in b/tests/atlocal.in index 362bfa9..e69de29 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +0,0 @@ -enable_nat_test='@osmo_ac_build_nat@' -enable_smpp_test='@osmo_ac_build_smpp@' -enable_bsc_test='@osmo_ac_build_bsc@' -enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@' -enable_sgsn_test='@found_libgtp_and_libcares@' -enable_oap_test='@found_libgtp_and_libcares@' -enable_gtphub_test='@found_libgtp_and_libcares@' diff --git a/tests/testsuite.at b/tests/testsuite.at index a412f7c..50f68e1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,6 +1,12 @@ AT_INIT AT_BANNER([Regression tests.]) +AT_SETUP([gsm0408]) +AT_KEYWORDS([gsm0408]) +cat $abs_srcdir/gsm0408/gsm0408_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm0408/gsm0408_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([bsc_subscr]) AT_KEYWORDS([bsc_subscr]) cat $abs_srcdir/subscr/bsc_subscr_test.ok > expout @@ -16,7 +22,6 @@ AT_SETUP([bsc-nat-trie]) AT_KEYWORDS([bsc-nat-trie]) -AT_CHECK([test "$enable_nat_test" != no || exit 77]) cp $abs_srcdir/bsc-nat-trie/prefixes.csv . cat $abs_srcdir/bsc-nat-trie/bsc_nat_trie_test.ok > expout AT_CHECK([$abs_top_builddir/tests/bsc-nat-trie/bsc_nat_trie_test], [], [expout], [ignore]) @@ -30,7 +35,6 @@ AT_SETUP([bsc]) AT_KEYWORDS([bsc]) -AT_CHECK([test "$enable_bsc_test" != no || exit 77]) cat $abs_srcdir/bsc/bsc_test.ok > expout AT_CHECK([$abs_top_builddir/tests/bsc/bsc_test], [], [expout], [ignore]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73ad079a6333ba56e73b7c4d1d0e9c8255c2a03b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:54:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 29 Sep 2017 12:54:14 +0000 Subject: [PATCH] osmo-bsc[master]: Fix repo split aftermath In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4108 to look at the new patch set (#2). Fix repo split aftermath * remove checks for non-existent tests * always enable bsc and nat-trie tests because both are built unconditionally * enable gsm0408 test which was removed by mistake * adjust gsm0408 test output to remove SMS-related results Change-Id: I73ad079a6333ba56e73b7c4d1d0e9c8255c2a03b Related: OS#2257 --- M tests/atlocal.in M tests/gsm0408/gsm0408_test.ok M tests/testsuite.at 3 files changed, 6 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/4108/2 diff --git a/tests/atlocal.in b/tests/atlocal.in index 362bfa9..e69de29 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,7 +0,0 @@ -enable_nat_test='@osmo_ac_build_nat@' -enable_smpp_test='@osmo_ac_build_smpp@' -enable_bsc_test='@osmo_ac_build_bsc@' -enable_mgcp_transcoding_test='@osmo_ac_mgcp_transcoding@' -enable_sgsn_test='@found_libgtp_and_libcares@' -enable_oap_test='@found_libgtp_and_libcares@' -enable_gtphub_test='@found_libgtp_and_libcares@' diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index d30f421..9824de4 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -58,10 +58,6 @@ Random range test: range 255, max num ARFCNs 22 Random range test: range 511, max num ARFCNs 18 Random range test: range 1023, max num ARFCNs 16 -testing RP-Reference wrap -Allocated reference: 255 -Allocated reference: 0 -Allocated reference: 1 Test SI2quater UARFCN (same scrambling code and diversity): generating SI2quater for 0 EARFCNs and 1 UARFCNs... generated valid SI2quater [00/00]: [23] 59 06 07 c0 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b diff --git a/tests/testsuite.at b/tests/testsuite.at index a412f7c..50f68e1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,6 +1,12 @@ AT_INIT AT_BANNER([Regression tests.]) +AT_SETUP([gsm0408]) +AT_KEYWORDS([gsm0408]) +cat $abs_srcdir/gsm0408/gsm0408_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm0408/gsm0408_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([bsc_subscr]) AT_KEYWORDS([bsc_subscr]) cat $abs_srcdir/subscr/bsc_subscr_test.ok > expout @@ -16,7 +22,6 @@ AT_SETUP([bsc-nat-trie]) AT_KEYWORDS([bsc-nat-trie]) -AT_CHECK([test "$enable_nat_test" != no || exit 77]) cp $abs_srcdir/bsc-nat-trie/prefixes.csv . cat $abs_srcdir/bsc-nat-trie/bsc_nat_trie_test.ok > expout AT_CHECK([$abs_top_builddir/tests/bsc-nat-trie/bsc_nat_trie_test], [], [expout], [ignore]) @@ -30,7 +35,6 @@ AT_SETUP([bsc]) AT_KEYWORDS([bsc]) -AT_CHECK([test "$enable_bsc_test" != no || exit 77]) cat $abs_srcdir/bsc/bsc_test.ok > expout AT_CHECK([$abs_top_builddir/tests/bsc/bsc_test], [], [expout], [ignore]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/4108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73ad079a6333ba56e73b7c4d1d0e9c8255c2a03b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-mgw: Introduce recipe In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4096 to look at the new patch set (#2). osmo-mgw: Introduce recipe Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a --- A recipes-osmocom/osmo-mgw/osmo-mgw.inc A recipes-osmocom/osmo-mgw/osmo-mgw_git.bb 2 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/96/4096/2 diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw.inc b/recipes-osmocom/osmo-mgw/osmo-mgw.inc new file mode 100644 index 0000000..45ee338 --- /dev/null +++ b/recipes-osmocom/osmo-mgw/osmo-mgw.inc @@ -0,0 +1,22 @@ +DESCRIPTION = "Osmocom Media Gateway (MGCP) implementation" +HOMEPAGE = "https://osmocom.org/projects/osmo-mgw" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libosmocore libosmo-netif bcg729 libgsm" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-mgcp-transcoding --with-g729" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-bsc_mgcp/mgcp.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg + install -m 0644 ${S}/contrib/systemd/osmo-bsc-mgcp.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_osmo-mgw = "osmo-bsc-mgcp.service" diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb new file mode 100644 index 0000000..1ea1a7b --- /dev/null +++ b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "1c8d67d7f5f6f8788d92df65a0b68e0ec19a34dc" +SRC_URI = "git://git.osmocom.org/osmo-mgw.git;protocol=git" +PV = "1.0.2+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-hlr: Introduce recipe In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4097 to look at the new patch set (#2). osmo-hlr: Introduce recipe Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 --- A recipes-osmocom/osmo-hlr/osmo-hlr.inc A recipes-osmocom/osmo-hlr/osmo-hlr_git.bb 2 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/97/4097/2 diff --git a/recipes-osmocom/osmo-hlr/osmo-hlr.inc b/recipes-osmocom/osmo-hlr/osmo-hlr.inc new file mode 100644 index 0000000..8afe774 --- /dev/null +++ b/recipes-osmocom/osmo-hlr/osmo-hlr.inc @@ -0,0 +1,26 @@ +DESCRIPTION = "Osmocom HLR implementation" +HOMEPAGE = "https://osmocom.org/projects/osmo-hlr" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libtalloc libosmocore libosmo-abis sqlite3 sqlite3-native" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_compile_append() { + sqlite3 ${WORKDIR}/hlr.db < ${S}/sql/hlr.sql +} + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + install -d ${D}${localstatedir}/lib/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-hlr.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-hlr.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/hlr.db ${D}${localstatedir}/lib/osmocom/hlr.db +} + +SYSTEMD_SERVICE_${PN} = "${PN}.service" diff --git a/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb b/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb new file mode 100644 index 0000000..8a08d94 --- /dev/null +++ b/recipes-osmocom/osmo-hlr/osmo-hlr_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "05c8b465ab2fe13edb67c95210a9b475f91ebeb3" +SRC_URI = "git://git.osmocom.org/osmo-hlr.git;protocol=git" +PV = "0.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-msc: Introduce recipe In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4098 to look at the new patch set (#2). osmo-msc: Introduce recipe Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e --- A recipes-osmocom/osmo-msc/osmo-msc.inc A recipes-osmocom/osmo-msc/osmo-msc_git.bb 2 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/98/4098/2 diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc new file mode 100644 index 0000000..b4decf9 --- /dev/null +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -0,0 +1,24 @@ +DESCRIPTION = "Osmocom MSC implementation" +HOMEPAGE = "https://osmocom.org/projects/osmomsc" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-smpp --enable-iu" + +RDEPENDS_${PN} = "libdbd-sqlite3" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-msc/osmo-msc.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-msc.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_${PN} = "${PN}.service" diff --git a/recipes-osmocom/osmo-msc/osmo-msc_git.bb b/recipes-osmocom/osmo-msc/osmo-msc_git.bb new file mode 100644 index 0000000..7d55237 --- /dev/null +++ b/recipes-osmocom/osmo-msc/osmo-msc_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "4e7ece0bd969389132d7babf8de4f57cf7d0126f" +SRC_URI = "git://git.osmocom.org/osmo-msc.git;protocol=git" +PV = "1.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-bsc: Introduce recipe In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4099 to look at the new patch set (#2). osmo-bsc: Introduce recipe This recipe provides osmo-bsc package from new osmo-bsc.git repository, and replaces old osmo-bsc from openbc.git. Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 --- A recipes-osmocom/osmo-bsc/osmo-bsc.inc A recipes-osmocom/osmo-bsc/osmo-bsc_git.bb 2 files changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/99/4099/2 diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc b/recipes-osmocom/osmo-bsc/osmo-bsc.inc new file mode 100644 index 0000000..dfa332a --- /dev/null +++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc @@ -0,0 +1,37 @@ +DESCRIPTION = "Osmocom BSC implementation" +HOMEPAGE = "https://osmocom.org/projects/osmobsc" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "sqlite3 libosmocore libosmo-abis libosmo-sccp libosmo-netif osmo-mgw" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/contrib/systemd/osmo-bsc.service ${D}${systemd_system_unitdir}/ +} + +PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils" +SYSTEMD_PACKAGES = "osmo-bsc" +SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service" + +FILES_ipaccess-utils = " \ + ${bindir}/ipaccess-find \ + ${bindir}/ipaccess-config \ + ${bindir}/ipaccess-proxy \ + " + +FILES_osmo-bsc-nat = " \ + ${bindir}/osmo-bsc_nat \ + ${sysconfdir}/osmocom/osmo-bsc_nat.cfg \ + " + +FILES_osmo-bsc-nat-doc = " ${docdir}/osmo-bsc/examples/osmo-bsc_nat " diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb new file mode 100644 index 0000000..234e054 --- /dev/null +++ b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "00c22464a0c1b51bb4b29efecab39e993224949c" +SRC_URI = "git://git.osmocom.org/osmo-bsc.git;protocol=git" +PV = "1.0.1+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: openbsc: Drop packages present in other recipes after split In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4100 to look at the new patch set (#2). openbsc: Drop packages present in other recipes after split The osmo-bsc one is renamed to osmo-bsc-sccplite and kept because the code in the new osmo-bsc repository still doesn't support SCCPLite, this this one can still be used by installing the osmo-bsc-sccplite package. Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 --- M recipes-osmocom/openbsc/openbsc.inc R recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init A recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service D recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init D recipes-osmocom/openbsc/openbsc/osmo-sgsn.init 5 files changed, 39 insertions(+), 151 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/00/4100/2 diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index 164b492..e04911d 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -7,14 +7,14 @@ RDEPENDS_osmo-nitb = "libdbd-sqlite3" SRC_URI = "file://osmo-nitb.init \ - file://osmo-bsc_mgcp.init \ - file://osmo-bsc.init \ - file://osmo-sgsn.init" + file://osmo-bsc-sccplite.init \ + file://osmo-bsc-sccplite.service \ + " -INC_PR = "r22.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r23.${META_TELEPHONY_OSMO_INC}" -EXTRA_OECONF += " --enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" +EXTRA_OECONF += "--enable-osmo-bsc --enable-mgcp-transcoding --with-g729" inherit autotools update-rc.d pkgconfig @@ -26,50 +26,38 @@ do_install_append() { install -d ${D}${sysconfdir}/osmocom install -m 0660 ${S}/doc/examples/osmo-nitb/nanobts/openbsc.cfg ${D}${sysconfdir}/osmocom/osmo-nitb.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc.cfg - install -m 0660 ${S}/doc/examples/osmo-bsc_mgcp/mgcp.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg - install -m 0660 ${S}/doc/examples/osmo-sgsn/osmo-sgsn.cfg ${D}${sysconfdir}/osmocom/osmo-sgsn.cfg + install -m 0660 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg # Install sysv-init files install -d ${D}${sysconfdir}/init.d install -d ${D}${sysconfdir}/rc5.d install -m 0775 ${WORKDIR}/osmo-nitb.init ${D}${sysconfdir}/init.d/osmo-nitb - install -m 0775 ${WORKDIR}/osmo-bsc_mgcp.init ${D}${sysconfdir}/init.d/osmo-bsc-mgcp - install -m 0775 ${WORKDIR}/osmo-bsc.init ${D}${sysconfdir}/init.d/osmo-bsc - install -m 0775 ${WORKDIR}/osmo-sgsn.init ${D}${sysconfdir}/init.d/osmo-sgsn + install -m 0775 ${WORKDIR}/osmo-bsc-sccplite.init ${D}${sysconfdir}/init.d/osmo-bsc-sccplite # Install systemd files and enable on sysinit - install -d ${D}${systemd_unitdir}/system - for i in `ls ${S}/contrib/systemd`; do - install -m 0644 ${S}/contrib/systemd/$i ${D}${systemd_unitdir}/system/ - done + install -d ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/contrib/systemd/osmo-nitb.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/osmo-bsc-sccplite.service ${D}${systemd_system_unitdir}/ install -d ${D}/var/lib/osmocom + + mv ${D}${bindir}/osmo-bsc ${D}${bindir}/osmo-bsc-sccplite } -PACKAGES =+ "osmo-bsc osmo-nitb osmo-gbproxy osmo-gbproxy-dbg osmo-sgsn ipaccess-utils osmo-bsc-mgcp osmo-bsc-nat" +PACKAGES =+ "osmo-bsc-sccplite osmo-nitb" -INITSCRIPT_PACKAGES = "osmo-bsc osmo-bsc-mgcp osmo-nitb osmo-sgsn" +INITSCRIPT_PACKAGES = "osmo-bsc-sccplite osmo-nitb" # Do not start any of the services by default SYSTEMD_AUTO_ENABLE = "disable" -CONFFILES_osmo-bsc = "${sysconfdir}/osmocom/osmo-bsc.cfg" -INITSCRIPT_NAME_osmo-bsc = "osmo-bsc" -INITSCRIPT_PARAMS_osmo-bsc = "defaults 30 30" -FILES_osmo-bsc = " ${bindir}/osmo-bsc \ - ${sysconfdir}/osmocom/osmo-bsc.cfg \ - ${sysconfdir}/init.d/osmo-bsc \ - ${systemd_unitdir}/system/osmo-bsc.service \ - " - -CONFFILES_osmo-bsc-mgcp = "${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg" -INITSCRIPT_NAME_osmo-bsc-mgcp = "osmo-bsc-mgcp" -INITSCRIPT_PARAMS_osmo-bsc-mgcp = "defaults 30 30" -FILES_osmo-bsc-mgcp = " ${bindir}/osmo-bsc_mgcp \ - ${sysconfdir}/osmocom/osmo-bsc-mgcp.cfg \ - ${sysconfdir}/init.d/osmo-bsc-mgcp \ - ${systemd_unitdir}/system/osmo-bsc-mgcp.service \ +CONFFILES_osmo-bsc-sccplite = "${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg" +INITSCRIPT_NAME_osmo-bsc-sccplite = "osmo-bsc-sccplite" +INITSCRIPT_PARAMS_osmo-bsc-sccplite = "defaults 30 30" +FILES_osmo-bsc-sccplite = " ${bindir}/osmo-bsc-sccplite \ + ${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg \ + ${sysconfdir}/init.d/osmo-bsc-sccplite \ + ${systemd_system_unitdir}/osmo-bsc-sccplite.service \ " CONFFILES_osmo-nitb = "${sysconfdir}/osmocom/osmo-nitb.cfg" @@ -81,19 +69,3 @@ ${sysconfdir}/osmocom/osmo-nitb.cfg \ ${systemd_unitdir}/system/osmo-nitb.service \ " - -CONFFILES_osmo-sgsn = "${sysconfdir}/osmocom/osmo-sgsn.cfg" -INITSCRIPT_NAME_osmo-sgsn = "osmo-sgsn" -INITSCRIPT_PARAMS_osmo-sgsn = "defaults 30 30" -FILES_osmo-sgsn = " ${bindir}/osmo-sgsn \ - ${sysconfdir}/init.d/osmo-sgsn \ - ${sysconfdir}/osmocom/osmo-sgsn.cfg \ - ${systemd_unitdir}/system/osmo-sgsn.service \ - " - -FILES_ipaccess-utils = " ${bindir}/ipaccess-find ${bindir}/ipaccess-config ${bindir}/ipaccess-proxy " -FILES_osmo-bsc-nat = " ${bindir}/osmo-bsc_nat " -FILES_osmo-gbproxy = " ${bindir}/osmo-gbproxy \ - ${systemd_unitdir}/system/osmo-gbproxy.service \ - " -FILES_osmo-gbproxy-dbg = " ${bindir}/.debug/osmo-gbproxy " diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc.init b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init similarity index 66% rename from recipes-osmocom/openbsc/openbsc/osmo-bsc.init rename to recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init index c793a0b..3186f6d 100755 --- a/recipes-osmocom/openbsc/openbsc/osmo-bsc.init +++ b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.init @@ -1,24 +1,24 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: osmo-bsc +# Provides: osmo-bsc-sccplite # Required-Start: $syslog $networking # Required-Stop: $syslog # Default-Start: 5 # Default-Stop: 1 -# Short-Description: Osmocom GSM Base Station Controller +# Short-Description: Osmocom GSM Base Station Controller (legacy, with SCCPLite) ### END INIT INFO -DAEMON=/usr/bin/osmo-bsc -NAME=osmo-bsc +DAEMON=/usr/bin/osmo-bsc-sccplite +NAME=osmo-bsc-sccplite DESC="Osmocom GSM Base Station Controller" -NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc.cfg -r /var/run/openbsc.ctl" +NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc-sccplite.cfg -r /var/run/openbsc.ctl" OSMOBTS_EXTRA_ARGS="" NO_START=1 set -e -test ! -r /etc/default/osmo-bsc || . /etc/default/osmo-bsc +test ! -r /etc/default/osmo-bsc-sccplite || . /etc/default/osmo-bsc-sccplite test "$NO_START" = "0" || exit 0 test -x "$DAEMON" || exit 0 diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service new file mode 100644 index 0000000..3edd35c --- /dev/null +++ b/recipes-osmocom/openbsc/openbsc/osmo-bsc-sccplite.service @@ -0,0 +1,12 @@ +[Unit] +Description=OpenBSC BSC (legacy, with SCCPLite) +Wants=osmo-bsc-mgcp.service + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/osmo-bsc-sccplite -c /etc/osmocom/osmo-bsc-sccplite.cfg -s +RestartSec=2 + +[Install] +WantedBy=multi-user.target diff --git a/recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init b/recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init deleted file mode 100755 index f417588..0000000 --- a/recipes-osmocom/openbsc/openbsc/osmo-bsc_mgcp.init +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-bsc_mgcp -# Required-Start: $syslog $networking -# Required-Stop: $syslog -# Default-Start: 5 -# Default-Stop: 1 -# Short-Description: Osmocom GSM BSC MGCP proxy -### END INIT INFO - -DAEMON=/usr/bin/osmo-bsc_mgcp -NAME=osmo-bsc_mgcp -DESC="Osmocom GSM BSC MGCP proxy" -NORMAL_ARGS="-D -c /etc/osmocom/osmo-bsc-mgcp.cfg" - -OSMOBTS_EXTRA_ARGS="" -NO_START=1 - -set -e - -test ! -r /etc/default/osmo-bsc_mgcp || . /etc/default/osmo-bsc_mgcp -test "$NO_START" = "0" || exit 0 -test -x "$DAEMON" || exit 0 - -case "$1" in - start) - echo -n "Starting $DESC: " - start-stop-daemon -S \ - -x "$DAEMON" -- $NORMAL_ARGS $OSMOBTS_EXTRA_ARGS - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon -K -x "$DAEMON" - echo "$NAME." - ;; - restart) - $0 stop - $0 start - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/recipes-osmocom/openbsc/openbsc/osmo-sgsn.init b/recipes-osmocom/openbsc/openbsc/osmo-sgsn.init deleted file mode 100755 index 4481135..0000000 --- a/recipes-osmocom/openbsc/openbsc/osmo-sgsn.init +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $syslog $networking -# Required-Stop: $syslog -# Default-Start: 5 -# Default-Stop: 1 -# Short-Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -DAEMON=/usr/bin/osmo-sgsn -NAME=osmo-sgsn -DESC="Osmocom Serving GPRS Support Node" -NORMAL_ARGS="-D -c /etc/osmocom/osmo-sgsn.cfg" - -OSMOSGSN_EXTRA_ARGS="" -NO_START=0 - -set -e - -test ! -r /etc/default/osmo-sgsn || . /etc/default/osmo-sgsn -test "$NO_START" = "0" || exit 0 -test -x "$DAEMON" || exit 0 - -case "$1" in - start) - echo -n "Starting $DESC: " - start-stop-daemon -S \ - -x "$DAEMON" -- $NORMAL_ARGS $OSMOSGSN_EXTRA_ARGS - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon -K -x "$DAEMON" - echo "$NAME." - ;; - restart|force-reload) - $0 stop - $0 start - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart}" >&2 - exit 1 - ;; -esac - -exit 0 -- To view, visit https://gerrit.osmocom.org/4100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-msc: Avoid installed duplicated binaries in osmo-bsc In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4101 to look at the new patch set (#2). osmo-msc: Avoid installed duplicated binaries in osmo-bsc Those two binaries are currently being installed by osmo-bsc too: - /usr/bin/osmo-meas-udp2db - /usr/bin/meas_json Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e --- M recipes-osmocom/osmo-msc/osmo-msc.inc 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/01/4101/2 diff --git a/recipes-osmocom/osmo-msc/osmo-msc.inc b/recipes-osmocom/osmo-msc/osmo-msc.inc index b4decf9..829f947 100644 --- a/recipes-osmocom/osmo-msc/osmo-msc.inc +++ b/recipes-osmocom/osmo-msc/osmo-msc.inc @@ -5,7 +5,7 @@ DEPENDS = "libdbi libasn1c osmo-iuh libosmocore libosmo-abis libosmo-sccp libosmo-netif libsmpp34 osmo-mgw" -INC_PR="r0.${META_TELEPHONY_OSMO_INC}" +INC_PR="r1.${META_TELEPHONY_OSMO_INC}" inherit autotools pkgconfig systemd @@ -19,6 +19,10 @@ install -m 0644 ${S}/doc/examples/osmo-msc/osmo-msc.cfg ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/contrib/systemd/osmo-msc.service ${D}${systemd_system_unitdir}/ + + # osmo-bsc already provides these, see issue Osmocom #2522: + rm -f ${D}${bindir}/.debug/*meas* + rm -f ${D}${bindir}/*meas* } SYSTEMD_SERVICE_${PN} = "${PN}.service" -- To view, visit https://gerrit.osmocom.org/4101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4087 to look at the new patch set (#2). Update osmocom versions to point to current master New versions are required in order to build new git repositories which will deprecate osmo-nitb soon. Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb M recipes-osmocom/libosmo-netif/libosmo-netif_git.bb M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/openbsc/openbsc_git.bb M recipes-osmocom/openggsn/openggsn_git.bb 6 files changed, 12 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/87/4087/2 diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index c9c2077..f796948 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -3,7 +3,7 @@ DEPENDS += "libtalloc" S = "${WORKDIR}/git" -SRCREV = "35003ec2ea7de49d67e5332938a66fe92580b94d" +SRCREV = "01543a1ea392fa98974ea2f99cafbc28e9966656" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" PV = "0.3.2+gitr${SRCPV}" -PR = "${INC_PR}.1" +PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb index bea2435..0e55628 100644 --- a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb +++ b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb @@ -3,7 +3,7 @@ DEPENDS += "libtalloc lksctp-tools" S = "${WORKDIR}/git" -SRCREV = "243a3b0372fe738b01c2d32d6f6cb7b7c99a1180" +SRCREV = "59941982083f7f0d6ab11f7bbb42c297a3fb8d69" SRC_URI = "git://git.osmocom.org/libosmo-netif.git;protocol=git" PV = "0.4.0+gitr${SRCPV}" -PR = "${INC_PR}.2" +PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 1e5af41..1ce9efc 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -1,13 +1,9 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "882f340b6c394f581f6c32cafefa10c7b57073b9" +SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" -PR = "${INC_PR}.1" - -# we require the tests to link to the static libosmo-sigtran library to -# access symbols not starting with osmo_* -EXTRA_OECONF_remove = "--disable-static" +PR = "${INC_PR}.0" # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index 964dea2..c8a794c 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -1,10 +1,10 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "a8a8d3977dc3b31352f8a87ca005763677bd7e8c" +SRCREV = "657c5b6cadcef470c7ff9bffed3caab227026e6a" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" PV = "0.9.0+gitr${SRCPV}" -PR = "r1" +PR = "r0" DEPENDS += "libtalloc" diff --git a/recipes-osmocom/openbsc/openbsc_git.bb b/recipes-osmocom/openbsc/openbsc_git.bb index ac0d257..59667f7 100644 --- a/recipes-osmocom/openbsc/openbsc_git.bb +++ b/recipes-osmocom/openbsc/openbsc_git.bb @@ -2,9 +2,9 @@ PV = "0.15.0+gitr${SRCPV}" PRINC = "0" -PR = "${INC_PR}.6" +PR = "${INC_PR}.0" -SRCREV = "ba66e79953cb1c2230fe2916ef7d8de78500c7fd" +SRCREV = "3ae8682f974058970fa564f09a34a51e867b896b" SRC_URI += "git://git.osmocom.org/openbsc.git;protocol=git" S = "${WORKDIR}/git/openbsc" diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb index d704bc5..55ca924 100644 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ b/recipes-osmocom/openggsn/openggsn_git.bb @@ -2,9 +2,9 @@ LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" PV = "0.92+gitr${SRCPV}" -PR = "r1" +PR = "r0" -SRCREV = "283188790bb1b3af673d4edbd56ff649b7464e1e" +SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" SRC_URI = "git://git.osmocom.org/openggsn \ file://openggsn.init \ file://libgtp-queue_depth_32.patch \ -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4089 to look at the new patch set (#2). update PV versions for libosmocore, libosmo-sccp and openggsn As we're building git master, we need to make sure PV is not lagging behind. I wish there was some OE magic by which it could discover PV from the source it builds. Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/openggsn/openggsn_git.bb 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/89/4089/2 diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 3d55f69..7ec2224 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -3,6 +3,7 @@ S = "${WORKDIR}/git" SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" +PV = "0.7.0+gitr${SRCPV}" PR = "${INC_PR}.0" # we require the tests to link to the static libosmo-sigtran library to diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index c8a794c..5d702a3 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -3,7 +3,7 @@ S = "${WORKDIR}/git" SRCREV = "657c5b6cadcef470c7ff9bffed3caab227026e6a" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" -PV = "0.9.0+gitr${SRCPV}" +PV = "0.9.6+gitr${SRCPV}" PR = "r0" DEPENDS += "libtalloc" diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb index 55ca924..6190b22 100644 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ b/recipes-osmocom/openggsn/openggsn_git.bb @@ -1,7 +1,7 @@ DESCRITOPN = "OpenGGSN a Free Software GGSN" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" -PV = "0.92+gitr${SRCPV}" +PV = "0.94+gitr${SRCPV}" PR = "r0" SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: libosmo-sccp: Install cfg and service file for osmo-stp In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4091 to look at the new patch set (#2). libosmo-sccp: Install cfg and service file for osmo-stp Patch with systemd service file is added while waiting to have it merged in upstream. Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp.inc M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb 2 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/91/4091/2 diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc index bac8527..744e80b 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc @@ -1,12 +1,12 @@ DESCRITOPN = "An utility library for Open Source Mobile Communications" DEPENDS = "libosmocore libosmo-netif" -HOMEPAGE = "http://openbsc.gnumonks.org" +HOMEPAGE = "https://osmocom.org/projects/libosmo-sccp" LICENSE = "AGPLv3" INC_PR="r1.${META_TELEPHONY_OSMO_INC}" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -inherit autotools pkgconfig +inherit autotools pkgconfig systemd ALLOW_EMPTY_libosmo-sccp = "1" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 7ec2224..ed28cea 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -4,13 +4,30 @@ SRCREV = "54fa75b85c91bb4bb79960942f63968f6423f6a5" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" PV = "0.7.0+gitr${SRCPV}" -PR = "${INC_PR}.0" +PR = "${INC_PR}.1" # we require the tests to link to the static libosmo-sigtran library to # access symbols not starting with osmo_* EXTRA_OECONF_remove = "--disable-static" +PACKAGES =+ "osmo-stp" +SYSTEMD_PACKAGES = "osmo-stp" +SYSTEMD_SERVICE_osmo-stp = "osmo-stp.service" + # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { echo "${PV}" > ${S}/.tarball-version } + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-stp.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-stp.service ${D}${systemd_system_unitdir}/ +} + +FILES_osmo-stp = " \ + ${bindir}/osmo-stp \ + ${sysconfdir}/osmocom/osmo-stp.cfg \ + " -- To view, visit https://gerrit.osmocom.org/4091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4092 to look at the new patch set (#2). Drop openggsn and introduce osmo-ggsn Take the opportunity to enable systemd service instead of sysvint like other osmocom services already do. Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a --- M recipes-osmocom/openbsc/openbsc.inc D recipes-osmocom/openggsn/openggsn_git.bb R recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch R recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init A recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb M recipes-telephony/tasks/task-telephony-all.bb 6 files changed, 49 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/92/4092/2 diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index a965040..164b492 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -1,5 +1,5 @@ DESCRIPTION = "OpenBSC a Free Software GSM BaseStationController" -DEPENDS = "libdbi libosmocore libosmo-sccp libosmo-abis libosmo-netif openggsn libsmpp34 bcg729 libgsm libpcap c-ares" +DEPENDS = "libdbi libosmocore libosmo-sccp libosmo-abis libosmo-netif osmo-ggsn libsmpp34 bcg729 libgsm libpcap c-ares" HOMEPAGE = "http://openbsc.osmocom.org/" LICENSE = "AGPLv3+" LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" @@ -11,7 +11,7 @@ file://osmo-bsc.init \ file://osmo-sgsn.init" -INC_PR = "r21.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r22.${META_TELEPHONY_OSMO_INC}" EXTRA_OECONF += " --enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" @@ -97,4 +97,3 @@ ${systemd_unitdir}/system/osmo-gbproxy.service \ " FILES_osmo-gbproxy-dbg = " ${bindir}/.debug/osmo-gbproxy " - diff --git a/recipes-osmocom/openggsn/openggsn_git.bb b/recipes-osmocom/openggsn/openggsn_git.bb deleted file mode 100644 index 6190b22..0000000 --- a/recipes-osmocom/openggsn/openggsn_git.bb +++ /dev/null @@ -1,40 +0,0 @@ -DESCRITOPN = "OpenGGSN a Free Software GGSN" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" -PV = "0.94+gitr${SRCPV}" -PR = "r0" - -SRCREV = "6045efb642918ac43056ca6a40cda2fe2e6db08d" -SRC_URI = "git://git.osmocom.org/openggsn \ - file://openggsn.init \ - file://libgtp-queue_depth_32.patch \ - " -S = "${WORKDIR}/git" - -DEPENDS = "libosmocore" - -PACKAGES =+ " libgtp libgtp-dev libgtp-staticdev openggsn-sgsnemu" -RDEPENDS_${PN} += "kernel-module-tun" - -inherit autotools update-rc.d pkgconfig - -do_install_append() { - install -d ${D}${sysconfdir}/init.d - install -d ${D}${systemd_unitdir}/system - - install -m 0776 ${WORKDIR}/openggsn.init ${D}${sysconfdir}/init.d/openggsn - install -m 0644 ${S}/contrib/openggsn.service ${D}${systemd_unitdir}/system/ -} - -INITSCRIPT_PACKAGES = "openggsn" - -INITSCRIPT_NAME_openggsn = "openggsn" -INITSCRIPT_PARAMS_openggsn = "defaults 29 29" -RDEPENDS_${PN} += "iptables kernel-module-ipt-masquerade" - -FILES_libgtp = "${libdir}/*${SOLIBS}" -FILES_libgtp-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" -FILES_libgtp-staticdev = "${libdir}/*.a" - -FILES_openggsn-sgsnemu = "${bindir}/sgsnemu" -FILES_${PN} += "${systemd_unitdir}/system/*" diff --git a/recipes-osmocom/openggsn/files/libgtp-queue_depth_32.patch b/recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch similarity index 100% rename from recipes-osmocom/openggsn/files/libgtp-queue_depth_32.patch rename to recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch diff --git a/recipes-osmocom/openggsn/files/openggsn.init b/recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init similarity index 97% rename from recipes-osmocom/openggsn/files/openggsn.init rename to recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init index 695a6cc..157d6dd 100755 --- a/recipes-osmocom/openggsn/files/openggsn.init +++ b/recipes-osmocom/osmo-ggsn/files/osmo-ggsn.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: openggsn +# Provides: osmo-ggsn # Required-Start: $network $local_fs # Required-Stop: # Default-Start: 2 3 4 5 @@ -15,8 +15,8 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="OpenGGSN Gateway GPRS Support Node" -NAME=openggsn +DESC="Osmocom GGSN implementation" +NAME=osmo-ggsn DAEMON=/usr/bin/ggsn DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid diff --git a/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb new file mode 100644 index 0000000..5a383b9 --- /dev/null +++ b/recipes-osmocom/osmo-ggsn/osmo-ggsn_git.bb @@ -0,0 +1,42 @@ +DESCRIPTION = "Osmocom GGSN implementation" +HOMEPAGE = "https://osmocom.org/projects/openggsn" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" +PV = "1.0.0+gitr${SRCPV}" +PR = "r0" + +SRCREV = "b5624c3d4838cd774c3a6df4208b709890174a25" +SRC_URI = "git://git.osmocom.org/osmo-ggsn \ + file://osmo-ggsn.init \ + file://libgtp-queue_depth_32.patch \ + " +S = "${WORKDIR}/git" + +DEPENDS = "libosmocore" + +PACKAGES =+ " libgtp libgtp-dev libgtp-staticdev osmo-sgsnemu" +RDEPENDS_${PN} += "iptables kernel-module-ipt-masquerade kernel-module-tun" + +inherit autotools update-rc.d pkgconfig systemd + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}/${sysconfdir}/osmocom/ + + install -m 0776 ${WORKDIR}/osmo-ggsn.init ${D}${sysconfdir}/init.d/osmo-ggsn + install -m 0644 ${S}/contrib/osmo-ggsn.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/doc/examples/osmo-ggsn.cfg ${D}${sysconfdir}/osmocom/ +} + +SYSTEMD_SERVICE_osmo-ggsn = "osmo-ggsn.service" + +INITSCRIPT_PACKAGES = "osmo-ggsn" +INITSCRIPT_NAME_osmo-ggsn = "osmo-ggsn" +INITSCRIPT_PARAMS_osmo-ggsn = "defaults 29 29" + +FILES_libgtp = "${libdir}/*${SOLIBS}" +FILES_libgtp-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la" +FILES_libgtp-staticdev = "${libdir}/*.a" + +FILES_osmo-sgsnemu = "${bindir}/sgsnemu" diff --git a/recipes-telephony/tasks/task-telephony-all.bb b/recipes-telephony/tasks/task-telephony-all.bb index cc1ca0b..5efec10 100644 --- a/recipes-telephony/tasks/task-telephony-all.bb +++ b/recipes-telephony/tasks/task-telephony-all.bb @@ -3,7 +3,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" ALLOW_EMPTY_${PN} = "1" -PR = "r4" +PR = "r5" DEPENDS = "\ libosmo-abis \ @@ -11,7 +11,7 @@ libosmocore \ openbsc \ packagegroup-osmocom \ - openggsn \ + osmo-ggsn \ misdn-utils \ dahdi-linux \ dahdi-tools \ @@ -21,4 +21,3 @@ libdbi \ libdbi-drivers \ " - -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: libasn1c: Introduce recipe In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4093 to look at the new patch set (#2). libasn1c: Introduce recipe Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 --- A recipes-osmocom/libasn1c/libasn1c.inc A recipes-osmocom/libasn1c/libasn1c_git.bb 2 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/93/4093/2 diff --git a/recipes-osmocom/libasn1c/libasn1c.inc b/recipes-osmocom/libasn1c/libasn1c.inc new file mode 100644 index 0000000..f1aa7b1 --- /dev/null +++ b/recipes-osmocom/libasn1c/libasn1c.inc @@ -0,0 +1,10 @@ +SUMMARY = "Runtime library of Lev Walkin's asn1c split out as separate library" +HOMEPAGE = "https://osmocom.org/" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=25192323023bb0db6998ac6fcd5aa6a1" + +DEPENDS = "libtalloc" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig diff --git a/recipes-osmocom/libasn1c/libasn1c_git.bb b/recipes-osmocom/libasn1c/libasn1c_git.bb new file mode 100644 index 0000000..0d4800a --- /dev/null +++ b/recipes-osmocom/libasn1c/libasn1c_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "aaae8c76496a97050264e4c49e539b0420496737" +SRC_URI = "git://git.osmocom.org/libasn1c.git;protocol=git" +PV = "0.9.28+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-iuh: Introduce recipe In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4094 to look at the new patch set (#2). osmo-iuh: Introduce recipe Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 --- A recipes-osmocom/osmo-iuh/osmo-iuh.inc A recipes-osmocom/osmo-iuh/osmo-iuh_git.bb 2 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/94/4094/2 diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh.inc b/recipes-osmocom/osmo-iuh/osmo-iuh.inc new file mode 100644 index 0000000..118827e --- /dev/null +++ b/recipes-osmocom/osmo-iuh/osmo-iuh.inc @@ -0,0 +1,20 @@ +DESCRIPTION = "Osmocom Iuh and HNB-GW implementation" +HOMEPAGE = "https://osmocom.org/projects/osmohnbgw" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "libosmocore libosmo-netif libosmo-sccp libasn1c" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-hnbgw.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/contrib/systemd/osmo-hnbgw.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE_${PN} = "osmo-hnbgw.service" diff --git a/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb b/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb new file mode 100644 index 0000000..821373d --- /dev/null +++ b/recipes-osmocom/osmo-iuh/osmo-iuh_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "5a3df8fa9ffc4400367250a0f9ff0e20dc4b5d3b" +SRC_URI = "git://git.osmocom.org/osmo-iuh.git;protocol=git" +PV = "0.1.0+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:21 +0000 Subject: [PATCH] meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4095 to look at the new patch set (#2). osmo-sgsn: Introduce recipe Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 --- A recipes-osmocom/osmo-sgsn/osmo-sgsn.inc A recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb 2 files changed, 48 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/95/4095/2 diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc new file mode 100644 index 0000000..3669b79 --- /dev/null +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn.inc @@ -0,0 +1,41 @@ +DESCRIPTION = "Osmocom SGSN implementation" +HOMEPAGE = "https://osmocom.org/projects/osmosgsn" +LICENSE = "AGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" + +DEPENDS = "c-ares libpcap libasn1c libosmocore libosmo-netif osmo-iuh osmo-ggsn" + +INC_PR="r0.${META_TELEPHONY_OSMO_INC}" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF += "--enable-iu" + +do_install_append() { + install -d ${D}${systemd_system_unitdir}/ + install -d ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/doc/examples/osmo-sgsn/osmo-sgsn.cfg ${D}${sysconfdir}/osmocom/ + install -m 0644 ${S}/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg ${D}${sysconfdir}/osmocom/ + + install -m 0644 ${S}/contrib/systemd/osmo-sgsn.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${S}/contrib/systemd/osmo-gbproxy.service ${D}${systemd_system_unitdir}/ +} + +PACKAGES =+ "osmo-gbproxy-doc osmo-gtphub-doc osmo-gbproxy osmo-gtphub" +SYSTEMD_PACKAGES = "osmo-sgsn osmo-gbproxy" +SYSTEMD_SERVICE_osmo-sgsn = "osmo-sgsn.service" +SYSTEMD_SERVICE_osmo-gbproxy = "osmo-gbproxy.service" + +FILES_osmo-gbproxy = " \ + ${bindir}/osmo-gbproxy \ + ${sysconfdir}/osmocom/osmo-gbproxy.cfg \ + " + +FILES_osmo-gtphub = " \ + ${bindir}/osmo-gtphub \ + ${sysconfdir}/osmocom/osmo-gtphub.cfg \ + " + +FILES_osmo-gbproxy-doc = " ${docdir}/osmo-sgsn/examples/osmo-gbproxy " +FILES_osmo-gtphub-doc = " ${docdir}/osmo-sgsn/examples/osmo-gtphub " diff --git a/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb b/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb new file mode 100644 index 0000000..e94618f --- /dev/null +++ b/recipes-osmocom/osmo-sgsn/osmo-sgsn_git.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +S = "${WORKDIR}/git" +SRCREV = "341d446b4db87b48812afe8d2149ebc840e8a357" +SRC_URI = "git://git.osmocom.org/osmo-sgsn.git;protocol=git" +PV = "0.1.0+gitr${SRCPV}" +PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 12:59:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 29 Sep 2017 12:59:24 +0000 Subject: [PATCH] meta-telephony[201705]: Fix typo with DESCRIPTION var in several recipes Message-ID: Review at https://gerrit.osmocom.org/4109 Fix typo with DESCRIPTION var in several recipes Change-Id: I2637afdb1c868a1f9b54dcbbe55b1a1ee7519d14 --- M recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb M recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb M recipes-isdn/lcr/lcr_git.bb M recipes-isdn/misdn/misdn-utils_git.bb M recipes-osmocom/libosmo-abis/libosmo-abis.inc M recipes-osmocom/libosmo-netif/libosmo-netif.inc M recipes-osmocom/libosmo-sccp/libosmo-sccp.inc M recipes-osmocom/libosmocore/libosmocore.inc 8 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/09/4109/1 diff --git a/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb b/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb index dc7926e..122b819 100644 --- a/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb +++ b/recipes-isdn/dahdi-linux/dahdi-linux_2.10.2.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "Digium Asterisk Hardware Driver Interface - Linux kernel part" +DESCRIPTION = "Digium Asterisk Hardware Driver Interface - Linux kernel part" SECTION = "base" HOMEPAGE = "http://www.asterisk.org" LICENSE = "GPLv2" diff --git a/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb b/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb index 337186d..eb8aa60 100644 --- a/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb +++ b/recipes-isdn/dahdi-tools/dahdi-tools_2.10.2.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "Utilities for the DAHDI Asterisk Linux kernel drivers" +DESCRIPTION = "Utilities for the DAHDI Asterisk Linux kernel drivers" HOMEPAGE = "http://www.asterisk.org" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "\ diff --git a/recipes-isdn/lcr/lcr_git.bb b/recipes-isdn/lcr/lcr_git.bb index 5858c89..4bcf762 100644 --- a/recipes-isdn/lcr/lcr_git.bb +++ b/recipes-isdn/lcr/lcr_git.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "Linux Call Router" +DESCRIPTION = "Linux Call Router" DEPENDS = "libgsm libopencore-amr sofia-sip" HOMEPAGE = "http://isdn.eversberg.eu/" LICENSE = "GPLv2+" diff --git a/recipes-isdn/misdn/misdn-utils_git.bb b/recipes-isdn/misdn/misdn-utils_git.bb index 1d9f0f2..74acc62 100644 --- a/recipes-isdn/misdn/misdn-utils_git.bb +++ b/recipes-isdn/misdn/misdn-utils_git.bb @@ -1,4 +1,4 @@ -DESCRITOPN = "mISDNutils userspace library" +DESCRIPTION = "mISDNutils userspace library" HOMEPAGE = "http://misdn.org" LICENSE = "LGPLv2+" LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605" diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis.inc b/recipes-osmocom/libosmo-abis/libosmo-abis.inc index f6c19f5..15a512a 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis.inc +++ b/recipes-osmocom/libosmo-abis/libosmo-abis.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "An utility library for Open Source Mobile Communications" +DESCRIPTION = "An utility library for Open Source Mobile Communications" DEPENDS = "libosmocore ortp" DEPENDS_append_geode = "dahdi-linux" HOMEPAGE = "http://openbsc.gnumonks.org" diff --git a/recipes-osmocom/libosmo-netif/libosmo-netif.inc b/recipes-osmocom/libosmo-netif/libosmo-netif.inc index e8c6e21..2b7c0fa 100644 --- a/recipes-osmocom/libosmo-netif/libosmo-netif.inc +++ b/recipes-osmocom/libosmo-netif/libosmo-netif.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "Osmux utility classes" +DESCRIPTION = "Osmux utility classes" DEPENDS = "libosmo-abis" HOMEPAGE = "http://git.osmocom.org" LICENSE = "GPLv2+" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc index 744e80b..d269dae 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "An utility library for Open Source Mobile Communications" +DESCRIPTION = "An utility library for Open Source Mobile Communications" DEPENDS = "libosmocore libosmo-netif" HOMEPAGE = "https://osmocom.org/projects/libosmo-sccp" LICENSE = "AGPLv3" diff --git a/recipes-osmocom/libosmocore/libosmocore.inc b/recipes-osmocom/libosmocore/libosmocore.inc index de5742f..25ed5c3 100644 --- a/recipes-osmocom/libosmocore/libosmocore.inc +++ b/recipes-osmocom/libosmocore/libosmocore.inc @@ -1,4 +1,4 @@ -DESCRITOPN = "An utility library for Open Source Mobile Communications" +DESCRIPTION = "An utility library for Open Source Mobile Communications" HOMEPAGE = "http://openbsc.gnumonks.org" LICENSE = "GPLv2+" -- To view, visit https://gerrit.osmocom.org/4109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2637afdb1c868a1f9b54dcbbe55b1a1ee7519d14 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Sep 29 15:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 29 Sep 2017 15:20:49 +0000 Subject: meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/4092/2/recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch File recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch: Line 9: -#define QUEUE_SIZE 1024 /* Size of retransmission queue */ Do you have any idea why this is necessary? -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Sep 29 15:21:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 29 Sep 2017 15:21:48 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Sep 29 15:49:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 29 Sep 2017 15:49:43 +0000 Subject: [PATCH] osmo-bsc[master]: SI2q: cleanup UARFCN addition Message-ID: Review at https://gerrit.osmocom.org/4110 SI2q: cleanup UARFCN addition * fix comment typo * constify parameter * move try-add-adjust routine into separate function to facilitate further modifications * remove excessive checks and unnecessary return values Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Related: OS#2357 --- M src/libbsc/rest_octets.c M src/libbsc/system_information.c 2 files changed, 44 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/4110/1 diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index 866734b..1b3b1a9 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -232,7 +232,7 @@ } /* Estimate how many bits it'll take to append single FDD UARFCN */ -static inline int append_utran_fdd_length(uint16_t u, int *sc, size_t sc_len, size_t length) +static inline int append_utran_fdd_length(uint16_t u, const int *sc, size_t sc_len, size_t length) { uint8_t chan_list[16] = { 0 }; int tmp[sc_len], f0; @@ -274,18 +274,42 @@ return 21 + range1024_p(length); } -/* Append multiple FDD UARFCNs */ -static inline int append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +static inline int try_adding_uarfcn(struct bitvec *bv, struct gsm_bts *bts, uint16_t uarfcn, + uint8_t num_sc, uint8_t start_pos, uint8_t budget) { - const uint16_t *u = bts->si_common.data.uarfcn_list, *sc = bts->si_common.data.scramble_list; - int i, j, k, rc, st = 0, a[bts->si_common.uarfcn_length]; + int i, k, rc, a[bts->si_common.uarfcn_length]; + + if (budget < 23) + return -ENOMEM; + + /* copy corresponding Scrambling Codes: range encoder make in-place modifications */ + for (i = start_pos, k = 0; i < num_sc; a[k++] = bts->si_common.data.scramble_list[i++]); + + /* estimate bit length requirements */ + rc = append_utran_fdd_length(uarfcn, a, bts->si_common.uarfcn_length, k); + if (rc < 0) + return rc; /* range encoder failure */ + + if (budget - rc <= 0) + return -ENOMEM; /* we have ran out of budget in current SI2q */ + + /* compute next offset */ + bts->u_offset += k; + + return budget - append_utran_fdd(bv, uarfcn, a, k); +} + +/* Append multiple FDD UARFCNs */ +static inline void append_uarfcns(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) +{ + const uint16_t *u = bts->si_common.data.uarfcn_list; + int i, rem = budget - 7, st = 0; /* account for constant bits right away */ uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ - uint8_t rem = budget - 7, offset_diff; /* account for constant bits right away */ OSMO_ASSERT(budget <= SI2Q_MAX_LEN); if (budget <= 7) - return -ENOMEM; + return; /* 3G Neighbour Cell Description */ bitvec_set_bit(bv, 1); @@ -299,53 +323,24 @@ /* No Bandwidth_FDD */ bitvec_set_bit(bv, 0); - for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - offset_diff = 0; - for (j = st, k = 0; j < i; j++) { - a[k++] = sc[j]; /* copy corresponding SCs */ - offset_diff++; /* compute proper offset step */ - } + for (i = bts->u_offset; i <= bts->si_common.uarfcn_length; i++) if (u[i] != cu) { /* we've reached new UARFCN */ - rc = append_utran_fdd_length(cu, a, bts->si_common.uarfcn_length, k); - if (rc < 0) { /* estimate bit length requirements */ - return rc; - } + rem = try_adding_uarfcn(bv, bts, cu, i, st, rem); + if (rem < 0) + break; - if (rem - rc <= 0) - break; /* we have ran out of budget in current SI2q */ - else { - rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset += offset_diff; - } - cu = u[i]; - st = i; /* update start position */ + if (i < bts->si_common.uarfcn_length) { + cu = u[i]; + st = i; + } else + break; } - } - - if (rem > 22) { /* add last UARFCN not covered by previous cycle if it could possibly fit into budget */ - offset_diff = 0; - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++) { - a[k++] = sc[i]; - offset_diff++; - } - rc = append_utran_fdd_length(cu, a, bts->si_common.uarfcn_length, k); - if (rc < 0) { - return rc; - } - - if (rem - rc >= 0) { - rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset += offset_diff; - } - } /* stop bit - end of Repeated UTRAN FDD Neighbour Cells */ bitvec_set_bit(bv, 0); /* UTRAN TDD Description */ bitvec_set_bit(bv, 0); - - return 0; } /* generate SI2quater rest octets: 3GPP TS 44.018 ? 10.5.2.33b */ @@ -389,15 +384,9 @@ bitvec_set_bit(&bv, 0); rc = SI2Q_MAX_LEN - (bv.cur_bit + 3); - if (rc > 0 && bts->si_common.uarfcn_length - bts->u_offset > 0) { - rc = append_uarfcns(&bv, bts, rc); - if (rc < 0) { - LOGP(DRR, LOGL_ERROR, "SI2quater [%u/%u]: failed to append %zu UARFCNs due to range encoding " - "failure: %s\n", - bts->si2q_index, bts->si2q_count, bts->si_common.uarfcn_length, strerror(-rc)); - return rc; - } - } else /* No 3G Neighbour Cell Description */ + if (rc > 0 && bts->si_common.uarfcn_length - bts->u_offset > 0) + append_uarfcns(&bv, bts, rc); + else /* No 3G Neighbour Cell Description */ bitvec_set_bit(&bv, 0); /* No 3G Measurement Parameters Description */ diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index c9da4b2..1dd91a0 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -182,7 +182,7 @@ int rc = make_si2quaters(bts, true); uint8_t num = bts->si2q_index + 1; /* number of SI2quater messages */ - /* N. B: si2q_num() should NEVER be called during actualSI2q rest octets generation + /* N. B: si2q_num() should NEVER be called during actual SI2q rest octets generation we're not re-entrant because of the following code: */ bts->u_offset = 0; bts->e_offset = 0; -- To view, visit https://gerrit.osmocom.org/4110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:39:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:39:55 +0000 Subject: osmo-bsc[master]: Fix repo split aftermath In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73ad079a6333ba56e73b7c4d1d0e9c8255c2a03b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:42:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:42:12 +0000 Subject: meta-telephony[201705]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:42:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:42:40 +0000 Subject: meta-telephony[201705]: Update osmocom versions to point to current master In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If36b86a6a542af7381d9a07da51a330f2e44a96f Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:43:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:43:14 +0000 Subject: meta-telephony[201705]: update PV versions for libosmocore, libosmo-sccp and openggsn In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib45238e95156f215412d51d975b1acb33633a3e1 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:43:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:43:48 +0000 Subject: meta-telephony[201705]: libosmo-abis: modify PV to match recent release In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f27661d9e5241efe7725b7d1efcf4aef55e2efe Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:44:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:44:18 +0000 Subject: meta-telephony[201705]: libosmo-sccp: Install cfg and service file for osmo-stp In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id82a12bbfb72b421c75140072048a963fb50f684 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:46:09 +0000 Subject: meta-telephony[201705]: Drop openggsn and introduce osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/4092/2/recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch File recipes-osmocom/osmo-ggsn/files/libgtp-queue_depth_32.patch: Line 9: -#define QUEUE_SIZE 1024 /* Size of retransmission queue */ > Do you have any idea why this is necessary? because libgtp sttaically allocates immensely large queues for packet re-transmissions by default, way too much to run OsmoSGSN or OpenGGSN/OsmoGGSN on the small ARM926EJS of sysmoBTS 1002. -- To view, visit https://gerrit.osmocom.org/4092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6018ef78ff18f2e6809fee957c9d645e35c7c9a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:47:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:47:23 +0000 Subject: meta-telephony[201705]: libasn1c: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50d990b06c56c3bfa71e7268694702300c0c9a26 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:48:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:48:17 +0000 Subject: meta-telephony[201705]: osmo-iuh: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33d6dccad2336b83f4b4e89769b0796d1c87ed94 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:49:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:49:06 +0000 Subject: meta-telephony[201705]: osmo-sgsn: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7e35660598bfd87917728c521c1fba827e98d68 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:49:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:49:44 +0000 Subject: meta-telephony[201705]: osmo-mgw: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9c2d6b5dd8dfd8a0b462d87e93e0733e57f7b0a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:50:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:50:13 +0000 Subject: meta-telephony[201705]: osmo-hlr: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7f47dca8d7e5e50792104ae0c7cb557391542f7 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:50:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:50:21 +0000 Subject: meta-telephony[201705]: osmo-msc: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68715d1970fde83fd6647344b82c6a859404ef9e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:50:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:50:28 +0000 Subject: meta-telephony[201705]: osmo-bsc: Introduce recipe In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06c529c01a72e16aa20a2c7a20e8b043718edab3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:51:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:51:39 +0000 Subject: meta-telephony[201705]: openbsc: Drop packages present in other recipes after split In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd029cbd36417ee980bff51b4112705be16175d3 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:52:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:52:09 +0000 Subject: meta-telephony[201705]: osmo-msc: Avoid installed duplicated binaries in osmo-bsc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic582450f1881373785f12714ffa3bd150d37417e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:52:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:52:31 +0000 Subject: meta-telephony[201705]: Fix typo with DESCRIPTION var in several recipes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2637afdb1c868a1f9b54dcbbe55b1a1ee7519d14 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:53:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:53:13 +0000 Subject: osmo-hlr[master]: debian: remove unneeded dependency libdbd-sqlite3 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bfe9c71740c1ced5bad0a41dfca568b9e00070c Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:56:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:56:09 +0000 Subject: osmo-msc[master]: cosmetic: vlr: declare a struct in .h; drop unused header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61d793c3001abbe6d381be1ae0bb350b07403e88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:56:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:56:28 +0000 Subject: osmo-msc[master]: fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:56:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:56:46 +0000 Subject: libosmocore[master]: doxygen: adjust copyright to include 2017 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7c09a676f67da15454aedcda99d0e9b301c9945 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:57:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:57:33 +0000 Subject: [MERGED] libosmocore[master]: doxygen: adjust copyright to include 2017 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: doxygen: adjust copyright to include 2017 ...................................................................... doxygen: adjust copyright to include 2017 Change-Id: If7c09a676f67da15454aedcda99d0e9b301c9945 --- M src/application.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/application.c b/src/application.c index aec3fd7..ee22639 100644 --- a/src/application.c +++ b/src/application.c @@ -43,7 +43,7 @@ * a multi-threaded context, you have to add your own locking. * * \section sec_copyright Copyright and License - * Copyright ? 2008-2016 - Harald Welte, Holger Freyther and contributors\n + * Copyright ? 2008-2017 - Harald Welte, Holger Freyther and contributors\n * All rights reserved. \n\n * The source code of libosmocore is licensed under the terms of the GNU * General Public License as published by the Free Software Foundation; -- To view, visit https://gerrit.osmocom.org/4106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7c09a676f67da15454aedcda99d0e9b301c9945 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:58:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:58:42 +0000 Subject: osmo-gsm-manuals[master]: tweak common/mncc.adoc: use variable for program name In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I993a3c3bf617b9823f49898364b5f728a4549330 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 11:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 11:59:18 +0000 Subject: osmo-gsm-manuals[master]: mncc.adoc: clarify MNCC_BRIDGE, with future outlook In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic71a83d71f2da87e1066fcc060b2b942643eddbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:00:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:00:07 +0000 Subject: osmo-gsm-manuals[master]: move smpp.adoc to common chapters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 it's actually not just a move but also some generalization of the wording, the changelog should state this I think. Otherwise +2. -- To view, visit https://gerrit.osmocom.org/4104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15febdea6569316dad3eed5f9dc7158adb5b078c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:01:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:01:24 +0000 Subject: osmo-gsm-manuals[master]: add OsmoMSC manual In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 this still doesn't use the common smpp.adoc but introduces its own version? -- To view, visit https://gerrit.osmocom.org/4012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:01:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:01:41 +0000 Subject: osmo-gsm-manuals[master]: mncc: not 'TCHF', rather 'TCH' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0edf1763122f182c66ad4c7155ddd4bea0c1d608 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:03:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:03:27 +0000 Subject: openbsc[master]: abis: fix unaligned memory access In-Reply-To: References: Message-ID: Patch Set 3: my point is: Unaligned accesses are not functional bugs but merely performance issues (on some platforms). If this occurs once per program start, it's not worth our time to "fix" them. We have plenty of real bugs to resolve -- To view, visit https://gerrit.osmocom.org/3750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:06:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:06:09 +0000 Subject: libosmocore[master]: IPA msgb: on ipa_msg_alloc(), set caller as talloc string In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 this breaks ABI and is not backwards compatible at run-time, only compile time (the symbol is removed). At the very least, TODO-RELEASE must be updated. But I still think it's not worth to force all users to update the library (and break running old binaries with new libraries). Let's just keep a compatibility function around? -- To view, visit https://gerrit.osmocom.org/4076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic67ca94b27a4f36ba1bf655b4cd1c7e78fd06ab8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:08:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:08:28 +0000 Subject: osmo-sgsn[master]: Use extended logging for PDP contexts In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91a126952ae75ae9ba1f42aac4d26413384bba5d Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:09:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:09:39 +0000 Subject: osmo-ci[master]: Use new GPRS repositories In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia49969cbfb9ef57b635a3b5759f411f71a54f8e1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:11:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:11:22 +0000 Subject: libosmocore[master]: Remove bogus error message In-Reply-To: References: Message-ID: Patch Set 5: leving this to Neels. -- To view, visit https://gerrit.osmocom.org/3973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia6ab79fe2f6b502ea223aa72e929dd3c75f34b5c Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:12:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:12:07 +0000 Subject: osmo-bts[master]: Replace dead code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:12:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:12:21 +0000 Subject: osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:12:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:12:52 +0000 Subject: osmo-sgsn[master]: Cleanup configure checks In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83ae896f57cfb4cb139a42fbf3d77d4b11313f65 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:13:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:13:15 +0000 Subject: [MERGED] osmo-bts[master]: vty: print version and description for each phy In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: print version and description for each phy ...................................................................... vty: print version and description for each phy When printing BTS via 'show bts ..' let's also print each TRX, which phy number and version it uses and its description. It's helpful in troubleshooting low-level issues as it allows vendor-specific code to easily expose firmware version. Related: SYS#3884 Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd --- M src/common/vty.c 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/vty.c b/src/common/vty.c index ef56705..77bb47d 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -730,6 +730,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) { struct gsm_bts_role_bts *btsb = bts->role; + struct gsm_bts_trx *trx; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u and %u TRX%s", @@ -767,6 +768,17 @@ VTY_NEWLINE); vty_out(vty, " OML Link state: %s.%s", bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); + + llist_for_each_entry(trx, &bts->trx_list, list) { + struct phy_instance *pinst = trx_phy_instance(trx); + vty_out(vty, " TRX %u%s", trx->nr, VTY_NEWLINE); + if (pinst) { + vty_out(vty, " phy %d %s", pinst->num, pinst->version); + if (pinst->description) + vty_out(vty, " (%s)", pinst->description); + vty_out(vty, "%s", VTY_NEWLINE); + } + } } -- To view, visit https://gerrit.osmocom.org/4058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Sep 30 12:13:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 30 Sep 2017 12:13:15 +0000 Subject: [MERGED] osmo-bts[master]: Replace dead code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Replace dead code ...................................................................... Replace dead code * remove leftover from copy-paste of corresponding OpenBSC code * print OML link state * print paging load Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 --- M src/common/vty.c 1 file changed, 5 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/vty.c b/src/common/vty.c index de9b23f..ef56705 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -762,24 +762,11 @@ VTY_NEWLINE); vty_out(vty, " CBCH backlog queue length: %u%s", llist_length(&btsb->smscb_state.queue), VTY_NEWLINE); -#if 0 - vty_out(vty, " Paging: %u pending requests, %u free slots%s", - paging_pending_requests_nr(bts), - bts->paging.available_slots, VTY_NEWLINE); - if (is_ipaccess_bts(bts)) { - vty_out(vty, " OML Link state: %s.%s", - bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); - } else { - vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); - e1isl_dump_vty(vty, bts->oml_link); - } - - /* FIXME: chan_desc */ - memset(&pl, 0, sizeof(pl)); - bts_chan_load(&pl, bts); - vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); - dump_pchan_load_vty(vty, " ", &pl); -#endif + vty_out(vty, " Paging: queue length %d, buffer space %d%s", + paging_queue_length(btsb->paging_state), paging_buffer_space(btsb->paging_state), + VTY_NEWLINE); + vty_out(vty, " OML Link state: %s.%s", + bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/4057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol